common/autoconf/toolchain.m4

changeset 972
f3697e0783e2
parent 971
584dc2e95e04
parent 872
3c48e11c3901
child 978
c5a60709f587
     1.1 --- a/common/autoconf/toolchain.m4	Thu Sep 12 12:29:17 2013 -0700
     1.2 +++ b/common/autoconf/toolchain.m4	Tue Nov 05 17:33:48 2013 -0800
     1.3 @@ -55,7 +55,7 @@
     1.4        fi
     1.5    elif test  "x$OPENJDK_TARGET_OS" = xwindows; then
     1.6      # First line typically looks something like:
     1.7 -    # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
     1.8 +    # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
     1.9      COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`
    1.10      COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"`
    1.11      COMPILER_VENDOR="Microsoft CL.EXE"
    1.12 @@ -95,25 +95,25 @@
    1.13  
    1.14  AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS],
    1.15  [
    1.16 -###############################################################################
    1.17 -#
    1.18 -# Configure the development tool paths and potential sysroot.
    1.19 -#
    1.20 -AC_LANG(C++)
    1.21 +  ###############################################################################
    1.22 +  #
    1.23 +  # Configure the development tool paths and potential sysroot.
    1.24 +  #
    1.25 +  AC_LANG(C++)
    1.26  
    1.27 -# The option used to specify the target .o,.a or .so file.
    1.28 -# When compiling, how to specify the to be created object file.
    1.29 -CC_OUT_OPTION='-o$(SPACE)'
    1.30 -# When linking, how to specify the to be created executable.
    1.31 -EXE_OUT_OPTION='-o$(SPACE)'
    1.32 -# When linking, how to specify the to be created dynamically linkable library.
    1.33 -LD_OUT_OPTION='-o$(SPACE)'
    1.34 -# When archiving, how to specify the to be create static archive for object files.
    1.35 -AR_OUT_OPTION='rcs$(SPACE)'
    1.36 -AC_SUBST(CC_OUT_OPTION)
    1.37 -AC_SUBST(EXE_OUT_OPTION)
    1.38 -AC_SUBST(LD_OUT_OPTION)
    1.39 -AC_SUBST(AR_OUT_OPTION)
    1.40 +  # The option used to specify the target .o,.a or .so file.
    1.41 +  # When compiling, how to specify the to be created object file.
    1.42 +  CC_OUT_OPTION='-o$(SPACE)'
    1.43 +  # When linking, how to specify the to be created executable.
    1.44 +  EXE_OUT_OPTION='-o$(SPACE)'
    1.45 +  # When linking, how to specify the to be created dynamically linkable library.
    1.46 +  LD_OUT_OPTION='-o$(SPACE)'
    1.47 +  # When archiving, how to specify the to be create static archive for object files.
    1.48 +  AR_OUT_OPTION='rcs$(SPACE)'
    1.49 +  AC_SUBST(CC_OUT_OPTION)
    1.50 +  AC_SUBST(EXE_OUT_OPTION)
    1.51 +  AC_SUBST(LD_OUT_OPTION)
    1.52 +  AC_SUBST(AR_OUT_OPTION)
    1.53  ])
    1.54  
    1.55  # $1 = compiler to test (CC or CXX)
    1.56 @@ -142,8 +142,8 @@
    1.57    fi
    1.58  
    1.59    if test "x[$]$1" = x; then
    1.60 -      HELP_MSG_MISSING_DEPENDENCY([devkit])
    1.61 -      AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG])
    1.62 +    HELP_MSG_MISSING_DEPENDENCY([devkit])
    1.63 +    AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG])
    1.64    fi
    1.65    BASIC_FIXUP_EXECUTABLE($1)
    1.66    TEST_COMPILER="[$]$1"
    1.67 @@ -187,24 +187,27 @@
    1.68  
    1.69  AC_DEFUN([TOOLCHAIN_SETUP_PATHS],
    1.70  [
    1.71 -if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
    1.72 -  TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
    1.73 -  TOOLCHAIN_SETUP_DXSDK
    1.74 -fi
    1.75 +  if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
    1.76 +    TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
    1.77 +    TOOLCHAIN_SETUP_MSVCR_DLL
    1.78 +    BASIC_DEPRECATED_ARG_WITH([dxsdk])
    1.79 +    BASIC_DEPRECATED_ARG_WITH([dxsdk-lib])
    1.80 +    BASIC_DEPRECATED_ARG_WITH([dxsdk-include])
    1.81 +  fi
    1.82  
    1.83 -AC_SUBST(MSVCR_DLL)
    1.84 +  AC_SUBST(MSVCR_DLL)
    1.85  
    1.86 -# If --build AND --host is set, then the configure script will find any
    1.87 -# cross compilation tools in the PATH. Cross compilation tools
    1.88 -# follows the cross compilation standard where they are prefixed with ${host}.
    1.89 -# For example the binary i686-sun-solaris2.10-gcc
    1.90 -# will cross compile for i686-sun-solaris2.10
    1.91 -# If neither of build and host is not set, then build=host and the
    1.92 -# default compiler found in the path will be used.
    1.93 -# Setting only --host, does not seem to be really supported.
    1.94 -# Please set both --build and --host if you want to cross compile.
    1.95 +  # If --build AND --host is set, then the configure script will find any
    1.96 +  # cross compilation tools in the PATH. Cross compilation tools
    1.97 +  # follows the cross compilation standard where they are prefixed with ${host}.
    1.98 +  # For example the binary i686-sun-solaris2.10-gcc
    1.99 +  # will cross compile for i686-sun-solaris2.10
   1.100 +  # If neither of build and host is not set, then build=host and the
   1.101 +  # default compiler found in the path will be used.
   1.102 +  # Setting only --host, does not seem to be really supported.
   1.103 +  # Please set both --build and --host if you want to cross compile.
   1.104  
   1.105 -if test "x$COMPILE_TYPE" = "xcross"; then
   1.106 +  if test "x$COMPILE_TYPE" = "xcross"; then
   1.107      # Now we to find a C/C++ compiler that can build executables for the build
   1.108      # platform. We can't use the AC_PROG_CC macro, since it can only be used
   1.109      # once. Also, we need to do this before adding a tools dir to the path,
   1.110 @@ -217,139 +220,140 @@
   1.111      BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
   1.112      AC_PATH_PROG(BUILD_LD, ld)
   1.113      BASIC_FIXUP_EXECUTABLE(BUILD_LD)
   1.114 -fi
   1.115 -AC_SUBST(BUILD_CC)
   1.116 -AC_SUBST(BUILD_CXX)
   1.117 -AC_SUBST(BUILD_LD)
   1.118 +  fi
   1.119 +  AC_SUBST(BUILD_CC)
   1.120 +  AC_SUBST(BUILD_CXX)
   1.121 +  AC_SUBST(BUILD_LD)
   1.122  
   1.123 -# If a devkit is found on the builddeps server, then prepend its path to the
   1.124 -# PATH variable. If there are cross compilers available in the devkit, these
   1.125 -# will be found by AC_PROG_CC et al.
   1.126 -DEVKIT=
   1.127 -BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
   1.128 -                    [# Found devkit
   1.129 -                     PATH="$DEVKIT/bin:$PATH"
   1.130 -                     SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root"
   1.131 -                     if test "x$x_includes" = "xNONE"; then
   1.132 -                         x_includes="$SYS_ROOT/usr/include/X11"
   1.133 -                     fi
   1.134 -                     if test "x$x_libraries" = "xNONE"; then
   1.135 -                         x_libraries="$SYS_ROOT/usr/lib"
   1.136 -                     fi
   1.137 -                    ],
   1.138 -                    [])
   1.139 +  # If a devkit is found on the builddeps server, then prepend its path to the
   1.140 +  # PATH variable. If there are cross compilers available in the devkit, these
   1.141 +  # will be found by AC_PROG_CC et al.
   1.142 +  DEVKIT=
   1.143 +  BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
   1.144 +      [
   1.145 +        # Found devkit
   1.146 +        PATH="$DEVKIT/bin:$PATH"
   1.147 +        SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root"
   1.148 +        if test "x$x_includes" = "xNONE"; then
   1.149 +          x_includes="$SYS_ROOT/usr/include/X11"
   1.150 +        fi
   1.151 +        if test "x$x_libraries" = "xNONE"; then
   1.152 +          x_libraries="$SYS_ROOT/usr/lib"
   1.153 +        fi
   1.154 +      ],
   1.155 +      [])
   1.156  
   1.157 -# Store the CFLAGS etal passed to the configure script.
   1.158 -ORG_CFLAGS="$CFLAGS"
   1.159 -ORG_CXXFLAGS="$CXXFLAGS"
   1.160 -ORG_OBJCFLAGS="$OBJCFLAGS"
   1.161 +  # Store the CFLAGS etal passed to the configure script.
   1.162 +  ORG_CFLAGS="$CFLAGS"
   1.163 +  ORG_CXXFLAGS="$CXXFLAGS"
   1.164 +  ORG_OBJCFLAGS="$OBJCFLAGS"
   1.165  
   1.166 -# autoconf magic only relies on PATH, so update it if tools dir is specified
   1.167 -OLD_PATH="$PATH"
   1.168 -if test "x$TOOLS_DIR" != x; then
   1.169 -  PATH=$TOOLS_DIR:$PATH
   1.170 -fi
   1.171 +  # autoconf magic only relies on PATH, so update it if tools dir is specified
   1.172 +  OLD_PATH="$PATH"
   1.173 +  if test "x$TOOLS_DIR" != x; then
   1.174 +    PATH=$TOOLS_DIR:$PATH
   1.175 +  fi
   1.176  
   1.177  
   1.178 -### Locate C compiler (CC)
   1.179 +  ### Locate C compiler (CC)
   1.180  
   1.181 -# On windows, only cl.exe is supported.
   1.182 -# On Solaris, cc is preferred to gcc.
   1.183 -# Elsewhere, gcc is preferred to cc.
   1.184 +  # On windows, only cl.exe is supported.
   1.185 +  # On Solaris, cc is preferred to gcc.
   1.186 +  # Elsewhere, gcc is preferred to cc.
   1.187  
   1.188 -if test "x$CC" != x; then
   1.189 -  COMPILER_CHECK_LIST="$CC"
   1.190 -elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.191 -  COMPILER_CHECK_LIST="cl"
   1.192 -elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
   1.193 -  COMPILER_CHECK_LIST="cc gcc"
   1.194 -elif test "x$OPENJDK_TARGET_OS" = "xaix"; then
   1.195 -  # Do not probe for cc on AIX.
   1.196 -  COMPILER_CHECK_LIST="xlc_r"
   1.197 -else
   1.198 -  COMPILER_CHECK_LIST="gcc cc"
   1.199 -fi
   1.200 +  if test "x$CC" != x; then
   1.201 +    COMPILER_CHECK_LIST="$CC"
   1.202 +  elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.203 +    COMPILER_CHECK_LIST="cl"
   1.204 +  elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
   1.205 +    COMPILER_CHECK_LIST="cc gcc"
   1.206 +  elif test "x$OPENJDK_TARGET_OS" = "xaix"; then
   1.207 +    # Do not probe for cc on AIX.
   1.208 +    COMPILER_CHECK_LIST="xlc_r"
   1.209 +  else
   1.210 +    COMPILER_CHECK_LIST="gcc cc"
   1.211 +  fi
   1.212  
   1.213 -TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
   1.214 -# Now that we have resolved CC ourself, let autoconf have its go at it
   1.215 -AC_PROG_CC([$CC])
   1.216 +  TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
   1.217 +  # Now that we have resolved CC ourself, let autoconf have its go at it
   1.218 +  AC_PROG_CC([$CC])
   1.219  
   1.220 -# Option used to tell the compiler whether to create 32- or 64-bit executables
   1.221 -# Notice that CC contains the full compiler path at this point.
   1.222 -case $CC in
   1.223 -  *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";;
   1.224 -  *)      COMPILER_TARGET_BITS_FLAG="-m";;
   1.225 -esac
   1.226 -AC_SUBST(COMPILER_TARGET_BITS_FLAG)
   1.227 +  # Option used to tell the compiler whether to create 32- or 64-bit executables
   1.228 +  # Notice that CC contains the full compiler path at this point.
   1.229 +  case $CC in
   1.230 +    *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";;
   1.231 +    *)      COMPILER_TARGET_BITS_FLAG="-m";;
   1.232 +  esac
   1.233 +  AC_SUBST(COMPILER_TARGET_BITS_FLAG)
   1.234  
   1.235 -### Locate C++ compiler (CXX)
   1.236 +  ### Locate C++ compiler (CXX)
   1.237  
   1.238 -if test "x$CXX" != x; then
   1.239 -  COMPILER_CHECK_LIST="$CXX"
   1.240 -elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.241 -  COMPILER_CHECK_LIST="cl"
   1.242 -elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
   1.243 -  COMPILER_CHECK_LIST="CC g++"
   1.244 -elif test "x$OPENJDK_TARGET_OS" = "xaix"; then
   1.245 -  # Do not probe for CC on AIX .
   1.246 -  COMPILER_CHECK_LIST="xlC_r"
   1.247 -else
   1.248 -  COMPILER_CHECK_LIST="g++ CC"
   1.249 -fi
   1.250 +  if test "x$CXX" != x; then
   1.251 +    COMPILER_CHECK_LIST="$CXX"
   1.252 +  elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
   1.253 +    COMPILER_CHECK_LIST="cl"
   1.254 +  elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
   1.255 +    COMPILER_CHECK_LIST="CC g++"
   1.256 +  elif test "x$OPENJDK_TARGET_OS" = "xaix"; then
   1.257 +    # Do not probe for CC on AIX .
   1.258 +    COMPILER_CHECK_LIST="xlC_r"
   1.259 +  else
   1.260 +    COMPILER_CHECK_LIST="g++ CC"
   1.261 +  fi
   1.262  
   1.263 -TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
   1.264 -# Now that we have resolved CXX ourself, let autoconf have its go at it
   1.265 -AC_PROG_CXX([$CXX])
   1.266 +  TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
   1.267 +  # Now that we have resolved CXX ourself, let autoconf have its go at it
   1.268 +  AC_PROG_CXX([$CXX])
   1.269  
   1.270 -### Locate other tools
   1.271 +  ### Locate other tools
   1.272  
   1.273 -if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.274 +  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.275      AC_PROG_OBJC
   1.276      BASIC_FIXUP_EXECUTABLE(OBJC)
   1.277 -else
   1.278 +  else
   1.279      OBJC=
   1.280 -fi
   1.281 +  fi
   1.282  
   1.283 -# Restore the flags to the user specified values.
   1.284 -# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
   1.285 -CFLAGS="$ORG_CFLAGS"
   1.286 -CXXFLAGS="$ORG_CXXFLAGS"
   1.287 -OBJCFLAGS="$ORG_OBJCFLAGS"
   1.288 +  # Restore the flags to the user specified values.
   1.289 +  # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
   1.290 +  CFLAGS="$ORG_CFLAGS"
   1.291 +  CXXFLAGS="$ORG_CXXFLAGS"
   1.292 +  OBJCFLAGS="$ORG_OBJCFLAGS"
   1.293  
   1.294 -LD="$CC"
   1.295 -LDEXE="$CC"
   1.296 -LDCXX="$CXX"
   1.297 -LDEXECXX="$CXX"
   1.298 -AC_SUBST(LD)
   1.299 -# LDEXE is the linker to use, when creating executables.
   1.300 -AC_SUBST(LDEXE)
   1.301 -# Linking C++ libraries.
   1.302 -AC_SUBST(LDCXX)
   1.303 -# Linking C++ executables.
   1.304 -AC_SUBST(LDEXECXX)
   1.305 +  LD="$CC"
   1.306 +  LDEXE="$CC"
   1.307 +  LDCXX="$CXX"
   1.308 +  LDEXECXX="$CXX"
   1.309 +  AC_SUBST(LD)
   1.310 +  # LDEXE is the linker to use, when creating executables.
   1.311 +  AC_SUBST(LDEXE)
   1.312 +  # Linking C++ libraries.
   1.313 +  AC_SUBST(LDCXX)
   1.314 +  # Linking C++ executables.
   1.315 +  AC_SUBST(LDEXECXX)
   1.316  
   1.317 -if test "x$OPENJDK_TARGET_OS" != xwindows; then
   1.318 +  if test "x$OPENJDK_TARGET_OS" != xwindows; then
   1.319      AC_CHECK_TOOL(AR, ar)
   1.320      BASIC_FIXUP_EXECUTABLE(AR)
   1.321 -fi
   1.322 -if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.323 +  fi
   1.324 +  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.325      ARFLAGS="-r"
   1.326 -elif test "x$OPENJDK_TARGET_OS" = xaix; then
   1.327 +  elif test "x$OPENJDK_TARGET_OS" = xaix; then
   1.328      ARFLAGS="-X64"
   1.329 -else
   1.330 +  else
   1.331      ARFLAGS=""
   1.332 -fi
   1.333 -AC_SUBST(ARFLAGS)
   1.334 +  fi
   1.335 +  AC_SUBST(ARFLAGS)
   1.336  
   1.337 -# For hotspot, we need these in Windows mixed path; other platforms keep them the same
   1.338 -HOTSPOT_CXX="$CXX"
   1.339 -HOTSPOT_LD="$LD"
   1.340 -AC_SUBST(HOTSPOT_CXX)
   1.341 -AC_SUBST(HOTSPOT_LD)
   1.342 +  # For hotspot, we need these in Windows mixed path; other platforms keep them the same
   1.343 +  HOTSPOT_CXX="$CXX"
   1.344 +  HOTSPOT_LD="$LD"
   1.345 +  AC_SUBST(HOTSPOT_CXX)
   1.346 +  AC_SUBST(HOTSPOT_LD)
   1.347  
   1.348 -COMPILER_NAME=gcc
   1.349 -COMPILER_TYPE=CC
   1.350 -AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [
   1.351 +  COMPILER_NAME=gcc
   1.352 +  COMPILER_TYPE=CC
   1.353 +  AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [
   1.354      # For now, assume that we are always compiling using cl.exe.
   1.355      CC_OUT_OPTION=-Fo
   1.356      EXE_OUT_OPTION=-out:
   1.357 @@ -396,45 +400,45 @@
   1.358  
   1.359      RC_FLAGS="-nologo -l 0x409 -r"
   1.360      AS_IF([test "x$VARIANT" = xOPT], [
   1.361 -        RC_FLAGS="$RC_FLAGS -d NDEBUG"
   1.362 -    ])
   1.363 +    RC_FLAGS="$RC_FLAGS -d NDEBUG"
   1.364 +  ])
   1.365  
   1.366 -    # The version variables used to create RC_FLAGS may be overridden
   1.367 -    # in a custom configure script, or possibly the command line.
   1.368 -    # Let those variables be expanded at make time in spec.gmk.
   1.369 -    # The \$ are escaped to the shell, and the $(...) variables
   1.370 -    # are evaluated by make.
   1.371 -    RC_FLAGS="$RC_FLAGS \
   1.372 -        -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
   1.373 -        -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
   1.374 -        -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
   1.375 -        -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
   1.376 -        -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
   1.377 -        -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
   1.378 -        -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
   1.379 +  # The version variables used to create RC_FLAGS may be overridden
   1.380 +  # in a custom configure script, or possibly the command line.
   1.381 +  # Let those variables be expanded at make time in spec.gmk.
   1.382 +  # The \$ are escaped to the shell, and the $(...) variables
   1.383 +  # are evaluated by make.
   1.384 +  RC_FLAGS="$RC_FLAGS \
   1.385 +      -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
   1.386 +      -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
   1.387 +      -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
   1.388 +      -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
   1.389 +      -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
   1.390 +      -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
   1.391 +      -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
   1.392  
   1.393 -    # lib.exe is used to create static libraries.
   1.394 -    AC_CHECK_PROG([WINAR], [lib],[lib],,,)
   1.395 -    BASIC_FIXUP_EXECUTABLE(WINAR)
   1.396 -    AR="$WINAR"
   1.397 -    ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
   1.398 +  # lib.exe is used to create static libraries.
   1.399 +  AC_CHECK_PROG([WINAR], [lib],[lib],,,)
   1.400 +  BASIC_FIXUP_EXECUTABLE(WINAR)
   1.401 +  AR="$WINAR"
   1.402 +  ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
   1.403  
   1.404 -    AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
   1.405 -    BASIC_FIXUP_EXECUTABLE(DUMPBIN)
   1.406 +  AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
   1.407 +      BASIC_FIXUP_EXECUTABLE(DUMPBIN)
   1.408  
   1.409 -    COMPILER_TYPE=CL
   1.410 -    CCXXFLAGS="$CCXXFLAGS -nologo"
   1.411 -])
   1.412 -AC_SUBST(RC_FLAGS)
   1.413 -AC_SUBST(COMPILER_TYPE)
   1.414 +      COMPILER_TYPE=CL
   1.415 +      CCXXFLAGS="$CCXXFLAGS -nologo"
   1.416 +  ])
   1.417 +  AC_SUBST(RC_FLAGS)
   1.418 +  AC_SUBST(COMPILER_TYPE)
   1.419  
   1.420 -AC_PROG_CPP
   1.421 -BASIC_FIXUP_EXECUTABLE(CPP)
   1.422 +  AC_PROG_CPP
   1.423 +  BASIC_FIXUP_EXECUTABLE(CPP)
   1.424  
   1.425 -AC_PROG_CXXCPP
   1.426 -BASIC_FIXUP_EXECUTABLE(CXXCPP)
   1.427 +  AC_PROG_CXXCPP
   1.428 +  BASIC_FIXUP_EXECUTABLE(CXXCPP)
   1.429  
   1.430 -if test "x$COMPILE_TYPE" != "xcross"; then
   1.431 +  if test "x$COMPILE_TYPE" != "xcross"; then
   1.432      # If we are not cross compiling, use the same compilers for
   1.433      # building the build platform executables. The cross-compilation
   1.434      # case needed to be done earlier, but this can only be done after
   1.435 @@ -442,28 +446,28 @@
   1.436      BUILD_CC="$CC"
   1.437      BUILD_CXX="$CXX"
   1.438      BUILD_LD="$LD"
   1.439 -fi
   1.440 +  fi
   1.441  
   1.442 -# for solaris we really need solaris tools, and not gnu equivalent
   1.443 -#   these seems to normally reside in /usr/ccs/bin so add that to path before
   1.444 -#   starting to probe
   1.445 -#
   1.446 -#   NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH
   1.447 -#         so that it can be overriden --with-tools-dir
   1.448 -if test "x$OPENJDK_BUILD_OS" = xsolaris; then
   1.449 +  # for solaris we really need solaris tools, and not gnu equivalent
   1.450 +  #   these seems to normally reside in /usr/ccs/bin so add that to path before
   1.451 +  #   starting to probe
   1.452 +  #
   1.453 +  #   NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH
   1.454 +  #         so that it can be overriden --with-tools-dir
   1.455 +  if test "x$OPENJDK_BUILD_OS" = xsolaris; then
   1.456      PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}"
   1.457 -fi
   1.458 +  fi
   1.459  
   1.460 -# Find the right assembler.
   1.461 -if test "x$OPENJDK_TARGET_OS" = xsolaris; then
   1.462 +  # Find the right assembler.
   1.463 +  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
   1.464      AC_PATH_PROG(AS, as)
   1.465      BASIC_FIXUP_EXECUTABLE(AS)
   1.466 -else
   1.467 +  else
   1.468      AS="$CC -c"
   1.469 -fi
   1.470 -AC_SUBST(AS)
   1.471 +  fi
   1.472 +  AC_SUBST(AS)
   1.473  
   1.474 -if test "x$OPENJDK_TARGET_OS" = xsolaris; then
   1.475 +  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
   1.476      AC_PATH_PROG(NM, nm)
   1.477      BASIC_FIXUP_EXECUTABLE(NM)
   1.478      AC_PATH_PROG(GNM, gnm)
   1.479 @@ -472,52 +476,52 @@
   1.480      BASIC_FIXUP_EXECUTABLE(STRIP)
   1.481      AC_PATH_PROG(MCS, mcs)
   1.482      BASIC_FIXUP_EXECUTABLE(MCS)
   1.483 -elif test "x$OPENJDK_TARGET_OS" != xwindows; then
   1.484 +  elif test "x$OPENJDK_TARGET_OS" != xwindows; then
   1.485      AC_CHECK_TOOL(NM, nm)
   1.486      BASIC_FIXUP_EXECUTABLE(NM)
   1.487      GNM="$NM"
   1.488      AC_SUBST(GNM)
   1.489      AC_CHECK_TOOL(STRIP, strip)
   1.490      BASIC_FIXUP_EXECUTABLE(STRIP)
   1.491 -fi
   1.492 +  fi
   1.493  
   1.494 -# objcopy is used for moving debug symbols to separate files when
   1.495 -# full debug symbols are enabled.
   1.496 -if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
   1.497 +  # objcopy is used for moving debug symbols to separate files when
   1.498 +  # full debug symbols are enabled.
   1.499 +  if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
   1.500      AC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy])
   1.501      # Only call fixup if objcopy was found.
   1.502      if test -n "$OBJCOPY"; then
   1.503 -        BASIC_FIXUP_EXECUTABLE(OBJCOPY)
   1.504 +      BASIC_FIXUP_EXECUTABLE(OBJCOPY)
   1.505      fi
   1.506 -fi
   1.507 +  fi
   1.508  
   1.509 -AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump])
   1.510 -if test "x$OBJDUMP" != x; then
   1.511 -  # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing.
   1.512 -  BASIC_FIXUP_EXECUTABLE(OBJDUMP)
   1.513 -fi
   1.514 +  AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump])
   1.515 +  if test "x$OBJDUMP" != x; then
   1.516 +    # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing.
   1.517 +    BASIC_FIXUP_EXECUTABLE(OBJDUMP)
   1.518 +  fi
   1.519  
   1.520 -if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
   1.521 -   AC_PATH_PROG(LIPO, lipo)
   1.522 -   BASIC_FIXUP_EXECUTABLE(LIPO)
   1.523 -fi
   1.524 +  if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
   1.525 +    AC_PATH_PROG(LIPO, lipo)
   1.526 +    BASIC_FIXUP_EXECUTABLE(LIPO)
   1.527 +  fi
   1.528  
   1.529 -TOOLCHAIN_SETUP_JTREG
   1.530 +  TOOLCHAIN_SETUP_JTREG
   1.531  
   1.532 -# Restore old path without tools dir
   1.533 -PATH="$OLD_PATH"
   1.534 +  # Restore old path without tools dir
   1.535 +  PATH="$OLD_PATH"
   1.536  ])
   1.537  
   1.538  
   1.539  AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS],
   1.540  [
   1.541  
   1.542 -###############################################################################
   1.543 -#
   1.544 -# How to compile shared libraries.
   1.545 -#
   1.546 +  ###############################################################################
   1.547 +  #
   1.548 +  # How to compile shared libraries.
   1.549 +  #
   1.550  
   1.551 -if test "x$GCC" = xyes; then
   1.552 +  if test "x$GCC" = xyes; then
   1.553      COMPILER_NAME=gcc
   1.554      PICFLAG="-fPIC"
   1.555      LIBRARY_PREFIX=lib
   1.556 @@ -542,42 +546,42 @@
   1.557  
   1.558      # Linking is different on MacOSX
   1.559      if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.560 -        # Might change in the future to clang.
   1.561 -        COMPILER_NAME=gcc
   1.562 -        SHARED_LIBRARY='lib[$]1.dylib'
   1.563 -        SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
   1.564 -        SHARED_LIBRARY_SUFFIX='.dylib'
   1.565 -        EXE_SUFFIX=''
   1.566 -        SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
   1.567 -        SET_SHARED_LIBRARY_MAPFILE=''
   1.568 -        SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
   1.569 -        SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
   1.570 -        POST_STRIP_CMD="$STRIP -S"
   1.571 +      # Might change in the future to clang.
   1.572 +      COMPILER_NAME=gcc
   1.573 +      SHARED_LIBRARY='lib[$]1.dylib'
   1.574 +      SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
   1.575 +      SHARED_LIBRARY_SUFFIX='.dylib'
   1.576 +      EXE_SUFFIX=''
   1.577 +      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
   1.578 +      SET_SHARED_LIBRARY_MAPFILE=''
   1.579 +      SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
   1.580 +      SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
   1.581 +      POST_STRIP_CMD="$STRIP -S"
   1.582      fi
   1.583 -else
   1.584 +  else
   1.585      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
   1.586 -        # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler
   1.587 -        COMPILER_NAME=ossc
   1.588 -        PICFLAG="-KPIC"
   1.589 -        LIBRARY_PREFIX=lib
   1.590 -        SHARED_LIBRARY='lib[$]1.so'
   1.591 -        STATIC_LIBRARY='lib[$]1.a'
   1.592 -        SHARED_LIBRARY_FLAGS="-G"
   1.593 -        SHARED_LIBRARY_SUFFIX='.so'
   1.594 -        STATIC_LIBRARY_SUFFIX='.a'
   1.595 -        OBJ_SUFFIX='.o'
   1.596 -        EXE_SUFFIX=''
   1.597 -        SET_SHARED_LIBRARY_NAME=''
   1.598 -        SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
   1.599 -	C_FLAG_REORDER='-xF'
   1.600 -	CXX_FLAG_REORDER='-xF'
   1.601 -        SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1'
   1.602 -        SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
   1.603 -        CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
   1.604 -        CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
   1.605 -        CFLAGS_JDKLIB_EXTRA='-xstrconst'
   1.606 -        POST_STRIP_CMD="$STRIP -x"
   1.607 -        POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
   1.608 +      # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler
   1.609 +      COMPILER_NAME=ossc
   1.610 +      PICFLAG="-KPIC"
   1.611 +      LIBRARY_PREFIX=lib
   1.612 +      SHARED_LIBRARY='lib[$]1.so'
   1.613 +      STATIC_LIBRARY='lib[$]1.a'
   1.614 +      SHARED_LIBRARY_FLAGS="-G"
   1.615 +      SHARED_LIBRARY_SUFFIX='.so'
   1.616 +      STATIC_LIBRARY_SUFFIX='.a'
   1.617 +      OBJ_SUFFIX='.o'
   1.618 +      EXE_SUFFIX=''
   1.619 +      SET_SHARED_LIBRARY_NAME=''
   1.620 +      SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
   1.621 +      C_FLAG_REORDER='-xF'
   1.622 +      CXX_FLAG_REORDER='-xF'
   1.623 +      SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1'
   1.624 +      SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
   1.625 +      CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
   1.626 +      CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
   1.627 +      CFLAGS_JDKLIB_EXTRA='-xstrconst'
   1.628 +      POST_STRIP_CMD="$STRIP -x"
   1.629 +      POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
   1.630      fi
   1.631      if test "x$OPENJDK_TARGET_OS" = xaix; then
   1.632          COMPILER_NAME=xlc
   1.633 @@ -603,388 +607,389 @@
   1.634          POST_MCS_CMD=""
   1.635      fi
   1.636      if test "x$OPENJDK_TARGET_OS" = xwindows; then
   1.637 -        # If it is not gcc, then assume it is the MS Visual Studio compiler
   1.638 -        COMPILER_NAME=cl
   1.639 -        PICFLAG=""
   1.640 -        LIBRARY_PREFIX=
   1.641 -        SHARED_LIBRARY='[$]1.dll'
   1.642 -        STATIC_LIBRARY='[$]1.lib'
   1.643 -        SHARED_LIBRARY_FLAGS="-LD"
   1.644 -        SHARED_LIBRARY_SUFFIX='.dll'
   1.645 -        STATIC_LIBRARY_SUFFIX='.lib'
   1.646 -        OBJ_SUFFIX='.obj'
   1.647 -        EXE_SUFFIX='.exe'
   1.648 -        SET_SHARED_LIBRARY_NAME=''
   1.649 -        SET_SHARED_LIBRARY_MAPFILE=''
   1.650 -        SET_SHARED_LIBRARY_ORIGIN=''
   1.651 -        SET_EXECUTABLE_ORIGIN=''
   1.652 +      # If it is not gcc, then assume it is the MS Visual Studio compiler
   1.653 +      COMPILER_NAME=cl
   1.654 +      PICFLAG=""
   1.655 +      LIBRARY_PREFIX=
   1.656 +      SHARED_LIBRARY='[$]1.dll'
   1.657 +      STATIC_LIBRARY='[$]1.lib'
   1.658 +      SHARED_LIBRARY_FLAGS="-LD"
   1.659 +      SHARED_LIBRARY_SUFFIX='.dll'
   1.660 +      STATIC_LIBRARY_SUFFIX='.lib'
   1.661 +      OBJ_SUFFIX='.obj'
   1.662 +      EXE_SUFFIX='.exe'
   1.663 +      SET_SHARED_LIBRARY_NAME=''
   1.664 +      SET_SHARED_LIBRARY_MAPFILE=''
   1.665 +      SET_SHARED_LIBRARY_ORIGIN=''
   1.666 +      SET_EXECUTABLE_ORIGIN=''
   1.667      fi
   1.668 -fi
   1.669 +  fi
   1.670  
   1.671 -AC_SUBST(COMPILER_NAME)
   1.672 -AC_SUBST(OBJ_SUFFIX)
   1.673 -AC_SUBST(SHARED_LIBRARY)
   1.674 -AC_SUBST(STATIC_LIBRARY)
   1.675 -AC_SUBST(LIBRARY_PREFIX)
   1.676 -AC_SUBST(SHARED_LIBRARY_SUFFIX)
   1.677 -AC_SUBST(STATIC_LIBRARY_SUFFIX)
   1.678 -AC_SUBST(EXE_SUFFIX)
   1.679 -AC_SUBST(SHARED_LIBRARY_FLAGS)
   1.680 -AC_SUBST(SET_SHARED_LIBRARY_NAME)
   1.681 -AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
   1.682 -AC_SUBST(C_FLAG_REORDER)
   1.683 -AC_SUBST(CXX_FLAG_REORDER)
   1.684 -AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
   1.685 -AC_SUBST(SET_EXECUTABLE_ORIGIN)
   1.686 -AC_SUBST(POST_STRIP_CMD)
   1.687 -AC_SUBST(POST_MCS_CMD)
   1.688 +  AC_SUBST(COMPILER_NAME)
   1.689 +  AC_SUBST(OBJ_SUFFIX)
   1.690 +  AC_SUBST(SHARED_LIBRARY)
   1.691 +  AC_SUBST(STATIC_LIBRARY)
   1.692 +  AC_SUBST(LIBRARY_PREFIX)
   1.693 +  AC_SUBST(SHARED_LIBRARY_SUFFIX)
   1.694 +  AC_SUBST(STATIC_LIBRARY_SUFFIX)
   1.695 +  AC_SUBST(EXE_SUFFIX)
   1.696 +  AC_SUBST(SHARED_LIBRARY_FLAGS)
   1.697 +  AC_SUBST(SET_SHARED_LIBRARY_NAME)
   1.698 +  AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
   1.699 +  AC_SUBST(C_FLAG_REORDER)
   1.700 +  AC_SUBST(CXX_FLAG_REORDER)
   1.701 +  AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
   1.702 +  AC_SUBST(SET_EXECUTABLE_ORIGIN)
   1.703 +  AC_SUBST(POST_STRIP_CMD)
   1.704 +  AC_SUBST(POST_MCS_CMD)
   1.705  
   1.706 -# The (cross) compiler is now configured, we can now test capabilities
   1.707 -# of the target platform.
   1.708 +  # The (cross) compiler is now configured, we can now test capabilities
   1.709 +  # of the target platform.
   1.710  ])
   1.711  
   1.712  AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
   1.713  [
   1.714  
   1.715 -###############################################################################
   1.716 -#
   1.717 -# Setup the opt flags for different compilers
   1.718 -# and different operating systems.
   1.719 -#
   1.720 +  ###############################################################################
   1.721 +  #
   1.722 +  # Setup the opt flags for different compilers
   1.723 +  # and different operating systems.
   1.724 +  #
   1.725  
   1.726 -#
   1.727 -# NOTE: check for -mstackrealign needs to be below potential addition of -m32
   1.728 -#
   1.729 -if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.730 +  #
   1.731 +  # NOTE: check for -mstackrealign needs to be below potential addition of -m32
   1.732 +  #
   1.733 +  if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
   1.734      # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
   1.735      # While waiting for a better solution, the current workaround is to use -mstackrealign.
   1.736      CFLAGS="$CFLAGS -mstackrealign"
   1.737      AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
   1.738      AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
   1.739 -                   [
   1.740 -		        AC_MSG_RESULT([yes])
   1.741 -                   ],
   1.742 -	           [
   1.743 -		        AC_MSG_RESULT([no])
   1.744 -	                AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
   1.745 -	           ])
   1.746 -fi
   1.747 +        [
   1.748 +          AC_MSG_RESULT([yes])
   1.749 +        ],
   1.750 +        [
   1.751 +          AC_MSG_RESULT([no])
   1.752 +          AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
   1.753 +        ]
   1.754 +    )
   1.755 +  fi
   1.756  
   1.757 -C_FLAG_DEPS="-MMD -MF"
   1.758 -CXX_FLAG_DEPS="-MMD -MF"
   1.759 +  C_FLAG_DEPS="-MMD -MF"
   1.760 +  CXX_FLAG_DEPS="-MMD -MF"
   1.761  
   1.762 -case $COMPILER_TYPE in
   1.763 -  CC )
   1.764 -    case $COMPILER_NAME in
   1.765 -      gcc )
   1.766 -      	case $OPENJDK_TARGET_OS in
   1.767 -	  macosx )
   1.768 -	    # On MacOSX we optimize for size, something
   1.769 -	    # we should do for all platforms?
   1.770 -	    C_O_FLAG_HI="-Os"
   1.771 -	    C_O_FLAG_NORM="-Os"
   1.772 -	    C_O_FLAG_NONE=""
   1.773 -	    ;;
   1.774 -	  *)
   1.775 -	    C_O_FLAG_HI="-O3"
   1.776 -	    C_O_FLAG_NORM="-O2"
   1.777 -	    C_O_FLAG_NONE="-O0"
   1.778 -	    ;;
   1.779 -	esac
   1.780 -        CXX_O_FLAG_HI="$C_O_FLAG_HI"
   1.781 -        CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
   1.782 -        CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   1.783 -        CFLAGS_DEBUG_SYMBOLS="-g"
   1.784 -        CXXFLAGS_DEBUG_SYMBOLS="-g"
   1.785 -        if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
   1.786 +  case $COMPILER_TYPE in
   1.787 +    CC )
   1.788 +      case $COMPILER_NAME in
   1.789 +        gcc )
   1.790 +          case $OPENJDK_TARGET_OS in
   1.791 +            macosx )
   1.792 +              # On MacOSX we optimize for size, something
   1.793 +              # we should do for all platforms?
   1.794 +              C_O_FLAG_HI="-Os"
   1.795 +              C_O_FLAG_NORM="-Os"
   1.796 +              C_O_FLAG_NONE=""
   1.797 +              ;;
   1.798 +            *)
   1.799 +              C_O_FLAG_HI="-O3"
   1.800 +              C_O_FLAG_NORM="-O2"
   1.801 +              C_O_FLAG_NONE="-O0"
   1.802 +              ;;
   1.803 +          esac
   1.804 +          CXX_O_FLAG_HI="$C_O_FLAG_HI"
   1.805 +          CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
   1.806 +          CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   1.807 +          CFLAGS_DEBUG_SYMBOLS="-g"
   1.808 +          CXXFLAGS_DEBUG_SYMBOLS="-g"
   1.809 +          if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
   1.810              CFLAGS_DEBUG_SYMBOLS="-g1"
   1.811              CXXFLAGS_DEBUG_SYMBOLS="-g1"
   1.812 -        fi
   1.813 -        ;;
   1.814 -      ossc )
   1.815 -        #
   1.816 -        # Forte has different names for this with their C++ compiler...
   1.817 -        #
   1.818 -        C_FLAG_DEPS="-xMMD -xMF"
   1.819 -        CXX_FLAG_DEPS="-xMMD -xMF"
   1.820 +          fi
   1.821 +          ;;
   1.822 +        ossc )
   1.823 +          #
   1.824 +          # Forte has different names for this with their C++ compiler...
   1.825 +          #
   1.826 +          C_FLAG_DEPS="-xMMD -xMF"
   1.827 +          CXX_FLAG_DEPS="-xMMD -xMF"
   1.828  
   1.829 -        # Extra options used with HIGHEST
   1.830 -        #
   1.831 -        # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
   1.832 -        #          done with care, there are some assumptions below that need to
   1.833 -        #          be understood about the use of pointers, and IEEE behavior.
   1.834 -        #
   1.835 -        # Use non-standard floating point mode (not IEEE 754)
   1.836 -        CC_HIGHEST="$CC_HIGHEST -fns"
   1.837 -        # Do some simplification of floating point arithmetic (not IEEE 754)
   1.838 -        CC_HIGHEST="$CC_HIGHEST -fsimple"
   1.839 -        # Use single precision floating point with 'float'
   1.840 -        CC_HIGHEST="$CC_HIGHEST -fsingle"
   1.841 -        # Assume memory references via basic pointer types do not alias
   1.842 -        #   (Source with excessing pointer casting and data access with mixed
   1.843 -        #    pointer types are not recommended)
   1.844 -        CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
   1.845 -        # Use intrinsic or inline versions for math/std functions
   1.846 -        #   (If you expect perfect errno behavior, do not use this)
   1.847 -        CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
   1.848 -        # Loop data dependency optimizations (need -xO3 or higher)
   1.849 -        CC_HIGHEST="$CC_HIGHEST -xdepend"
   1.850 -        # Pointer parameters to functions do not overlap
   1.851 -        #   (Similar to -xalias_level=basic usage, but less obvious sometimes.
   1.852 -        #    If you pass in multiple pointers to the same data, do not use this)
   1.853 -        CC_HIGHEST="$CC_HIGHEST -xrestrict"
   1.854 -        # Inline some library routines
   1.855 -        #   (If you expect perfect errno behavior, do not use this)
   1.856 -        CC_HIGHEST="$CC_HIGHEST -xlibmil"
   1.857 -        # Use optimized math routines
   1.858 -        #   (If you expect perfect errno behavior, do not use this)
   1.859 -        #  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
   1.860 -        #CC_HIGHEST="$CC_HIGHEST -xlibmopt"
   1.861 +          # Extra options used with HIGHEST
   1.862 +          #
   1.863 +          # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
   1.864 +          #          done with care, there are some assumptions below that need to
   1.865 +          #          be understood about the use of pointers, and IEEE behavior.
   1.866 +          #
   1.867 +          # Use non-standard floating point mode (not IEEE 754)
   1.868 +          CC_HIGHEST="$CC_HIGHEST -fns"
   1.869 +          # Do some simplification of floating point arithmetic (not IEEE 754)
   1.870 +          CC_HIGHEST="$CC_HIGHEST -fsimple"
   1.871 +          # Use single precision floating point with 'float'
   1.872 +          CC_HIGHEST="$CC_HIGHEST -fsingle"
   1.873 +          # Assume memory references via basic pointer types do not alias
   1.874 +          #   (Source with excessing pointer casting and data access with mixed
   1.875 +          #    pointer types are not recommended)
   1.876 +          CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
   1.877 +          # Use intrinsic or inline versions for math/std functions
   1.878 +          #   (If you expect perfect errno behavior, do not use this)
   1.879 +          CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
   1.880 +          # Loop data dependency optimizations (need -xO3 or higher)
   1.881 +          CC_HIGHEST="$CC_HIGHEST -xdepend"
   1.882 +          # Pointer parameters to functions do not overlap
   1.883 +          #   (Similar to -xalias_level=basic usage, but less obvious sometimes.
   1.884 +          #    If you pass in multiple pointers to the same data, do not use this)
   1.885 +          CC_HIGHEST="$CC_HIGHEST -xrestrict"
   1.886 +          # Inline some library routines
   1.887 +          #   (If you expect perfect errno behavior, do not use this)
   1.888 +          CC_HIGHEST="$CC_HIGHEST -xlibmil"
   1.889 +          # Use optimized math routines
   1.890 +          #   (If you expect perfect errno behavior, do not use this)
   1.891 +          #  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
   1.892 +          #CC_HIGHEST="$CC_HIGHEST -xlibmopt"
   1.893  
   1.894 -        if test "x$OPENJDK_TARGET_CPU" = xsparc; then
   1.895 -          CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
   1.896 -          CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
   1.897 -        fi
   1.898 +          if test "x$OPENJDK_TARGET_CPU" = xsparc; then
   1.899 +            CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
   1.900 +            CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
   1.901 +          fi
   1.902  
   1.903 -        case $OPENJDK_TARGET_CPU_ARCH in
   1.904 -          x86)
   1.905 -            C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr"
   1.906 -            C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
   1.907 -            C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
   1.908 -            C_O_FLAG_NONE="-xregs=no%frameptr"
   1.909 -            CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
   1.910 -            CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
   1.911 -            CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
   1.912 -            CXX_O_FLAG_NONE="-xregs=no%frameptr"
   1.913 -            if test "x$OPENJDK_TARGET_CPU" = xx86; then
   1.914 -               C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
   1.915 -               CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
   1.916 -            fi
   1.917 -            ;;
   1.918 -          sparc)
   1.919 -            CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
   1.920 -            CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
   1.921 -            C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
   1.922 -            C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
   1.923 -            C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
   1.924 -            C_O_FLAG_NONE=""
   1.925 -            CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
   1.926 -            CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
   1.927 -            CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
   1.928 -            CXX_O_FLAG_NONE=""
   1.929 -            ;;
   1.930 -        esac
   1.931 +          case $OPENJDK_TARGET_CPU_ARCH in
   1.932 +            x86)
   1.933 +              C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr"
   1.934 +              C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
   1.935 +              C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
   1.936 +              C_O_FLAG_NONE="-xregs=no%frameptr"
   1.937 +              CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
   1.938 +              CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
   1.939 +              CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
   1.940 +              CXX_O_FLAG_NONE="-xregs=no%frameptr"
   1.941 +              if test "x$OPENJDK_TARGET_CPU" = xx86; then
   1.942 +                C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
   1.943 +                CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
   1.944 +              fi
   1.945 +              ;;
   1.946 +            sparc)
   1.947 +              CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
   1.948 +              CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
   1.949 +              C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
   1.950 +              C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
   1.951 +              C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
   1.952 +              C_O_FLAG_NONE=""
   1.953 +              CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
   1.954 +              CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
   1.955 +              CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
   1.956 +              CXX_O_FLAG_NONE=""
   1.957 +              ;;
   1.958 +          esac
   1.959  
   1.960 -        CFLAGS_DEBUG_SYMBOLS="-g -xs"
   1.961 -        CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
   1.962 -        ;;
   1.963 -      xlc )
   1.964 -        C_FLAG_DEPS="-qmakedep=gcc -MF"
   1.965 -        CXX_FLAG_DEPS="-qmakedep=gcc -MF"
   1.966 -        C_O_FLAG_HIGHEST="-O3"
   1.967 -        C_O_FLAG_HI="-O3 -qstrict"
   1.968 -        C_O_FLAG_NORM="-O2"
   1.969 -        C_O_FLAG_NONE=""
   1.970 -        CXX_O_FLAG_HIGHEST="-O3"
   1.971 -        CXX_O_FLAG_HI="-O3 -qstrict"
   1.972 -        CXX_O_FLAG_NORM="-O2"
   1.973 -        CXX_O_FLAG_NONE=""
   1.974 -        CFLAGS_DEBUG_SYMBOLS="-g"
   1.975 -        CXXFLAGS_DEBUG_SYMBOLS="-g"
   1.976 -        LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
   1.977 -        CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
   1.978 -        CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
   1.979 -        ;;
   1.980 -    esac
   1.981 -    ;;
   1.982 -  CL )
   1.983 -    C_O_FLAG_HIGHEST="-O2"
   1.984 -    C_O_FLAG_HI="-O1"
   1.985 -    C_O_FLAG_NORM="-O1"
   1.986 -    C_O_FLAG_NONE="-Od"
   1.987 -    CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
   1.988 -    CXX_O_FLAG_HI="$C_O_FLAG_HI"
   1.989 -    CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
   1.990 -    CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
   1.991 -    ;;
   1.992 -esac
   1.993 +          CFLAGS_DEBUG_SYMBOLS="-g -xs"
   1.994 +          CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
   1.995 +          ;;
   1.996 +        xlc )
   1.997 +          C_FLAG_DEPS="-qmakedep=gcc -MF"
   1.998 +          CXX_FLAG_DEPS="-qmakedep=gcc -MF"
   1.999 +          C_O_FLAG_HIGHEST="-O3"
  1.1000 +          C_O_FLAG_HI="-O3 -qstrict"
  1.1001 +          C_O_FLAG_NORM="-O2"
  1.1002 +          C_O_FLAG_NONE=""
  1.1003 +          CXX_O_FLAG_HIGHEST="-O3"
  1.1004 +          CXX_O_FLAG_HI="-O3 -qstrict"
  1.1005 +          CXX_O_FLAG_NORM="-O2"
  1.1006 +          CXX_O_FLAG_NONE=""
  1.1007 +          CFLAGS_DEBUG_SYMBOLS="-g"
  1.1008 +          CXXFLAGS_DEBUG_SYMBOLS="-g"
  1.1009 +          LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
  1.1010 +          CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
  1.1011 +          CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
  1.1012 +          ;;
  1.1013 +      esac
  1.1014 +      ;;
  1.1015 +    CL )
  1.1016 +      C_O_FLAG_HIGHEST="-O2"
  1.1017 +      C_O_FLAG_HI="-O1"
  1.1018 +      C_O_FLAG_NORM="-O1"
  1.1019 +      C_O_FLAG_NONE="-Od"
  1.1020 +      CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
  1.1021 +      CXX_O_FLAG_HI="$C_O_FLAG_HI"
  1.1022 +      CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
  1.1023 +      CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
  1.1024 +      ;;
  1.1025 +  esac
  1.1026  
  1.1027 -if test -z "$C_O_FLAG_HIGHEST"; then
  1.1028 -   C_O_FLAG_HIGHEST="$C_O_FLAG_HI"
  1.1029 -fi
  1.1030 +  if test -z "$C_O_FLAG_HIGHEST"; then
  1.1031 +    C_O_FLAG_HIGHEST="$C_O_FLAG_HI"
  1.1032 +  fi
  1.1033  
  1.1034 -if test -z "$CXX_O_FLAG_HIGHEST"; then
  1.1035 -   CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI"
  1.1036 -fi
  1.1037 +  if test -z "$CXX_O_FLAG_HIGHEST"; then
  1.1038 +    CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI"
  1.1039 +  fi
  1.1040  
  1.1041 -AC_SUBST(C_O_FLAG_HIGHEST)
  1.1042 -AC_SUBST(C_O_FLAG_HI)
  1.1043 -AC_SUBST(C_O_FLAG_NORM)
  1.1044 -AC_SUBST(C_O_FLAG_NONE)
  1.1045 -AC_SUBST(CXX_O_FLAG_HIGHEST)
  1.1046 -AC_SUBST(CXX_O_FLAG_HI)
  1.1047 -AC_SUBST(CXX_O_FLAG_NORM)
  1.1048 -AC_SUBST(CXX_O_FLAG_NONE)
  1.1049 -AC_SUBST(C_FLAG_DEPS)
  1.1050 -AC_SUBST(CXX_FLAG_DEPS)
  1.1051 +  AC_SUBST(C_O_FLAG_HIGHEST)
  1.1052 +  AC_SUBST(C_O_FLAG_HI)
  1.1053 +  AC_SUBST(C_O_FLAG_NORM)
  1.1054 +  AC_SUBST(C_O_FLAG_NONE)
  1.1055 +  AC_SUBST(CXX_O_FLAG_HIGHEST)
  1.1056 +  AC_SUBST(CXX_O_FLAG_HI)
  1.1057 +  AC_SUBST(CXX_O_FLAG_NORM)
  1.1058 +  AC_SUBST(CXX_O_FLAG_NONE)
  1.1059 +  AC_SUBST(C_FLAG_DEPS)
  1.1060 +  AC_SUBST(CXX_FLAG_DEPS)
  1.1061  ])
  1.1062  
  1.1063  AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK],
  1.1064  [
  1.1065  
  1.1066 -if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
  1.1067 -   AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
  1.1068 -fi
  1.1069 +  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
  1.1070 +    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
  1.1071 +  fi
  1.1072  
  1.1073 -if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
  1.1074 -   AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
  1.1075 -fi
  1.1076 +  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
  1.1077 +    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
  1.1078 +  fi
  1.1079  
  1.1080 -if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
  1.1081 -   AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
  1.1082 -fi
  1.1083 +  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
  1.1084 +    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
  1.1085 +  fi
  1.1086  
  1.1087 -AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
  1.1088 -    [extra flags to be used when compiling jdk c-files])])
  1.1089 +  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
  1.1090 +      [extra flags to be used when compiling jdk c-files])])
  1.1091  
  1.1092 -AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
  1.1093 -    [extra flags to be used when compiling jdk c++-files])])
  1.1094 +  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
  1.1095 +      [extra flags to be used when compiling jdk c++-files])])
  1.1096  
  1.1097 -AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
  1.1098 -    [extra flags to be used when linking jdk])])
  1.1099 +  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
  1.1100 +      [extra flags to be used when linking jdk])])
  1.1101  
  1.1102 -CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
  1.1103 -CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
  1.1104 -LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
  1.1105 +  CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
  1.1106 +  CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
  1.1107 +  LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
  1.1108  
  1.1109 -# Hotspot needs these set in their legacy form
  1.1110 -LEGACY_EXTRA_CFLAGS=$with_extra_cflags
  1.1111 -LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
  1.1112 -LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
  1.1113 +  # Hotspot needs these set in their legacy form
  1.1114 +  LEGACY_EXTRA_CFLAGS=$with_extra_cflags
  1.1115 +  LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
  1.1116 +  LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
  1.1117  
  1.1118 -AC_SUBST(LEGACY_EXTRA_CFLAGS)
  1.1119 -AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
  1.1120 -AC_SUBST(LEGACY_EXTRA_LDFLAGS)
  1.1121 +  AC_SUBST(LEGACY_EXTRA_CFLAGS)
  1.1122 +  AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
  1.1123 +  AC_SUBST(LEGACY_EXTRA_LDFLAGS)
  1.1124  
  1.1125 -###############################################################################
  1.1126 -#
  1.1127 -# Now setup the CFLAGS and LDFLAGS for the JDK build.
  1.1128 -# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
  1.1129 -#
  1.1130 -case $COMPILER_NAME in
  1.1131 -      gcc )
  1.1132 -      	  CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
  1.1133 -                          -pipe \
  1.1134 -                          -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
  1.1135 -	  case $OPENJDK_TARGET_CPU_ARCH in
  1.1136 -	  arm )
  1.1137 -            # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
  1.1138 -	    CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
  1.1139 -	  ;;
  1.1140 -	  ppc )
  1.1141 -            # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
  1.1142 -	  ;;
  1.1143 -	  * )
  1.1144 -	    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
  1.1145 -	    CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
  1.1146 +  ###############################################################################
  1.1147 +  #
  1.1148 +  # Now setup the CFLAGS and LDFLAGS for the JDK build.
  1.1149 +  # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
  1.1150 +  #
  1.1151 +  case $COMPILER_NAME in
  1.1152 +    gcc )
  1.1153 +      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
  1.1154 +      -pipe \
  1.1155 +      -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
  1.1156 +      case $OPENJDK_TARGET_CPU_ARCH in
  1.1157 +        arm )
  1.1158 +          # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
  1.1159 +          CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
  1.1160            ;;
  1.1161 -	  esac
  1.1162 +        ppc )
  1.1163 +          # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
  1.1164            ;;
  1.1165 -      ossc )
  1.1166 -          CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
  1.1167 -          case $OPENJDK_TARGET_CPU_ARCH in
  1.1168 -          x86 )
  1.1169 -            CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
  1.1170 -       	    CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
  1.1171 +        * )
  1.1172 +          CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
  1.1173 +          CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
  1.1174            ;;
  1.1175 -          esac
  1.1176 +      esac
  1.1177 +      ;;
  1.1178 +    ossc )
  1.1179 +      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
  1.1180 +      case $OPENJDK_TARGET_CPU_ARCH in
  1.1181 +        x86 )
  1.1182 +          CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
  1.1183 +          CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
  1.1184 +          ;;
  1.1185 +      esac
  1.1186  
  1.1187 -      	  CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
  1.1188 -      	  CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
  1.1189 +      CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
  1.1190 +      CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
  1.1191  
  1.1192 -          LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
  1.1193 -          LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
  1.1194 +      LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
  1.1195 +      LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
  1.1196 +      ;;
  1.1197 +    xlc )
  1.1198 +      CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
  1.1199 +      CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
  1.1200 +
  1.1201 +      LDFLAGS_JDK="$LDFLAGS_JDK"
  1.1202 +      LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK"
  1.1203 +      ;;
  1.1204 +    cl )
  1.1205 +      CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
  1.1206 +      -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
  1.1207 +      -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
  1.1208 +      -DWIN32 -DIAL"
  1.1209 +      case $OPENJDK_TARGET_CPU in
  1.1210 +        x86 )
  1.1211 +          CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
  1.1212            ;;
  1.1213 -      xlc )
  1.1214 -          CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
  1.1215 -          CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
  1.1216 +        x86_64 )
  1.1217 +          CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
  1.1218 +          ;;
  1.1219 +      esac
  1.1220 +      ;;
  1.1221 +  esac
  1.1222  
  1.1223 -          LDFLAGS_JDK="$LDFLAGS_JDK"
  1.1224 -          LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK"
  1.1225 -          ;;
  1.1226 -      cl )
  1.1227 -          CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
  1.1228 -               -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
  1.1229 -	       -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
  1.1230 -	       -DWIN32 -DIAL"
  1.1231 -          case $OPENJDK_TARGET_CPU in
  1.1232 -              x86 )
  1.1233 -                  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
  1.1234 -                  ;;
  1.1235 -              x86_64 )
  1.1236 -                  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
  1.1237 -                  ;;
  1.1238 -          esac
  1.1239 -          ;;
  1.1240 -esac
  1.1241 +  ###############################################################################
  1.1242  
  1.1243 -###############################################################################
  1.1244 +  # Adjust flags according to debug level.
  1.1245 +  case $DEBUG_LEVEL in
  1.1246 +    fastdebug )
  1.1247 +      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
  1.1248 +      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
  1.1249 +      C_O_FLAG_HI="$C_O_FLAG_NORM"
  1.1250 +      C_O_FLAG_NORM="$C_O_FLAG_NORM"
  1.1251 +      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
  1.1252 +      CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
  1.1253 +      JAVAC_FLAGS="$JAVAC_FLAGS -g"
  1.1254 +      ;;
  1.1255 +    slowdebug )
  1.1256 +      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
  1.1257 +      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
  1.1258 +      C_O_FLAG_HI="$C_O_FLAG_NONE"
  1.1259 +      C_O_FLAG_NORM="$C_O_FLAG_NONE"
  1.1260 +      CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
  1.1261 +      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
  1.1262 +      JAVAC_FLAGS="$JAVAC_FLAGS -g"
  1.1263 +      ;;
  1.1264 +  esac
  1.1265  
  1.1266 -# Adjust flags according to debug level.
  1.1267 -case $DEBUG_LEVEL in
  1.1268 -      fastdebug )
  1.1269 -              CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
  1.1270 -              CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
  1.1271 -	      C_O_FLAG_HI="$C_O_FLAG_NORM"
  1.1272 -	      C_O_FLAG_NORM="$C_O_FLAG_NORM"
  1.1273 -	      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
  1.1274 -	      CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
  1.1275 -              JAVAC_FLAGS="$JAVAC_FLAGS -g"
  1.1276 -              ;;
  1.1277 -      slowdebug )
  1.1278 -              CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
  1.1279 -              CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
  1.1280 -	      C_O_FLAG_HI="$C_O_FLAG_NONE"
  1.1281 -	      C_O_FLAG_NORM="$C_O_FLAG_NONE"
  1.1282 -	      CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
  1.1283 -	      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
  1.1284 -              JAVAC_FLAGS="$JAVAC_FLAGS -g"
  1.1285 -              ;;
  1.1286 -esac
  1.1287 +  CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
  1.1288  
  1.1289 -CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
  1.1290 +  # The package path is used only on macosx?
  1.1291 +  PACKAGE_PATH=/opt/local
  1.1292 +  AC_SUBST(PACKAGE_PATH)
  1.1293  
  1.1294 -# The package path is used only on macosx?
  1.1295 -PACKAGE_PATH=/opt/local
  1.1296 -AC_SUBST(PACKAGE_PATH)
  1.1297 -
  1.1298 -if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
  1.1299 +  if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
  1.1300      # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
  1.1301      #   Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
  1.1302      #   (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
  1.1303      #   Note: -Dmacro         is the same as    #define macro 1
  1.1304 -    #         -Dmacro=	    is the same as    #define macro
  1.1305 +    #         -Dmacro=        is the same as    #define macro
  1.1306      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1307 -        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
  1.1308 +      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
  1.1309      else
  1.1310 -        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
  1.1311 +      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
  1.1312      fi
  1.1313 -else
  1.1314 +  else
  1.1315      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
  1.1316 -fi
  1.1317 -if test "x$OPENJDK_TARGET_OS" = xlinux; then
  1.1318 +  fi
  1.1319 +  if test "x$OPENJDK_TARGET_OS" = xlinux; then
  1.1320      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX"
  1.1321 -fi
  1.1322 -if test "x$OPENJDK_TARGET_OS" = xwindows; then
  1.1323 +  fi
  1.1324 +  if test "x$OPENJDK_TARGET_OS" = xwindows; then
  1.1325      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS"
  1.1326 -fi
  1.1327 -if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1328 +  fi
  1.1329 +  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1330      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS"
  1.1331 -fi
  1.1332 -if test "x$OPENJDK_TARGET_OS" = xaix; then
  1.1333 +  fi
  1.1334 +  if test "x$OPENJDK_TARGET_OS" = xaix; then
  1.1335      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DAIX -DPPC64"
  1.1336 -fi
  1.1337 -if test "x$OPENJDK_TARGET_OS" = xmacosx; then
  1.1338 +  fi
  1.1339 +  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
  1.1340      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
  1.1341      # Setting these parameters makes it an error to link to macosx APIs that are
  1.1342      # newer than the given OS version and makes the linked binaries compatible even
  1.1343 @@ -997,118 +1002,118 @@
  1.1344      # command line.
  1.1345      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
  1.1346      LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
  1.1347 -fi
  1.1348 -if test "x$OPENJDK_TARGET_OS" = xbsd; then
  1.1349 +  fi
  1.1350 +  if test "x$OPENJDK_TARGET_OS" = xbsd; then
  1.1351      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
  1.1352 -fi
  1.1353 -if test "x$DEBUG_LEVEL" = xrelease; then
  1.1354 +  fi
  1.1355 +  if test "x$DEBUG_LEVEL" = xrelease; then
  1.1356      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
  1.1357 -    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1358 -        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
  1.1359 -    fi
  1.1360 -else
  1.1361 +  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1362 +    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
  1.1363 +  fi
  1.1364 +  else
  1.1365      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
  1.1366 -fi
  1.1367 +  fi
  1.1368  
  1.1369 -CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
  1.1370 -CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
  1.1371 +  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
  1.1372 +  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
  1.1373  
  1.1374 -CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
  1.1375 -        -I${JDK_OUTPUTDIR}/include \
  1.1376 -        -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
  1.1377 -        -I${JDK_TOPDIR}/src/share/javavm/export \
  1.1378 -        -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \
  1.1379 -        -I${JDK_TOPDIR}/src/share/native/common \
  1.1380 -        -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
  1.1381 +  CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
  1.1382 +      -I${JDK_OUTPUTDIR}/include \
  1.1383 +      -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
  1.1384 +      -I${JDK_TOPDIR}/src/share/javavm/export \
  1.1385 +      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \
  1.1386 +      -I${JDK_TOPDIR}/src/share/native/common \
  1.1387 +      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
  1.1388  
  1.1389 -# The shared libraries are compiled using the picflag.
  1.1390 -CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
  1.1391 -CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
  1.1392 +  # The shared libraries are compiled using the picflag.
  1.1393 +  CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
  1.1394 +  CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
  1.1395  
  1.1396 -# Executable flags
  1.1397 -CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
  1.1398 -CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
  1.1399 +  # Executable flags
  1.1400 +  CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
  1.1401 +  CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
  1.1402  
  1.1403 -# Now this is odd. The JDK native libraries have to link against libjvm.so
  1.1404 -# On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
  1.1405 -# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
  1.1406 -# is identical for client and server? Yes. Which is picked at runtime (client or server)?
  1.1407 -# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
  1.1408 -# libraries will link to whatever is in memory. Yuck.
  1.1409 -#
  1.1410 -# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
  1.1411 -if test "x$COMPILER_NAME" = xcl; then
  1.1412 +  # Now this is odd. The JDK native libraries have to link against libjvm.so
  1.1413 +  # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
  1.1414 +  # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
  1.1415 +  # is identical for client and server? Yes. Which is picked at runtime (client or server)?
  1.1416 +  # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
  1.1417 +  # libraries will link to whatever is in memory. Yuck.
  1.1418 +  #
  1.1419 +  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
  1.1420 +  if test "x$COMPILER_NAME" = xcl; then
  1.1421      LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
  1.1422      if test "x$OPENJDK_TARGET_CPU" = xx86; then
  1.1423 -        LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
  1.1424 +      LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
  1.1425      fi
  1.1426      # TODO: make -debug optional "--disable-full-debug-symbols"
  1.1427      LDFLAGS_JDK="$LDFLAGS_JDK -debug"
  1.1428      LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
  1.1429      LDFLAGS_JDKLIB_SUFFIX=""
  1.1430      if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
  1.1431 -        LDFLAGS_STACK_SIZE=1048576
  1.1432 +      LDFLAGS_STACK_SIZE=1048576
  1.1433      else
  1.1434 -        LDFLAGS_STACK_SIZE=327680
  1.1435 +      LDFLAGS_STACK_SIZE=327680
  1.1436      fi
  1.1437      LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
  1.1438 -else
  1.1439 +  else
  1.1440      if test "x$COMPILER_NAME" = xgcc; then
  1.1441 -        # If this is a --hash-style=gnu system, use --hash-style=both, why?
  1.1442 -        HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
  1.1443 -        if test -n "$HAS_GNU_HASH"; then
  1.1444 -            LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
  1.1445 +      # If this is a --hash-style=gnu system, use --hash-style=both, why?
  1.1446 +      HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
  1.1447 +      if test -n "$HAS_GNU_HASH"; then
  1.1448 +        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
  1.1449 +      fi
  1.1450 +      if test "x$OPENJDK_TARGET_OS" = xlinux; then
  1.1451 +        # And since we now know that the linker is gnu, then add -z defs, to forbid
  1.1452 +        # undefined symbols in object files.
  1.1453 +        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
  1.1454 +        if test "x$DEBUG_LEVEL" = "xrelease"; then
  1.1455 +          # When building release libraries, tell the linker optimize them.
  1.1456 +          # Should this be supplied to the OSS linker as well?
  1.1457 +          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
  1.1458          fi
  1.1459 -        if test "x$OPENJDK_TARGET_OS" = xlinux; then
  1.1460 -          # And since we now know that the linker is gnu, then add -z defs, to forbid
  1.1461 -          # undefined symbols in object files.
  1.1462 -          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
  1.1463 -          if test "x$DEBUG_LEVEL" = "xrelease"; then
  1.1464 -              # When building release libraries, tell the linker optimize them.
  1.1465 -              # Should this be supplied to the OSS linker as well?
  1.1466 -              LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
  1.1467 -          fi
  1.1468 -        fi
  1.1469 +      fi
  1.1470      fi
  1.1471      LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
  1.1472 -                    -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
  1.1473 +        -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
  1.1474  
  1.1475      # On some platforms (mac) the linker warns about non existing -L dirs.
  1.1476      # Add server first if available. Linking aginst client does not always produce the same results.
  1.1477      # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
  1.1478      # Default to server for other variants.
  1.1479      if test "x$JVM_VARIANT_SERVER" = xtrue; then
  1.1480 -        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
  1.1481 +      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
  1.1482      elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
  1.1483 -        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
  1.1484 +      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
  1.1485      elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
  1.1486 -        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
  1.1487 +      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
  1.1488      else
  1.1489 -        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
  1.1490 +      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
  1.1491      fi
  1.1492  
  1.1493      LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
  1.1494      if test "x$COMPILER_NAME" = xossc; then
  1.1495 -        LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
  1.1496 +      LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
  1.1497      fi
  1.1498  
  1.1499      LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
  1.1500      if test "x$OPENJDK_TARGET_OS" = xlinux; then
  1.1501 -        LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
  1.1502 +      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
  1.1503      fi
  1.1504 -fi
  1.1505 +  fi
  1.1506  
  1.1507 -AC_SUBST(CFLAGS_JDKLIB)
  1.1508 -AC_SUBST(CFLAGS_JDKEXE)
  1.1509 +  AC_SUBST(CFLAGS_JDKLIB)
  1.1510 +  AC_SUBST(CFLAGS_JDKEXE)
  1.1511  
  1.1512 -AC_SUBST(CXXFLAGS_JDKLIB)
  1.1513 -AC_SUBST(CXXFLAGS_JDKEXE)
  1.1514 +  AC_SUBST(CXXFLAGS_JDKLIB)
  1.1515 +  AC_SUBST(CXXFLAGS_JDKEXE)
  1.1516  
  1.1517 -AC_SUBST(LDFLAGS_JDKLIB)
  1.1518 -AC_SUBST(LDFLAGS_JDKEXE)
  1.1519 -AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
  1.1520 -AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
  1.1521 -AC_SUBST(LDFLAGS_CXX_JDK)
  1.1522 +  AC_SUBST(LDFLAGS_JDKLIB)
  1.1523 +  AC_SUBST(LDFLAGS_JDKEXE)
  1.1524 +  AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
  1.1525 +  AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
  1.1526 +  AC_SUBST(LDFLAGS_CXX_JDK)
  1.1527  ])
  1.1528  
  1.1529  
  1.1530 @@ -1124,18 +1129,16 @@
  1.1531    saved_cflags="$CFLAGS"
  1.1532    CFLAGS="$CFLAGS $1"
  1.1533    AC_LANG_PUSH([C])
  1.1534 -  AC_COMPILE_IFELSE([
  1.1535 -    AC_LANG_SOURCE([[int i;]])
  1.1536 -  ], [], [supports=no])
  1.1537 +  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], 
  1.1538 +      [supports=no])
  1.1539    AC_LANG_POP([C])
  1.1540    CFLAGS="$saved_cflags"
  1.1541  
  1.1542    saved_cxxflags="$CXXFLAGS"
  1.1543    CXXFLAGS="$CXXFLAG $1"
  1.1544    AC_LANG_PUSH([C++])
  1.1545 -  AC_COMPILE_IFELSE([
  1.1546 -    AC_LANG_SOURCE([[int i;]])
  1.1547 -  ], [], [supports=no])
  1.1548 +  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], 
  1.1549 +      [supports=no])
  1.1550    AC_LANG_POP([C++])
  1.1551    CXXFLAGS="$saved_cxxflags"
  1.1552  
  1.1553 @@ -1164,8 +1167,8 @@
  1.1554    # Check that the compiler supports -mX (or -qX on AIX) flags
  1.1555    # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
  1.1556    TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
  1.1557 -    [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
  1.1558 -    [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
  1.1559 +      [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
  1.1560 +      [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
  1.1561    AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
  1.1562  
  1.1563  
  1.1564 @@ -1191,9 +1194,9 @@
  1.1565  AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
  1.1566  [
  1.1567    AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
  1.1568 -  [Regression Test Harness @<:@probed@:>@])],
  1.1569 -  [],
  1.1570 -  [with_jtreg=no])
  1.1571 +      [Regression Test Harness @<:@probed@:>@])],
  1.1572 +      [],
  1.1573 +      [with_jtreg=no])
  1.1574  
  1.1575    if test "x$with_jtreg" = xno; then
  1.1576      # jtreg disabled

mercurial