common/autoconf/basics.m4

changeset 459
3156dff953b1
child 478
2ba6f4da4bf3
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/common/autoconf/basics.m4	Thu Jul 05 18:27:07 2012 -0700
     1.3 @@ -0,0 +1,485 @@
     1.4 +#
     1.5 +# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 +#
     1.8 +# This code is free software; you can redistribute it and/or modify it
     1.9 +# under the terms of the GNU General Public License version 2 only, as
    1.10 +# published by the Free Software Foundation.  Oracle designates this
    1.11 +# particular file as subject to the "Classpath" exception as provided
    1.12 +# by Oracle in the LICENSE file that accompanied this code.
    1.13 +#
    1.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 +# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 +# version 2 for more details (a copy is included in the LICENSE file that
    1.18 +# accompanied this code).
    1.19 +#
    1.20 +# You should have received a copy of the GNU General Public License version
    1.21 +# 2 along with this work; if not, write to the Free Software Foundation,
    1.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 +#
    1.24 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 +# or visit www.oracle.com if you need additional information or have any
    1.26 +# questions.
    1.27 +#
    1.28 +
    1.29 +AC_DEFUN([ADD_JVM_ARG_IF_OK],
    1.30 +[
    1.31 +    # Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
    1.32 +    # If so, then append $1 to $2
    1.33 +    FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
    1.34 +    FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`
    1.35 +    if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
    1.36 +        $2="[$]$2 $1"
    1.37 +    fi
    1.38 +])
    1.39 +
    1.40 +AC_DEFUN([WHICHCMD],
    1.41 +[
    1.42 +    # Translate "gcc -E" into "`which gcc` -E" ie
    1.43 +    # extract the full path to the binary and at the
    1.44 +    # same time maintain any arguments passed to it.
    1.45 +    # The command MUST exist in the path, or else!
    1.46 +    tmp="[$]$1"
    1.47 +    car="${tmp%% *}"
    1.48 +    tmp="[$]$1 EOL"
    1.49 +    cdr="${tmp#* }"
    1.50 +    # On windows we want paths without spaces.
    1.51 +    if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
    1.52 +        WHICHCMD_SPACESAFE(car)
    1.53 +    else
    1.54 +        # "which" is not portable, but is used here
    1.55 +        # because we know that the command exists!
    1.56 +        car=`which $car`
    1.57 +    fi
    1.58 +    if test "x$cdr" != xEOL; then
    1.59 +        $1="$car ${cdr% *}"
    1.60 +    else
    1.61 +        $1="$car"
    1.62 +    fi
    1.63 +])
    1.64 +
    1.65 +AC_DEFUN([SPACESAFE],
    1.66 +[
    1.67 +    # Fail with message $2 if var $1 contains a path with no spaces in it.
    1.68 +    # Unless on Windows, where we can rewrite the path.
    1.69 +    HAS_SPACE=`echo "[$]$1" | grep " "`
    1.70 +    if test "x$HAS_SPACE" != x; then
    1.71 +        if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
    1.72 +            $1=`$CYGPATH -s -m -a "[$]$1"`
    1.73 +            $1=`$CYGPATH -u "[$]$1"`            
    1.74 +        else
    1.75 +            AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
    1.76 +        fi
    1.77 +    fi
    1.78 +])
    1.79 +
    1.80 +AC_DEFUN([WHICHCMD_SPACESAFE],
    1.81 +[
    1.82 +    # Translate long cygdrive or C:\sdfsf path
    1.83 +    # into a short mixed mode path that has no
    1.84 +    # spaces in it.
    1.85 +    tmp="[$]$1"
    1.86 +    
    1.87 +    if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
    1.88 +        tmp=`$CYGPATH -u "[$]$1"`
    1.89 +        tmp=`which "$tmp"`
    1.90 +        # If file exists with .exe appended, that's the real filename
    1.91 +        # and cygpath needs that to convert to short style path.
    1.92 +        if test -f "${tmp}.exe"; then
    1.93 +           tmp="${tmp}.exe"
    1.94 +        elif test -f "${tmp}.cmd"; then
    1.95 +           tmp="${tmp}.cmd"
    1.96 +        fi
    1.97 +        # Convert to C:/ mixed style path without spaces.
    1.98 +         tmp=`$CYGPATH -s -m "$tmp"`
    1.99 +    fi
   1.100 +    $1="$tmp"
   1.101 +])
   1.102 +
   1.103 +AC_DEFUN([REMOVE_SYMBOLIC_LINKS],
   1.104 +[
   1.105 +    if test "x$OPENJDK_BUILD_OS" != xwindows; then
   1.106 +        # Follow a chain of symbolic links. Use readlink
   1.107 +        # where it exists, else fall back to horribly
   1.108 +        # complicated shell code.
   1.109 +        AC_PATH_PROG(READLINK, readlink)
   1.110 +        if test "x$READLINK_TESTED" != yes; then
   1.111 +            # On MacOSX there is a readlink tool with a different
   1.112 +            # purpose than the GNU readlink tool. Check the found readlink.
   1.113 +            ISGNU=`$READLINK --help 2>&1 | grep GNU`
   1.114 +            if test "x$ISGNU" = x; then
   1.115 +                 # A readlink that we do not know how to use.
   1.116 +                 # Are there other non-GNU readlinks out there?
   1.117 +                 READLINK_TESTED=yes
   1.118 +                 READLINK=
   1.119 +            fi
   1.120 +        fi
   1.121 +
   1.122 +        if test "x$READLINK" != x; then
   1.123 +            $1=`$READLINK -f [$]$1`
   1.124 +        else
   1.125 +            STARTDIR=$PWD
   1.126 +            COUNTER=0
   1.127 +            DIR=`dirname [$]$1`
   1.128 +            FIL=`basename [$]$1`
   1.129 +            while test $COUNTER -lt 20; do
   1.130 +                ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'`
   1.131 +                if test "x$ISLINK" == x; then
   1.132 +                    # This is not a symbolic link! We are done!
   1.133 +                    break
   1.134 +                fi
   1.135 +                # The link might be relative! We have to use cd to travel safely.
   1.136 +                cd $DIR
   1.137 +                cd `dirname $ISLINK`
   1.138 +                DIR=`pwd`
   1.139 +                FIL=`basename $ISLINK`
   1.140 +                let COUNTER=COUNTER+1
   1.141 +            done
   1.142 +            cd $STARTDIR
   1.143 +            $1=$DIR/$FIL
   1.144 +        fi
   1.145 +    fi
   1.146 +])
   1.147 +
   1.148 +AC_DEFUN_ONCE([BASIC_INIT],
   1.149 +[
   1.150 +# Save the original command line. This is passed to us by the wrapper configure script.
   1.151 +AC_SUBST(CONFIGURE_COMMAND_LINE)
   1.152 +DATE_WHEN_CONFIGURED=`LANG=C date`
   1.153 +AC_SUBST(DATE_WHEN_CONFIGURED)
   1.154 +
   1.155 +# Locate the directory of this script.
   1.156 +SCRIPT="[$]0"
   1.157 +REMOVE_SYMBOLIC_LINKS(SCRIPT)        
   1.158 +AUTOCONF_DIR=`dirname [$]0`
   1.159 +])
   1.160 +
   1.161 +AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
   1.162 +[
   1.163 +# Where is the source? It is located two levels above the configure script.
   1.164 +CURDIR="$PWD"
   1.165 +cd "$AUTOCONF_DIR/../.."
   1.166 +SRC_ROOT="`pwd`"
   1.167 +if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   1.168 +    SRC_ROOT_LENGTH=`pwd|wc -m`
   1.169 +    if test $SRC_ROOT_LENGTH -gt 100; then
   1.170 +        AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
   1.171 +    fi
   1.172 +fi
   1.173 +AC_SUBST(SRC_ROOT)
   1.174 +cd "$CURDIR"
   1.175 +
   1.176 +SPACESAFE(SRC_ROOT,[the path to the source root])
   1.177 +SPACESAFE(CURDIR,[the path to the current directory])
   1.178 +])
   1.179 +
   1.180 +AC_DEFUN_ONCE([BASIC_SETUP_SEARCHPATH],
   1.181 +[
   1.182 +if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   1.183 +    # Add extra search paths on solaris for utilities like ar and as etc...
   1.184 +    PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
   1.185 +fi
   1.186 +])
   1.187 +
   1.188 +AC_DEFUN_ONCE([BASIC_SETUP_PATH_SEP],
   1.189 +[
   1.190 +# For cygwin we need cygpath first, since it is used everywhere.
   1.191 +AC_PATH_PROG(CYGPATH, cygpath)
   1.192 +PATH_SEP=":"
   1.193 +if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
   1.194 +    if test "x$CYGPATH" = x; then
   1.195 +        AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
   1.196 +    fi
   1.197 +    PATH_SEP=";"
   1.198 +fi
   1.199 +AC_SUBST(PATH_SEP)
   1.200 +])
   1.201 +
   1.202 +AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
   1.203 +[
   1.204 +
   1.205 +AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
   1.206 +	[use this as the name of the configuration, overriding the generated default])],
   1.207 +        [ CONF_NAME=${with_conf_name} ])
   1.208 +
   1.209 +# Test from where we are running configure, in or outside of src root.
   1.210 +if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
   1.211 +    # We are running configure from the src root.
   1.212 +    # Create a default ./build/target-variant-debuglevel output root.
   1.213 +    if test "x${CONF_NAME}" = x; then
   1.214 +        CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
   1.215 +    fi
   1.216 +    OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
   1.217 +    mkdir -p "$OUTPUT_ROOT"
   1.218 +    if test ! -d "$OUTPUT_ROOT"; then
   1.219 +        AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT])
   1.220 +    fi
   1.221 +else
   1.222 +    # We are running configure from outside of the src dir.
   1.223 +    # Then use the current directory as output dir!
   1.224 +    # If configuration is situated in normal build directory, just use the build
   1.225 +    # directory name as configuration name, otherwise use the complete path.
   1.226 +    if test "x${CONF_NAME}" = x; then
   1.227 +        CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
   1.228 +    fi
   1.229 +    OUTPUT_ROOT="$CURDIR"
   1.230 +fi
   1.231 +
   1.232 +SPACESAFE(OUTPUT_ROOT,[the path to the output root])
   1.233 +
   1.234 +AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
   1.235 +AC_SUBST(CONF_NAME, $CONF_NAME)
   1.236 +AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
   1.237 +
   1.238 +# Most of the probed defines are put into config.h
   1.239 +AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
   1.240 +# The spec.gmk file contains all variables for the make system.
   1.241 +AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
   1.242 +# The spec.sh file contains variables for compare{images|-objects}.sh scrips.
   1.243 +AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
   1.244 +# The generated Makefile knows where the spec.gmk is and where the source is.
   1.245 +# You can run make from the OUTPUT_ROOT, or from the top-level Makefile
   1.246 +# which will look for generated configurations
   1.247 +AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
   1.248 +
   1.249 +# Save the arguments given to us
   1.250 +echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments
   1.251 +])
   1.252 +
   1.253 +AC_DEFUN_ONCE([BASIC_SETUP_LOGGING],
   1.254 +[
   1.255 +# Setup default logging of stdout and stderr to build.log in the output root.
   1.256 +BUILD_LOG='$(OUTPUT_ROOT)/build.log'
   1.257 +BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
   1.258 +BUILD_LOG_WRAPPER='$(SH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
   1.259 +AC_SUBST(BUILD_LOG)
   1.260 +AC_SUBST(BUILD_LOG_PREVIOUS)
   1.261 +AC_SUBST(BUILD_LOG_WRAPPER)
   1.262 +])
   1.263 +
   1.264 +
   1.265 +#%%% Simple tools %%%
   1.266 +
   1.267 +AC_DEFUN([BASIC_CHECK_FIND_DELETE],
   1.268 +[
   1.269 +    # Test if find supports -delete
   1.270 +    AC_MSG_CHECKING([if find supports -delete])
   1.271 +    FIND_DELETE="-delete"
   1.272 +
   1.273 +    DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
   1.274 +
   1.275 +    echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
   1.276 +
   1.277 +    TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
   1.278 +    if test -f $DELETEDIR/TestIfFindSupportsDelete; then
   1.279 +        # No, it does not.
   1.280 +        rm $DELETEDIR/TestIfFindSupportsDelete
   1.281 +        FIND_DELETE="-exec rm \{\} \+"
   1.282 +        AC_MSG_RESULT([no])    
   1.283 +    else
   1.284 +        AC_MSG_RESULT([yes])    
   1.285 +    fi
   1.286 +    rmdir $DELETEDIR
   1.287 +])
   1.288 +
   1.289 +AC_DEFUN([CHECK_NONEMPTY],
   1.290 +[
   1.291 +    # Test that variable $1 is not empty.
   1.292 +    if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
   1.293 +])
   1.294 +
   1.295 +AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
   1.296 +[
   1.297 +# Start with tools that do not need have cross compilation support
   1.298 +# and can be expected to be found in the default PATH. These tools are
   1.299 +# used by configure. Nor are these tools expected to be found in the
   1.300 +# devkit from the builddeps server either, since they are
   1.301 +# needed to download the devkit. 
   1.302 +AC_PROG_AWK
   1.303 +CHECK_NONEMPTY(AWK)
   1.304 +AC_PATH_PROG(CAT, cat)
   1.305 +CHECK_NONEMPTY(CAT)
   1.306 +AC_PATH_PROG(CHMOD, chmod)
   1.307 +CHECK_NONEMPTY(CHMOD)
   1.308 +AC_PATH_PROG(CP, cp)
   1.309 +CHECK_NONEMPTY(CP)
   1.310 +AC_PATH_PROG(CPIO, cpio)
   1.311 +CHECK_NONEMPTY(CPIO)
   1.312 +AC_PATH_PROG(CUT, cut)
   1.313 +CHECK_NONEMPTY(CUT)
   1.314 +AC_PATH_PROG(DATE, date)
   1.315 +CHECK_NONEMPTY(DATE)
   1.316 +AC_PATH_PROG(DF, df)
   1.317 +CHECK_NONEMPTY(DF)
   1.318 +AC_PATH_PROG(DIFF, diff)
   1.319 +CHECK_NONEMPTY(DIFF)
   1.320 +# Warning echo is really, really unportable!!!!! Different
   1.321 +# behaviour in bash and dash and in a lot of other shells!
   1.322 +# Use printf for serious work! 
   1.323 +AC_PATH_PROG(ECHO, echo)
   1.324 +CHECK_NONEMPTY(ECHO)
   1.325 +AC_PROG_EGREP
   1.326 +CHECK_NONEMPTY(EGREP)
   1.327 +AC_PROG_FGREP
   1.328 +CHECK_NONEMPTY(FGREP)
   1.329 +
   1.330 +AC_PATH_PROG(FIND, find)
   1.331 +CHECK_NONEMPTY(FIND)
   1.332 +BASIC_CHECK_FIND_DELETE
   1.333 +AC_SUBST(FIND_DELETE)
   1.334 +
   1.335 +AC_PROG_GREP
   1.336 +CHECK_NONEMPTY(GREP)
   1.337 +AC_PATH_PROG(HEAD, head)
   1.338 +CHECK_NONEMPTY(HEAD)
   1.339 +AC_PATH_PROG(LN, ln)
   1.340 +CHECK_NONEMPTY(LN)
   1.341 +AC_PATH_PROG(LS, ls)
   1.342 +CHECK_NONEMPTY(LS)
   1.343 +AC_PATH_PROGS(MAKE, [gmake make])
   1.344 +CHECK_NONEMPTY(MAKE)
   1.345 +MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'`
   1.346 +if test "x$MAKE_VERSION" = x; then
   1.347 +    AC_MSG_ERROR([You must use GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
   1.348 +fi
   1.349 +AC_PATH_PROG(MKDIR, mkdir)
   1.350 +CHECK_NONEMPTY(MKDIR)
   1.351 +AC_PATH_PROG(MV, mv)
   1.352 +CHECK_NONEMPTY(MV)
   1.353 +AC_PATH_PROGS(NAWK, [nawk gawk awk])
   1.354 +CHECK_NONEMPTY(NAWK)
   1.355 +AC_PATH_PROG(PRINTF, printf)
   1.356 +CHECK_NONEMPTY(PRINTF)
   1.357 +AC_PATH_PROG(THEPWDCMD, pwd)
   1.358 +AC_PATH_PROG(RM, rm)
   1.359 +CHECK_NONEMPTY(RM)
   1.360 +RM="$RM -f"
   1.361 +AC_PROG_SED
   1.362 +CHECK_NONEMPTY(SED)
   1.363 +AC_PATH_PROG(SH, sh)
   1.364 +CHECK_NONEMPTY(SH)
   1.365 +AC_PATH_PROG(SORT, sort)
   1.366 +CHECK_NONEMPTY(SORT)
   1.367 +AC_PATH_PROG(TAR, tar)
   1.368 +CHECK_NONEMPTY(TAR)
   1.369 +AC_PATH_PROG(TAIL, tail)
   1.370 +CHECK_NONEMPTY(TAIL)
   1.371 +AC_PATH_PROG(TEE, tee)
   1.372 +CHECK_NONEMPTY(TEE)
   1.373 +AC_PATH_PROG(TR, tr)
   1.374 +CHECK_NONEMPTY(TR)
   1.375 +AC_PATH_PROG(TOUCH, touch)
   1.376 +CHECK_NONEMPTY(TOUCH)
   1.377 +AC_PATH_PROG(WC, wc)
   1.378 +CHECK_NONEMPTY(WC)
   1.379 +AC_PATH_PROG(XARGS, xargs)
   1.380 +CHECK_NONEMPTY(XARGS)
   1.381 +AC_PATH_PROG(ZIP, zip)
   1.382 +CHECK_NONEMPTY(ZIP)
   1.383 +AC_PATH_PROG(UNZIP, unzip)
   1.384 +CHECK_NONEMPTY(UNZIP)
   1.385 +AC_PATH_PROG(LDD, ldd)
   1.386 +if test "x$LDD" = "x"; then
   1.387 +    # List shared lib dependencies is used for
   1.388 +    # debug output and checking for forbidden dependencies.
   1.389 +    # We can build without it.
   1.390 +    LDD="true"
   1.391 +fi
   1.392 +AC_PATH_PROG(OTOOL, otool)
   1.393 +if test "x$OTOOL" = "x"; then
   1.394 +   OTOOL="true"
   1.395 +fi
   1.396 +AC_PATH_PROG(READELF, readelf)
   1.397 +AC_PATH_PROG(EXPR, expr)
   1.398 +CHECK_NONEMPTY(EXPR)
   1.399 +AC_PATH_PROG(FILE, file)
   1.400 +CHECK_NONEMPTY(FILE)
   1.401 +AC_PATH_PROG(HG, hg)
   1.402 +])
   1.403 +
   1.404 +
   1.405 +
   1.406 +AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE],
   1.407 +[
   1.408 +# When using cygwin, we need a wrapper binary that renames
   1.409 +# /cygdrive/c/ arguments into c:/ arguments and peeks into
   1.410 +# @files and rewrites these too! This wrapper binary is
   1.411 +# called uncygdrive.exe.
   1.412 +UNCYGDRIVE=
   1.413 +if test "x$OPENJDK_BUILD_OS" = xwindows; then
   1.414 +    AC_MSG_CHECKING([if uncygdrive can be created])
   1.415 +    UNCYGDRIVE_SRC=`$CYGPATH -m $SRC_ROOT/common/src/uncygdrive.c`
   1.416 +    rm -f $OUTPUT_ROOT/uncygdrive*
   1.417 +    UNCYGDRIVE=`$CYGPATH -m $OUTPUT_ROOT/uncygdrive.exe`
   1.418 +    cd $OUTPUT_ROOT
   1.419 +    $CC $UNCYGDRIVE_SRC /Fe$UNCYGDRIVE > $OUTPUT_ROOT/uncygdrive1.log 2>&1
   1.420 +    cd $CURDIR
   1.421 +
   1.422 +    if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then 
   1.423 +        AC_MSG_RESULT([no])
   1.424 +        cat $OUTPUT_ROOT/uncygdrive1.log
   1.425 +        AC_MSG_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe])
   1.426 +    fi
   1.427 +    AC_MSG_RESULT([$UNCYGDRIVE])
   1.428 +    AC_MSG_CHECKING([if uncygdrive.exe works])
   1.429 +    cd $OUTPUT_ROOT
   1.430 +    $UNCYGDRIVE $CC $SRC_ROOT/common/src/uncygdrive.c /Fe$OUTPUT_ROOT/uncygdrive2.exe > $OUTPUT_ROOT/uncygdrive2.log 2>&1 
   1.431 +    cd $CURDIR
   1.432 +    if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then 
   1.433 +        AC_MSG_RESULT([no])
   1.434 +        cat $OUTPUT_ROOT/uncygdrive2.log
   1.435 +        AC_MSG_ERROR([Uncygdrive did not work!])
   1.436 +    fi
   1.437 +    AC_MSG_RESULT([yes])
   1.438 +    rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
   1.439 +fi
   1.440 +
   1.441 +AC_SUBST(UNCYGDRIVE)
   1.442 +])
   1.443 +
   1.444 +
   1.445 +# Check if build directory is on local disk.
   1.446 +# Argument 1: directory to test
   1.447 +# Argument 2: what to do if it is on local disk
   1.448 +# Argument 3: what to do otherwise (remote disk or failure)
   1.449 +AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
   1.450 +[
   1.451 +	# df -l lists only local disks; if the given directory is not found then
   1.452 +	# a non-zero exit code is given
   1.453 +	if $DF -l $1 > /dev/null 2>&1; then
   1.454 +          $2
   1.455 +        else
   1.456 +          $3
   1.457 +        fi
   1.458 +])
   1.459 +
   1.460 +AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
   1.461 +[
   1.462 +
   1.463 +AC_MSG_CHECKING([if build directory is on local disk])
   1.464 +BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
   1.465 +  [OUTPUT_DIR_IS_LOCAL="yes"],
   1.466 +  [OUTPUT_DIR_IS_LOCAL="no"])
   1.467 +AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
   1.468 +
   1.469 +# Check if the user has any old-style ALT_ variables set.
   1.470 +FOUND_ALT_VARIABLES=`env | grep ^ALT_`
   1.471 +
   1.472 +# Before generating output files, test if they exist. If they do, this is a reconfigure.
   1.473 +# Since we can't properly handle the dependencies for this, warn the user about the situation
   1.474 +if test -e $OUTPUT_ROOT/spec.gmk; then
   1.475 +  IS_RECONFIGURE=yes
   1.476 +else
   1.477 +  IS_RECONFIGURE=no
   1.478 +fi
   1.479 +
   1.480 +if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then
   1.481 +  HIDE_PERFORMANCE_HINTS=yes
   1.482 +else
   1.483 +  HIDE_PERFORMANCE_HINTS=no
   1.484 +  # Hide it the next time around...
   1.485 +  $TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1
   1.486 +fi
   1.487 +
   1.488 +])

mercurial