8001897: build-infra: misc adjustments to configure script
authorihse
Mon, 29 Oct 2012 14:06:57 -0700
changeset 14112 1b447f5cb0d1
parent 14111 2a82ecb35fc7
child 14113 c76eadb8e8fd
8001897: build-infra: misc adjustments to configure script Reviewed-by: ohair
common/autoconf/Makefile.in
common/autoconf/basics.m4
common/autoconf/generated-configure.sh
common/autoconf/jdk-options.m4
common/autoconf/spec.gmk.in
common/autoconf/toolchain.m4
--- a/common/autoconf/Makefile.in	Fri Oct 26 14:29:57 2012 -0700
+++ b/common/autoconf/Makefile.in	Mon Oct 29 14:06:57 2012 -0700
@@ -21,6 +21,7 @@
 # questions.
 #
 
-# Generated Makefile @DATE_WHEN_CONFIGURED@
+# This Makefile was generated by configure @DATE_WHEN_CONFIGURED@
+# GENERATED FILE, DO NOT EDIT
 SPEC:=@OUTPUT_ROOT@/spec.gmk
 include @SRC_ROOT@/common/makefiles/Makefile
--- a/common/autoconf/basics.m4	Fri Oct 26 14:29:57 2012 -0700
+++ b/common/autoconf/basics.m4	Mon Oct 29 14:06:57 2012 -0700
@@ -143,25 +143,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME [$]$1`
-            FILE=`$BASENAME [$]$1`
+            sym_link_dir=`$DIRNAME [$]$1`
+            sym_link_file=`$BASENAME [$]$1`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.             
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            $1=$DIR/$FILE
+            $1=$sym_link_dir/$sym_link_file
         fi
     fi
 ])
@@ -340,7 +340,6 @@
 AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
 [
 
-AC_MSG_CHECKING([what configuration name to use])
 AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
 	[use this as the name of the configuration @<:@generated from important configuration options@:>@])],
         [ CONF_NAME=${with_conf_name} ])
@@ -366,7 +365,27 @@
         CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
     fi
     OUTPUT_ROOT="$CURDIR"
+
+    # WARNING: This might be a bad thing to do. You need to be sure you want to
+    # have a configuration in this directory. Do some sanity checks!
+
+    if test ! -e "$OUTPUT_ROOT/spec.gmk"; then
+      # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
+      # other files
+      files_present=`$LS $OUTPUT_ROOT`
+      if test "x$files_present" != x; then
+        AC_MSG_NOTICE([Current directory is $CURDIR.])
+        AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
+        AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
+        AC_MSG_NOTICE([However, this directory is not empty. This is not allowed, since it could])
+        AC_MSG_NOTICE([seriously mess up just about everything.])
+        AC_MSG_NOTICE([Try 'cd $SRC_ROOT' and restart configure])
+        AC_MSG_NOTICE([(or create a new empty directory and cd to it).])
+        AC_MSG_ERROR([Will not continue creating configuration in $CURDIR])
+      fi
+    fi
 fi
+AC_MSG_CHECKING([what configuration name to use])
 AC_MSG_RESULT([$CONF_NAME])
 
 BASIC_FIXUP_PATH(OUTPUT_ROOT)
--- a/common/autoconf/generated-configure.sh	Fri Oct 26 14:29:57 2012 -0700
+++ b/common/autoconf/generated-configure.sh	Mon Oct 29 14:06:57 2012 -0700
@@ -767,6 +767,7 @@
 JDK_MINOR_VERSION
 JDK_MAJOR_VERSION
 COMPRESS_JARS
+UNLIMITED_CRYPTO
 CACERTS_FILE
 TEST_IN_BUILD
 BUILD_HEADLESS
@@ -962,6 +963,7 @@
 enable_headful
 enable_hotspot_test_in_build
 with_cacerts_file
+enable_unlimited_crypto
 with_boot_jdk
 with_boot_jdk_jvmargs
 with_add_source_root
@@ -1647,6 +1649,8 @@
                           support) [enabled]
   --enable-hotspot-test-in-build
                           run the Queens test after Hotspot build [disabled]
+  --enable-unlimited-crypto
+                          Enable unlimited crypto policy [disabled]
   --disable-debug-symbols disable generation of debug symbols [enabled]
   --disable-zip-debug-info
                           disable zipping of debug-info files [enabled]
@@ -3661,7 +3665,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1351257228
+DATE_WHEN_GENERATED=1351539315
 
 ###############################################################################
 #
@@ -6906,25 +6910,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME $SCRIPT`
-            FILE=`$BASENAME $SCRIPT`
+            sym_link_dir=`$DIRNAME $SCRIPT`
+            sym_link_file=`$BASENAME $SCRIPT`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            SCRIPT=$DIR/$FILE
+            SCRIPT=$sym_link_dir/$sym_link_file
         fi
     fi
 
