office-gobmx/bootstrap
Norbert Thiebaud fd9366c85c prep work to eliminated Env.*.sh, introduce config_{host,build}.mk
This introduce config_host.mk and config_build.mk
generated from config_host.mk.in
The intent is for that file to be both sourcable in a shell and includable
in a gnu Makefile.
Eventually all the environment set-up will be in config_host.mk.in
and so there won't be a need to source anything in shell before make.
2011-12-24 21:42:08 -06:00

106 lines
2.8 KiB
Bash
Executable file

#!/bin/sh
if test -z "${SRC_ROOT}"; then
if test -f ./config_build.mk ; then
. ./config_build.mk
else
if test -f ./config_host.mk ; then
. ./config_host.mk
fi
fi
fi
if test -z "${SOLARENV}"; then
if test -f ./Env.Build.sh ; then
. ./Env.Build.sh
else
if test -f ./Env.Host.sh ; then
. ./Env.Host.sh
fi
fi
fi
if test -z "${SOLARENV}"; then
echo "bootstrap: No environment set!"
exit 1
fi
# remove aliases set by Env.Host.sh
unalias mkout 2> /dev/null
unalias deliver 2> /dev/null
unalias build 2> /dev/null
unalias zipdep 2> /dev/null
# 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
# ------------------------------------------------------------------------------
# Build dmake
if test "$BUILD_DMAKE" != "NO"; then
if test ! -x "$SRC_ROOT/dmake/dmake$EXEEXT"; then
cd "$SRC_ROOT/dmake" || exit
# 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
# For normal unixy systems
if test -f "Makefile" ; then
$GNUMAKE distclean || exit
fi
./configure $DMAKE_CONF || exit
## invoke the gnu make command set by configure.
$GNUMAKE || exit
echo ""
echo "dmake has been successfully built"
cd ..
else
echo "dmake/dmake already built"
fi
fi
mkdir -p "$SOLARENV/$OUTPATH_FOR_BUILD/bin"
if test "$BUILD_DMAKE" != "NO"; then
cp -f "$SRC_ROOT/dmake/dmake$EXEEXT" "$SOLARENV/$OUTPATH_FOR_BUILD/bin" || exit
echo ""
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"
# Local Variables:
# mode: shell-script
# tab-width: 4
# indent-tabs-mode: nil
# End:
# vim:set shiftwidth=4 softtabstop=4 expandtab: