Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / bootstrap
blobbbe941d3c64719f132d34426047c28a1682bff65
1 #!/bin/sh
3 if test -z "${SRC_ROOT}"; then
4 if test -f ./config_build.mk ; then
5 sed -e 's/^\s*\(export [A-Z0-9_]*=\)\(.*\)$/\1"\2"/' <config_build.mk >config_build.mk.sh
6 . ./config_build.mk.sh
7 rm config_build.mk.sh
8 else
9 if test -f ./config_host.mk ; then
10 sed -e 's/^\s*\(export [A-Z0-9_]*=\)\(.*\)$/\1"\2"/' <config_host.mk >config_host.mk.sh
11 . ./config_host.mk.sh
12 rm config_host.mk.sh
16 if test -z "${SOLARENV}"; then
17 echo "bootstrap: No environment set!"
18 exit 1
21 # executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x
22 # Use spawn instead of fork when building dmake on cygwin.
23 if test "$GUI_FOR_BUILD" = "WNT"; then
24 EXEEXT=".exe"
25 DMAKE_CONF="--enable-spawn"
26 else
27 EXEEXT=""
28 DMAKE_CONF=""
30 export EXEEXT
32 # ------------------------------------------------------------------------------
33 # Build dmake
35 if test "$BUILD_DMAKE" != "NO"; then
36 if test ! -x "$SRC_ROOT/dmake/dmake$EXEEXT"; then
37 cd "$SRC_ROOT/dmake" || exit
39 # If cross-compiling then don't use the cross compilers to build dmake.
40 if test "$GUI_FOR_BUILD" = "WNT"; then
41 # Let the Cygwin gcc be found
42 unset CC CXX AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
43 elif test "$CROSS_COMPILING" = "YES"; then
44 export CC="$CC_FOR_BUILD"
45 export CXX="$CXX_FOR_BUILD"
46 unset AR NM OBJDUMP PKG_CONFIG RANLIB STRIP
49 # For normal unixy systems
50 if test -f "Makefile" ; then
51 $GNUMAKE distclean || exit
54 ./configure $DMAKE_CONF || exit
56 ## invoke the gnu make command set by configure.
57 $GNUMAKE || exit
59 echo ""
60 echo "dmake has been successfully built"
62 cd ..
63 else
64 echo "dmake/dmake already built"
68 mkdir -p "$SOLARENV/$OUTPATH_FOR_BUILD/bin"
69 if test "$BUILD_DMAKE" != "NO"; then
70 cp -f "$SRC_ROOT/dmake/dmake$EXEEXT" "$SOLARENV/$OUTPATH_FOR_BUILD/bin" || exit
71 echo ""
72 echo "dmake copied to $SOLARENV/$OUTPATH_FOR_BUILD/bin/dmake$EXEEXT"
75 #make sure build.pl is executable
77 chmod +x "$SRC_ROOT/solenv/bin/build.pl"
78 chmod +x "$SRC_ROOT/solenv/bin/zipdep.pl"
80 # Local Variables:
81 # mode: shell-script
82 # tab-width: 4
83 # indent-tabs-mode: nil
84 # End:
86 # vim:set shiftwidth=4 softtabstop=4 expandtab: