common/autoconf/basics.m4

changeset 972
f3697e0783e2
parent 904
37d2736caf46
child 912
a667caba1e84
     1.1 --- a/common/autoconf/basics.m4	Thu Sep 12 12:29:17 2013 -0700
     1.2 +++ b/common/autoconf/basics.m4	Tue Nov 05 17:33:48 2013 -0800
     1.3 @@ -24,23 +24,23 @@
     1.4  #
     1.5  
     1.6  # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
     1.7 -# If so, then append $1 to $2\
     1.8 +# If so, then append $1 to $2 \
     1.9  # Also set JVM_ARG_OK to true/false depending on outcome.
    1.10  AC_DEFUN([ADD_JVM_ARG_IF_OK],
    1.11  [
    1.12 -    $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD
    1.13 -    $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD
    1.14 -    OUTPUT=`$3 $1 -version 2>&1`
    1.15 -    FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
    1.16 -    FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
    1.17 -    if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
    1.18 -        $2="[$]$2 $1"
    1.19 -	JVM_ARG_OK=true
    1.20 -    else
    1.21 -	$ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD
    1.22 -	$ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD
    1.23 -	JVM_ARG_OK=false
    1.24 -    fi
    1.25 +  $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD
    1.26 +  $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD
    1.27 +  OUTPUT=`$3 $1 -version 2>&1`
    1.28 +  FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn`
    1.29 +  FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""`
    1.30 +  if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
    1.31 +    $2="[$]$2 $1"
    1.32 +    JVM_ARG_OK=true
    1.33 +  else
    1.34 +    $ECHO "Arg failed:" >&AS_MESSAGE_LOG_FD
    1.35 +    $ECHO "$OUTPUT" >&AS_MESSAGE_LOG_FD
    1.36 +    JVM_ARG_OK=false
    1.37 +  fi
    1.38  ])
    1.39  
    1.40  # Appends a string to a path variable, only adding the : when needed.
    1.41 @@ -82,7 +82,7 @@
    1.42        AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
    1.43      fi
    1.44  
    1.45 -    $1="`cd "$path"; $THEPWDCMD -L`" 
    1.46 +    $1="`cd "$path"; $THEPWDCMD -L`"
    1.47    fi
    1.48  ])
    1.49  
    1.50 @@ -129,88 +129,109 @@
    1.51        AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.])
    1.52        new_path="$path"
    1.53      fi
    1.54 -    
    1.55 +
    1.56      if test "x$new_path" = x; then
    1.57 -        AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
    1.58 -        has_space=`$ECHO "$complete" | $GREP " "`
    1.59 -        if test "x$has_space" != x; then
    1.60 -          AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.])
    1.61 -        fi
    1.62 -        AC_MSG_ERROR([Cannot locate the the path of $1])
    1.63 +      AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
    1.64 +      has_space=`$ECHO "$complete" | $GREP " "`
    1.65 +      if test "x$has_space" != x; then
    1.66 +        AC_MSG_NOTICE([This might be caused by spaces in the path, which is not allowed.])
    1.67        fi
    1.68 +      AC_MSG_ERROR([Cannot locate the the path of $1])
    1.69 +    fi
    1.70    fi
    1.71  
    1.72 -      # Now join together the path and the arguments once again
    1.73 -      if test "x$arguments" != xEOL; then
    1.74 -        new_complete="$new_path ${arguments% *}"
    1.75 -      else
    1.76 -        new_complete="$new_path"
    1.77 -      fi
    1.78 +  # Now join together the path and the arguments once again
    1.79 +  if test "x$arguments" != xEOL; then
    1.80 +    new_complete="$new_path ${arguments% *}"
    1.81 +  else
    1.82 +    new_complete="$new_path"
    1.83 +  fi
    1.84  
    1.85    if test "x$complete" != "x$new_complete"; then
    1.86 -      $1="$new_complete"
    1.87 -      AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
    1.88 -    fi
    1.89 +    $1="$new_complete"
    1.90 +    AC_MSG_NOTICE([Rewriting $1 to "$new_complete"])
    1.91 +  fi
    1.92  ])
    1.93  
    1.94  AC_DEFUN([BASIC_REMOVE_SYMBOLIC_LINKS],
    1.95  [
    1.96 -    if test "x$OPENJDK_BUILD_OS" != xwindows; then
    1.97 -        # Follow a chain of symbolic links. Use readlink
    1.98 -        # where it exists, else fall back to horribly
    1.99 -        # complicated shell code.
   1.100 -        if test "x$READLINK_TESTED" != yes; then
   1.101 -            # On MacOSX there is a readlink tool with a different
   1.102 -            # purpose than the GNU readlink tool. Check the found readlink.
   1.103 -            ISGNU=`$READLINK --version 2>&1 | $GREP GNU`
   1.104 -            if test "x$ISGNU" = x; then
   1.105 -                 # A readlink that we do not know how to use.
   1.106 -                 # Are there other non-GNU readlinks out there?
   1.107 -                 READLINK_TESTED=yes
   1.108 -                 READLINK=
   1.109 -            fi
   1.110 +  if test "x$OPENJDK_BUILD_OS" != xwindows; then
   1.111 +    # Follow a chain of symbolic links. Use readlink
   1.112 +    # where it exists, else fall back to horribly
   1.113 +    # complicated shell code.
   1.114 +    if test "x$READLINK_TESTED" != yes; then
   1.115 +      # On MacOSX there is a readlink tool with a different
   1.116 +      # purpose than the GNU readlink tool. Check the found readlink.
   1.117 +      ISGNU=`$READLINK --version 2>&1 | $GREP GNU`
   1.118 +      if test "x$ISGNU" = x; then
   1.119 +        # A readlink that we do not know how to use.
   1.120 +        # Are there other non-GNU readlinks out there?
   1.121 +        READLINK_TESTED=yes
   1.122 +        READLINK=
   1.123 +      fi
   1.124 +    fi
   1.125 +
   1.126 +    if test "x$READLINK" != x; then
   1.127 +      $1=`$READLINK -f [$]$1`
   1.128 +    else
   1.129 +      # Save the current directory for restoring afterwards
   1.130 +      STARTDIR=$PWD
   1.131 +      COUNTER=0
   1.132 +      sym_link_dir=`$DIRNAME [$]$1`
   1.133 +      sym_link_file=`$BASENAME [$]$1`
   1.134 +      cd $sym_link_dir
   1.135 +      # Use -P flag to resolve symlinks in directories.
   1.136 +      cd `$THEPWDCMD -P`
   1.137 +      sym_link_dir=`$THEPWDCMD -P`
   1.138 +      # Resolve file symlinks
   1.139 +      while test $COUNTER -lt 20; do
   1.140 +        ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
   1.141 +        if test "x$ISLINK" == x; then
   1.142 +          # This is not a symbolic link! We are done!
   1.143 +          break
   1.144          fi
   1.145 +        # Again resolve directory symlinks since the target of the just found
   1.146 +        # link could be in a different directory
   1.147 +        cd `$DIRNAME $ISLINK`
   1.148 +        sym_link_dir=`$THEPWDCMD -P`
   1.149 +        sym_link_file=`$BASENAME $ISLINK`
   1.150 +        let COUNTER=COUNTER+1
   1.151 +      done
   1.152 +      cd $STARTDIR
   1.153 +      $1=$sym_link_dir/$sym_link_file
   1.154 +    fi
   1.155 +  fi
   1.156 +])
   1.157  
   1.158 -        if test "x$READLINK" != x; then
   1.159 -            $1=`$READLINK -f [$]$1`
   1.160 -        else
   1.161 -            # Save the current directory for restoring afterwards
   1.162 -            STARTDIR=$PWD
   1.163 -            COUNTER=0
   1.164 -            sym_link_dir=`$DIRNAME [$]$1`
   1.165 -            sym_link_file=`$BASENAME [$]$1`
   1.166 -            cd $sym_link_dir
   1.167 -            # Use -P flag to resolve symlinks in directories.
   1.168 -            cd `$THEPWDCMD -P`
   1.169 -            sym_link_dir=`$THEPWDCMD -P`
   1.170 -            # Resolve file symlinks
   1.171 -            while test $COUNTER -lt 20; do
   1.172 -                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
   1.173 -                if test "x$ISLINK" == x; then
   1.174 -                    # This is not a symbolic link! We are done!
   1.175 -                    break
   1.176 -                fi
   1.177 -                # Again resolve directory symlinks since the target of the just found
   1.178 -                # link could be in a different directory
   1.179 -                cd `$DIRNAME $ISLINK`
   1.180 -                sym_link_dir=`$THEPWDCMD -P`
   1.181 -                sym_link_file=`$BASENAME $ISLINK`
   1.182 -                let COUNTER=COUNTER+1
   1.183 -            done
   1.184 -            cd $STARTDIR
   1.185 -            $1=$sym_link_dir/$sym_link_file
   1.186 -        fi
   1.187 -    fi
   1.188 +# Register a --with argument but mark it as deprecated
   1.189 +# $1: The name of the with argument to deprecate, not including --with-
   1.190 +AC_DEFUN([BASIC_DEPRECATED_ARG_WITH],
   1.191 +[
   1.192 +  AC_ARG_WITH($1, [AS_HELP_STRING([--with-$1],
   1.193 +      [Deprecated. Option is kept for backwards compatibility and is ignored])],
   1.194 +      [AC_MSG_WARN([Option --with-$1 is deprecated and will be ignored.])])
   1.195 +])
   1.196 +
   1.197 +# Register a --enable argument but mark it as deprecated
   1.198 +# $1: The name of the with argument to deprecate, not including --enable-
   1.199 +# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -)
   1.200 +AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
   1.201 +[
   1.202 +  AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
   1.203 +      [Deprecated. Option is kept for backwards compatibility and is ignored])])
   1.204 +  if test "x$enable_$2" != x; then
   1.205 +    AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
   1.206 +  fi
   1.207  ])
   1.208  
   1.209  AC_DEFUN_ONCE([BASIC_INIT],
   1.210  [
   1.211 -# Save the original command line. This is passed to us by the wrapper configure script.
   1.212 -AC_SUBST(CONFIGURE_COMMAND_LINE)
   1.213 -DATE_WHEN_CONFIGURED=`LANG=C date`
   1.214 -AC_SUBST(DATE_WHEN_CONFIGURED)
   1.215 -AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
   1.216 -AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.])
   1.217 +  # Save the original command line. This is passed to us by the wrapper configure script.
   1.218 +  AC_SUBST(CONFIGURE_COMMAND_LINE)
   1.219 +  DATE_WHEN_CONFIGURED=`LANG=C date`
   1.220 +  AC_SUBST(DATE_WHEN_CONFIGURED)
   1.221 +  AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
   1.222 +  AC_MSG_NOTICE([configure script generated at timestamp $DATE_WHEN_GENERATED.])
   1.223  ])
   1.224  
   1.225  # Test that variable $1 denoting a program is not empty. If empty, exit with an error.
   1.226 @@ -218,15 +239,15 @@
   1.227  # $2: executable name to print in warning (optional)
   1.228  AC_DEFUN([BASIC_CHECK_NONEMPTY],
   1.229  [
   1.230 -    if test "x[$]$1" = x; then
   1.231 -        if test "x$2" = x; then
   1.232 -          PROG_NAME=translit($1,A-Z,a-z)
   1.233 -        else
   1.234 -          PROG_NAME=$2
   1.235 -        fi
   1.236 -        AC_MSG_NOTICE([Could not find $PROG_NAME!])
   1.237 -        AC_MSG_ERROR([Cannot continue])
   1.238 +  if test "x[$]$1" = x; then
   1.239 +    if test "x$2" = x; then
   1.240 +      PROG_NAME=translit($1,A-Z,a-z)
   1.241 +    else
   1.242 +      PROG_NAME=$2
   1.243      fi
   1.244 +    AC_MSG_NOTICE([Could not find $PROG_NAME!])
   1.245 +    AC_MSG_ERROR([Cannot continue])
   1.246 +  fi
   1.247  ])
   1.248  
   1.249  # Does AC_PATH_PROG followed by BASIC_CHECK_NONEMPTY.
   1.250 @@ -235,8 +256,8 @@
   1.251  # $2: executable name to look for
   1.252  AC_DEFUN([BASIC_REQUIRE_PROG],
   1.253  [
   1.254 -    AC_PATH_PROGS($1, $2)
   1.255 -    BASIC_CHECK_NONEMPTY($1, $2)
   1.256 +  AC_PATH_PROGS($1, $2)
   1.257 +  BASIC_CHECK_NONEMPTY($1, $2)
   1.258  ])
   1.259  
   1.260  # Setup the most fundamental tools that relies on not much else to set up,
   1.261 @@ -244,171 +265,171 @@
   1.262  AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
   1.263  [
   1.264  
   1.265 -# Start with tools that do not need have cross compilation support
   1.266 -# and can be expected to be found in the default PATH. These tools are
   1.267 -# used by configure. Nor are these tools expected to be found in the
   1.268 -# devkit from the builddeps server either, since they are
   1.269 -# needed to download the devkit.
   1.270 +  # Start with tools that do not need have cross compilation support
   1.271 +  # and can be expected to be found in the default PATH. These tools are
   1.272 +  # used by configure. Nor are these tools expected to be found in the
   1.273 +  # devkit from the builddeps server either, since they are
   1.274 +  # needed to download the devkit.
   1.275  
   1.276 -# First are all the simple required tools.
   1.277 -BASIC_REQUIRE_PROG(BASENAME, basename)
   1.278 -BASIC_REQUIRE_PROG(BASH, bash)
   1.279 -BASIC_REQUIRE_PROG(CAT, cat)
   1.280 -BASIC_REQUIRE_PROG(CHMOD, chmod)
   1.281 -BASIC_REQUIRE_PROG(CMP, cmp)
   1.282 -BASIC_REQUIRE_PROG(COMM, comm)
   1.283 -BASIC_REQUIRE_PROG(CP, cp)
   1.284 -BASIC_REQUIRE_PROG(CPIO, cpio)
   1.285 -BASIC_REQUIRE_PROG(CUT, cut)
   1.286 -BASIC_REQUIRE_PROG(DATE, date)
   1.287 -BASIC_REQUIRE_PROG(DIFF, [gdiff diff])
   1.288 -BASIC_REQUIRE_PROG(DIRNAME, dirname)
   1.289 -BASIC_REQUIRE_PROG(ECHO, echo)
   1.290 -BASIC_REQUIRE_PROG(EXPR, expr)
   1.291 -BASIC_REQUIRE_PROG(FILE, file)
   1.292 -BASIC_REQUIRE_PROG(FIND, find)
   1.293 -BASIC_REQUIRE_PROG(HEAD, head)
   1.294 -BASIC_REQUIRE_PROG(LN, ln)
   1.295 -BASIC_REQUIRE_PROG(LS, ls)
   1.296 -BASIC_REQUIRE_PROG(MKDIR, mkdir)
   1.297 -BASIC_REQUIRE_PROG(MKTEMP, mktemp)
   1.298 -BASIC_REQUIRE_PROG(MV, mv)
   1.299 -BASIC_REQUIRE_PROG(PRINTF, printf)
   1.300 -BASIC_REQUIRE_PROG(RM, rm)
   1.301 -BASIC_REQUIRE_PROG(SH, sh)
   1.302 -BASIC_REQUIRE_PROG(SORT, sort)
   1.303 -BASIC_REQUIRE_PROG(TAIL, tail)
   1.304 -BASIC_REQUIRE_PROG(TAR, tar)
   1.305 -BASIC_REQUIRE_PROG(TEE, tee)
   1.306 -BASIC_REQUIRE_PROG(TOUCH, touch)
   1.307 -BASIC_REQUIRE_PROG(TR, tr)
   1.308 -BASIC_REQUIRE_PROG(UNAME, uname)
   1.309 -BASIC_REQUIRE_PROG(UNIQ, uniq)
   1.310 -BASIC_REQUIRE_PROG(WC, wc)
   1.311 -BASIC_REQUIRE_PROG(WHICH, which)
   1.312 -BASIC_REQUIRE_PROG(XARGS, xargs)
   1.313 +  # First are all the simple required tools.
   1.314 +  BASIC_REQUIRE_PROG(BASENAME, basename)
   1.315 +  BASIC_REQUIRE_PROG(BASH, bash)
   1.316 +  BASIC_REQUIRE_PROG(CAT, cat)
   1.317 +  BASIC_REQUIRE_PROG(CHMOD, chmod)
   1.318 +  BASIC_REQUIRE_PROG(CMP, cmp)
   1.319 +  BASIC_REQUIRE_PROG(COMM, comm)
   1.320 +  BASIC_REQUIRE_PROG(CP, cp)
   1.321 +  BASIC_REQUIRE_PROG(CPIO, cpio)
   1.322 +  BASIC_REQUIRE_PROG(CUT, cut)
   1.323 +  BASIC_REQUIRE_PROG(DATE, date)
   1.324 +  BASIC_REQUIRE_PROG(DIFF, [gdiff diff])
   1.325 +  BASIC_REQUIRE_PROG(DIRNAME, dirname)
   1.326 +  BASIC_REQUIRE_PROG(ECHO, echo)
   1.327 +  BASIC_REQUIRE_PROG(EXPR, expr)
   1.328 +  BASIC_REQUIRE_PROG(FILE, file)
   1.329 +  BASIC_REQUIRE_PROG(FIND, find)
   1.330 +  BASIC_REQUIRE_PROG(HEAD, head)
   1.331 +  BASIC_REQUIRE_PROG(LN, ln)
   1.332 +  BASIC_REQUIRE_PROG(LS, ls)
   1.333 +  BASIC_REQUIRE_PROG(MKDIR, mkdir)
   1.334 +  BASIC_REQUIRE_PROG(MKTEMP, mktemp)
   1.335 +  BASIC_REQUIRE_PROG(MV, mv)
   1.336 +  BASIC_REQUIRE_PROG(PRINTF, printf)
   1.337 +  BASIC_REQUIRE_PROG(RM, rm)
   1.338 +  BASIC_REQUIRE_PROG(SH, sh)
   1.339 +  BASIC_REQUIRE_PROG(SORT, sort)
   1.340 +  BASIC_REQUIRE_PROG(TAIL, tail)
   1.341 +  BASIC_REQUIRE_PROG(TAR, tar)
   1.342 +  BASIC_REQUIRE_PROG(TEE, tee)
   1.343 +  BASIC_REQUIRE_PROG(TOUCH, touch)
   1.344 +  BASIC_REQUIRE_PROG(TR, tr)
   1.345 +  BASIC_REQUIRE_PROG(UNAME, uname)
   1.346 +  BASIC_REQUIRE_PROG(UNIQ, uniq)
   1.347 +  BASIC_REQUIRE_PROG(WC, wc)
   1.348 +  BASIC_REQUIRE_PROG(WHICH, which)
   1.349 +  BASIC_REQUIRE_PROG(XARGS, xargs)
   1.350  
   1.351 -# Then required tools that require some special treatment.
   1.352 -AC_PROG_AWK
   1.353 -BASIC_CHECK_NONEMPTY(AWK)
   1.354 -AC_PROG_GREP
   1.355 -BASIC_CHECK_NONEMPTY(GREP)
   1.356 -AC_PROG_EGREP
   1.357 -BASIC_CHECK_NONEMPTY(EGREP)
   1.358 -AC_PROG_FGREP
   1.359 -BASIC_CHECK_NONEMPTY(FGREP)
   1.360 -AC_PROG_SED
   1.361 -BASIC_CHECK_NONEMPTY(SED)
   1.362 +  # Then required tools that require some special treatment.
   1.363 +  AC_PROG_AWK
   1.364 +  BASIC_CHECK_NONEMPTY(AWK)
   1.365 +  AC_PROG_GREP
   1.366 +  BASIC_CHECK_NONEMPTY(GREP)
   1.367 +  AC_PROG_EGREP
   1.368 +  BASIC_CHECK_NONEMPTY(EGREP)
   1.369 +  AC_PROG_FGREP
   1.370 +  BASIC_CHECK_NONEMPTY(FGREP)
   1.371 +  AC_PROG_SED
   1.372 +  BASIC_CHECK_NONEMPTY(SED)
   1.373  
   1.374 -AC_PATH_PROGS(NAWK, [nawk gawk awk])
   1.375 -BASIC_CHECK_NONEMPTY(NAWK)
   1.376 +  AC_PATH_PROGS(NAWK, [nawk gawk awk])
   1.377 +  BASIC_CHECK_NONEMPTY(NAWK)
   1.378  
   1.379 -# Always force rm.
   1.380 -RM="$RM -f"
   1.381 +  # Always force rm.
   1.382 +  RM="$RM -f"
   1.383  
   1.384 -# pwd behaves differently on various platforms and some don't support the -L flag.
   1.385 -# Always use the bash builtin pwd to get uniform behavior.
   1.386 -THEPWDCMD=pwd
   1.387 +  # pwd behaves differently on various platforms and some don't support the -L flag.
   1.388 +  # Always use the bash builtin pwd to get uniform behavior.
   1.389 +  THEPWDCMD=pwd
   1.390  
   1.391 -# These are not required on all platforms
   1.392 -AC_PATH_PROG(CYGPATH, cygpath)
   1.393 -AC_PATH_PROG(READLINK, readlink)
   1.394 -AC_PATH_PROG(DF, df)
   1.395 -AC_PATH_PROG(SETFILE, SetFile)
   1.396 +  # These are not required on all platforms
   1.397 +  AC_PATH_PROG(CYGPATH, cygpath)
   1.398 +  AC_PATH_PROG(READLINK, readlink)
   1.399 +  AC_PATH_PROG(DF, df)
   1.400 +  AC_PATH_PROG(SETFILE, SetFile)
   1.401  ])
   1.402  
   1.403  # Setup basic configuration paths, and platform-specific stuff related to PATHs.
   1.404  AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
   1.405  [
   1.406 -# Locate the directory of this script.
   1.407 -SCRIPT="[$]0"
   1.408 -AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L`
   1.409 +  # Locate the directory of this script.
   1.410 +  SCRIPT="[$]0"
   1.411 +  AUTOCONF_DIR=`cd \`$DIRNAME $SCRIPT\`; $THEPWDCMD -L`
   1.412  
   1.413 -# Where is the source? It is located two levels above the configure script.
   1.414 -CURDIR="$PWD"
   1.415 -cd "$AUTOCONF_DIR/../.."
   1.416 -SRC_ROOT="`$THEPWDCMD -L`"
   1.417 +  # Where is the source? It is located two levels above the configure script.
   1.418 +  CURDIR="$PWD"
   1.419 +  cd "$AUTOCONF_DIR/../.."
   1.420 +  SRC_ROOT="`$THEPWDCMD -L`"
   1.421  
   1.422 -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.423 -  PATH_SEP=";"
   1.424 -  BASIC_CHECK_PATHS_WINDOWS
   1.425 -else
   1.426 -  PATH_SEP=":"
   1.427 -fi
   1.428 +  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.429 +    PATH_SEP=";"
   1.430 +    BASIC_CHECK_PATHS_WINDOWS
   1.431 +  else
   1.432 +    PATH_SEP=":"
   1.433 +  fi
   1.434  
   1.435 -AC_SUBST(SRC_ROOT)
   1.436 -AC_SUBST(PATH_SEP)
   1.437 -cd "$CURDIR"
   1.438 +  AC_SUBST(SRC_ROOT)
   1.439 +  AC_SUBST(PATH_SEP)
   1.440 +  cd "$CURDIR"
   1.441  
   1.442 -BASIC_FIXUP_PATH(SRC_ROOT)
   1.443 -BASIC_FIXUP_PATH(CURDIR)
   1.444 +  BASIC_FIXUP_PATH(SRC_ROOT)
   1.445 +  BASIC_FIXUP_PATH(CURDIR)
   1.446  
   1.447 -if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   1.448 +  if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   1.449      # Add extra search paths on solaris for utilities like ar and as etc...
   1.450      PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
   1.451 -fi
   1.452 +  fi
   1.453  
   1.454 -# You can force the sys-root if the sys-root encoded into the cross compiler tools
   1.455 -# is not correct.
   1.456 -AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
   1.457 -  [pass this sys-root to the compilers and tools (for cross-compiling)])])
   1.458 +  # You can force the sys-root if the sys-root encoded into the cross compiler tools
   1.459 +  # is not correct.
   1.460 +  AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
   1.461 +      [pass this sys-root to the compilers and tools (for cross-compiling)])])
   1.462  
   1.463 -if test "x$with_sys_root" != x; then
   1.464 -  SYS_ROOT=$with_sys_root
   1.465 -else
   1.466 -  SYS_ROOT=/
   1.467 -fi
   1.468 -AC_SUBST(SYS_ROOT)
   1.469 +  if test "x$with_sys_root" != x; then
   1.470 +    SYS_ROOT=$with_sys_root
   1.471 +  else
   1.472 +    SYS_ROOT=/
   1.473 +  fi
   1.474 +  AC_SUBST(SYS_ROOT)
   1.475  
   1.476 -AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
   1.477 -  [search this directory for compilers and tools (for cross-compiling)])], 
   1.478 -  [TOOLS_DIR=$with_tools_dir]
   1.479 -)
   1.480 +  AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
   1.481 +      [search this directory for compilers and tools (for cross-compiling)])],
   1.482 +      [TOOLS_DIR=$with_tools_dir]
   1.483 +  )
   1.484  
   1.485 -AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
   1.486 -  [use this directory as base for tools-dir and sys-root (for cross-compiling)])],
   1.487 -  [
   1.488 -    if test "x$with_sys_root" != x; then
   1.489 -      AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time])
   1.490 -    fi
   1.491 -    BASIC_FIXUP_PATH([with_devkit])
   1.492 -    BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin)
   1.493 -    if test -d "$with_devkit/$host_alias/libc"; then
   1.494 -      SYS_ROOT=$with_devkit/$host_alias/libc
   1.495 -    elif test -d "$with_devkit/$host/sys-root"; then
   1.496 -      SYS_ROOT=$with_devkit/$host/sys-root
   1.497 -    fi
   1.498 -  ])
   1.499 +  AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
   1.500 +      [use this directory as base for tools-dir and sys-root (for cross-compiling)])],
   1.501 +      [
   1.502 +        if test "x$with_sys_root" != x; then
   1.503 +          AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time])
   1.504 +        fi
   1.505 +        BASIC_FIXUP_PATH([with_devkit])
   1.506 +        BASIC_APPEND_TO_PATH([TOOLS_DIR],$with_devkit/bin)
   1.507 +        if test -d "$with_devkit/$host_alias/libc"; then
   1.508 +          SYS_ROOT=$with_devkit/$host_alias/libc
   1.509 +        elif test -d "$with_devkit/$host/sys-root"; then
   1.510 +          SYS_ROOT=$with_devkit/$host/sys-root
   1.511 +        fi
   1.512 +      ])
   1.513  ])
   1.514  
   1.515  AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
   1.516  [
   1.517  
   1.518 -AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
   1.519 -	[use this as the name of the configuration @<:@generated from important configuration options@:>@])],
   1.520 -        [ CONF_NAME=${with_conf_name} ])
   1.521 +  AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
   1.522 +      [use this as the name of the configuration @<:@generated from important configuration options@:>@])],
   1.523 +      [ CONF_NAME=${with_conf_name} ])
   1.524  
   1.525 -# Test from where we are running configure, in or outside of src root.
   1.526 -if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
   1.527 -        || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
   1.528 -        || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
   1.529 +  # Test from where we are running configure, in or outside of src root.
   1.530 +  if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
   1.531 +      || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
   1.532 +      || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
   1.533      # We are running configure from the src root.
   1.534      # Create a default ./build/target-variant-debuglevel output root.
   1.535      if test "x${CONF_NAME}" = x; then
   1.536 -        CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   1.537 +      CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   1.538      fi
   1.539      OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
   1.540      $MKDIR -p "$OUTPUT_ROOT"
   1.541      if test ! -d "$OUTPUT_ROOT"; then
   1.542 -        AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT])
   1.543 +      AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT])
   1.544      fi
   1.545 -else
   1.546 +  else
   1.547      # We are running configure from outside of the src dir.
   1.548      # Then use the current directory as output dir!
   1.549      # If configuration is situated in normal build directory, just use the build
   1.550      # directory name as configuration name, otherwise use the complete path.
   1.551      if test "x${CONF_NAME}" = x; then
   1.552 -        CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
   1.553 +      CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
   1.554      fi
   1.555      OUTPUT_ROOT="$CURDIR"
   1.556  
   1.557 @@ -419,10 +440,10 @@
   1.558        # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
   1.559        # other files
   1.560        files_present=`$LS $OUTPUT_ROOT`
   1.561 -      # Configure has already touched config.log and confdefs.h in the current dir when this check 
   1.562 +      # Configure has already touched config.log and confdefs.h in the current dir when this check
   1.563        # is performed.
   1.564        filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \
   1.565 -                                             | $TR -d '\n'`
   1.566 +      | $TR -d '\n'`
   1.567        if test "x$filtered_files" != x; then
   1.568          AC_MSG_NOTICE([Current directory is $CURDIR.])
   1.569          AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
   1.570 @@ -434,46 +455,46 @@
   1.571          AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
   1.572        fi
   1.573      fi
   1.574 -fi
   1.575 -AC_MSG_CHECKING([what configuration name to use])
   1.576 -AC_MSG_RESULT([$CONF_NAME])
   1.577 +  fi
   1.578 +  AC_MSG_CHECKING([what configuration name to use])
   1.579 +  AC_MSG_RESULT([$CONF_NAME])
   1.580  
   1.581 -BASIC_FIXUP_PATH(OUTPUT_ROOT)
   1.582 +  BASIC_FIXUP_PATH(OUTPUT_ROOT)
   1.583  
   1.584 -AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
   1.585 -AC_SUBST(CONF_NAME, $CONF_NAME)
   1.586 -AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
   1.587 +  AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
   1.588 +  AC_SUBST(CONF_NAME, $CONF_NAME)
   1.589 +  AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
   1.590  
   1.591 -# Most of the probed defines are put into config.h
   1.592 -AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
   1.593 -# The spec.gmk file contains all variables for the make system.
   1.594 -AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
   1.595 -# The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
   1.596 -AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
   1.597 -# The bootcycle-spec.gmk file contains support for boot cycle builds.
   1.598 -AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
   1.599 -# The compare.sh is used to compare the build output to other builds.
   1.600 -AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in])
   1.601 -# Spec.sh is currently used by compare-objects.sh
   1.602 -AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
   1.603 -# The generated Makefile knows where the spec.gmk is and where the source is.
   1.604 -# You can run make from the OUTPUT_ROOT, or from the top-level Makefile
   1.605 -# which will look for generated configurations
   1.606 -AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
   1.607 +  # Most of the probed defines are put into config.h
   1.608 +  AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
   1.609 +  # The spec.gmk file contains all variables for the make system.
   1.610 +  AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
   1.611 +  # The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
   1.612 +  AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
   1.613 +  # The bootcycle-spec.gmk file contains support for boot cycle builds.
   1.614 +  AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
   1.615 +  # The compare.sh is used to compare the build output to other builds.
   1.616 +  AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in])
   1.617 +  # Spec.sh is currently used by compare-objects.sh
   1.618 +  AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
   1.619 +  # The generated Makefile knows where the spec.gmk is and where the source is.
   1.620 +  # You can run make from the OUTPUT_ROOT, or from the top-level Makefile
   1.621 +  # which will look for generated configurations
   1.622 +  AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
   1.623  
   1.624 -# Save the arguments given to us
   1.625 -echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments
   1.626 +  # Save the arguments given to us
   1.627 +  echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments
   1.628  ])
   1.629  
   1.630  AC_DEFUN_ONCE([BASIC_SETUP_LOGGING],
   1.631  [
   1.632 -# Setup default logging of stdout and stderr to build.log in the output root.
   1.633 -BUILD_LOG='$(OUTPUT_ROOT)/build.log'
   1.634 -BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
   1.635 -BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
   1.636 -AC_SUBST(BUILD_LOG)
   1.637 -AC_SUBST(BUILD_LOG_PREVIOUS)
   1.638 -AC_SUBST(BUILD_LOG_WRAPPER)
   1.639 +  # Setup default logging of stdout and stderr to build.log in the output root.
   1.640 +  BUILD_LOG='$(OUTPUT_ROOT)/build.log'
   1.641 +  BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
   1.642 +  BUILD_LOG_WRAPPER='$(BASH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
   1.643 +  AC_SUBST(BUILD_LOG)
   1.644 +  AC_SUBST(BUILD_LOG_PREVIOUS)
   1.645 +  AC_SUBST(BUILD_LOG_WRAPPER)
   1.646  ])
   1.647  
   1.648  
   1.649 @@ -493,7 +514,7 @@
   1.650      if test "x$IS_GNU_MAKE" = x; then
   1.651        AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
   1.652      else
   1.653 -      IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'`
   1.654 +      IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP -e '3\.8[[12]]' -e '4\.'`
   1.655        if test "x$IS_MODERN_MAKE" = x; then
   1.656          AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
   1.657        else
   1.658 @@ -572,85 +593,86 @@
   1.659  
   1.660  AC_DEFUN([BASIC_CHECK_FIND_DELETE],
   1.661  [
   1.662 -    # Test if find supports -delete
   1.663 -    AC_MSG_CHECKING([if find supports -delete])
   1.664 -    FIND_DELETE="-delete"
   1.665 +  # Test if find supports -delete
   1.666 +  AC_MSG_CHECKING([if find supports -delete])
   1.667 +  FIND_DELETE="-delete"
   1.668  
   1.669 -    DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
   1.670 +  DELETEDIR=`$MKTEMP -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
   1.671  
   1.672 -    echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
   1.673 +  echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
   1.674  
   1.675 -    TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
   1.676 -    if test -f $DELETEDIR/TestIfFindSupportsDelete; then
   1.677 -        # No, it does not.
   1.678 -        rm $DELETEDIR/TestIfFindSupportsDelete
   1.679 -        FIND_DELETE="-exec rm \{\} \+"
   1.680 -        AC_MSG_RESULT([no])    
   1.681 -    else
   1.682 -        AC_MSG_RESULT([yes])    
   1.683 -    fi
   1.684 -    rmdir $DELETEDIR
   1.685 -    AC_SUBST(FIND_DELETE)
   1.686 +  TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
   1.687 +  if test -f $DELETEDIR/TestIfFindSupportsDelete; then
   1.688 +    # No, it does not.
   1.689 +    rm $DELETEDIR/TestIfFindSupportsDelete
   1.690 +    FIND_DELETE="-exec rm \{\} \+"
   1.691 +    AC_MSG_RESULT([no])
   1.692 +  else
   1.693 +    AC_MSG_RESULT([yes])
   1.694 +  fi
   1.695 +  rmdir $DELETEDIR
   1.696 +  AC_SUBST(FIND_DELETE)
   1.697  ])
   1.698  
   1.699  AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
   1.700  [
   1.701 -BASIC_CHECK_GNU_MAKE
   1.702 +  BASIC_CHECK_GNU_MAKE
   1.703  
   1.704 -BASIC_CHECK_FIND_DELETE
   1.705 +  BASIC_CHECK_FIND_DELETE
   1.706  
   1.707 -# These tools might not be installed by default, 
   1.708 -# need hint on how to install them.
   1.709 -BASIC_REQUIRE_PROG(UNZIP, unzip)
   1.710 -BASIC_REQUIRE_PROG(ZIP, zip)
   1.711 +  # These tools might not be installed by default,
   1.712 +  # need hint on how to install them.
   1.713 +  BASIC_REQUIRE_PROG(UNZIP, unzip)
   1.714 +  BASIC_REQUIRE_PROG(ZIP, zip)
   1.715  
   1.716 -# Non-required basic tools
   1.717 +  # Non-required basic tools
   1.718  
   1.719 -AC_PATH_PROG(LDD, ldd)
   1.720 -if test "x$LDD" = "x"; then
   1.721 +  AC_PATH_PROG(LDD, ldd)
   1.722 +  if test "x$LDD" = "x"; then
   1.723      # List shared lib dependencies is used for
   1.724      # debug output and checking for forbidden dependencies.
   1.725      # We can build without it.
   1.726      LDD="true"
   1.727 -fi
   1.728 -AC_PATH_PROG(OTOOL, otool)
   1.729 -if test "x$OTOOL" = "x"; then
   1.730 -   OTOOL="true"
   1.731 -fi
   1.732 -AC_PATH_PROGS(READELF, [readelf greadelf])
   1.733 -AC_PATH_PROG(HG, hg)
   1.734 -AC_PATH_PROG(STAT, stat)
   1.735 -AC_PATH_PROG(TIME, time)
   1.736 -# Check if it's GNU time
   1.737 -IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'`
   1.738 -if test "x$IS_GNU_TIME" != x; then
   1.739 -  IS_GNU_TIME=yes
   1.740 -else
   1.741 -  IS_GNU_TIME=no
   1.742 -fi
   1.743 -AC_SUBST(IS_GNU_TIME)
   1.744 +  fi
   1.745 +  AC_PATH_PROG(OTOOL, otool)
   1.746 +  if test "x$OTOOL" = "x"; then
   1.747 +    OTOOL="true"
   1.748 +  fi
   1.749 +  AC_PATH_PROGS(READELF, [readelf greadelf])
   1.750 +  AC_PATH_PROG(HG, hg)
   1.751 +  AC_PATH_PROG(STAT, stat)
   1.752 +  AC_PATH_PROG(TIME, time)
   1.753 +  # Check if it's GNU time
   1.754 +  IS_GNU_TIME=`$TIME --version 2>&1 | $GREP 'GNU time'`
   1.755 +  if test "x$IS_GNU_TIME" != x; then
   1.756 +    IS_GNU_TIME=yes
   1.757 +  else
   1.758 +    IS_GNU_TIME=no
   1.759 +  fi
   1.760 +  AC_SUBST(IS_GNU_TIME)
   1.761  
   1.762 -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.763 -  BASIC_REQUIRE_PROG(COMM, comm)
   1.764 -fi
   1.765 +  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.766 +    BASIC_REQUIRE_PROG(COMM, comm)
   1.767 +  fi
   1.768  
   1.769 -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
   1.770 -  BASIC_REQUIRE_PROG(XATTR, xattr)
   1.771 -  AC_PATH_PROG(CODESIGN, codesign)
   1.772 -  if test "x$CODESIGN" != "x"; then
   1.773 -    # Verify that the openjdk_codesign certificate is present
   1.774 -    AC_MSG_CHECKING([if openjdk_codesign certificate is present])
   1.775 -    rm -f codesign-testfile
   1.776 -    touch codesign-testfile
   1.777 -    codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
   1.778 -    rm -f codesign-testfile
   1.779 -    if test "x$CODESIGN" = x; then
   1.780 -      AC_MSG_RESULT([no])
   1.781 -    else
   1.782 -      AC_MSG_RESULT([yes])
   1.783 +  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
   1.784 +    BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil)
   1.785 +    BASIC_REQUIRE_PROG(XATTR, xattr)
   1.786 +    AC_PATH_PROG(CODESIGN, codesign)
   1.787 +    if test "x$CODESIGN" != "x"; then
   1.788 +      # Verify that the openjdk_codesign certificate is present
   1.789 +      AC_MSG_CHECKING([if openjdk_codesign certificate is present])
   1.790 +      rm -f codesign-testfile
   1.791 +      touch codesign-testfile
   1.792 +      codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
   1.793 +      rm -f codesign-testfile
   1.794 +      if test "x$CODESIGN" = x; then
   1.795 +        AC_MSG_RESULT([no])
   1.796 +      else
   1.797 +        AC_MSG_RESULT([yes])
   1.798 +      fi
   1.799      fi
   1.800    fi
   1.801 -fi
   1.802  ])
   1.803  
   1.804  # Check if build directory is on local disk. If not possible to determine,
   1.805 @@ -660,8 +682,8 @@
   1.806  # Argument 3: what to do otherwise (remote disk or failure)
   1.807  AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
   1.808  [
   1.809 -	# df -l lists only local disks; if the given directory is not found then
   1.810 -	# a non-zero exit code is given
   1.811 +  # df -l lists only local disks; if the given directory is not found then
   1.812 +  # a non-zero exit code is given
   1.813    if test "x$DF" = x; then
   1.814      if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.815        # msys does not have df; use Windows "net use" instead.
   1.816 @@ -698,32 +720,30 @@
   1.817  
   1.818  AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
   1.819  [
   1.820 +  AC_MSG_CHECKING([if build directory is on local disk])
   1.821 +  BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
   1.822 +      [OUTPUT_DIR_IS_LOCAL="yes"],
   1.823 +      [OUTPUT_DIR_IS_LOCAL="no"])
   1.824 +  AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
   1.825  
   1.826 -AC_MSG_CHECKING([if build directory is on local disk])
   1.827 -BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
   1.828 -  [OUTPUT_DIR_IS_LOCAL="yes"],
   1.829 -  [OUTPUT_DIR_IS_LOCAL="no"])
   1.830 -AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
   1.831 +  BASIC_CHECK_SRC_PERMS
   1.832  
   1.833 -BASIC_CHECK_SRC_PERMS
   1.834 +  # Check if the user has any old-style ALT_ variables set.
   1.835 +  FOUND_ALT_VARIABLES=`env | grep ^ALT_`
   1.836  
   1.837 -# Check if the user has any old-style ALT_ variables set.
   1.838 -FOUND_ALT_VARIABLES=`env | grep ^ALT_`
   1.839 +  # Before generating output files, test if they exist. If they do, this is a reconfigure.
   1.840 +  # Since we can't properly handle the dependencies for this, warn the user about the situation
   1.841 +  if test -e $OUTPUT_ROOT/spec.gmk; then
   1.842 +    IS_RECONFIGURE=yes
   1.843 +  else
   1.844 +    IS_RECONFIGURE=no
   1.845 +  fi
   1.846  
   1.847 -# Before generating output files, test if they exist. If they do, this is a reconfigure.
   1.848 -# Since we can't properly handle the dependencies for this, warn the user about the situation
   1.849 -if test -e $OUTPUT_ROOT/spec.gmk; then
   1.850 -  IS_RECONFIGURE=yes
   1.851 -else
   1.852 -  IS_RECONFIGURE=no
   1.853 -fi
   1.854 -
   1.855 -if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then
   1.856 -  HIDE_PERFORMANCE_HINTS=yes
   1.857 -else
   1.858 -  HIDE_PERFORMANCE_HINTS=no
   1.859 -  # Hide it the next time around...
   1.860 -  $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1
   1.861 -fi
   1.862 -
   1.863 +  if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then
   1.864 +    HIDE_PERFORMANCE_HINTS=yes
   1.865 +  else
   1.866 +    HIDE_PERFORMANCE_HINTS=no
   1.867 +    # Hide it the next time around...
   1.868 +    $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1
   1.869 +  fi
   1.870  ])

mercurial