1# ************************************************************* 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20# ************************************************************* 21 22# executables are *.exe for WNT. This variable is necessary since Cygwin 1.5.x 23# Use spawn instead of fork when building dmake on cygwin. 24if test "$GUI" = "WNT"; then 25 EXEEXT=".exe" 26else 27 EXEEXT="" 28fi 29export EXEEXT 30 31mkdir -p "$SOLARENV/$INPATH/bin" 32 33#make sure build.pl is executable 34 35chmod +x "$SRC_ROOT/solenv/bin/build.pl" 36chmod +x "$SRC_ROOT/solenv/bin/build_client.pl" 37chmod +x "$SRC_ROOT/solenv/bin/zipdep.pl" 38chmod +x "$SRC_ROOT/solenv/bin/gccinstlib.pl" 39 40# fetch or update external tarballs 41if [ "$DO_FETCH_TARBALLS" = "yes" ]; then 42# check perl include locations 43 "$PERL" -e 'print "\nInclude locations: @INC\n\n"'; 44 "$PERL" "$SOLARENV/bin/download_external_dependencies.pl" $SRC_ROOT/external_deps.lst 45 if [ "$?" != "0" ]; then 46 echo "*** Error downloading external dependencies, please fix the previous problems and try again ***" 47 exit 1 48 fi 49fi 50 51# ------------------------------------------------------------------------------ 52# Build dmake 53 54if test -n "$DMAKE_URL" -a ! -x "$SOLARENV/$INPATH/bin/dmake$EXEEXT"; then 55 56 # Assume that the dmake archive has been downloaded by fetch_tarballs.sh 57 # Determine the name of the downloaded file. 58 dmake_package_name=`echo $DMAKE_URL | sed "s/^\(.*\/\)//"` 59 60 tmp_build_dir="$SOLARENV/$INPATH/misc/build/" 61 echo "making and entering $tmp_build_dir" 62 # Clean up any residues from a previous and unsuccessful build. 63 rm -rf "$tmp_build_dir" 64 mkdir -p "$tmp_build_dir" 65 cd "$tmp_build_dir" || exit 66 67 dmake_full_package_name=$(find $TARFILE_LOCATION -type f -name "*-$dmake_package_name") 68 if [ -z "$dmake_full_package_name" ]; then 69 echo "can not find the dmake package" 70 exit 71 fi 72 if test "$GUI" = "WNT"; then 73 dmake_full_package_name=`cygpath -u "$dmake_full_package_name"` 74 fi 75 echo "unpacking $dmake_full_package_name" 76 77 # Unpack it. 78 case $dmake_package_name in 79 *.tar.gz) 80 tar -xzf "$dmake_full_package_name" 81 dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.gz\)//"` 82 ;; 83 *.tgz) 84 tar -xzf "$dmake_full_package_name" 85 dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tgz\)//"` 86 ;; 87 *.tar.bz2) 88 tar -xjf "$dmake_full_package_name" 89 dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.tar.bz2\)//"` 90 ;; 91 *.zip) 92 unzip "$dmake_full_package_name" 93 dmake_directory_name=`echo $dmake_package_name | sed "s/\(\.zip\)//"` 94 ;; 95 *) 96 echo "can not unpack the dmake source" 97 dmake_directory_name= 98 exit 1 99 ;; 100 esac 101 102 echo "entering $dmake_directory_name" 103 cd "$dmake_directory_name" || exit 104 105 # Special case! The w32/tcsh build needs CC pointing to the MSVC++ compiler 106 # but we need a cygwin/gcc build dmake to understand the posix paths 107 if test "$GUI" = "WNT"; then 108 CC="" 109 CXX="" 110 export CC 111 export CXX 112 DMAKE_CONF="--enable-spawn" 113 else 114 DMAKE_CONF="" 115 fi 116 117 # For unixy systems 118 if test -f "Makefile" ; then 119 $GNUMAKE distclean || exit 120 fi 121 122 ./configure $DMAKE_CONF || exit 123 124 ## invoke the gnu make command set by configure. 125 $GNUMAKE || exit 126 127 128 # Deploy the dmake executable to solenv 129 cp -f "$tmp_build_dir/$dmake_directory_name/dmake$EXEEXT" "$SOLARENV/$INPATH/bin/dmake$EXEEXT" || exit 130 echo "" 131 echo "dmake successfully built and copied to $SOLARENV/$INPATH/bin/dmake$EXEEXT" 132 echo "" 133 134 # Clean up. Note that this is skipped when one of the exits is executed above. 135 rm -rf "$tmp_build_dir" 136 137elif test "$IS_SYSTEM_DMAKE" = "YES"; then 138 139 echo "" 140 echo "dmake is located in search path" 141 echo "" 142 143elif test -n "$DMAKE_PATH" -a -x "$DMAKE_PATH" -a ! -x "$SOLARENV/$INPATH/bin/dmake$EXEEXT"; then 144 145 cp -f "$DMAKE_PATH" "$SOLARENV/$INPATH/bin/dmake$EXEEXT" || exit 146 147 echo "" 148 echo "dmake copied to $SOLARENV/$INPATH/bin/dmake$EXEEXT" 149 echo "" 150 151else 152 153 if test -x "$SOLARENV/$INPATH/bin/dmake$EXEEXT"; then 154 echo "" 155 echo "dmake present in $SOLARENV/$INPATH/bin/dmake$EXEEXT" 156 fi 157 158fi 159 160# Download missing extensions. 161"$PERL" "$SOLARENV/bin/download_missing_extensions.pl" 162