@@ -7563,8 +7567,6 @@
 # and options (variants and debug level) parsed.
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5
-$as_echo_n "checking what configuration name to use... " >&6; }
 
 # Check whether --with-conf-name was given.
 if test "${with_conf_name+set}" = set; then :
@@ -7593,7 +7595,35 @@
         CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
     fi
     OUTPUT_ROOT="$CURDIR"
-fi
+
+    # WARNING: This might be a bad thing to do. You need to be sure you want to
+    # have a configuration in this directory. Do some sanity checks!
+
+    if test ! -e "$OUTPUT_ROOT/spec.gmk"; then
+      # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
+      # other files
+      files_present=`$LS $OUTPUT_ROOT`
+      if test "x$files_present" != x; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5
+$as_echo "$as_me: Current directory is $CURDIR." >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Since this is not the source root, configure will output the configuration here" >&5
+$as_echo "$as_me: Since this is not the source root, configure will output the configuration here" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: (as opposed to creating a configuration in <src_root>/build/<conf-name>)." >&5
+$as_echo "$as_me: (as opposed to creating a configuration in <src_root>/build/<conf-name>)." >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: However, this directory is not empty. This is not allowed, since it could" >&5
+$as_echo "$as_me: However, this directory is not empty. This is not allowed, since it could" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: seriously mess up just about everything." >&5
+$as_echo "$as_me: seriously mess up just about everything." >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: Try 'cd $SRC_ROOT' and restart configure" >&5
+$as_echo "$as_me: Try 'cd $SRC_ROOT' and restart configure" >&6;}
+        { $as_echo "$as_me:${as_lineno-$LINENO}: (or create a new empty directory and cd to it)." >&5
+$as_echo "$as_me: (or create a new empty directory and cd to it)." >&6;}
+        as_fn_error $? "Will not continue creating configuration in $CURDIR" "$LINENO" 5
+      fi
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5
+$as_echo_n "checking what configuration name to use... " >&6; }
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONF_NAME" >&5
 $as_echo "$CONF_NAME" >&6; }
 
@@ -10334,6 +10364,24 @@
 
 ###############################################################################
 #
+# Enable or disable unlimited crypto
+#
+# Check whether --enable-unlimited-crypto was given.
+if test "${enable_unlimited_crypto+set}" = set; then :
+  enableval=$enable_unlimited_crypto;
+else
+  enable_unlimited_crypto=no
+fi
+
+if test "x$enable_unlimited_crypto" = "xyes"; then
+    UNLIMITED_CRYPTO=true
+else
+    UNLIMITED_CRYPTO=false
+fi
+
+
+###############################################################################
+#
 # Compress jars
 #
 COMPRESS_JARS=false
@@ -11543,25 +11591,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME $BINARY`
-            FILE=`$BASENAME $BINARY`
+            sym_link_dir=`$DIRNAME $BINARY`
+            sym_link_file=`$BASENAME $BINARY`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            BINARY=$DIR/$FILE
+            BINARY=$sym_link_dir/$sym_link_file
         fi
     fi
 
@@ -17823,25 +17871,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME $TEST_COMPILER`
-            FILE=`$BASENAME $TEST_COMPILER`
+            sym_link_dir=`$DIRNAME $TEST_COMPILER`
+            sym_link_file=`$BASENAME $TEST_COMPILER`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            TEST_COMPILER=$DIR/$FILE
+            TEST_COMPILER=$sym_link_dir/$sym_link_file
         fi
     fi
 
