2011-10-07 14:10:10 -05:00
|
|
|
#!/bin/sh
|
2006-07-05 16:07:20 -05:00
|
|
|
|
2011-12-24 19:25:58 -06:00
|
|
|
if test -z "${SRC_ROOT}"; then
|
|
|
|
if test -f ./config_build.mk ; then
|
2012-03-23 02:45:49 -05:00
|
|
|
sed -e 's/^\s*\(export [A-Z0-9_]*=\)\(.*\)$/\1"\2"/' <config_build.mk >config_build.mk.sh
|
2012-03-05 12:38:29 -06:00
|
|
|
. ./config_build.mk.sh
|
|
|
|
rm config_build.mk.sh
|
2011-12-24 19:25:58 -06:00
|
|
|
else
|
|
|
|
if test -f ./config_host.mk ; then
|
2012-03-23 02:45:49 -05:00
|
|
|
sed -e 's/^\s*\(export [A-Z0-9_]*=\)\(.*\)$/\1"\2"/' <config_host.mk >config_host.mk.sh
|
2012-02-10 05:34:42 -06:00
|
|
|
. ./config_host.mk.sh
|
|
|
|
rm config_host.mk.sh
|
2011-12-24 19:25:58 -06:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2011-04-18 10:59:15 -05:00
|
|
|
if test -z "${SOLARENV}"; then
|
|
|
|
echo "bootstrap: No environment set!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2003-12-01 10:38:25 -06:00
|
|
|
# executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x
|
2011-08-11 00:35:15 -05:00
|
|
|
# Use spawn instead of fork when building dmake on cygwin.
|
2011-05-16 10:46:27 -05:00
|
|
|
if test "$GUI_FOR_BUILD" = "WNT"; then
|
2006-09-27 04:25:09 -05:00
|
|
|
EXEEXT=".exe"
|
|
|
|
DMAKE_CONF="--enable-spawn"
|
2003-12-01 10:38:25 -06:00
|
|
|
else
|
2006-09-27 04:25:09 -05:00
|
|
|
EXEEXT=""
|
|
|
|
DMAKE_CONF=""
|
2006-07-05 16:07:20 -05:00
|
|
|
fi
|
2006-07-19 03:36:10 -05:00
|
|
|
export EXEEXT
|
2000-09-18 10:18:56 -05:00
|
|
|
|
2006-09-27 04:25:09 -05:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Build dmake
|
|
|
|
|
2006-07-05 16:07:20 -05:00
|
|
|
if test "$BUILD_DMAKE" != "NO"; then
|
2010-12-02 11:03:33 -06:00
|
|
|
if test ! -x "$SRC_ROOT/dmake/dmake$EXEEXT"; then
|
2006-09-27 04:25:09 -05:00
|
|
|
cd "$SRC_ROOT/dmake" || exit
|
2003-01-20 08:00:18 -06:00
|
|
|
|
2011-05-16 10:46:27 -05:00
|
|
|
# If cross-compiling then don't use the cross compilers to build dmake.
|
|
|
|
if test "$GUI_FOR_BUILD" = "WNT"; then
|
|
|
|
# Let the Cygwin gcc be found
|
2011-05-18 10:55:07 -05:00
|
|
|
unset CC CXX AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
|
2011-05-16 10:46:27 -05:00
|
|
|
elif test "$CROSS_COMPILING" = "YES"; then
|
|
|
|
export CC="$CC_FOR_BUILD"
|
|
|
|
export CXX="$CXX_FOR_BUILD"
|
2011-05-18 10:55:07 -05:00
|
|
|
unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
|
2006-09-27 04:25:09 -05:00
|
|
|
fi
|
2000-09-18 10:18:56 -05:00
|
|
|
|
2006-09-27 04:25:09 -05:00
|
|
|
# For normal unixy systems
|
|
|
|
if test -f "Makefile" ; then
|
|
|
|
$GNUMAKE distclean || exit
|
|
|
|
fi
|
2000-09-18 10:18:56 -05:00
|
|
|
|
2006-09-27 04:25:09 -05:00
|
|
|
./configure $DMAKE_CONF || exit
|
2002-10-09 07:17:17 -05:00
|
|
|
|
2006-09-27 04:25:09 -05:00
|
|
|
## invoke the gnu make command set by configure.
|
|
|
|
$GNUMAKE || exit
|
2000-09-18 10:18:56 -05:00
|
|
|
|
2006-09-27 04:25:09 -05:00
|
|
|
echo ""
|
|
|
|
echo "dmake has been successfully built"
|
2003-12-17 08:00:10 -06:00
|
|
|
|
2006-09-27 04:25:09 -05:00
|
|
|
cd ..
|
|
|
|
else
|
2011-05-16 10:46:27 -05:00
|
|
|
echo "dmake/dmake already built"
|
2006-09-27 04:25:09 -05:00
|
|
|
fi
|
2006-07-05 16:07:20 -05:00
|
|
|
fi
|
|
|
|
|
Rehash of cross-compilation ideas
Like in my previous plan, when cross-compiling we run the same
configure script separately for a native build configuration on the
build platform, in a temporary subdirectory.
Now use a fixed name "CONF-FOR-BUILD" for that subdirectory, so that
it is easy to edit out that path component from those build
environment variables that contain it.
Pass more of the native build environment variables up to the main
configure and propagate those to the build environment suffixed with
_FOR_BUILD: INPATH, OUTPATH OUTDIR, PATH, SOLARINC, SOLARLIB,
WORKDIR. Whether these all will actually be needed remains to be seen,
the set can be reduced later.
The environment setting file (*Env.Set.sh) for the native build is
copied here to the top directory under the name Env.Build.sh, and the
environment variables set in it that contain pathnames are modified to
point directly to this top directory, not the temporary CONF-FOR-BUILD
subdirectory.
When doing a cross-compiling build, we first do a build of the
necessary build-time tools for the build platform. This is done in the
same source tree. As the directories where build results are stored
include the platform specification (OUTPATH or in some cases INPATH),
there should be no clashes.
Don't run the download script from ./bootstrap(.1). We are running it
from Makefile already anyway often enough. This could also do with
some clean-up; the ./g -f clone phase is a bit slow, I am not sure if
it really is necessary every time? Also, we should not overwrite
ooo.lst if its contents isn't changing.
Use INPATH_FOR_BUILD in SOLARBINDIR so that the self-built tools like
idlc that we run are for the build platform, not the host
platform.
Attempt to get rid of the makefile.rc and makefile.mk files. Surely it
should be enough with just Makefile(.in) (and then GNUmakefile.mk for
its own so far special gbuild purposes). Instead of invoking dmake to
do "clean" or "distclean" from Makefile(.in), we already just do the
same directly in Makefile(.in). This way we don't need to first build
dmake in order to be able to do a make clean, which will then finally
clean out dmake again;)
Ideally I would like to get rid of bootstrap(.1), too. It should be
possible to merge its tasks into configure(.in) or Makefile(.in) as
appropriate.
And actually, maybe also what set_soenv(.in) does could well be merged
into configure(.in)?
2011-06-04 06:59:34 -05:00
|
|
|
mkdir -p "$SOLARENV/$OUTPATH_FOR_BUILD/bin"
|
2006-07-05 16:07:20 -05:00
|
|
|
if test "$BUILD_DMAKE" != "NO"; then
|
Rehash of cross-compilation ideas
Like in my previous plan, when cross-compiling we run the same
configure script separately for a native build configuration on the
build platform, in a temporary subdirectory.
Now use a fixed name "CONF-FOR-BUILD" for that subdirectory, so that
it is easy to edit out that path component from those build
environment variables that contain it.
Pass more of the native build environment variables up to the main
configure and propagate those to the build environment suffixed with
_FOR_BUILD: INPATH, OUTPATH OUTDIR, PATH, SOLARINC, SOLARLIB,
WORKDIR. Whether these all will actually be needed remains to be seen,
the set can be reduced later.
The environment setting file (*Env.Set.sh) for the native build is
copied here to the top directory under the name Env.Build.sh, and the
environment variables set in it that contain pathnames are modified to
point directly to this top directory, not the temporary CONF-FOR-BUILD
subdirectory.
When doing a cross-compiling build, we first do a build of the
necessary build-time tools for the build platform. This is done in the
same source tree. As the directories where build results are stored
include the platform specification (OUTPATH or in some cases INPATH),
there should be no clashes.
Don't run the download script from ./bootstrap(.1). We are running it
from Makefile already anyway often enough. This could also do with
some clean-up; the ./g -f clone phase is a bit slow, I am not sure if
it really is necessary every time? Also, we should not overwrite
ooo.lst if its contents isn't changing.
Use INPATH_FOR_BUILD in SOLARBINDIR so that the self-built tools like
idlc that we run are for the build platform, not the host
platform.
Attempt to get rid of the makefile.rc and makefile.mk files. Surely it
should be enough with just Makefile(.in) (and then GNUmakefile.mk for
its own so far special gbuild purposes). Instead of invoking dmake to
do "clean" or "distclean" from Makefile(.in), we already just do the
same directly in Makefile(.in). This way we don't need to first build
dmake in order to be able to do a make clean, which will then finally
clean out dmake again;)
Ideally I would like to get rid of bootstrap(.1), too. It should be
possible to merge its tasks into configure(.in) or Makefile(.in) as
appropriate.
And actually, maybe also what set_soenv(.in) does could well be merged
into configure(.in)?
2011-06-04 06:59:34 -05:00
|
|
|
cp -f "$SRC_ROOT/dmake/dmake$EXEEXT" "$SOLARENV/$OUTPATH_FOR_BUILD/bin" || exit
|
2006-09-27 04:25:09 -05:00
|
|
|
echo ""
|
Rehash of cross-compilation ideas
Like in my previous plan, when cross-compiling we run the same
configure script separately for a native build configuration on the
build platform, in a temporary subdirectory.
Now use a fixed name "CONF-FOR-BUILD" for that subdirectory, so that
it is easy to edit out that path component from those build
environment variables that contain it.
Pass more of the native build environment variables up to the main
configure and propagate those to the build environment suffixed with
_FOR_BUILD: INPATH, OUTPATH OUTDIR, PATH, SOLARINC, SOLARLIB,
WORKDIR. Whether these all will actually be needed remains to be seen,
the set can be reduced later.
The environment setting file (*Env.Set.sh) for the native build is
copied here to the top directory under the name Env.Build.sh, and the
environment variables set in it that contain pathnames are modified to
point directly to this top directory, not the temporary CONF-FOR-BUILD
subdirectory.
When doing a cross-compiling build, we first do a build of the
necessary build-time tools for the build platform. This is done in the
same source tree. As the directories where build results are stored
include the platform specification (OUTPATH or in some cases INPATH),
there should be no clashes.
Don't run the download script from ./bootstrap(.1). We are running it
from Makefile already anyway often enough. This could also do with
some clean-up; the ./g -f clone phase is a bit slow, I am not sure if
it really is necessary every time? Also, we should not overwrite
ooo.lst if its contents isn't changing.
Use INPATH_FOR_BUILD in SOLARBINDIR so that the self-built tools like
idlc that we run are for the build platform, not the host
platform.
Attempt to get rid of the makefile.rc and makefile.mk files. Surely it
should be enough with just Makefile(.in) (and then GNUmakefile.mk for
its own so far special gbuild purposes). Instead of invoking dmake to
do "clean" or "distclean" from Makefile(.in), we already just do the
same directly in Makefile(.in). This way we don't need to first build
dmake in order to be able to do a make clean, which will then finally
clean out dmake again;)
Ideally I would like to get rid of bootstrap(.1), too. It should be
possible to merge its tasks into configure(.in) or Makefile(.in) as
appropriate.
And actually, maybe also what set_soenv(.in) does could well be merged
into configure(.in)?
2011-06-04 06:59:34 -05:00
|
|
|
echo "dmake copied to $SOLARENV/$OUTPATH_FOR_BUILD/bin/dmake$EXEEXT"
|
2006-09-15 05:18:41 -05:00
|
|
|
fi
|
|
|
|
|
2011-12-17 10:54:24 -06:00
|
|
|
# build concat-deps
|
|
|
|
echo "building concat-deps"
|
2011-12-18 05:15:53 -06:00
|
|
|
if [ "$COM_FOR_BUILD" = "MSC" ] ; then
|
|
|
|
# on cygwin force the use of gcc
|
|
|
|
gcc -O2 "$SOLARENV/bin/concat-deps.c" -o "$SOLARENV/bin/concat-deps" || exit
|
|
|
|
else
|
|
|
|
$CC_FOR_BUILD -O2 "$SOLARENV/bin/concat-deps.c" -o "$SOLARENV/bin/concat-deps" || exit
|
|
|
|
fi
|
2011-08-11 00:35:15 -05:00
|
|
|
#make sure build.pl is executable
|
2003-12-17 08:00:10 -06:00
|
|
|
|
2006-07-05 16:07:20 -05:00
|
|
|
chmod +x "$SRC_ROOT/solenv/bin/build.pl"
|
|
|
|
chmod +x "$SRC_ROOT/solenv/bin/zipdep.pl"
|
|
|
|
chmod +x "$SRC_ROOT/solenv/bin/gccinstlib.pl"
|
2010-01-15 07:55:12 -06:00
|
|
|
|
Rehash of cross-compilation ideas
Like in my previous plan, when cross-compiling we run the same
configure script separately for a native build configuration on the
build platform, in a temporary subdirectory.
Now use a fixed name "CONF-FOR-BUILD" for that subdirectory, so that
it is easy to edit out that path component from those build
environment variables that contain it.
Pass more of the native build environment variables up to the main
configure and propagate those to the build environment suffixed with
_FOR_BUILD: INPATH, OUTPATH OUTDIR, PATH, SOLARINC, SOLARLIB,
WORKDIR. Whether these all will actually be needed remains to be seen,
the set can be reduced later.
The environment setting file (*Env.Set.sh) for the native build is
copied here to the top directory under the name Env.Build.sh, and the
environment variables set in it that contain pathnames are modified to
point directly to this top directory, not the temporary CONF-FOR-BUILD
subdirectory.
When doing a cross-compiling build, we first do a build of the
necessary build-time tools for the build platform. This is done in the
same source tree. As the directories where build results are stored
include the platform specification (OUTPATH or in some cases INPATH),
there should be no clashes.
Don't run the download script from ./bootstrap(.1). We are running it
from Makefile already anyway often enough. This could also do with
some clean-up; the ./g -f clone phase is a bit slow, I am not sure if
it really is necessary every time? Also, we should not overwrite
ooo.lst if its contents isn't changing.
Use INPATH_FOR_BUILD in SOLARBINDIR so that the self-built tools like
idlc that we run are for the build platform, not the host
platform.
Attempt to get rid of the makefile.rc and makefile.mk files. Surely it
should be enough with just Makefile(.in) (and then GNUmakefile.mk for
its own so far special gbuild purposes). Instead of invoking dmake to
do "clean" or "distclean" from Makefile(.in), we already just do the
same directly in Makefile(.in). This way we don't need to first build
dmake in order to be able to do a make clean, which will then finally
clean out dmake again;)
Ideally I would like to get rid of bootstrap(.1), too. It should be
possible to merge its tasks into configure(.in) or Makefile(.in) as
appropriate.
And actually, maybe also what set_soenv(.in) does could well be merged
into configure(.in)?
2011-06-04 06:59:34 -05:00
|
|
|
# Local Variables:
|
|
|
|
# mode: shell-script
|
|
|
|
# tab-width: 4
|
|
|
|
# indent-tabs-mode: nil
|
|
|
|
# End:
|
|
|
|
|
|
|
|
# vim:set shiftwidth=4 softtabstop=4 expandtab:
|