make/autoconf/flags-cflags.m4
author chegar
Sat, 10 Mar 2018 10:11:43 +0000
branchhttp-client-branch
changeset 56274 56e6b3f2e09f
parent 49120 c04d813140dc
child 49155 7cd937277d5e
child 56228 a20f3126f7c0
permissions -rw-r--r--
http-client-branch: test for default impl of newWebSocketBuilder
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     1
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     2
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     4
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    10
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    15
# accompanied this code).
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    16
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    20
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    23
# questions.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    24
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    25
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    26
################################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    27
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    28
# Setup flags for C/C++ compiler
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    29
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    30
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    31
###############################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    32
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    33
# How to compile shared libraries.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    34
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    35
AC_DEFUN([FLAGS_SETUP_SHARED_LIBS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    36
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    37
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    38
    C_FLAG_REORDER=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    39
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    40
    # Default works for linux, might work on other platforms as well.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    41
    SHARED_LIBRARY_FLAGS='-shared'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    42
    SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    43
    SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    44
    SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    45
    SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    46
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    47
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    48
    C_FLAG_REORDER=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    49
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    50
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    51
      # Linking is different on MacOSX
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    52
      SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    53
      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    54
      SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    55
      SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    56
      SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    57
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    58
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    59
      # Default works for linux, might work on other platforms as well.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    60
      SHARED_LIBRARY_FLAGS='-shared'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    61
      SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    62
      SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    63
      SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    64
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    65
      # arm specific settings
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    66
      if test "x$OPENJDK_TARGET_CPU" = "xarm"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    67
        # '-Wl,-z,origin' isn't used on arm.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    68
        SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    69
      else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    70
        SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    71
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    72
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    73
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    74
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    75
    C_FLAG_REORDER='-xF'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    76
    SHARED_LIBRARY_FLAGS="-G"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    77
    SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    78
    SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    79
    SET_SHARED_LIBRARY_NAME='-h [$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    80
    SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    81
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    82
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    83
    C_FLAG_REORDER=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    84
    SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    85
    SET_EXECUTABLE_ORIGIN=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    86
    SET_SHARED_LIBRARY_ORIGIN=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    87
    SET_SHARED_LIBRARY_NAME=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    88
    SET_SHARED_LIBRARY_MAPFILE=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    89
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    90
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    91
    C_FLAG_REORDER=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    92
    SHARED_LIBRARY_FLAGS="-dll"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    93
    SET_EXECUTABLE_ORIGIN=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    94
    SET_SHARED_LIBRARY_ORIGIN=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    95
    SET_SHARED_LIBRARY_NAME=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    96
    SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    97
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    98
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    99
  AC_SUBST(C_FLAG_REORDER)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   100
  AC_SUBST(SET_EXECUTABLE_ORIGIN)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   101
  AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   102
  AC_SUBST(SET_SHARED_LIBRARY_NAME)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   103
  AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   104
  AC_SUBST(SHARED_LIBRARY_FLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   105
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   106
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   107
AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   108
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   109
  # Debug symbols
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   110
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   111
    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   112
      CFLAGS_DEBUG_SYMBOLS="-g1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   113
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   114
      CFLAGS_DEBUG_SYMBOLS="-g"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   115
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   116
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   117
    CFLAGS_DEBUG_SYMBOLS="-g"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   118
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   119
    CFLAGS_DEBUG_SYMBOLS="-g -xs"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   120
    # -g0 enables debug symbols without disabling inlining.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   121
    CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   122
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   123
    CFLAGS_DEBUG_SYMBOLS="-g"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   124
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   125
    CFLAGS_DEBUG_SYMBOLS="-Zi"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   126
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   127
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   128
  if test "x$CXXFLAGS_DEBUG_SYMBOLS" = x; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   129
    # If we did not specify special flags for C++, use C version
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   130
    CXXFLAGS_DEBUG_SYMBOLS="$CFLAGS_DEBUG_SYMBOLS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   131
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   132
  AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   133
  AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   134
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   135
  # FIXME: This was never used in the old build. What to do with it?
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   136
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   137
    # "-Og" suppported for GCC 4.8 and later
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   138
    CFLAG_OPTIMIZE_DEBUG_FLAG="-Og"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   139
    FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CFLAG_OPTIMIZE_DEBUG_FLAG],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   140
      IF_TRUE: [HAS_CFLAG_OPTIMIZE_DEBUG=true],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   141
      IF_FALSE: [HAS_CFLAG_OPTIMIZE_DEBUG=false])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   142
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   143
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   144
  # Debug symbols for JVM_CFLAGS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   145
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   146
    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   147
    if test "x$DEBUG_LEVEL" = xslowdebug; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   148
      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   149
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   150
      # -g0 does not disable inlining, which -g does.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   151
      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   152
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   153
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   154
    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   155
  else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   156
    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   157
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   158
  AC_SUBST(JVM_CFLAGS_SYMBOLS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   159
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   160
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   161
AC_DEFUN([FLAGS_SETUP_WARNINGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   162
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   163
  AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   164
      [do not consider native warnings to be an error @<:@enabled@:>@])])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   165
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   166
  AC_MSG_CHECKING([if native warnings are errors])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   167
  if test "x$enable_warnings_as_errors" = "xyes"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   168
    AC_MSG_RESULT([yes (explicitly set)])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   169
    WARNINGS_AS_ERRORS=true
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   170
  elif test "x$enable_warnings_as_errors" = "xno"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   171
    AC_MSG_RESULT([no])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   172
    WARNINGS_AS_ERRORS=false
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   173
  elif test "x$enable_warnings_as_errors" = "x"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   174
    AC_MSG_RESULT([yes (default)])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   175
    WARNINGS_AS_ERRORS=true
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   176
  else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   177
    AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   178
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   179
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   180
  AC_SUBST(WARNINGS_AS_ERRORS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   181
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   182
  case "${TOOLCHAIN_TYPE}" in
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   183
    microsoft)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   184
      DISABLE_WARNING_PREFIX="-wd"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   185
      CFLAGS_WARNINGS_ARE_ERRORS="-WX"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   186
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   187
    solstudio)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   188
      DISABLE_WARNING_PREFIX="-erroff="
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   189
      CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   190
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   191
    gcc)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   192
      # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   193
      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   194
          IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   195
          IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false]
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   196
      )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   197
      if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   198
        DISABLE_WARNING_PREFIX="-Wno-"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   199
      else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   200
        DISABLE_WARNING_PREFIX=
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   201
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   202
      CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   203
      # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   204
      # CFLAGS since any target specific flags will likely not work with the
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   205
      # build compiler
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   206
      CC_OLD="$CC"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   207
      CXX_OLD="$CXX"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   208
      CC="$BUILD_CC"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   209
      CXX="$BUILD_CXX"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   210
      CFLAGS_OLD="$CFLAGS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   211
      CFLAGS=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   212
      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   213
          IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   214
          IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false]
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   215
      )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   216
      if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   217
        BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   218
      else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   219
        BUILD_CC_DISABLE_WARNING_PREFIX=
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   220
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   221
      CC="$CC_OLD"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   222
      CXX="$CXX_OLD"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   223
      CFLAGS="$CFLAGS_OLD"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   224
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   225
    clang)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   226
      DISABLE_WARNING_PREFIX="-Wno-"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   227
      CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   228
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   229
    xlc)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   230
      DISABLE_WARNING_PREFIX="-qsuppress="
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   231
      CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   232
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   233
  esac
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   234
  AC_SUBST(DISABLE_WARNING_PREFIX)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   235
  AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   236
  AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   237
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   238
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   239
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   240
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   241
  # bounds, memory and behavior checking options
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   242
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   243
    case $DEBUG_LEVEL in
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   244
    release )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   245
      # no adjustment
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   246
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   247
    fastdebug )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   248
      # no adjustment
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   249
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   250
    slowdebug )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   251
      # FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   252
      # get's added conditionally on whether we produce debug symbols or not.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   253
      # This is most likely not really correct.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   254
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   255
      # Add runtime stack smashing and undefined behavior checks.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   256
      # Not all versions of gcc support -fstack-protector
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   257
      STACK_PROTECTOR_CFLAG="-fstack-protector-all"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   258
      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   259
          IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   260
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   261
      CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   262
      CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   263
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   264
      if test "x$STACK_PROTECTOR_CFLAG" != x; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   265
        JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   266
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   267
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   268
    esac
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   269
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   270
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   271
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   272
AC_DEFUN([FLAGS_SETUP_OPTIMIZATION],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   273
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   274
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   275
    CC_HIGHEST="-fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   276
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   277
    C_O_FLAG_HIGHEST_JVM="-xO4"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   278
    C_O_FLAG_DEBUG_JVM=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   279
    C_O_FLAG_SIZE=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   280
    C_O_FLAG_DEBUG=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   281
    C_O_FLAG_NONE=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   282
    if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   283
      C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   284
      C_O_FLAG_HI="-xO4 -Wu,-O4~yz"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   285
      C_O_FLAG_NORM="-xO2 -Wu,-O2~yz"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   286
    elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   287
      C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   288
          -xprefetch=auto,explicit -xchip=ultra $CC_HIGHEST"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   289
      C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   290
      C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   291
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   292
  elif test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   293
    C_O_FLAG_HIGHEST_JVM="-O3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   294
    C_O_FLAG_HIGHEST="-O3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   295
    C_O_FLAG_HI="-O3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   296
    C_O_FLAG_NORM="-O2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   297
    C_O_FLAG_SIZE="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   298
    C_O_FLAG_DEBUG="-O0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   299
    C_O_FLAG_DEBUG_JVM="-O0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   300
    C_O_FLAG_NONE="-O0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   301
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   302
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   303
      # On MacOSX we optimize for size, something
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   304
      # we should do for all platforms?
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   305
      C_O_FLAG_HIGHEST_JVM="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   306
      C_O_FLAG_HIGHEST="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   307
      C_O_FLAG_HI="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   308
      C_O_FLAG_NORM="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   309
      C_O_FLAG_DEBUG_JVM=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   310
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   311
      C_O_FLAG_HIGHEST_JVM="-O3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   312
      C_O_FLAG_HIGHEST="-O3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   313
      C_O_FLAG_HI="-O3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   314
      C_O_FLAG_NORM="-O2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   315
      C_O_FLAG_DEBUG_JVM="-O0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   316
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   317
    C_O_FLAG_SIZE="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   318
    C_O_FLAG_DEBUG="-O0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   319
    C_O_FLAG_NONE="-O0"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   320
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   321
    C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   322
    C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   323
    C_O_FLAG_HI="-O3 -qinline -qinlglue"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   324
    C_O_FLAG_NORM="-O2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   325
    C_O_FLAG_DEBUG="-qnoopt"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   326
    # FIXME: Value below not verified.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   327
    C_O_FLAG_DEBUG_JVM=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   328
    C_O_FLAG_NONE="-qnoopt"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   329
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   330
    C_O_FLAG_HIGHEST_JVM="-O2 -Oy-"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   331
    C_O_FLAG_HIGHEST="-O2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   332
    C_O_FLAG_HI="-O1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   333
    C_O_FLAG_NORM="-O1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   334
    C_O_FLAG_DEBUG="-Od"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   335
    C_O_FLAG_DEBUG_JVM=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   336
    C_O_FLAG_NONE="-Od"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   337
    C_O_FLAG_SIZE="-Os"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   338
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   339
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   340
  # Now copy to C++ flags
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   341
  CXX_O_FLAG_HIGHEST_JVM="$C_O_FLAG_HIGHEST_JVM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   342
  CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   343
  CXX_O_FLAG_HI="$C_O_FLAG_HI"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   344
  CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   345
  CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   346
  CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   347
  CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   348
  CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   349
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   350
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   351
    # In solstudio, also add this to C (but not C++) flags...
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   352
    C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xalias_level=basic"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   353
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   354
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   355
  # Adjust optimization flags according to debug level.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   356
  case $DEBUG_LEVEL in
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   357
    release )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   358
      # no adjustment
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   359
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   360
    fastdebug )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   361
      # Not quite so much optimization
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   362
      C_O_FLAG_HI="$C_O_FLAG_NORM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   363
      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   364
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   365
    slowdebug )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   366
      # Disable optimization
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   367
      C_O_FLAG_HIGHEST_JVM="$C_O_FLAG_DEBUG_JVM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   368
      C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   369
      C_O_FLAG_HI="$C_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   370
      C_O_FLAG_NORM="$C_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   371
      C_O_FLAG_SIZE="$C_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   372
      CXX_O_FLAG_HIGHEST_JVM="$CXX_O_FLAG_DEBUG_JVM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   373
      CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   374
      CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   375
      CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   376
      CXX_O_FLAG_SIZE="$CXX_O_FLAG_DEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   377
      ;;
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   378
  esac
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   379
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   380
  AC_SUBST(C_O_FLAG_HIGHEST_JVM)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   381
  AC_SUBST(C_O_FLAG_HIGHEST)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   382
  AC_SUBST(C_O_FLAG_HI)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   383
  AC_SUBST(C_O_FLAG_NORM)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   384
  AC_SUBST(C_O_FLAG_NONE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   385
  AC_SUBST(C_O_FLAG_SIZE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   386
  AC_SUBST(CXX_O_FLAG_HIGHEST_JVM)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   387
  AC_SUBST(CXX_O_FLAG_HIGHEST)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   388
  AC_SUBST(CXX_O_FLAG_HI)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   389
  AC_SUBST(CXX_O_FLAG_NORM)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   390
  AC_SUBST(CXX_O_FLAG_NONE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   391
  AC_SUBST(CXX_O_FLAG_SIZE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   392
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   393
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   394
AC_DEFUN([FLAGS_SETUP_CFLAGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   395
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   396
  ### CFLAGS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   397
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   398
  FLAGS_SETUP_CFLAGS_HELPER
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   399
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   400
  FLAGS_OS=$OPENJDK_TARGET_OS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   401
  FLAGS_OS_TYPE=$OPENJDK_TARGET_OS_TYPE
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   402
  FLAGS_CPU=$OPENJDK_TARGET_CPU
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   403
  FLAGS_CPU_ARCH=$OPENJDK_TARGET_CPU_ARCH
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   404
  FLAGS_CPU_BITS=$OPENJDK_TARGET_CPU_BITS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   405
  FLAGS_CPU_ENDIAN=$OPENJDK_TARGET_CPU_ENDIAN
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   406
  FLAGS_CPU_LEGACY=$OPENJDK_TARGET_CPU_LEGACY
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   407
  FLAGS_CPU_LEGACY_LIB=$OPENJDK_TARGET_CPU_LEGACY_LIB
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   408
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   409
  FLAGS_SETUP_CFLAGS_CPU_DEP([TARGET])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   410
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   411
  FLAGS_OS=$OPENJDK_BUILD_OS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   412
  FLAGS_OS_TYPE=$OPENJDK_BUILD_OS_TYPE
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   413
  FLAGS_CPU=$OPENJDK_BUILD_CPU
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   414
  FLAGS_CPU_ARCH=$OPENJDK_BUILD_CPU_ARCH
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   415
  FLAGS_CPU_BITS=$OPENJDK_BUILD_CPU_BITS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   416
  FLAGS_CPU_ENDIAN=$OPENJDK_BUILD_CPU_ENDIAN
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   417
  FLAGS_CPU_LEGACY=$OPENJDK_BUILD_CPU_LEGACY
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   418
  FLAGS_CPU_LEGACY_LIB=$OPENJDK_BUILD_CPU_LEGACY_LIB
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   419
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   420
  FLAGS_SETUP_CFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   421
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   422
  # Tests are only ever compiled for TARGET
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   423
  CFLAGS_TESTLIB="$CFLAGS_JDKLIB"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   424
  CXXFLAGS_TESTLIB="$CXXFLAGS_JDKLIB"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   425
  CFLAGS_TESTEXE="$CFLAGS_JDKEXE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   426
  CXXFLAGS_TESTEXE="$CXXFLAGS_JDKEXE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   427
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   428
  AC_SUBST(CFLAGS_TESTLIB)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   429
  AC_SUBST(CFLAGS_TESTEXE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   430
  AC_SUBST(CXXFLAGS_TESTLIB)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   431
  AC_SUBST(CXXFLAGS_TESTEXE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   432
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   433
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   434
################################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   435
# platform independent
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   436
AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   437
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   438
  #### OS DEFINES, these should be independent on toolchain
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   439
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   440
    CFLAGS_OS_DEF_JVM="-DLINUX"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   441
    CFLAGS_OS_DEF_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   442
  elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   443
    CFLAGS_OS_DEF_JVM="-DSOLARIS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   444
    CFLAGS_OS_DEF_JDK="-D__solaris__"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   445
  elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   446
    CFLAGS_OS_DEF_JVM="-D_ALLBSD_SOURCE -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   447
    CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   448
  elif test "x$OPENJDK_TARGET_OS" = xaix; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   449
    CFLAGS_OS_DEF_JVM="-DAIX"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   450
  elif test "x$OPENJDK_TARGET_OS" = xbsd; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   451
    CFLAGS_OS_DEF_JDK="-D_ALLBSD_SOURCE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   452
  elif test "x$OPENJDK_TARGET_OS" = xwindows; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   453
    CFLAGS_OS_DEF_JVM="-D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   454
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   455
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   456
  # Setup target OS define. Use OS target name but in upper case.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   457
  OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   458
  CFLAGS_OS_DEF_JDK="$CFLAGS_OS_DEF_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   459
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   460
  #### GLOBAL DEFINES
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   461
  # Set some common defines. These works for all compilers, but assume
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   462
  # -D is universally accepted.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   463
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   464
  # Always enable optional macros for VM.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   465
  ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   466
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   467
  # Setup some hard coded includes
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   468
  ALWAYS_CFLAGS_JDK=" \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   469
      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   470
      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   471
      -I${TOPDIR}/src/java.base/share/native/libjava \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   472
      -I${TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   473
      -I${TOPDIR}/src/hotspot/share/include \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   474
      -I${TOPDIR}/src/hotspot/os/${HOTSPOT_TARGET_OS_TYPE}/include"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   475
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   476
  ###############################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   477
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   478
  # Adjust flags according to debug level.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   479
  # Setup debug/release defines
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   480
  if test "x$DEBUG_LEVEL" = xrelease; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   481
    DEBUG_CFLAGS_JDK="-DNDEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   482
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   483
      DEBUG_CFLAGS_JDK="$DEBUG_CFLAGS_JDK -DTRIMMED"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   484
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   485
  else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   486
    DEBUG_CFLAGS_JDK="-DDEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   487
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   488
    if test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   489
      # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   490
      # Hotspot now overflows its 64K TOC (currently only for debug),
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   491
      # so for debug we build with '-qpic=large -bbigtoc'.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   492
      DEBUG_CFLAGS_JVM="-qpic=large"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   493
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   494
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   495
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   496
  if test "x$DEBUG_LEVEL" != xrelease; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   497
    DEBUG_OPTIONS_FLAGS_JDK="$CFLAGS_DEBUG_OPTIONS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   498
    DEBUG_SYMBOLS_CFLAGS_JDK="$CFLAGS_DEBUG_SYMBOLS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   499
    DEBUG_SYMBOLS_CXXFLAGS_JDK="$CXXFLAGS_DEBUG_SYMBOLS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   500
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   501
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   502
  #### TOOLCHAIN DEFINES
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   503
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   504
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   505
    ALWAYS_DEFINES_JVM="-D_GNU_SOURCE -D_REENTRANT"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   506
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   507
    ALWAYS_DEFINES_JVM="-D_GNU_SOURCE"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   508
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   509
    ALWAYS_DEFINES_JVM="-DSPARC_WORKS -D_Crun_inline_placement"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   510
    ALWAYS_DEFINES_JDK="-DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   511
    ALWAYS_DEFINES_JDK_CXXONLY="-DCC_NOEX"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   512
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   513
    ALWAYS_DEFINES_JVM="-D_REENTRANT"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   514
    ALWAYS_DEFINES_JDK="-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   515
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   516
    ALWAYS_DEFINES_JDK="-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   517
        -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -DIAL"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   518
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   519
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   520
  ###############################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   521
  #
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   522
  #
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   523
  # CFLAGS BASIC
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   524
  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   525
    # COMMON to gcc and clang
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   526
    TOOLCHAIN_CFLAGS_JVM="-pipe -fno-rtti -fno-exceptions \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   527
        -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   528
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   529
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   530
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   531
    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fcheck-new"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   532
    TOOLCHAIN_CFLAGS_JDK="-pipe"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   533
    TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX (but since this gives *worse* performance, use no-strict-aliasing everywhere!)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   534
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   535
    CXXSTD_CXXFLAG="-std=gnu++98"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   536
    FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$CXXSTD_CXXFLAG -Werror],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   537
    						 IF_FALSE: [CXXSTD_CXXFLAG=""])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   538
    TOOLCHAIN_CFLAGS_JDK_CXXONLY="$CXXSTD_CXXFLAG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   539
    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM $CXXSTD_CXXFLAG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   540
    ADLC_CXXFLAG="$CXXSTD_CXXFLAG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   541
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   542
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   543
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   544
    # Restrict the debug information created by Clang to avoid
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   545
    # too big object files and speed the build up a little bit
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   546
    # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   547
    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -flimit-debug-info"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   548
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   549
    if test "x$OPENJDK_TARGET_OS" = xlinux; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   550
      TOOLCHAIN_CFLAGS_JDK="-pipe"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   551
      TOOLCHAIN_CFLAGS_JDK_CONLY="-fno-strict-aliasing" # technically NOT for CXX
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   552
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   553
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   554
    TOOLCHAIN_CFLAGS_JDK="-mt"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   555
    TOOLCHAIN_CFLAGS_JDK_CONLY="-xc99=%none -xCC -Xa -v -W0,-noglobal" # C only
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   556
    TOOLCHAIN_CFLAGS_JDK_CXXONLY="-features=no%except -norunpath -xnolib" # CXX only
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   557
    TOOLCHAIN_CFLAGS_JVM="-template=no%extdef -features=no%split_init \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   558
        -library=stlport4 -mt -features=no%except"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   559
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   560
    TOOLCHAIN_CFLAGS_JDK="-qchars=signed -qfullpath -qsaveopt"  # add on both CFLAGS
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   561
    TOOLCHAIN_CFLAGS_JVM="-qtune=balanced \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   562
        -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   563
        -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   564
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   565
    TOOLCHAIN_CFLAGS_JVM="-nologo -MD -MP"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   566
    TOOLCHAIN_CFLAGS_JDK="-nologo -MD -Zc:wchar_t-"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   567
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   568
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   569
  # CFLAGS WARNINGS STUFF
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   570
  # Set JVM_CFLAGS warning handling
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   571
  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   572
    # COMMON to gcc and clang
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   573
    WARNING_CFLAGS_JVM="-Wpointer-arith -Wsign-compare -Wunused-function"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   574
    if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   575
      # Non-zero builds have stricter warnings
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   576
      WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wundef -Wformat=2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   577
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   578
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   579
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   580
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   581
    WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   582
    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   583
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   584
    if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   585
      # Non-zero builds have stricter warnings
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   586
      WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wreturn-type"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   587
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   588
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   589
    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   590
    if test "x$OPENJDK_TARGET_OS" = xlinux; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   591
      WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-sometimes-uninitialized"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   592
      WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   593
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   594
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   595
    WARNING_CFLAGS_JDK_CONLY="-errshort=tags"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   596
    WARNING_CFLAGS_JDK_CXXONLY="+w"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   597
    WARNING_CFLAGS_JDK="-errtags=yes -errfmt"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   598
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   599
    WARNING_CFLAGS="-W3"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   600
    WARNING_CFLAGS_JDK="-wd4800"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   601
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   602
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   603
  # Set some additional per-OS defines.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   604
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   605
  # Additional macosx handling
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   606
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   607
    OS_CFLAGS="-DMAC_OS_X_VERSION_MIN_REQUIRED=$MACOSX_VERSION_MIN_NODOTS \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   608
        -mmacosx-version-min=$MACOSX_VERSION_MIN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   609
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   610
    if test -n "$MACOSX_VERSION_MAX"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   611
        OS_CFLAGS="$OS_CFLAGS \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   612
            -DMAC_OS_X_VERSION_MAX_ALLOWED=$MACOSX_VERSION_MAX_NODOTS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   613
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   614
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   615
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   616
  # Where does this really belong??
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   617
  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   618
    PICFLAG="-fPIC"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   619
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   620
    PICFLAG="-KPIC"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   621
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   622
    # '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   623
    # one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   624
    # will have to patch this single instruction with a call to some out-of-order code which
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   625
    # does the load from the TOC. This is of course slow. But in that case we also would have
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   626
    # to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   627
    # With 'qpic=large' the compiler will by default generate a two-instruction sequence which
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   628
    # can be patched directly by the linker and does not require a jump to out-of-order code.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   629
    # Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   630
    # instead. This creates a distinct TOC for every compilation unit (and thus requires two
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   631
    # loads for accessing a global variable). But there are rumors that this may be seen as a
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   632
    # 'performance feature' because of improved code locality of the symbols used in a
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   633
    # compilation unit.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   634
    PICFLAG="-qpic"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   635
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   636
    PICFLAG=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   637
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   638
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   639
  JVM_PICFLAG="$PICFLAG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   640
  JDK_PICFLAG="$PICFLAG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   641
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   642
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   643
    # Linking is different on MacOSX
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   644
    JDK_PICFLAG=''
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   645
    if test "x$STATIC_BUILD" = xtrue; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   646
      JVM_PICFLAG=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   647
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   648
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   649
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   650
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   651
    OS_CFLAGS_JVM="$OS_CFLAGS_JVM -mno-omit-leaf-frame-pointer -mstack-alignment=16"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   652
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   653
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   654
  # Optional POSIX functionality needed by the JVM
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   655
  #
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   656
  # Check if clock_gettime is available and in which library. This indicates
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   657
  # availability of CLOCK_MONOTONIC for hotspot. But we don't need to link, so
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   658
  # don't let it update LIBS.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   659
  save_LIBS="$LIBS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   660
  AC_SEARCH_LIBS(clock_gettime, rt, [HAS_CLOCK_GETTIME=true], [])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   661
  if test "x$LIBS" = "x-lrt "; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   662
    CLOCK_GETTIME_IN_LIBRT=true
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   663
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   664
  LIBS="$save_LIBS"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   665
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   666
  if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   667
    OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DSUPPORTS_CLOCK_MONOTONIC"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   668
    if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   669
      OS_CFLAGS_JVM="$OS_CFLAGS_JVM -DNEEDS_LIBRT"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   670
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   671
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   672
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   673
  # EXPORT
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   674
  AC_SUBST(ADLC_CXXFLAG)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   675
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   676
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   677
################################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   678
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   679
#      conditionals against.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   680
# $2 - Optional prefix for each variable defined.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   681
AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   682
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   683
  #### CPU DEFINES, these should (in theory) be independent on toolchain
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   684
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   685
  # Setup target CPU
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   686
  # Setup endianness
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   687
  if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   688
    $1_DEFINES_CPU_JVM="-DVM_LITTLE_ENDIAN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   689
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   690
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   691
    # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   692
    #   Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   693
    if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   694
      $1_DEFINES_CPU_JDK="-D_LITTLE_ENDIAN="
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   695
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   696
      $1_DEFINES_CPU_JDK="-D_BIG_ENDIAN="
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   697
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   698
  else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   699
    if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   700
      $1_DEFINES_CPU_JDK="-D_LITTLE_ENDIAN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   701
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   702
      $1_DEFINES_CPU_JDK="-D_BIG_ENDIAN"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   703
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   704
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   705
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   706
  # setup CPU bit size
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   707
  $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DARCH='\"$FLAGS_CPU_LEGACY\"' \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   708
      -D$FLAGS_CPU_LEGACY"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   709
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   710
  if test "x$FLAGS_CPU_BITS" = x64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   711
    # -D_LP64=1 is only set on linux and mac. Setting on windows causes diff in
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   712
    # unpack200.exe.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   713
    if test "x$FLAGS_OS" = xlinux || test "x$FLAGS_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   714
      $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_LP64=1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   715
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   716
    if test "x$FLAGS_OS" != xsolaris && test "x$FLAGS_OS" != xaix; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   717
      # Solaris does not have _LP64=1 in the old build.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   718
      # xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   719
      $1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -D_LP64=1"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   720
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   721
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   722
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   723
  # toolchain dependend, per-cpu
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   724
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   725
    if test "x$FLAGS_CPU_ARCH" = xx86; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   726
      $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   727
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   728
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   729
    if test "x$FLAGS_CPU" = xx86_64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   730
      $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_AMD64_ -Damd64"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   731
    else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   732
      $1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_X86_ -Dx86"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   733
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   734
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   735
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   736
  # CFLAGS PER CPU
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   737
  if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   738
    # COMMON to gcc and clang
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   739
    if test "x$FLAGS_CPU" = xx86; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   740
      # Force compatibility with i586 on 32 bit intel platforms.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   741
      $1_CFLAGS_CPU="-march=i586"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   742
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   743
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   744
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   745
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   746
    if test "x$FLAGS_CPU" = xarm; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   747
      # -Wno-psabi to get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   748
      $1_CFLAGS_CPU="-fsigned-char -Wno-psabi $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   749
      $1_CFLAGS_CPU_JVM="-DARM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   750
    elif test "x$FLAGS_CPU" = xaarch64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   751
      if test "x$HOTSPOT_TARGET_CPU_PORT" = xarm64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   752
        $1_CFLAGS_CPU_JVM="-fsigned-char -DARM"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   753
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   754
    elif test "x$FLAGS_CPU_ARCH" = xppc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   755
      $1_CFLAGS_CPU_JVM="-minsert-sched-nops=regroup_exact -mno-multiple -mno-string"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   756
      if test "x$FLAGS_CPU" = xppc64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   757
        # -mminimal-toc fixes `relocation truncated to fit' error for gcc 4.1.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   758
        # Use ppc64 instructions, but schedule for power5
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   759
        $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -mminimal-toc -mcpu=powerpc64 -mtune=power5"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   760
      elif test "x$FLAGS_CPU" = xppc64le; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   761
        # Little endian machine uses ELFv2 ABI.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   762
        # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   763
        $1_CFLAGS_CPU_JVM="${$1_CFLAGS_CPU_JVM} -DABI_ELFv2 -mcpu=power8 -mtune=power8"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   764
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   765
    elif test "x$FLAGS_CPU" = xs390x; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   766
      $1_CFLAGS_CPU="-mbackchain -march=z10"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   767
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   768
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   769
    if test "x$FLAGS_CPU_ARCH" != xarm &&  test "x$FLAGS_CPU_ARCH" != xppc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   770
      # for all archs except arm and ppc, prevent gcc to omit frame pointer
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   771
      $1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   772
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   773
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   774
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   775
    if test "x$FLAGS_OS" = xlinux; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   776
      # ppc test not really needed for clang
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   777
      if test "x$FLAGS_CPU_ARCH" != xarm &&  test "x$FLAGS_CPU_ARCH" != xppc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   778
        # for all archs except arm and ppc, prevent gcc to omit frame pointer
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   779
        $1_CFLAGS_CPU_JDK="${$1_CFLAGS_CPU_JDK} -fno-omit-frame-pointer"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   780
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   781
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   782
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   783
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   784
    if test "x$FLAGS_CPU" = xx86_64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   785
      # NOTE: -xregs=no%frameptr is supposed to be default on x64
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   786
      $1_CFLAGS_CPU_JDK="-xregs=no%frameptr"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   787
    elif test "x$FLAGS_CPU" = xsparcv9; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   788
      $1_CFLAGS_CPU_JVM="-xarch=sparc"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   789
      $1_CFLAGS_CPU_JDK_LIBONLY="-xregs=no%appl"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   790
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   791
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   792
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   793
    if test "x$FLAGS_CPU" = xppc64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   794
      $1_CFLAGS_CPU_JVM="-qarch=ppc64"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   795
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   796
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   797
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   798
    if test "x$FLAGS_CPU" = xx86; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   799
      $1_CFLAGS_CPU_JVM="-arch:IA32"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   800
    elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   801
      if test "x$DEBUG_LEVEL" != xrelease; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   802
        # NOTE: This is probably redundant; -homeparams is default on
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   803
        # non-release builds.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   804
        $1_CFLAGS_CPU_JVM="-homeparams"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   805
      fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   806
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   807
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   808
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   809
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   810
    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($1))
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   811
    $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   812
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   813
    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2,
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   814
        IF_AT_LEAST: [
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   815
          # These flags either do not work or give spurious warnings prior to gcc 4.8.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   816
          $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   817
        ]
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   818
    )
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   819
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   820
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   821
  # EXPORT to API
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   822
  CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM $TOOLCHAIN_CFLAGS_JVM \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   823
      $OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   824
      $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   825
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   826
  CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   827
      $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   828
      $WARNING_CFLAGS $WARNING_CFLAGS_JDK"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   829
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   830
  # Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   831
  # (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   832
  # change in the future.)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   833
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   834
  CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY $DEBUG_SYMBOLS_CFLAGS_JDK \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   835
      $WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   836
  CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY $TOOLCHAIN_CFLAGS_JDK_CXXONLY \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   837
      $DEBUG_SYMBOLS_CXXFLAGS_JDK $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   838
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   839
  $1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   840
  $1_CFLAGS_JDK="${$1_DEFINES_CPU_JDK} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JDK} ${$1_TOOLCHAIN_CFLAGS}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   841
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   842
  $2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   843
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   844
  $2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   845
  $2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   846
  $2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   847
  $2CXXFLAGS_JDKLIB="${$2CXXFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   848
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   849
  AC_SUBST($2JVM_CFLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   850
  AC_SUBST($2CFLAGS_JDKLIB)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   851
  AC_SUBST($2CFLAGS_JDKEXE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   852
  AC_SUBST($2CXXFLAGS_JDKLIB)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   853
  AC_SUBST($2CXXFLAGS_JDKEXE)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   854
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   855
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   856
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   857
# Arguments:
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   858
# $1 - Prefix for each variable defined.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   859
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   860
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   861
  # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   862
  # runs afoul of the more aggressive versions of these optimisations.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   863
  # Notably, value range propagation now assumes that the this pointer of C++
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   864
  # member functions is non-null.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   865
  NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   866
  dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   867
  dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   868
  dnl					     IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   869
  NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   870
  dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   871
  dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   872
  dnl					     IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   873
  AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   874
  $1_GCC6_CFLAGS="${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   875
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   876
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   877
# Documentation on common flags used for solstudio in HIGHEST.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   878
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   879
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   880
#          done with care, there are some assumptions below that need to
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   881
#          be understood about the use of pointers, and IEEE behavior.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   882
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   883
# -fns: Use non-standard floating point mode (not IEEE 754)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   884
# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   885
# -fsingle: Use single precision floating point with 'float'
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   886
# -xalias_level=basic: Assume memory references via basic pointer types do not alias
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   887
#   (Source with excessing pointer casting and data access with mixed
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   888
#    pointer types are not recommended)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   889
# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   890
#   (If you expect perfect errno behavior, do not use this)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   891
# -xdepend: Loop data dependency optimizations (need -xO3 or higher)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   892
# -xrestrict: Pointer parameters to functions do not overlap
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   893
#   (Similar to -xalias_level=basic usage, but less obvious sometimes.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   894
#    If you pass in multiple pointers to the same data, do not use this)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   895
# -xlibmil: Inline some library routines
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   896
#   (If you expect perfect errno behavior, do not use this)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   897
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   898
#   (If you expect perfect errno behavior, do not use this)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   899
#  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now