office-gobmx/bootstrap

96 lines
2.7 KiB
Text
Raw Normal View History

#!/bin/sh
if test -z "${SRC_ROOT}"; then
if test -f ./config_build.mk ; then
sed -e 's/^\(export [A-Z0-9_]*=\)\(.*\)$/\1"\2"/' <config_build.mk >config_build.mk.sh
. ./config_build.mk.sh
rm config_build.mk.sh
else
if test -f ./config_host.mk ; then
sed -e 's/^\(export [A-Z0-9_]*=\)\(.*\)$/\1"\2"/' <config_host.mk >config_host.mk.sh
. ./config_host.mk.sh
rm config_host.mk.sh
fi
fi
fi
if test -z "${SOLARENV}"; then
echo "bootstrap: No environment set!"
exit 1
fi
# executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x
# Use spawn instead of fork when building dmake on cygwin.
if test "$GUI_FOR_BUILD" = "WNT"; then
EXEEXT=".exe"
DMAKE_CONF="--enable-spawn"
else
EXEEXT=""
DMAKE_CONF=""
fi
export EXEEXT
2000-09-18 10:18:56 -05:00
# ------------------------------------------------------------------------------
# Build dmake
if test "$BUILD_DMAKE" != "NO"; then
if test ! -x "$SRC_ROOT/dmake/dmake$EXEEXT"; then
cd "$SRC_ROOT/dmake" || exit
2003-01-20 08:00:18 -06: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
unset CC CXX AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
elif test "$CROSS_COMPILING" = "YES"; then
export CC="$CC_FOR_BUILD"
export CXX="$CXX_FOR_BUILD"
unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
fi
2000-09-18 10:18:56 -05:00
# For normal unixy systems
if test -f "Makefile" ; then
$GNUMAKE distclean || exit
fi
2000-09-18 10:18:56 -05:00
./configure $DMAKE_CONF || exit
## invoke the gnu make command set by configure.
$GNUMAKE || exit
2000-09-18 10:18:56 -05:00
echo ""
echo "dmake has been successfully built"
cd ..
else
echo "dmake/dmake already built"
fi
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"
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
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"
fi
# build concat-deps
echo "building concat-deps"
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
#make sure build.pl is executable
chmod +x "$SRC_ROOT/solenv/bin/build.pl"
chmod +x "$SRC_ROOT/solenv/bin/zipdep.pl"
chmod +x "$SRC_ROOT/solenv/bin/gccinstlib.pl"
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: