< prev index next >

make/autoconf/basics.m4

Print this page




 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   CURDIR="$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 
 657   # We can only call BASIC_FIXUP_PATH after BASIC_CHECK_PATHS_WINDOWS.
 658   BASIC_FIXUP_PATH(CURDIR)
 659   BASIC_FIXUP_PATH(TOPDIR)
 660 
 661   # Locate the directory of this script.
 662   AUTOCONF_DIR=$TOPDIR/make/autoconf
 663 
 664   # Setup username (for use in adhoc version strings etc)
 665   # Outer [ ] to quote m4.
 666   [ USERNAME=`$ECHO "$USER" | $TR -d -c '[a-z][A-Z][0-9]'` ]
 667   AC_SUBST(USERNAME)
 668 ])
 669 
 670 ###############################################################################
 671 # Evaluates platform specific overrides for devkit variables.
 672 # $1: Name of variable
 673 AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
 674 [
 675   if test "x[$]$1" = x; then
 676     eval $1="\${$1_${OPENJDK_TARGET_CPU}}"
 677   fi
 678 ])


 851   BASIC_PREPEND_TO_PATH([PATH],$EXTRA_PATH)
 852 
 853   AC_MSG_CHECKING([for sysroot])
 854   AC_MSG_RESULT([$SYSROOT])
 855   AC_MSG_CHECKING([for toolchain path])
 856   AC_MSG_RESULT([$TOOLCHAIN_PATH])
 857   AC_MSG_CHECKING([for extra path])
 858   AC_MSG_RESULT([$EXTRA_PATH])
 859 ])
 860 
 861 ###############################################################################
 862 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
 863 [
 864 
 865   AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
 866       [use this as the name of the configuration @<:@generated from important configuration options@:>@])],
 867       [ CONF_NAME=${with_conf_name} ])
 868 
 869   # Test from where we are running configure, in or outside of src root.
 870   AC_MSG_CHECKING([where to store configuration])
 871   if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \
 872       || test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
 873       || test "x$CURDIR" = "x$TOPDIR/make" ; then

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




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


< prev index next >