f206336a25
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)?
69 lines
1.9 KiB
Groff
Executable file
69 lines
1.9 KiB
Groff
Executable file
|
|
# 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
|
|
|
|
#make sure build.pl is executable
|
|
|
|
chmod +x "$SRC_ROOT/solenv/bin/build.pl"
|
|
chmod +x "$SRC_ROOT/solenv/bin/build_client.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:
|