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" 20fb6b49d1SJü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 36fb6b49d1SJürgen Schmidt 37fb6b49d1SJürgen Schmidt# ------------------------------------------------------------------------------ 38fb6b49d1SJürgen Schmidt# Build dmake 39fb6b49d1SJürgen Schmidt 40fb6b49d1SJürgen Schmidtif test -n "$DMAKE_URL" -a ! -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then 41fb6b49d1SJürgen Schmidt 42fb6b49d1SJürgen Schmidt # Assume that the dmake archive has been downloaded by fetch_tarballs.sh 43fb6b49d1SJürgen Schmidt # Determine the name of the downloaded file. 44fb6b49d1SJürgen Schmidt dmake_package_name=`echo $DMAKE_URL | sed "s/^\(.*\/\)//"` 45fb6b49d1SJürgen Schmidt 46fb6b49d1SJürgen Schmidt tmp_build_dir="$SOLARENV/$OUTPATH/misc/build/" 47fb6b49d1SJürgen Schmidt echo "making and entering $tmp_build_dir" 48fb6b49d1SJürgen Schmidt # Clean up any residues from a previous and unsuccessful build. 49fb6b49d1SJürgen Schmidt rm -rf "$tmp_build_dir" 50fb6b49d1SJürgen Schmidt mkdir -p "$tmp_build_dir" 51fb6b49d1SJürgen Schmidt cd "$tmp_build_dir" || exit 52fb6b49d1SJürgen Schmidt 53fb6b49d1SJürgen Schmidt dmake_full_package_name="$TARFILE_LOCATION/$dmake_package_name" 54fb6b49d1SJürgen Schmidt if test "$GUI" = "WNT"; then 55fb6b49d1SJürgen Schmidt dmake_full_package_name=`cygpath -u "$dmake_full_package_name"` 56fb6b49d1SJürgen Schmidt fi 57fb6b49d1SJürgen Schmidt echo "unpacking $dmake_full_package_name" 58fb6b49d1SJürgen Schmidt 59fb6b49d1SJürgen Schmidt # Unpack it. 60fb6b49d1SJürgen Schmidt case $dmake_package_name in 61fb6b49d1SJürgen Schmidt *.tar.gz) 62fb6b49d1SJürgen Schmidt tar -xzf "$dmake_full_package_name" 63fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.gz\)//"` 64fb6b49d1SJürgen Schmidt ;; 65fb6b49d1SJürgen Schmidt *.tgz) 66fb6b49d1SJürgen Schmidt tar -xzf "$dmake_full_package_name" 67fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tgz\)//"` 68fb6b49d1SJürgen Schmidt ;; 69fb6b49d1SJürgen Schmidt *.tar.bz2) 70fb6b49d1SJürgen Schmidt tar -xjf "$dmake_full_package_name" 71fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.bz2\)//"` 72fb6b49d1SJürgen Schmidt ;; 73fb6b49d1SJürgen Schmidt *.zip) 74fb6b49d1SJürgen Schmidt unzip "$dmake_full_package_name" 75fb6b49d1SJürgen Schmidt dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.zip\)//"` 76fb6b49d1SJürgen Schmidt ;; 77fb6b49d1SJürgen Schmidt *) 78fb6b49d1SJürgen Schmidt echo "can not unpack the dmake source" 79fb6b49d1SJürgen Schmidt dmake_directory_name= 80fb6b49d1SJürgen Schmidt exit 1 81fb6b49d1SJürgen Schmidt ;; 82fb6b49d1SJürgen Schmidt esac 83fb6b49d1SJürgen Schmidt 84fb6b49d1SJürgen Schmidt echo "entering $dmake_directory_name" 85fb6b49d1SJürgen Schmidt cd "$dmake_directory_name" || exit 86fb6b49d1SJürgen Schmidt 87fb6b49d1SJürgen Schmidt # Special case! The w32/tcsh build needs CC pointing to the MSVC++ compiler 88fb6b49d1SJürgen Schmidt # but we need a cygwin/gcc build dmake to understand the posix paths 89fb6b49d1SJürgen Schmidt if test "$GUI" = "WNT"; then 90fb6b49d1SJürgen Schmidt CC="" 91fb6b49d1SJürgen Schmidt CXX="" 92fb6b49d1SJürgen Schmidt export CC 93fb6b49d1SJürgen Schmidt export CXX 94fb6b49d1SJürgen Schmidt DMAKE_CONF="--enable-spawn" 95fb6b49d1SJürgen Schmidt else 96fb6b49d1SJürgen Schmidt DMAKE_CONF="" 97fb6b49d1SJürgen Schmidt fi 98fb6b49d1SJürgen Schmidt 99fb6b49d1SJürgen Schmidt # For unixy systems 100fb6b49d1SJürgen Schmidt if test -f "Makefile" ; then 101fb6b49d1SJürgen Schmidt $GNUMAKE distclean || exit 102fb6b49d1SJürgen Schmidt fi 103fb6b49d1SJürgen Schmidt 104fb6b49d1SJürgen Schmidt ./configure $DMAKE_CONF || exit 105fb6b49d1SJürgen Schmidt 106fb6b49d1SJürgen Schmidt ## invoke the gnu make command set by configure. 107fb6b49d1SJürgen Schmidt $GNUMAKE || exit 108fb6b49d1SJürgen Schmidt 109fb6b49d1SJürgen Schmidt 110fb6b49d1SJürgen Schmidt # Deploy the dmake executable to solenv 111fb6b49d1SJürgen Schmidt cp -f "$tmp_build_dir/$dmake_directory_name/dmake$EXEEXT" "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT" || exit 112fb6b49d1SJürgen Schmidt echo "" 113fb6b49d1SJürgen Schmidt echo "dmake successfully built and copied to $SOLARENV/$OUTPATH/bin/dmake$EXEEXT" 114fb6b49d1SJürgen Schmidt echo "" 115fb6b49d1SJürgen Schmidt 116fb6b49d1SJürgen Schmidt # Clean up. Note that this is skipped when one of the exits is executed above. 117fb6b49d1SJürgen Schmidt rm -rf "$tmp_build_dir" 118fb6b49d1SJürgen Schmidt 119*aee29faaSAriel Constenla-Haileelif test "$IS_SYSTEM_DMAKE" = "YES"; then 120*aee29faaSAriel Constenla-Haile 121*aee29faaSAriel Constenla-Haile echo "" 122*aee29faaSAriel Constenla-Haile echo "dmake is located in search path" 123*aee29faaSAriel Constenla-Haile echo "" 124*aee29faaSAriel Constenla-Haile 125*aee29faaSAriel Constenla-Haileelif test -n "$DMAKE_PATH" -a -x "$DMAKE_PATH" -a ! -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then 126*aee29faaSAriel Constenla-Haile 127*aee29faaSAriel Constenla-Haile cp -f "$DMAKE_PATH" "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT" || exit 128*aee29faaSAriel Constenla-Haile 129*aee29faaSAriel Constenla-Haile echo "" 130*aee29faaSAriel Constenla-Haile echo "dmake copied to $SOLARENV/$OUTPATH/bin/dmake$EXEEXT" 131*aee29faaSAriel Constenla-Haile echo "" 132*aee29faaSAriel Constenla-Haile 133fb6b49d1SJürgen Schmidtelse 134fb6b49d1SJürgen Schmidt 135fb6b49d1SJürgen Schmidt if test -x "$SOLARENV/$OUTPATH/bin/dmake$EXEEXT"; then 136fb6b49d1SJürgen Schmidt echo "" 137fb6b49d1SJürgen Schmidt echo "dmake present in $SOLARENV/$OUTPATH/bin/dmake$EXEEXT" 138fb6b49d1SJürgen Schmidt fi 139fb6b49d1SJürgen Schmidt 140fb6b49d1SJürgen Schmidtfi 141