common/autoconf/boot-jdk.m4

changeset 972
f3697e0783e2
parent 965
3ef3f4174c2b
parent 839
174a54ce39c4
child 1133
50aaf272884f
child 1187
d74730a6d7d0
     1.1 --- a/common/autoconf/boot-jdk.m4	Thu Sep 12 12:29:17 2013 -0700
     1.2 +++ b/common/autoconf/boot-jdk.m4	Tue Nov 05 17:33:48 2013 -0800
     1.3 @@ -44,7 +44,7 @@
     1.4            AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring])
     1.5            AC_MSG_NOTICE([(This might be an JRE instead of an JDK)])
     1.6            BOOT_JDK_FOUND=no
     1.7 -        else 
     1.8 +        else
     1.9            # Do we have an rt.jar? (On MacOSX it is called classes.jar)
    1.10            if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
    1.11              AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring])
    1.12 @@ -79,70 +79,70 @@
    1.13  # Test: Is bootjdk explicitely set by command line arguments?
    1.14  AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
    1.15  [
    1.16 -if test "x$with_boot_jdk" != x; then
    1.17 +  if test "x$with_boot_jdk" != x; then
    1.18      BOOT_JDK=$with_boot_jdk
    1.19      BOOT_JDK_FOUND=maybe
    1.20      AC_MSG_NOTICE([Found potential Boot JDK using configure arguments])
    1.21 -fi
    1.22 +  fi
    1.23  ])
    1.24  
    1.25  # Test: Is bootjdk available from builddeps?
    1.26  AC_DEFUN([BOOTJDK_CHECK_BUILDDEPS],
    1.27  [
    1.28 -    BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no])
    1.29 +  BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no])
    1.30  ])
    1.31  
    1.32  # Test: Is $JAVA_HOME set?
    1.33  AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
    1.34  [
    1.35 -    if test "x$JAVA_HOME" != x; then
    1.36 -        JAVA_HOME_PROCESSED="$JAVA_HOME"
    1.37 -        BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED)
    1.38 -        if test ! -d "$JAVA_HOME_PROCESSED"; then
    1.39 -            AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
    1.40 -        else
    1.41 -          # Aha, the user has set a JAVA_HOME
    1.42 -          # let us use that as the Boot JDK.
    1.43 -          BOOT_JDK="$JAVA_HOME_PROCESSED"
    1.44 -          BOOT_JDK_FOUND=maybe
    1.45 -          AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME])
    1.46 -        fi
    1.47 +  if test "x$JAVA_HOME" != x; then
    1.48 +    JAVA_HOME_PROCESSED="$JAVA_HOME"
    1.49 +    BASIC_FIXUP_PATH(JAVA_HOME_PROCESSED)
    1.50 +    if test ! -d "$JAVA_HOME_PROCESSED"; then
    1.51 +      AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
    1.52 +    else
    1.53 +      # Aha, the user has set a JAVA_HOME
    1.54 +      # let us use that as the Boot JDK.
    1.55 +      BOOT_JDK="$JAVA_HOME_PROCESSED"
    1.56 +      BOOT_JDK_FOUND=maybe
    1.57 +      AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME])
    1.58      fi
    1.59 +  fi
    1.60  ])
    1.61  
    1.62  # Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
    1.63  AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK],
    1.64  [
    1.65 -    AC_PATH_PROG(JAVAC_CHECK, javac)
    1.66 -    AC_PATH_PROG(JAVA_CHECK, java)
    1.67 -    BINARY="$JAVAC_CHECK"
    1.68 -    if test "x$JAVAC_CHECK" = x; then
    1.69 -        BINARY="$JAVA_CHECK"
    1.70 +  AC_PATH_PROG(JAVAC_CHECK, javac)
    1.71 +  AC_PATH_PROG(JAVA_CHECK, java)
    1.72 +  BINARY="$JAVAC_CHECK"
    1.73 +  if test "x$JAVAC_CHECK" = x; then
    1.74 +    BINARY="$JAVA_CHECK"
    1.75 +  fi
    1.76 +  if test "x$BINARY" != x; then
    1.77 +    # So there is a java(c) binary, it might be part of a JDK.
    1.78 +    # Lets find the JDK/JRE directory by following symbolic links.
    1.79 +    # Linux/GNU systems often have links from /usr/bin/java to
    1.80 +    # /etc/alternatives/java to the real JDK binary.
    1.81 +    BASIC_REMOVE_SYMBOLIC_LINKS(BINARY)
    1.82 +    BOOT_JDK=`dirname "$BINARY"`
    1.83 +    BOOT_JDK=`cd "$BOOT_JDK/.."; pwd`
    1.84 +    if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
    1.85 +      # Looks like we found ourselves an JDK
    1.86 +      BOOT_JDK_FOUND=maybe
    1.87 +      AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH])
    1.88      fi
    1.89 -    if test "x$BINARY" != x; then
    1.90 -        # So there is a java(c) binary, it might be part of a JDK.
    1.91 -        # Lets find the JDK/JRE directory by following symbolic links.
    1.92 -        # Linux/GNU systems often have links from /usr/bin/java to 
    1.93 -        # /etc/alternatives/java to the real JDK binary.
    1.94 -        BASIC_REMOVE_SYMBOLIC_LINKS(BINARY)
    1.95 -        BOOT_JDK=`dirname "$BINARY"`
    1.96 -        BOOT_JDK=`cd "$BOOT_JDK/.."; pwd`
    1.97 -        if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
    1.98 -            # Looks like we found ourselves an JDK
    1.99 -            BOOT_JDK_FOUND=maybe
   1.100 -            AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH])
   1.101 -        fi
   1.102 -    fi
   1.103 +  fi
   1.104  ])
   1.105  
   1.106  # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
   1.107  AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME],
   1.108  [
   1.109 -    if test -x /usr/libexec/java_home; then
   1.110 -        BOOT_JDK=`/usr/libexec/java_home`
   1.111 -        BOOT_JDK_FOUND=maybe
   1.112 -        AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home])
   1.113 -    fi
   1.114 +  if test -x /usr/libexec/java_home; then
   1.115 +    BOOT_JDK=`/usr/libexec/java_home`
   1.116 +    BOOT_JDK_FOUND=maybe
   1.117 +    AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home])
   1.118 +  fi
   1.119  ])
   1.120  
   1.121  # Look for a jdk in the given path. If there are multiple, try to select the newest.
   1.122 @@ -204,123 +204,123 @@
   1.123    AC_MSG_CHECKING([for $2 in Boot JDK])
   1.124    $1=$BOOT_JDK/bin/$2
   1.125    if test ! -x [$]$1; then
   1.126 -      AC_MSG_RESULT(not found)
   1.127 -      AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk])
   1.128 -      AC_MSG_ERROR([Could not find $2 in the Boot JDK])
   1.129 +    AC_MSG_RESULT(not found)
   1.130 +    AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk])
   1.131 +    AC_MSG_ERROR([Could not find $2 in the Boot JDK])
   1.132    fi
   1.133    AC_MSG_RESULT(ok)
   1.134  ])
   1.135  
   1.136  ###############################################################################
   1.137  #
   1.138 -# We need a Boot JDK to bootstrap the build. 
   1.139 +# We need a Boot JDK to bootstrap the build.
   1.140  #
   1.141  
   1.142  AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
   1.143  [
   1.144 -BOOT_JDK_FOUND=no
   1.145 -AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk],
   1.146 -    [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])])
   1.147 +  BOOT_JDK_FOUND=no
   1.148 +  AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk],
   1.149 +      [path to Boot JDK (used to bootstrap build) @<:@probed@:>@])])
   1.150  
   1.151 -# We look for the Boot JDK through various means, going from more certain to
   1.152 -# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if
   1.153 -# we detected something (if so, the path to the jdk is in BOOT_JDK). But we 
   1.154 -# must check if this is indeed valid; otherwise we'll continue looking.
   1.155 +  # We look for the Boot JDK through various means, going from more certain to
   1.156 +  # more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if
   1.157 +  # we detected something (if so, the path to the jdk is in BOOT_JDK). But we
   1.158 +  # must check if this is indeed valid; otherwise we'll continue looking.
   1.159  
   1.160 -# Test: Is bootjdk explicitely set by command line arguments?
   1.161 -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS])
   1.162 -if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then
   1.163 -  # Having specified an argument which is incorrect will produce an instant failure;
   1.164 -  # we should not go on looking
   1.165 -  AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK])
   1.166 -fi
   1.167 +  # Test: Is bootjdk explicitely set by command line arguments?
   1.168 +  BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS])
   1.169 +  if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then
   1.170 +    # Having specified an argument which is incorrect will produce an instant failure;
   1.171 +    # we should not go on looking
   1.172 +    AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK])
   1.173 +  fi
   1.174  
   1.175 -# Test: Is bootjdk available from builddeps?
   1.176 -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS])
   1.177 +  # Test: Is bootjdk available from builddeps?
   1.178 +  BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS])
   1.179  
   1.180 -# Test: Is $JAVA_HOME set?
   1.181 -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME])
   1.182 +  # Test: Is $JAVA_HOME set?
   1.183 +  BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME])
   1.184  
   1.185 -# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
   1.186 -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME])
   1.187 +  # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
   1.188 +  BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME])
   1.189  
   1.190 -# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
   1.191 -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK])
   1.192 +  # Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
   1.193 +  BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK])
   1.194  
   1.195 -# Test: Is there a JDK installed in default, well-known locations?
   1.196 -BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS])
   1.197 +  # Test: Is there a JDK installed in default, well-known locations?
   1.198 +  BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS])
   1.199  
   1.200 -# If we haven't found anything yet, we've truly lost. Give up.
   1.201 -if test "x$BOOT_JDK_FOUND" = xno; then
   1.202 -  HELP_MSG_MISSING_DEPENDENCY([openjdk])
   1.203 -  AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG])
   1.204 -  AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk])
   1.205 -  AC_MSG_ERROR([Cannot continue])
   1.206 -fi
   1.207 +  # If we haven't found anything yet, we've truly lost. Give up.
   1.208 +  if test "x$BOOT_JDK_FOUND" = xno; then
   1.209 +    HELP_MSG_MISSING_DEPENDENCY([openjdk])
   1.210 +    AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG])
   1.211 +    AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk])
   1.212 +    AC_MSG_ERROR([Cannot continue])
   1.213 +  fi
   1.214  
   1.215 -# Setup proper paths for what we found
   1.216 -BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
   1.217 -if test ! -f "$BOOT_RTJAR"; then
   1.218 +  # Setup proper paths for what we found
   1.219 +  BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
   1.220 +  if test ! -f "$BOOT_RTJAR"; then
   1.221      # On MacOSX it is called classes.jar
   1.222      BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
   1.223      if test -f "$BOOT_RTJAR"; then
   1.224 -      # Remove the .. 
   1.225 +      # Remove the ..
   1.226        BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
   1.227      fi
   1.228 -fi
   1.229 -BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
   1.230 -BOOT_JDK="$BOOT_JDK"
   1.231 -AC_SUBST(BOOT_RTJAR)
   1.232 -AC_SUBST(BOOT_TOOLSJAR)
   1.233 -AC_SUBST(BOOT_JDK)
   1.234 +  fi
   1.235 +  BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
   1.236 +  BOOT_JDK="$BOOT_JDK"
   1.237 +  AC_SUBST(BOOT_RTJAR)
   1.238 +  AC_SUBST(BOOT_TOOLSJAR)
   1.239 +  AC_SUBST(BOOT_JDK)
   1.240  
   1.241 -# Setup tools from the Boot JDK.
   1.242 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java)
   1.243 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac)
   1.244 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah)
   1.245 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap)
   1.246 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar)
   1.247 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic)
   1.248 -BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii)
   1.249 +  # Setup tools from the Boot JDK.
   1.250 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java)
   1.251 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac)
   1.252 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah)
   1.253 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap)
   1.254 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar)
   1.255 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic)
   1.256 +  BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii)
   1.257  
   1.258 -# Finally, set some other options...
   1.259 +  # Finally, set some other options...
   1.260  
   1.261 -# When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
   1.262 -BOOT_JDK_SOURCETARGET="-source 7 -target 7"
   1.263 -AC_SUBST(BOOT_JDK_SOURCETARGET)
   1.264 -AC_SUBST(JAVAC_FLAGS)
   1.265 +  # When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
   1.266 +  BOOT_JDK_SOURCETARGET="-source 7 -target 7"
   1.267 +  AC_SUBST(BOOT_JDK_SOURCETARGET)
   1.268 +  AC_SUBST(JAVAC_FLAGS)
   1.269  ])
   1.270  
   1.271  AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
   1.272  [
   1.273 -##############################################################################
   1.274 -#
   1.275 -# Specify options for anything that is run with the Boot JDK.
   1.276 -#
   1.277 -AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
   1.278 -	[specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values,
   1.279 -     e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
   1.280 +  ##############################################################################
   1.281 +  #
   1.282 +  # Specify options for anything that is run with the Boot JDK.
   1.283 +  #
   1.284 +  AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
   1.285 +  [specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values,
   1.286 +  e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
   1.287  
   1.288 -if test "x$with_boot_jdk_jvmargs" = x; then
   1.289 +  if test "x$with_boot_jdk_jvmargs" = x; then
   1.290      # Not all JVM:s accept the same arguments on the command line.
   1.291      # OpenJDK specific increase in thread stack for JDK build,
   1.292      # well more specifically, when running javac.
   1.293      if test "x$BUILD_NUM_BITS" = x32; then
   1.294 -       STACK_SIZE=768
   1.295 +      STACK_SIZE=768
   1.296      else
   1.297 -       # Running Javac on a JVM on a 64-bit machine, the stack takes more space
   1.298 -       # since 64-bit pointers are pushed on the stach. Apparently, we need
   1.299 -       # to increase the stack space when javacing the JDK....
   1.300 -       STACK_SIZE=1536
   1.301 +      # Running Javac on a JVM on a 64-bit machine, the stack takes more space
   1.302 +      # since 64-bit pointers are pushed on the stach. Apparently, we need
   1.303 +      # to increase the stack space when javacing the JDK....
   1.304 +      STACK_SIZE=1536
   1.305      fi
   1.306  
   1.307      # Minimum amount of heap memory.
   1.308      ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
   1.309      if test "x$OPENJDK_TARGET_OS" = "xmacosx" || test "x$OPENJDK_TARGET_CPU" = "xppc64" ; then
   1.310 -        # Why does macosx need more heap? Its the huge JDK batch.
   1.311 -        ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
   1.312 +      # Why does macosx need more heap? Its the huge JDK batch.
   1.313 +      ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
   1.314      else
   1.315 -        ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
   1.316 +      ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
   1.317      fi
   1.318      # When is adding -client something that speeds up the JVM?
   1.319      # ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
   1.320 @@ -329,7 +329,7 @@
   1.321      ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
   1.322      # Disable special log output when a debug build is used as Boot JDK...
   1.323      ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])
   1.324 -fi
   1.325 +  fi
   1.326  
   1.327 -AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
   1.328 +  AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
   1.329  ])

mercurial