< prev index next >

make/autoconf/basics.m4

Print this page


   1 #
   2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 206 ])
 207 
 208 ###############################################################################
 209 # This will make sure the given variable points to a full and proper
 210 # path. This means:
 211 # 1) There will be no spaces in the path. On unix platforms,
 212 #    spaces in the path will result in an error. On Windows,
 213 #    the path will be rewritten using short-style to be space-free.
 214 # 2) The path will be absolute, and it will be in unix-style (on
 215 #     cygwin).
 216 # $1: The name of the variable to fix
 217 AC_DEFUN([BASIC_FIXUP_PATH],
 218 [
 219   # Only process if variable expands to non-empty
 220 
 221   if test "x[$]$1" != x; then
 222     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 223       BASIC_FIXUP_PATH_CYGWIN($1)
 224     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 225       BASIC_FIXUP_PATH_MSYS($1)
 226     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
 227       BASIC_FIXUP_PATH_WSL($1)
 228     else
 229       # We're on a unix platform. Hooray! :)
 230       path="[$]$1"
 231       has_space=`$ECHO "$path" | $GREP " "`
 232       if test "x$has_space" != x; then
 233         AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
 234         AC_MSG_ERROR([Spaces are not allowed in this path.])
 235       fi
 236 
 237       # Use eval to expand a potential ~
 238       eval path="$path"
 239       if test ! -f "$path" && test ! -d "$path"; then
 240         AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
 241       fi
 242 
 243       if test -d "$path"; then
 244         $1="`cd "$path"; $THEPWDCMD -L`"
 245       else
 246         dir="`$DIRNAME "$path"`"
 247         base="`$BASENAME "$path"`"


 255 # This will make sure the given variable points to a executable
 256 # with a full and proper path. This means:
 257 # 1) There will be no spaces in the path. On unix platforms,
 258 #    spaces in the path will result in an error. On Windows,
 259 #    the path will be rewritten using short-style to be space-free.
 260 # 2) The path will be absolute, and it will be in unix-style (on
 261 #     cygwin).
 262 # Any arguments given to the executable is preserved.
 263 # If the input variable does not have a directory specification, then
 264 # it need to be in the PATH.
 265 # $1: The name of the variable to fix
 266 AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
 267 [
 268   # Only process if variable expands to non-empty
 269 
 270   if test "x[$]$1" != x; then
 271     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 272       BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
 273     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 274       BASIC_FIXUP_EXECUTABLE_MSYS($1)
 275     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
 276       BASIC_FIXUP_EXECUTABLE_WSL($1)
 277     else
 278       # We're on a unix platform. Hooray! :)
 279       # First separate the path from the arguments. This will split at the first
 280       # space.
 281       complete="[$]$1"
 282       path="${complete%% *}"
 283       tmp="$complete EOL"
 284       arguments="${tmp#* }"
 285 
 286       # Cannot rely on the command "which" here since it doesn't always work.
 287       is_absolute_path=`$ECHO "$path" | $GREP ^/`
 288       if test -z "$is_absolute_path"; then
 289         # Path to executable is not absolute. Find it.
 290         IFS_save="$IFS"
 291         IFS=:
 292         for p in $PATH; do
 293           if test -f "$p/$path" && test -x "$p/$path"; then
 294             new_path="$p/$path"
 295             break
 296           fi


 389 # $3: Messages to user.
 390 AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
 391 [
 392   AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
 393       [Deprecated. Option is kept for backwards compatibility and is ignored])])
 394   if test "x$enable_$2" != x; then
 395     AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
 396 
 397     if test "x$3" != x; then
 398       AC_MSG_WARN([$3])
 399     fi
 400 
 401   fi
 402 ])
 403 
 404 ###############################################################################
 405 AC_DEFUN_ONCE([BASIC_INIT],
 406 [
 407   # Save the original command line. This is passed to us by the wrapper configure script.
 408   AC_SUBST(CONFIGURE_COMMAND_LINE)
 409   # AUTOCONF might be set in the environment by the user. Preserve for "make reconfigure".
 410   AC_SUBST(AUTOCONF)
 411   # Save the path variable before it gets changed
 412   ORIGINAL_PATH="$PATH"
 413   AC_SUBST(ORIGINAL_PATH)
 414   DATE_WHEN_CONFIGURED=`LANG=C date`
 415   AC_SUBST(DATE_WHEN_CONFIGURED)
 416   AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
 417 ])
 418 
 419 ###############################################################################
 420 # Test that variable $1 denoting a program is not empty. If empty, exit with an error.
 421 # $1: variable to check
 422 AC_DEFUN([BASIC_CHECK_NONEMPTY],
 423 [
 424   if test "x[$]$1" = x; then
 425     AC_MSG_ERROR([Could not find required tool for $1])
 426   fi
 427 ])
 428 
 429 ###############################################################################
 430 # Check that there are no unprocessed overridden variables left.


 596   BASIC_REQUIRE_PROGS(WC, wc)
 597   BASIC_REQUIRE_PROGS(WHICH, which)
 598   BASIC_REQUIRE_PROGS(XARGS, xargs)
 599 
 600   # Then required tools that require some special treatment.
 601   BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
 602   BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
 603   BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
 604   BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
 605   BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
 606 
 607   # Always force rm.
 608   RM="$RM -f"
 609 
 610   # pwd behaves differently on various platforms and some don't support the -L flag.
 611   # Always use the bash builtin pwd to get uniform behavior.
 612   THEPWDCMD=pwd
 613 
 614   # These are not required on all platforms
 615   BASIC_PATH_PROGS(CYGPATH, cygpath)
 616   BASIC_PATH_PROGS(WSLPATH, wslpath)
 617   BASIC_PATH_PROGS(DF, df)
 618   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
 619   BASIC_PATH_PROGS(NICE, nice)
 620 
 621   BASIC_PATH_PROGS(LSB_RELEASE, lsb_release)
 622   BASIC_PATH_PROGS(CMD, [cmd.exe /mnt/c/Windows/System32/cmd.exe])
 623 ])
 624 
 625 ###############################################################################
 626 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
 627 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
 628 [
 629   # Save the current directory this script was started from
 630   CONFIGURE_START_DIR="$PWD"
 631 
 632   # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them
 633   # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED
 634   # was not available at that time.
 635   REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'`
 636   if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then
 637     ORIGINAL_PATH="$REWRITTEN_PATH"
 638     AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH])
 639   fi
 640 
 641   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 642     PATH_SEP=";"
 643     EXE_SUFFIX=".exe"
 644     BASIC_CHECK_PATHS_WINDOWS
 645   else
 646     PATH_SEP=":"
 647     EXE_SUFFIX=""
 648   fi
 649   AC_SUBST(PATH_SEP)
 650   AC_SUBST(EXE_SUFFIX)
 651 
 652   # We get the top-level directory from the supporting wrappers.
 653   AC_MSG_CHECKING([for top-level directory])
 654   AC_MSG_RESULT([$TOPDIR])
 655   AC_SUBST(TOPDIR)
 656   AC_SUBST(CONFIGURE_START_DIR)
 657 
 658   # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
 659   BASIC_FIXUP_PATH(CONFIGURE_START_DIR)
 660   BASIC_FIXUP_PATH(TOPDIR)
 661 
 662   # Locate the directory of this script.
 663   AUTOCONF_DIR=$TOPDIR/make/autoconf
 664 
 665   # Setup username (for use in adhoc version strings etc)
 666   # Outer [ ] to quote m4.
 667   [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
 668   AC_SUBST(USERNAME)
 669 ])
 670 
 671 ###############################################################################
 672 # Evaluates platform specific overrides for devkit variables.
 673 # $1: Name of variable
 674 AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
 675 [
 676   if test "x[$]$1" = x; then
 677     eval $1="\${$1_${OPENJDK_TARGET_CPU}}"
 678   fi
 679 ])


 852   BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
 853 
 854   AC_MSG_CHECKING([for sysroot])
 855   AC_MSG_RESULT([$SYSROOT])
 856   AC_MSG_CHECKING([for toolchain path])
 857   AC_MSG_RESULT([$TOOLCHAIN_PATH])
 858   AC_MSG_CHECKING([for extra path])
 859   AC_MSG_RESULT([$EXTRA_PATH])
 860 ])
 861 
 862 ###############################################################################
 863 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
 864 [
 865 
 866   AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
 867       [use this as the name of the configuration @<:@generated from important configuration options@:>@])],
 868       [ CONF_NAME=${with_conf_name} ])
 869 
 870   # Test from where we are running configure, in or outside of src root.
 871   AC_MSG_CHECKING([where to store configuration])
 872   if test "x$CONFIGURE_START_DIR" = "x$TOPDIR" \
 873       || test "x$CONFIGURE_START_DIR" = "x$CUSTOM_ROOT" \
 874       || test "x$CONFIGURE_START_DIR" = "x$TOPDIR/make/autoconf" \
 875       || test "x$CONFIGURE_START_DIR" = "x$TOPDIR/make" ; then
 876     # We are running configure from the src root.
 877     # Create a default ./build/target-variant-debuglevel output root.
 878     if test "x${CONF_NAME}" = x; then
 879       AC_MSG_RESULT([in default location])
 880       CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JVM_VARIANTS_WITH_AND}-${DEBUG_LEVEL}"
 881     else
 882       AC_MSG_RESULT([in build directory with custom name])
 883     fi
 884 
 885     if test "x$CUSTOM_ROOT" != x; then
 886       WORKSPACE_ROOT="${CUSTOM_ROOT}"
 887     else
 888       WORKSPACE_ROOT="${TOPDIR}"
 889     fi
 890     OUTPUTDIR="${WORKSPACE_ROOT}/build/${CONF_NAME}"
 891     $MKDIR -p "$OUTPUTDIR"
 892     if test ! -d "$OUTPUTDIR"; then
 893       AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])
 894     fi
 895   else
 896     # We are running configure from outside of the src dir.
 897     # Then use the current directory as output dir!
 898     # If configuration is situated in normal build directory, just use the build
 899     # directory name as configuration name, otherwise use the complete path.
 900     if test "x${CONF_NAME}" = x; then
 901       CONF_NAME=`$ECHO $CONFIGURE_START_DIR | $SED -e "s!^${TOPDIR}/build/!!"`
 902     fi
 903     OUTPUTDIR="$CONFIGURE_START_DIR"
 904     AC_MSG_RESULT([in current directory])
 905 
 906     # WARNING: This might be a bad thing to do. You need to be sure you want to
 907     # have a configuration in this directory. Do some sanity checks!
 908 
 909     if test ! -e "$OUTPUTDIR/spec.gmk"; then
 910       # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
 911       # other files
 912       files_present=`$LS $OUTPUTDIR`
 913       # Configure has already touched config.log and confdefs.h in the current dir when this check
 914       # is performed.
 915       filtered_files=`$ECHO "$files_present" \
 916           | $SED -e 's/config.log//g' \
 917               -e 's/configure.log//g' \
 918               -e 's/confdefs.h//g' \
 919               -e 's/configure-support//g' \
 920               -e 's/ //g' \
 921           | $TR -d '\n'`
 922       if test "x$filtered_files" != x; then
 923         AC_MSG_NOTICE([Current directory is $CONFIGURE_START_DIR.])
 924         AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
 925         AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
 926         AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
 927         AC_MSG_NOTICE([seriously mess up just about everything.])
 928         AC_MSG_NOTICE([Try 'cd $TOPDIR' and restart configure])
 929         AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
 930         AC_MSG_ERROR([Will not continue creating configuration in $CONFIGURE_START_DIR])
 931       fi
 932     fi
 933   fi
 934   AC_MSG_CHECKING([what configuration name to use])
 935   AC_MSG_RESULT([$CONF_NAME])
 936 
 937   BASIC_FIXUP_PATH(OUTPUTDIR)
 938 
 939   CONFIGURESUPPORT_OUTPUTDIR="$OUTPUTDIR/configure-support"
 940   $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
 941 
 942   SPEC="$OUTPUTDIR/spec.gmk"
 943   AC_SUBST(SPEC)
 944   AC_SUBST(CONF_NAME)
 945   AC_SUBST(OUTPUTDIR)
 946   AC_SUBST(WORKSPACE_ROOT)
 947   AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
 948 
 949   # The spec.gmk file contains all variables for the make system.
 950   AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
 951   # The bootcycle-spec.gmk file contains support for boot cycle builds.
 952   AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
 953   # The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
 954   AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
 955   # The compare.sh is used to compare the build output to other builds.
 956   AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
 957   # The generated Makefile knows where the spec.gmk is and where the source is.
 958   # You can run make from the OUTPUTDIR, or from the top-level Makefile
 959   # which will look for generated configurations
 960   AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
 961 ])
 962 
 963 #%%% Simple tools %%%
 964 
 965 ###############################################################################
 966 # Check if we have found a usable version of make


 979     MAKE_VERSION_EXPR="-e 3\.8[[12]] -e 4\."
 980     MAKE_REQUIRED_VERSION="3.81"
 981   fi
 982 
 983   if test "x$MAKE_CANDIDATE" != x; then
 984     AC_MSG_NOTICE([Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION])
 985     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
 986     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
 987     if test "x$IS_GNU_MAKE" = x; then
 988       AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
 989     else
 990       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR`
 991       if test "x$IS_MODERN_MAKE" = x; then
 992         AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
 993       else
 994         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
 995           if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 996             MAKE_EXPECTED_ENV='cygwin'
 997           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 998             MAKE_EXPECTED_ENV='msys'
 999           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
1000             MAKE_EXPECTED_ENV='x86_64-.*-linux-gnu'
1001           else
1002             AC_MSG_ERROR([Unknown Windows environment])
1003           fi
1004           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
1005           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
1006         else
1007           # Not relevant for non-Windows
1008           IS_MAKE_CORRECT_ENV=true
1009         fi
1010         if test "x$IS_MAKE_CORRECT_ENV" = x; then
1011           AC_MSG_NOTICE([Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring.])
1012         else
1013           FOUND_MAKE=$MAKE_CANDIDATE
1014           BASIC_FIXUP_EXECUTABLE(FOUND_MAKE)
1015         fi
1016       fi
1017     fi
1018   fi
1019 ])
1020 


1172   NEEDLE_LIST=${NEEDLE_SPACES// /$'\n'}
1173   RESULT="$($GREP -Fvx "$STACK_LIST" <<< "$NEEDLE_LIST")"
1174   if test "x$RESULT" == "x"; then
1175     AC_MSG_RESULT([yes])
1176   else
1177     if test "x$OPENJDK_TARGET_OS" = "xaix"; then
1178       ADDINFO="Please make sure you use GNU grep, usually found at /opt/freeware/bin."
1179     fi
1180     AC_MSG_ERROR([grep does not handle -Fx correctly. ${ADDINFO}])
1181   fi
1182 ])
1183 
1184 ###############################################################################
1185 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
1186 [
1187   BASIC_CHECK_GNU_MAKE
1188 
1189   BASIC_CHECK_FIND_DELETE
1190   BASIC_CHECK_TAR
1191   BASIC_CHECK_GREP
1192   BASIC_SETUP_PANDOC
1193 
1194   # These tools might not be installed by default,
1195   # need hint on how to install them.
1196   BASIC_REQUIRE_PROGS(UNZIP, unzip)
1197   # Since zip uses "ZIP" as a environment variable for passing options, we need
1198   # to name our variable differently, hence ZIPEXE.
1199   BASIC_REQUIRE_PROGS(ZIPEXE, zip)
1200 
1201   # Non-required basic tools
1202 
1203   BASIC_PATH_PROGS(LDD, ldd)
1204   if test "x$LDD" = "x"; then
1205     # List shared lib dependencies is used for
1206     # debug output and checking for forbidden dependencies.
1207     # We can build without it.
1208     LDD="true"
1209   fi
1210   BASIC_PATH_PROGS(READELF, [greadelf readelf])
1211   BASIC_PATH_PROGS(DOT, dot)
1212   BASIC_PATH_PROGS(HG, hg)


1269         $2
1270       else
1271         $3
1272       fi
1273     else
1274       # No df here, say it's local
1275       $2
1276     fi
1277   else
1278     # JDK-8189619
1279     # df on AIX does not understand -l. On modern AIXes it understands "-T local" which
1280     # is the same. On older AIXes we just continue to live with a "not local build" warning.
1281     if test "x$OPENJDK_TARGET_OS" = xaix; then
1282       DF_LOCAL_ONLY_OPTION='-T local'
1283     else
1284       DF_LOCAL_ONLY_OPTION='-l'
1285     fi
1286     if $DF $DF_LOCAL_ONLY_OPTION $1 > /dev/null 2>&1; then
1287       $2
1288     else
1289       # In WSL, local Windows drives are considered remote by df, but we are
1290       # required to build into a directory accessible from windows, so consider
1291       # them local here.
1292       if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
1293         if $DF $1 | $GREP -q "^[[A-Z]]:"; then
1294           $2
1295         else
1296           $3
1297         fi
1298       else
1299         $3
1300       fi
1301     fi
1302   fi
1303 ])
1304 
1305 ###############################################################################
1306 # Check that source files have basic read permissions set. This might
1307 # not be the case in cygwin in certain conditions.
1308 AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
1309 [
1310   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
1311     file_to_test="$TOPDIR/LICENSE"
1312     if test `$STAT -c '%a' "$file_to_test"` -lt 400; then
1313       AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin.])
1314     fi
1315   fi
1316 ])
1317 
1318 ###############################################################################
1319 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
1320 [


1355   fi
1356 
1357   # Test if bash supports pipefail.
1358   AC_MSG_CHECKING([if bash supports pipefail])
1359   if ${BASH} -c 'set -o pipefail'; then
1360     BASH_ARGS="$BASH_ARGS -o pipefail"
1361     AC_MSG_RESULT([yes])
1362   else
1363     AC_MSG_RESULT([no])
1364   fi
1365 
1366   AC_MSG_CHECKING([if bash supports errexit (-e)])
1367   if ${BASH} -e -c 'true'; then
1368     BASH_ARGS="$BASH_ARGS -e"
1369     AC_MSG_RESULT([yes])
1370   else
1371     AC_MSG_RESULT([no])
1372   fi
1373 
1374   AC_SUBST(BASH_ARGS)
1375 ])
1376 
1377 ################################################################################
1378 #
1379 # Setup Pandoc
1380 #
1381 AC_DEFUN_ONCE([BASIC_SETUP_PANDOC],
1382 [
1383   BASIC_PATH_PROGS(PANDOC, pandoc)
1384 
1385   PANDOC_MARKDOWN_FLAG="markdown"
1386   if test -n "$PANDOC"; then
1387     AC_MSG_CHECKING(if the pandoc smart extension needs to be disabled for markdown)
1388     if $PANDOC --list-extensions | $GREP -q '\+smart'; then
1389       AC_MSG_RESULT([yes])
1390       PANDOC_MARKDOWN_FLAG="markdown-smart"
1391     else
1392       AC_MSG_RESULT([no])
1393     fi
1394   fi
1395 
1396   if test -n "$PANDOC"; then
1397     ENABLE_PANDOC="true"
1398   else
1399     ENABLE_PANDOC="false"
1400   fi
1401   AC_SUBST(ENABLE_PANDOC)
1402   AC_SUBST(PANDOC_MARKDOWN_FLAG)
1403 ])
1404 
1405 ################################################################################
1406 #
1407 # Default make target
1408 #
1409 AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
1410 [
1411   AC_ARG_WITH(default-make-target, [AS_HELP_STRING([--with-default-make-target],
1412       [set the default make target @<:@exploded-image@:>@])])
1413   if test "x$with_default_make_target" = "x" \
1414       || test "x$with_default_make_target" = "xyes"; then
1415     DEFAULT_MAKE_TARGET="exploded-image"
1416   elif test "x$with_default_make_target" = "xno"; then
1417     AC_MSG_ERROR([--without-default-make-target is not a valid option])
1418   else
1419     DEFAULT_MAKE_TARGET="$with_default_make_target"
1420   fi
1421 
1422   AC_SUBST(DEFAULT_MAKE_TARGET)


   1 #
   2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 206 ])
 207 
 208 ###############################################################################
 209 # This will make sure the given variable points to a full and proper
 210 # path. This means:
 211 # 1) There will be no spaces in the path. On unix platforms,
 212 #    spaces in the path will result in an error. On Windows,
 213 #    the path will be rewritten using short-style to be space-free.
 214 # 2) The path will be absolute, and it will be in unix-style (on
 215 #     cygwin).
 216 # $1: The name of the variable to fix
 217 AC_DEFUN([BASIC_FIXUP_PATH],
 218 [
 219   # Only process if variable expands to non-empty
 220 
 221   if test "x[$]$1" != x; then
 222     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 223       BASIC_FIXUP_PATH_CYGWIN($1)
 224     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 225       BASIC_FIXUP_PATH_MSYS($1)


 226     else
 227       # We're on a unix platform. Hooray! :)
 228       path="[$]$1"
 229       has_space=`$ECHO "$path" | $GREP " "`
 230       if test "x$has_space" != x; then
 231         AC_MSG_NOTICE([The path of $1, which resolves as "$path", is invalid.])
 232         AC_MSG_ERROR([Spaces are not allowed in this path.])
 233       fi
 234 
 235       # Use eval to expand a potential ~
 236       eval path="$path"
 237       if test ! -f "$path" && test ! -d "$path"; then
 238         AC_MSG_ERROR([The path of $1, which resolves as "$path", is not found.])
 239       fi
 240 
 241       if test -d "$path"; then
 242         $1="`cd "$path"; $THEPWDCMD -L`"
 243       else
 244         dir="`$DIRNAME "$path"`"
 245         base="`$BASENAME "$path"`"


 253 # This will make sure the given variable points to a executable
 254 # with a full and proper path. This means:
 255 # 1) There will be no spaces in the path. On unix platforms,
 256 #    spaces in the path will result in an error. On Windows,
 257 #    the path will be rewritten using short-style to be space-free.
 258 # 2) The path will be absolute, and it will be in unix-style (on
 259 #     cygwin).
 260 # Any arguments given to the executable is preserved.
 261 # If the input variable does not have a directory specification, then
 262 # it need to be in the PATH.
 263 # $1: The name of the variable to fix
 264 AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
 265 [
 266   # Only process if variable expands to non-empty
 267 
 268   if test "x[$]$1" != x; then
 269     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 270       BASIC_FIXUP_EXECUTABLE_CYGWIN($1)
 271     elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 272       BASIC_FIXUP_EXECUTABLE_MSYS($1)


 273     else
 274       # We're on a unix platform. Hooray! :)
 275       # First separate the path from the arguments. This will split at the first
 276       # space.
 277       complete="[$]$1"
 278       path="${complete%% *}"
 279       tmp="$complete EOL"
 280       arguments="${tmp#* }"
 281 
 282       # Cannot rely on the command "which" here since it doesn't always work.
 283       is_absolute_path=`$ECHO "$path" | $GREP ^/`
 284       if test -z "$is_absolute_path"; then
 285         # Path to executable is not absolute. Find it.
 286         IFS_save="$IFS"
 287         IFS=:
 288         for p in $PATH; do
 289           if test -f "$p/$path" && test -x "$p/$path"; then
 290             new_path="$p/$path"
 291             break
 292           fi


 385 # $3: Messages to user.
 386 AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE],
 387 [
 388   AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1],
 389       [Deprecated. Option is kept for backwards compatibility and is ignored])])
 390   if test "x$enable_$2" != x; then
 391     AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])
 392 
 393     if test "x$3" != x; then
 394       AC_MSG_WARN([$3])
 395     fi
 396 
 397   fi
 398 ])
 399 
 400 ###############################################################################
 401 AC_DEFUN_ONCE([BASIC_INIT],
 402 [
 403   # Save the original command line. This is passed to us by the wrapper configure script.
 404   AC_SUBST(CONFIGURE_COMMAND_LINE)


 405   # Save the path variable before it gets changed
 406   ORIGINAL_PATH="$PATH"
 407   AC_SUBST(ORIGINAL_PATH)
 408   DATE_WHEN_CONFIGURED=`LANG=C date`
 409   AC_SUBST(DATE_WHEN_CONFIGURED)
 410   AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
 411 ])
 412 
 413 ###############################################################################
 414 # Test that variable $1 denoting a program is not empty. If empty, exit with an error.
 415 # $1: variable to check
 416 AC_DEFUN([BASIC_CHECK_NONEMPTY],
 417 [
 418   if test "x[$]$1" = x; then
 419     AC_MSG_ERROR([Could not find required tool for $1])
 420   fi
 421 ])
 422 
 423 ###############################################################################
 424 # Check that there are no unprocessed overridden variables left.


 590   BASIC_REQUIRE_PROGS(WC, wc)
 591   BASIC_REQUIRE_PROGS(WHICH, which)
 592   BASIC_REQUIRE_PROGS(XARGS, xargs)
 593 
 594   # Then required tools that require some special treatment.
 595   BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
 596   BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
 597   BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
 598   BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
 599   BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
 600 
 601   # Always force rm.
 602   RM="$RM -f"
 603 
 604   # pwd behaves differently on various platforms and some don't support the -L flag.
 605   # Always use the bash builtin pwd to get uniform behavior.
 606   THEPWDCMD=pwd
 607 
 608   # These are not required on all platforms
 609   BASIC_PATH_PROGS(CYGPATH, cygpath)

 610   BASIC_PATH_PROGS(DF, df)
 611   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
 612   BASIC_PATH_PROGS(NICE, nice)
 613   BASIC_PATH_PROGS(PANDOC, pandoc)


 614 ])
 615 
 616 ###############################################################################
 617 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
 618 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
 619 [
 620   # Save the current directory this script was started from
 621   CURDIR="$PWD"
 622 
 623   # We might need to rewrite ORIGINAL_PATH, if it includes "#", to quote them
 624   # for make. We couldn't do this when we retrieved ORIGINAL_PATH, since SED
 625   # was not available at that time.
 626   REWRITTEN_PATH=`$ECHO "$ORIGINAL_PATH" | $SED -e 's/#/\\\\#/g'`
 627   if test "x$REWRITTEN_PATH" != "x$ORIGINAL_PATH"; then
 628     ORIGINAL_PATH="$REWRITTEN_PATH"
 629     AC_MSG_NOTICE([Rewriting ORIGINAL_PATH to $REWRITTEN_PATH])
 630   fi
 631 
 632   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 633     PATH_SEP=";"

 634     BASIC_CHECK_PATHS_WINDOWS
 635   else
 636     PATH_SEP=":"

 637   fi
 638   AC_SUBST(PATH_SEP)

 639 
 640   # We get the top-level directory from the supporting wrappers.
 641   AC_MSG_CHECKING([for top-level directory])
 642   AC_MSG_RESULT([$TOPDIR])
 643   AC_SUBST(TOPDIR)

 644 
 645   # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
 646   BASIC_FIXUP_PATH(CURDIR)
 647   BASIC_FIXUP_PATH(TOPDIR)
 648 
 649   # Locate the directory of this script.
 650   AUTOCONF_DIR=$TOPDIR/make/autoconf
 651 
 652   # Setup username (for use in adhoc version strings etc)
 653   # Outer [ ] to quote m4.
 654   [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
 655   AC_SUBST(USERNAME)
 656 ])
 657 
 658 ###############################################################################
 659 # Evaluates platform specific overrides for devkit variables.
 660 # $1: Name of variable
 661 AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
 662 [
 663   if test "x[$]$1" = x; then
 664     eval $1="\${$1_${OPENJDK_TARGET_CPU}}"
 665   fi
 666 ])


 839   BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
 840 
 841   AC_MSG_CHECKING([for sysroot])
 842   AC_MSG_RESULT([$SYSROOT])
 843   AC_MSG_CHECKING([for toolchain path])
 844   AC_MSG_RESULT([$TOOLCHAIN_PATH])
 845   AC_MSG_CHECKING([for extra path])
 846   AC_MSG_RESULT([$EXTRA_PATH])
 847 ])
 848 
 849 ###############################################################################
 850 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
 851 [
 852 
 853   AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
 854       [use this as the name of the configuration @<:@generated from important configuration options@:>@])],
 855       [ CONF_NAME=${with_conf_name} ])
 856 
 857   # Test from where we are running configure, in or outside of src root.
 858   AC_MSG_CHECKING([where to store configuration])
 859   if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \
 860       || test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
 861       || test "x$CURDIR" = "x$TOPDIR/make" ; then

 862     # We are running configure from the src root.
 863     # Create a default ./build/target-variant-debuglevel output root.
 864     if test "x${CONF_NAME}" = x; then
 865       AC_MSG_RESULT([in default location])
 866       CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JVM_VARIANTS_WITH_AND}-${DEBUG_LEVEL}"
 867     else
 868       AC_MSG_RESULT([in build directory with custom name])
 869     fi
 870 
 871     if test "x$CUSTOM_ROOT" != x; then
 872       OUTPUTDIR="${CUSTOM_ROOT}/build/${CONF_NAME}"
 873     else
 874       OUTPUTDIR="${TOPDIR}/build/${CONF_NAME}"
 875     fi

 876     $MKDIR -p "$OUTPUTDIR"
 877     if test ! -d "$OUTPUTDIR"; then
 878       AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])
 879     fi
 880   else
 881     # We are running configure from outside of the src dir.
 882     # Then use the current directory as output dir!
 883     # If configuration is situated in normal build directory, just use the build
 884     # directory name as configuration name, otherwise use the complete path.
 885     if test "x${CONF_NAME}" = x; then
 886       CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${TOPDIR}/build/!!"`
 887     fi
 888     OUTPUTDIR="$CURDIR"
 889     AC_MSG_RESULT([in current directory])
 890 
 891     # WARNING: This might be a bad thing to do. You need to be sure you want to
 892     # have a configuration in this directory. Do some sanity checks!
 893 
 894     if test ! -e "$OUTPUTDIR/spec.gmk"; then
 895       # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
 896       # other files
 897       files_present=`$LS $OUTPUTDIR`
 898       # Configure has already touched config.log and confdefs.h in the current dir when this check
 899       # is performed.
 900       filtered_files=`$ECHO "$files_present" \
 901           | $SED -e 's/config.log//g' \
 902               -e 's/configure.log//g' \
 903               -e 's/confdefs.h//g' \
 904               -e 's/configure-support//g' \
 905               -e 's/ //g' \
 906           | $TR -d '\n'`
 907       if test "x$filtered_files" != x; then
 908         AC_MSG_NOTICE([Current directory is $CURDIR.])
 909         AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
 910         AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
 911         AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
 912         AC_MSG_NOTICE([seriously mess up just about everything.])
 913         AC_MSG_NOTICE([Try 'cd $TOPDIR' and restart configure])
 914         AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
 915         AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
 916       fi
 917     fi
 918   fi
 919   AC_MSG_CHECKING([what configuration name to use])
 920   AC_MSG_RESULT([$CONF_NAME])
 921 
 922   BASIC_FIXUP_PATH(OUTPUTDIR)
 923 
 924   CONFIGURESUPPORT_OUTPUTDIR="$OUTPUTDIR/configure-support"
 925   $MKDIR -p "$CONFIGURESUPPORT_OUTPUTDIR"
 926 
 927   SPEC="$OUTPUTDIR/spec.gmk"
 928   AC_SUBST(SPEC)
 929   AC_SUBST(CONF_NAME)
 930   AC_SUBST(OUTPUTDIR)

 931   AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
 932 
 933   # The spec.gmk file contains all variables for the make system.
 934   AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
 935   # The bootcycle-spec.gmk file contains support for boot cycle builds.
 936   AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
 937   # The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
 938   AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
 939   # The compare.sh is used to compare the build output to other builds.
 940   AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
 941   # The generated Makefile knows where the spec.gmk is and where the source is.
 942   # You can run make from the OUTPUTDIR, or from the top-level Makefile
 943   # which will look for generated configurations
 944   AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
 945 ])
 946 
 947 #%%% Simple tools %%%
 948 
 949 ###############################################################################
 950 # Check if we have found a usable version of make


 963     MAKE_VERSION_EXPR="-e 3\.8[[12]] -e 4\."
 964     MAKE_REQUIRED_VERSION="3.81"
 965   fi
 966 
 967   if test "x$MAKE_CANDIDATE" != x; then
 968     AC_MSG_NOTICE([Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION])
 969     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
 970     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
 971     if test "x$IS_GNU_MAKE" = x; then
 972       AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
 973     else
 974       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP $MAKE_VERSION_EXPR`
 975       if test "x$IS_MODERN_MAKE" = x; then
 976         AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version $MAKE_REQUIRED_VERSION or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
 977       else
 978         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
 979           if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
 980             MAKE_EXPECTED_ENV='cygwin'
 981           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 982             MAKE_EXPECTED_ENV='msys'


 983           else
 984             AC_MSG_ERROR([Unknown Windows environment])
 985           fi
 986           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
 987           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
 988         else
 989           # Not relevant for non-Windows
 990           IS_MAKE_CORRECT_ENV=true
 991         fi
 992         if test "x$IS_MAKE_CORRECT_ENV" = x; then
 993           AC_MSG_NOTICE([Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring.])
 994         else
 995           FOUND_MAKE=$MAKE_CANDIDATE
 996           BASIC_FIXUP_EXECUTABLE(FOUND_MAKE)
 997         fi
 998       fi
 999     fi
1000   fi
1001 ])
1002 


1154   NEEDLE_LIST=${NEEDLE_SPACES// /$'\n'}
1155   RESULT="$($GREP -Fvx "$STACK_LIST" <<< "$NEEDLE_LIST")"
1156   if test "x$RESULT" == "x"; then
1157     AC_MSG_RESULT([yes])
1158   else
1159     if test "x$OPENJDK_TARGET_OS" = "xaix"; then
1160       ADDINFO="Please make sure you use GNU grep, usually found at /opt/freeware/bin."
1161     fi
1162     AC_MSG_ERROR([grep does not handle -Fx correctly. ${ADDINFO}])
1163   fi
1164 ])
1165 
1166 ###############################################################################
1167 AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
1168 [
1169   BASIC_CHECK_GNU_MAKE
1170 
1171   BASIC_CHECK_FIND_DELETE
1172   BASIC_CHECK_TAR
1173   BASIC_CHECK_GREP

1174 
1175   # These tools might not be installed by default,
1176   # need hint on how to install them.
1177   BASIC_REQUIRE_PROGS(UNZIP, unzip)
1178   # Since zip uses "ZIP" as a environment variable for passing options, we need
1179   # to name our variable differently, hence ZIPEXE.
1180   BASIC_REQUIRE_PROGS(ZIPEXE, zip)
1181 
1182   # Non-required basic tools
1183 
1184   BASIC_PATH_PROGS(LDD, ldd)
1185   if test "x$LDD" = "x"; then
1186     # List shared lib dependencies is used for
1187     # debug output and checking for forbidden dependencies.
1188     # We can build without it.
1189     LDD="true"
1190   fi
1191   BASIC_PATH_PROGS(READELF, [greadelf readelf])
1192   BASIC_PATH_PROGS(DOT, dot)
1193   BASIC_PATH_PROGS(HG, hg)


1250         $2
1251       else
1252         $3
1253       fi
1254     else
1255       # No df here, say it's local
1256       $2
1257     fi
1258   else
1259     # JDK-8189619
1260     # df on AIX does not understand -l. On modern AIXes it understands "-T local" which
1261     # is the same. On older AIXes we just continue to live with a "not local build" warning.
1262     if test "x$OPENJDK_TARGET_OS" = xaix; then
1263       DF_LOCAL_ONLY_OPTION='-T local'
1264     else
1265       DF_LOCAL_ONLY_OPTION='-l'
1266     fi
1267     if $DF $DF_LOCAL_ONLY_OPTION $1 > /dev/null 2>&1; then
1268       $2
1269     else
1270       $3











1271     fi
1272   fi
1273 ])
1274 
1275 ###############################################################################
1276 # Check that source files have basic read permissions set. This might
1277 # not be the case in cygwin in certain conditions.
1278 AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
1279 [
1280   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
1281     file_to_test="$TOPDIR/LICENSE"
1282     if test `$STAT -c '%a' "$file_to_test"` -lt 400; then
1283       AC_MSG_ERROR([Bad file permissions on src files. This is usually caused by cloning the repositories with a non cygwin hg in a directory not created in cygwin.])
1284     fi
1285   fi
1286 ])
1287 
1288 ###############################################################################
1289 AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
1290 [


1325   fi
1326 
1327   # Test if bash supports pipefail.
1328   AC_MSG_CHECKING([if bash supports pipefail])
1329   if ${BASH} -c 'set -o pipefail'; then
1330     BASH_ARGS="$BASH_ARGS -o pipefail"
1331     AC_MSG_RESULT([yes])
1332   else
1333     AC_MSG_RESULT([no])
1334   fi
1335 
1336   AC_MSG_CHECKING([if bash supports errexit (-e)])
1337   if ${BASH} -e -c 'true'; then
1338     BASH_ARGS="$BASH_ARGS -e"
1339     AC_MSG_RESULT([yes])
1340   else
1341     AC_MSG_RESULT([no])
1342   fi
1343 
1344   AC_SUBST(BASH_ARGS)




























1345 ])
1346 
1347 ################################################################################
1348 #
1349 # Default make target
1350 #
1351 AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
1352 [
1353   AC_ARG_WITH(default-make-target, [AS_HELP_STRING([--with-default-make-target],
1354       [set the default make target @<:@exploded-image@:>@])])
1355   if test "x$with_default_make_target" = "x" \
1356       || test "x$with_default_make_target" = "xyes"; then
1357     DEFAULT_MAKE_TARGET="exploded-image"
1358   elif test "x$with_default_make_target" = "xno"; then
1359     AC_MSG_ERROR([--without-default-make-target is not a valid option])
1360   else
1361     DEFAULT_MAKE_TARGET="$with_default_make_target"
1362   fi
1363 
1364   AC_SUBST(DEFAULT_MAKE_TARGET)


< prev index next >