@@ -18231,25 +18279,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME $PROPER_COMPILER_CC`
-            FILE=`$BASENAME $PROPER_COMPILER_CC`
+            sym_link_dir=`$DIRNAME $PROPER_COMPILER_CC`
+            sym_link_file=`$BASENAME $PROPER_COMPILER_CC`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            PROPER_COMPILER_CC=$DIR/$FILE
+            PROPER_COMPILER_CC=$sym_link_dir/$sym_link_file
         fi
     fi
 
@@ -19278,25 +19326,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME $TEST_COMPILER`
-            FILE=`$BASENAME $TEST_COMPILER`
+            sym_link_dir=`$DIRNAME $TEST_COMPILER`
+            sym_link_file=`$BASENAME $TEST_COMPILER`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            TEST_COMPILER=$DIR/$FILE
+            TEST_COMPILER=$sym_link_dir/$sym_link_file
         fi
     fi
 
@@ -19686,25 +19734,25 @@
         else
             STARTDIR=$PWD
             COUNTER=0
-            DIR=`$DIRNAME $PROPER_COMPILER_CXX`
-            FILE=`$BASENAME $PROPER_COMPILER_CXX`
+            sym_link_dir=`$DIRNAME $PROPER_COMPILER_CXX`
+            sym_link_file=`$BASENAME $PROPER_COMPILER_CXX`
             while test $COUNTER -lt 20; do
-                ISLINK=`$LS -l $DIR/$FILE | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
+                ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'`
                 if test "x$ISLINK" == x; then
                     # This is not a symbolic link! We are done!
                     break
                 fi
                 # The link might be relative! We have to use cd to travel safely.
-                cd $DIR
+                cd $sym_link_dir
                 # ... and we must get the to the absolute path, not one using symbolic links.
                 cd `pwd -P`
                 cd `$DIRNAME $ISLINK`
-                DIR=`$THEPWDCMD`
-                FILE=`$BASENAME $ISLINK`
+                sym_link_dir=`$THEPWDCMD`
+                sym_link_file=`$BASENAME $ISLINK`
                 let COUNTER=COUNTER+1
             done
             cd $STARTDIR
-            PROPER_COMPILER_CXX=$DIR/$FILE
+            PROPER_COMPILER_CXX=$sym_link_dir/$sym_link_file
         fi
     fi
 
@@ -20039,7 +20087,7 @@
 
 ### Locate other tools
 
-if test "x$OPENJDK_TARGET_OS" != xwindows; then
+if test "x$OPENJDK_TARGET_OS" = xmacosx; then
     ac_ext=m
 ac_cpp='$OBJCPP $CPPFLAGS'
 ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--- a/common/autoconf/jdk-options.m4	Fri Oct 26 14:29:57 2012 -0700
+++ b/common/autoconf/jdk-options.m4	Mon Oct 29 14:06:57 2012 -0700
@@ -334,6 +334,20 @@
 
 ###############################################################################
 #
+# Enable or disable unlimited crypto
+#
+AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
+        [Enable unlimited crypto policy @<:@disabled@:>@])],,
+    [enable_unlimited_crypto=no])
+if test "x$enable_unlimited_crypto" = "xyes"; then
+    UNLIMITED_CRYPTO=true
+else
+    UNLIMITED_CRYPTO=false
+fi
+AC_SUBST(UNLIMITED_CRYPTO)
+
+###############################################################################
+#
 # Compress jars
 #
 COMPRESS_JARS=false
--- a/common/autoconf/spec.gmk.in	Fri Oct 26 14:29:57 2012 -0700
+++ b/common/autoconf/spec.gmk.in	Mon Oct 29 14:06:57 2012 -0700
@@ -265,6 +265,9 @@
 # Source file for cacerts
 CACERTS_FILE=@CACERTS_FILE@
 
+# Enable unlimited crypto policy
+UNLIMITED_CRYPTO=@UNLIMITED_CRYPTO@
+
 # Necessary additional compiler flags to compile X11 
 X_CFLAGS:=@X_CFLAGS@
 X_LIBS:=@X_LIBS@
--- a/common/autoconf/toolchain.m4	Fri Oct 26 14:29:57 2012 -0700
+++ b/common/autoconf/toolchain.m4	Mon Oct 29 14:06:57 2012 -0700
@@ -264,7 +264,7 @@
 
 ### Locate other tools
 
-if test "x$OPENJDK_TARGET_OS" != xwindows; then
+if test "x$OPENJDK_TARGET_OS" = xmacosx; then
     AC_PROG_OBJC
     BASIC_FIXUP_EXECUTABLE(OBJC)
 else