< prev index next >

common/autoconf/basics.m4

Print this page




 419   BASIC_REQUIRE_PROGS(XARGS, xargs)
 420 
 421   # Then required tools that require some special treatment.
 422   BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
 423   BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
 424   BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
 425   BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
 426   BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
 427 
 428   # Always force rm.
 429   RM="$RM -f"
 430 
 431   # pwd behaves differently on various platforms and some don't support the -L flag.
 432   # Always use the bash builtin pwd to get uniform behavior.
 433   THEPWDCMD=pwd
 434 
 435   # These are not required on all platforms
 436   BASIC_PATH_PROGS(CYGPATH, cygpath)
 437   BASIC_PATH_PROGS(READLINK, [greadlink readlink])
 438   BASIC_PATH_PROGS(DF, df)
 439   BASIC_PATH_PROGS(SETFILE, SetFile)
 440   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
 441 ])
 442 
 443 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
 444 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
 445 [
 446   # Save the current directory this script was started from
 447   CURDIR="$PWD"
 448 
 449   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 450     PATH_SEP=";"
 451     BASIC_CHECK_PATHS_WINDOWS
 452   else
 453     PATH_SEP=":"
 454   fi
 455   AC_SUBST(PATH_SEP)
 456 
 457   # We get the top-level directory from the supporting wrappers.
 458   AC_MSG_CHECKING([for top-level directory])
 459   AC_MSG_RESULT([$TOPDIR])


 556   AC_ARG_WITH(sysroot, [AS_HELP_STRING([--with-sysroot],
 557       [use this directory as sysroot])],
 558       [SYSROOT=$with_sysroot]
 559   )
 560 
 561   AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
 562       [alias for --with-toolchain-path for backwards compatibility])],
 563       [BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_tools_dir)]
 564   )
 565 
 566   AC_ARG_WITH([toolchain-path], [AS_HELP_STRING([--with-toolchain-path],
 567       [prepend these directories when searching for toolchain binaries (compilers etc)])],
 568       [BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_toolchain_path)]
 569   )
 570 
 571   AC_ARG_WITH([extra-path], [AS_HELP_STRING([--with-extra-path],
 572       [prepend these directories to the default path])],
 573       [BASIC_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)]
 574   )
 575 
 576   if test "x$OPENJDK_BUILD_OS" = "xmacosx"; then
 577     # detect if Xcode is installed by running xcodebuild -version


 578     # if no Xcode installed, xcodebuild exits with 1
 579     # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
 580     if /usr/bin/xcodebuild -version >/dev/null 2>&1; then
 581       # We need to use xcodebuild in the toolchain dir provided by the user, this will
 582       # fall back on the stub binary in /usr/bin/xcodebuild
 583       AC_PATH_PROG([XCODEBUILD], [xcodebuild], [/usr/bin/xcodebuild], [$TOOLCHAIN_PATH])
 584     else
 585       # this should result in SYSROOT being empty, unless --with-sysroot is provided
 586       # when only the command line tools are installed there are no SDKs, so headers
 587       # are copied into the system frameworks
 588       XCODEBUILD=
 589       AC_SUBST(XCODEBUILD)
 590     fi
 591 
 592     AC_MSG_CHECKING([for sdk name])
 593     AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
 594         [use the platform SDK of the given name. @<:@macosx@:>@])],
 595         [SDKNAME=$with_sdk_name]
 596     )
 597     AC_MSG_RESULT([$SDKNAME])
 598 
 599     # if toolchain path is specified then don't rely on system headers, they may not compile
 600     HAVE_SYSTEM_FRAMEWORK_HEADERS=0


 944   fi
 945   AC_SUBST(IS_GNU_TIME)
 946 
 947   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
 948     BASIC_REQUIRE_PROGS(DSYMUTIL, dsymutil)
 949     BASIC_REQUIRE_PROGS(XATTR, xattr)
 950     BASIC_PATH_PROGS(CODESIGN, codesign)
 951     if test "x$CODESIGN" != "x"; then
 952       # Verify that the openjdk_codesign certificate is present
 953       AC_MSG_CHECKING([if openjdk_codesign certificate is present])
 954       rm -f codesign-testfile
 955       touch codesign-testfile
 956       codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
 957       rm -f codesign-testfile
 958       if test "x$CODESIGN" = x; then
 959         AC_MSG_RESULT([no])
 960       else
 961         AC_MSG_RESULT([yes])
 962       fi
 963     fi

 964   fi
 965 ])
 966 
 967 # Check if build directory is on local disk. If not possible to determine,
 968 # we prefer to claim it's local.
 969 # Argument 1: directory to test
 970 # Argument 2: what to do if it is on local disk
 971 # Argument 3: what to do otherwise (remote disk or failure)
 972 AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
 973 [
 974   # df -l lists only local disks; if the given directory is not found then
 975   # a non-zero exit code is given
 976   if test "x$DF" = x; then
 977     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 978       # msys does not have df; use Windows "net use" instead.
 979       IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:`
 980       if test "x$IS_NETWORK_DISK" = x; then
 981         $2
 982       else
 983         $3




 419   BASIC_REQUIRE_PROGS(XARGS, xargs)
 420 
 421   # Then required tools that require some special treatment.
 422   BASIC_REQUIRE_SPECIAL(AWK, [AC_PROG_AWK])
 423   BASIC_REQUIRE_SPECIAL(GREP, [AC_PROG_GREP])
 424   BASIC_REQUIRE_SPECIAL(EGREP, [AC_PROG_EGREP])
 425   BASIC_REQUIRE_SPECIAL(FGREP, [AC_PROG_FGREP])
 426   BASIC_REQUIRE_SPECIAL(SED, [AC_PROG_SED])
 427 
 428   # Always force rm.
 429   RM="$RM -f"
 430 
 431   # pwd behaves differently on various platforms and some don't support the -L flag.
 432   # Always use the bash builtin pwd to get uniform behavior.
 433   THEPWDCMD=pwd
 434 
 435   # These are not required on all platforms
 436   BASIC_PATH_PROGS(CYGPATH, cygpath)
 437   BASIC_PATH_PROGS(READLINK, [greadlink readlink])
 438   BASIC_PATH_PROGS(DF, df)

 439   BASIC_PATH_PROGS(CPIO, [cpio bsdcpio])
 440 ])
 441 
 442 # Setup basic configuration paths, and platform-specific stuff related to PATHs.
 443 AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
 444 [
 445   # Save the current directory this script was started from
 446   CURDIR="$PWD"
 447 
 448   if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
 449     PATH_SEP=";"
 450     BASIC_CHECK_PATHS_WINDOWS
 451   else
 452     PATH_SEP=":"
 453   fi
 454   AC_SUBST(PATH_SEP)
 455 
 456   # We get the top-level directory from the supporting wrappers.
 457   AC_MSG_CHECKING([for top-level directory])
 458   AC_MSG_RESULT([$TOPDIR])


 555   AC_ARG_WITH(sysroot, [AS_HELP_STRING([--with-sysroot],
 556       [use this directory as sysroot])],
 557       [SYSROOT=$with_sysroot]
 558   )
 559 
 560   AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
 561       [alias for --with-toolchain-path for backwards compatibility])],
 562       [BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_tools_dir)]
 563   )
 564 
 565   AC_ARG_WITH([toolchain-path], [AS_HELP_STRING([--with-toolchain-path],
 566       [prepend these directories when searching for toolchain binaries (compilers etc)])],
 567       [BASIC_PREPEND_TO_PATH([TOOLCHAIN_PATH],$with_toolchain_path)]
 568   )
 569 
 570   AC_ARG_WITH([extra-path], [AS_HELP_STRING([--with-extra-path],
 571       [prepend these directories to the default path])],
 572       [BASIC_PREPEND_TO_PATH([EXTRA_PATH],$with_extra_path)]
 573   )
 574 
 575   # OPENJDK_BUILD_OS has not yet been setup
 576   if test "`uname`" = "Darwin"; then
 577     # If a devkit has been supplied, find xcodebuild in the toolchain_path.
 578     # If not, detect if Xcode is installed by running xcodebuild -version
 579     # if no Xcode installed, xcodebuild exits with 1
 580     # if Xcode is installed, even if xcode-select is misconfigured, then it exits with 0
 581     if test "x$DEVKIT_ROOT" != x || /usr/bin/xcodebuild -version >/dev/null 2>&1; then
 582       # We need to use xcodebuild in the toolchain dir provided by the user, this will
 583       # fall back on the stub binary in /usr/bin/xcodebuild
 584       AC_PATH_PROG([XCODEBUILD], [xcodebuild], [/usr/bin/xcodebuild], [$TOOLCHAIN_PATH])
 585     else
 586       # this should result in SYSROOT being empty, unless --with-sysroot is provided
 587       # when only the command line tools are installed there are no SDKs, so headers
 588       # are copied into the system frameworks
 589       XCODEBUILD=
 590       AC_SUBST(XCODEBUILD)
 591     fi
 592 
 593     AC_MSG_CHECKING([for sdk name])
 594     AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
 595         [use the platform SDK of the given name. @<:@macosx@:>@])],
 596         [SDKNAME=$with_sdk_name]
 597     )
 598     AC_MSG_RESULT([$SDKNAME])
 599 
 600     # if toolchain path is specified then don't rely on system headers, they may not compile
 601     HAVE_SYSTEM_FRAMEWORK_HEADERS=0


 945   fi
 946   AC_SUBST(IS_GNU_TIME)
 947 
 948   if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
 949     BASIC_REQUIRE_PROGS(DSYMUTIL, dsymutil)
 950     BASIC_REQUIRE_PROGS(XATTR, xattr)
 951     BASIC_PATH_PROGS(CODESIGN, codesign)
 952     if test "x$CODESIGN" != "x"; then
 953       # Verify that the openjdk_codesign certificate is present
 954       AC_MSG_CHECKING([if openjdk_codesign certificate is present])
 955       rm -f codesign-testfile
 956       touch codesign-testfile
 957       codesign -s openjdk_codesign codesign-testfile 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD || CODESIGN=
 958       rm -f codesign-testfile
 959       if test "x$CODESIGN" = x; then
 960         AC_MSG_RESULT([no])
 961       else
 962         AC_MSG_RESULT([yes])
 963       fi
 964     fi
 965     BASIC_REQUIRE_PROGS(SETFILE, SetFile)
 966   fi
 967 ])
 968 
 969 # Check if build directory is on local disk. If not possible to determine,
 970 # we prefer to claim it's local.
 971 # Argument 1: directory to test
 972 # Argument 2: what to do if it is on local disk
 973 # Argument 3: what to do otherwise (remote disk or failure)
 974 AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
 975 [
 976   # df -l lists only local disks; if the given directory is not found then
 977   # a non-zero exit code is given
 978   if test "x$DF" = x; then
 979     if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
 980       # msys does not have df; use Windows "net use" instead.
 981       IS_NETWORK_DISK=`net use | grep \`pwd -W | cut -d ":" -f 1 | tr a-z A-Z\`:`
 982       if test "x$IS_NETWORK_DISK" = x; then
 983         $2
 984       else
 985         $3


< prev index next >