1cdf0e10cSrcweir 2cdf0e10cSrcweir# executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x 3cdf0e10cSrcweir# Use spawn instead of fork when building dmake on cygwin. 4cdf0e10cSrcweirif test "$GUI" = "WNT"; then 5cdf0e10cSrcweir EXEEXT=".exe" 6cdf0e10cSrcweirelse 7cdf0e10cSrcweir EXEEXT="" 8cdf0e10cSrcweirfi 9cdf0e10cSrcweirexport EXEEXT 10cdf0e10cSrcweir 11cdf0e10cSrcweirmkdir -p "$SOLARENV/$OUTPATH/bin" 12cdf0e10cSrcweir 13cdf0e10cSrcweirif test "$GUI" = "WNT" -a ! -x "$SOLARENV/$OUTPATH/bin/guw$EXEEXT"; then 14cdf0e10cSrcweir echo "" 15cdf0e10cSrcweir echo "Calling $GNUMAKE in guw" 16cdf0e10cSrcweir cd "$SRC_ROOT/guw" || exit 17cdf0e10cSrcweir $GNUMAKE || exit 18cdf0e10cSrcweir echo "" 19cdf0e10cSrcweir echo "guw has been successfully made" 20*fb6b49d1SJürgen Schmidt cp -f "$SRC_ROOT/guw/guw$EXEEXT" "$SOLARENV/$OUTPATH/bin/guw$EXEEXT" || exit 21cdf0e10cSrcweir echo "" 22cdf0e10cSrcweir echo "guw copied to $SOLARENV/$OUTPATH/bin/guw$EXEEXT" 23cdf0e10cSrcweirfi 24cdf0e10cSrcweir 25cdf0e10cSrcweir#make sure build.pl is executable 26cdf0e10cSrcweir 27cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/build.pl" 28cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/build_client.pl" 29cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/zipdep.pl" 30cdf0e10cSrcweirchmod +x "$SRC_ROOT/solenv/bin/gccinstlib.pl" 31cdf0e10cSrcweir 32cdf0e10cSrcweir# fetch or update external tarballs 33cdf0e10cSrcweirif [ "$DO_FETCH_TARBALLS" = "yes" ]; then 34cdf0e10cSrcweir $SRC_ROOT/fetch_tarballs.sh $SRC_ROOT/ooo.lst 35cdf0e10cSrcweirfi 36*fb6b49d1SJürgen Schmidt 37*fb6b49d1SJürgen Schmidt# ------------------------------------------------------------------------------ 38*fb6b49d1SJürgen Schmidt# Build dmake 39*fb6b49d1SJürgen Schmidt 40*fb6b49d1SJürgen Schmidtif test -n "$DMAKE_URL" -a ! -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then 41*fb6b49d1SJürgen Schmidt 42*fb6b49d1SJürgen Schmidt # Assume that the dmake archive has been downloaded by fetch_tarballs.sh 43*fb6b49d1SJürgen Schmidt # Determine the name of the downloaded file. 44*fb6b49d1SJürgen Schmidt dmake_package_name=`echo $DMAKE_URL | sed "s/^\(.*\/\)//"` 45*fb6b49d1SJürgen Schmidt 46*fb6b49d1SJürgen Schmidt tmp_build_dir="$SOLARENV/$OUTPATH/misc/build/" 47*fb6b49d1SJürgen Schmidt echo "making and entering $tmp_build_dir" 48*fb6b49d1SJürgen Schmidt # Clean up any residues from a previous and unsuccessful build. 49*fb6b49d1SJürgen Schmidt rm -rf "$tmp_build_dir" 50*fb6b49d1SJürgen Schmidt mkdir -p "$tmp_build_dir" 51*fb6b49d1SJürgen Schmidt cd "$tmp_build_dir" || exit 52*fb6b49d1SJürgen Schmidt 53*fb6b49d1SJürgen Schmidt dmake_full_package_name="$TARFILE_LOCATION/$dmake_package_name" 54*fb6b49d1SJürgen Schmidt if test "$GUI" = "WNT"; then 55*fb6b49d1SJürgen Schmidt dmake_full_package_name=`cygpath -u "$dmake_full_package_name"` 56*fb6b49d1SJürgen Schmidt fi 57*fb6b49d1SJürgen Schmidt echo "unpacking $dmake_full_package_name" 58*fb6b49d1SJürgen Schmidt 59*fb6b49d1SJürgen Schmidt # Unpack it. 60*fb6b49d1SJürgen Schmidt case $dmake_package_name in 61*fb6b49d1SJürgen Schmidt *.tar.gz) 62*fb6b49d1SJürgen Schmidt tar -xzf "$dmake_full_package_name" 63*fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.gz\)//"` 64*fb6b49d1SJürgen Schmidt ;; 65*fb6b49d1SJürgen Schmidt *.tgz) 66*fb6b49d1SJürgen Schmidt tar -xzf "$dmake_full_package_name" 67*fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tgz\)//"` 68*fb6b49d1SJürgen Schmidt ;; 69*fb6b49d1SJürgen Schmidt *.tar.bz2) 70*fb6b49d1SJürgen Schmidt tar -xjf "$dmake_full_package_name" 71*fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.bz2\)//"` 72*fb6b49d1SJürgen Schmidt ;; 73*fb6b49d1SJürgen Schmidt *.zip) 74*fb6b49d1SJürgen Schmidt unzip "$dmake_full_package_name" 75*fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.zip\)//"` 76*fb6b49d1SJürgen Schmidt ;; 77*fb6b49d1SJürgen Schmidt *) 78*fb6b49d1SJürgen Schmidt echo "can not unpack the dmake source" 79*fb6b49d1SJürgen Schmidt dmake_directory_name= 80*fb6b49d1SJürgen Schmidt exit 1 81*fb6b49d1SJürgen Schmidt ;; 82*fb6b49d1SJürgen Schmidt esac 83*fb6b49d1SJürgen Schmidt 84*fb6b49d1SJürgen Schmidt echo "entering $dmake_directory_name" 85*fb6b49d1SJürgen Schmidt cd "$dmake_directory_name" || exit 86*fb6b49d1SJürgen Schmidt 87*fb6b49d1SJürgen Schmidt # Special case! The w32/tcsh build needs CC pointing to the MSVC++ compiler 88*fb6b49d1SJürgen Schmidt # but we need a cygwin/gcc build dmake to understand the posix paths 89*fb6b49d1SJürgen Schmidt if test "$GUI" = "WNT"; then 90*fb6b49d1SJürgen Schmidt CC="" 91*fb6b49d1SJürgen Schmidt CXX="" 92*fb6b49d1SJürgen Schmidt export CC 93*fb6b49d1SJürgen Schmidt export CXX 94*fb6b49d1SJürgen Schmidt DMAKE_CONF="--enable-spawn" 95*fb6b49d1SJürgen Schmidt else 96*fb6b49d1SJürgen Schmidt DMAKE_CONF="" 97*fb6b49d1SJürgen Schmidt fi 98*fb6b49d1SJürgen Schmidt 99*fb6b49d1SJürgen Schmidt # For unixy systems 100*fb6b49d1SJürgen Schmidt if test -f "Makefile" ; then 101*fb6b49d1SJürgen Schmidt $GNUMAKE distclean || exit 102*fb6b49d1SJürgen Schmidt fi 103*fb6b49d1SJürgen Schmidt 104*fb6b49d1SJürgen Schmidt ./configure $DMAKE_CONF || exit 105*fb6b49d1SJürgen Schmidt 106*fb6b49d1SJürgen Schmidt ## invoke the gnu make command set by configure. 107*fb6b49d1SJürgen Schmidt $GNUMAKE || exit 108*fb6b49d1SJürgen Schmidt 109*fb6b49d1SJürgen Schmidt 110*fb6b49d1SJürgen Schmidt # Deploy the dmake executable to solenv 111*fb6b49d1SJürgen Schmidt cp -f "$tmp_build_dir/$dmake_directory_name/dmake$EXEEXT" "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT" || exit 112*fb6b49d1SJürgen Schmidt echo "" 113*fb6b49d1SJürgen Schmidt echo "dmake successfully built and copied to $SOLARENV/$OUTPATH/bin/dmake$EXEEXT" 114*fb6b49d1SJürgen Schmidt echo "" 115*fb6b49d1SJürgen Schmidt 116*fb6b49d1SJürgen Schmidt # Clean up. Note that this is skipped when one of the exits is executed above. 117*fb6b49d1SJürgen Schmidt rm -rf "$tmp_build_dir" 118*fb6b49d1SJürgen Schmidt 119*fb6b49d1SJürgen Schmidtelse 120*fb6b49d1SJürgen Schmidt 121*fb6b49d1SJürgen Schmidt if test -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then 122*fb6b49d1SJürgen Schmidt echo "" 123*fb6b49d1SJürgen Schmidt echo "dmake present in $SOLARENV/$OUTPATH/bin/dmake$EXEEXT" 124*fb6b49d1SJürgen Schmidt fi 125*fb6b49d1SJürgen Schmidt 126*fb6b49d1SJürgen Schmidtfi 127