common/autoconf/flags.m4
author henryjen
Tue, 25 Feb 2014 23:38:52 -0800
changeset 23161 85635b5bf0a6
parent 22730 c6ac76f2c90c
child 23423 153d4b6b1124
permissions -rw-r--r--
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler Reviewed-by: erikj, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     1
#
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
     2
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     4
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    10
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    15
# accompanied this code).
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    16
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    20
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    23
# questions.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    24
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    25
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    26
AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    27
[
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    28
  # Option used to tell the compiler whether to create 32- or 64-bit executables
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    29
  if test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    30
    COMPILER_TARGET_BITS_FLAG="-q"
22458
6a74da13c52f 8022411: Allow overriding of CXX and CC with absolute path
ihse
parents: 22179
diff changeset
    31
  else
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    32
    COMPILER_TARGET_BITS_FLAG="-m"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
    33
  fi
22467
kvn
parents: 22466 21055
diff changeset
    34
  AC_SUBST(COMPILER_TARGET_BITS_FLAG)
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    35
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    36
  # FIXME: figure out if we should select AR flags depending on OS or toolchain.
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
    37
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    38
    ARFLAGS="-r"
22467
kvn
parents: 22466 21055
diff changeset
    39
  elif test "x$OPENJDK_TARGET_OS" = xaix; then
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    40
    ARFLAGS="-X64"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    41
  elif test "x$OPENJDK_TARGET_OS" = xwindows; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    42
    # lib.exe is used as AR to create static libraries.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    43
    ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
    44
  else
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    45
    ARFLAGS=""
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
    46
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
    47
  AC_SUBST(ARFLAGS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    48
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    49
  ## Setup strip.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    50
  # FIXME: should this really be per platform, or should it be per toolchain type?
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    51
  # strip is not provided by clang or solstudio; so guessing platform makes most sense.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    52
  # FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    53
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    54
    STRIPFLAGS="-g"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    55
  elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    56
    STRIPFLAGS="-x"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    57
  elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    58
    STRIPFLAGS="-S"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    59
  elif test "x$OPENJDK_TARGET_OS" = xaix; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    60
    STRIPFLAGS="-X32_64"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    61
  fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    62
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    63
  if test "x$OPENJDK_TARGET_OS" != xwindows; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    64
    POST_STRIP_CMD="$STRIP $STRIPFLAGS"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    65
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    66
  AC_SUBST(POST_STRIP_CMD)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    67
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    68
  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    69
    # FIXME: break out into MCSFLAGS
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    70
    POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    71
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    72
  AC_SUBST(POST_MCS_CMD)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    73
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    74
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    75
    CC_OUT_OPTION=-Fo
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    76
    EXE_OUT_OPTION=-out:
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    77
    LD_OUT_OPTION=-out:
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    78
    AR_OUT_OPTION=-out:
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    79
  else
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    80
    # The option used to specify the target .o,.a or .so file.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    81
    # When compiling, how to specify the to be created object file.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    82
    CC_OUT_OPTION='-o$(SPACE)'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    83
    # When linking, how to specify the to be created executable.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    84
    EXE_OUT_OPTION='-o$(SPACE)'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    85
    # When linking, how to specify the to be created dynamically linkable library.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    86
    LD_OUT_OPTION='-o$(SPACE)'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    87
    # When archiving, how to specify the to be create static archive for object files.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    88
    AR_OUT_OPTION='rcs$(SPACE)'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    89
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    90
  AC_SUBST(CC_OUT_OPTION)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    91
  AC_SUBST(EXE_OUT_OPTION)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    92
  AC_SUBST(LD_OUT_OPTION)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    93
  AC_SUBST(AR_OUT_OPTION)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    94
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    95
  # On Windows, we need to set RC flags.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    96
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    97
    RC_FLAGS="-nologo -l 0x409 -r"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    98
    if test "x$VARIANT" = xOPT; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
    99
      RC_FLAGS="$RC_FLAGS -d NDEBUG"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   100
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   101
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   102
    # The version variables used to create RC_FLAGS may be overridden
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   103
    # in a custom configure script, or possibly the command line.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   104
    # Let those variables be expanded at make time in spec.gmk.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   105
    # The \$ are escaped to the shell, and the $(...) variables
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   106
    # are evaluated by make.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   107
    RC_FLAGS="$RC_FLAGS \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   108
        -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   109
        -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   110
        -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   111
        -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   112
        -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   113
        -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   114
        -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   115
  fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   116
  AC_SUBST(RC_FLAGS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   117
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   118
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   119
    # FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   120
    CCXXFLAGS="$CCXXFLAGS -nologo"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   121
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   122
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   123
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   124
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   125
[
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   126
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   127
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   128
  # How to compile shared libraries.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   129
  #
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   130
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   131
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   132
    PICFLAG="-fPIC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   133
    C_FLAG_REORDER=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   134
    CXX_FLAG_REORDER=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   135
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   136
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   137
      # Linking is different on MacOSX
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   138
      SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   139
      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   140
      SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   141
      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   142
      SET_SHARED_LIBRARY_MAPFILE=''
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   143
    else
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   144
      # Default works for linux, might work on other platforms as well.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   145
      SHARED_LIBRARY_FLAGS='-shared'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   146
      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   147
      SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   148
      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   149
      SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   150
    fi
23161
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   151
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   152
    PICFLAG=''
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   153
    C_FLAG_REORDER=''
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   154
    CXX_FLAG_REORDER=''
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   155
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   156
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   157
      # Linking is different on MacOSX
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   158
      SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   159
      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   160
      SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   161
      SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   162
      SET_SHARED_LIBRARY_MAPFILE=''
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   163
    else
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   164
      # Default works for linux, might work on other platforms as well.
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   165
      SHARED_LIBRARY_FLAGS='-shared'
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   166
      SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   167
      SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   168
      SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   169
      SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   170
    fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   171
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   172
    PICFLAG="-KPIC"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   173
    C_FLAG_REORDER='-xF'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   174
    CXX_FLAG_REORDER='-xF'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   175
    SHARED_LIBRARY_FLAGS="-G"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   176
    SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN[$]1'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   177
    SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   178
    SET_SHARED_LIBRARY_NAME=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   179
    SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   180
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   181
    PICFLAG="-qpic=large"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   182
    C_FLAG_REORDER=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   183
    CXX_FLAG_REORDER=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   184
    SHARED_LIBRARY_FLAGS="-qmkshrobj"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   185
    SET_EXECUTABLE_ORIGIN=""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   186
    SET_SHARED_LIBRARY_ORIGIN=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   187
    SET_SHARED_LIBRARY_NAME=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   188
    SET_SHARED_LIBRARY_MAPFILE=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   189
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   190
    PICFLAG=""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   191
    C_FLAG_REORDER=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   192
    CXX_FLAG_REORDER=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   193
    SHARED_LIBRARY_FLAGS="-LD"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   194
    SET_EXECUTABLE_ORIGIN=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   195
    SET_SHARED_LIBRARY_ORIGIN=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   196
    SET_SHARED_LIBRARY_NAME=''
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   197
    SET_SHARED_LIBRARY_MAPFILE=''
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   198
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   199
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   200
  AC_SUBST(C_FLAG_REORDER)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   201
  AC_SUBST(CXX_FLAG_REORDER)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   202
  AC_SUBST(SHARED_LIBRARY_FLAGS)
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   203
  AC_SUBST(SET_EXECUTABLE_ORIGIN)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   204
  AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   205
  AC_SUBST(SET_SHARED_LIBRARY_NAME)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   206
  AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   207
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   208
  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   209
    CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   210
    CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   211
    CFLAGS_JDKLIB_EXTRA='-xstrconst'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   212
  fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   213
  # The (cross) compiler is now configured, we can now test capabilities
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   214
  # of the target platform.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   215
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   216
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   217
# Documentation on common flags used for solstudio in HIGHEST.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   218
#
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   219
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   220
#          done with care, there are some assumptions below that need to
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   221
#          be understood about the use of pointers, and IEEE behavior.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   222
#
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   223
# -fns: Use non-standard floating point mode (not IEEE 754)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   224
# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   225
# -fsingle: Use single precision floating point with 'float'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   226
# -xalias_level=basic: Assume memory references via basic pointer types do not alias
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   227
#   (Source with excessing pointer casting and data access with mixed
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   228
#    pointer types are not recommended)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   229
# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   230
#   (If you expect perfect errno behavior, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   231
# -xdepend: Loop data dependency optimizations (need -xO3 or higher)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   232
# -xrestrict: Pointer parameters to functions do not overlap
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   233
#   (Similar to -xalias_level=basic usage, but less obvious sometimes.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   234
#    If you pass in multiple pointers to the same data, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   235
# -xlibmil: Inline some library routines
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   236
#   (If you expect perfect errno behavior, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   237
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   238
#   (If you expect perfect errno behavior, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   239
#  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   240
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   241
    # FIXME: this will never happen since sparc != sparcv9, ie 32 bit, which we don't build anymore.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   242
    # Bug?
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   243
    #if test "x$OPENJDK_TARGET_CPU" = xsparc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   244
    #  CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   245
    #  CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   246
    #fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   247
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   248
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   249
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   250
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   251
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   252
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   253
  # Setup the opt flags for different compilers
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   254
  # and different operating systems.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   255
  #
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   256
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   257
  # FIXME: this was indirectly the old default, but just inherited.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   258
  # if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   259
  #   C_FLAG_DEPS="-MMD -MF"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   260
  # fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   261
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   262
  # Generate make dependency files
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   263
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   264
    C_FLAG_DEPS="-MMD -MF"
23161
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   265
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   266
    C_FLAG_DEPS="-MMD -MF"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   267
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   268
    C_FLAG_DEPS="-xMMD -xMF"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   269
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   270
    C_FLAG_DEPS="-qmakedep=gcc -MF"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   271
  fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   272
  CXX_FLAG_DEPS="$C_FLAG_DEPS"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   273
  AC_SUBST(C_FLAG_DEPS)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   274
  AC_SUBST(CXX_FLAG_DEPS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   275
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   276
  # Debug symbols
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   277
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   278
    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   279
      CFLAGS_DEBUG_SYMBOLS="-g1"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   280
      CXXFLAGS_DEBUG_SYMBOLS="-g1"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   281
    else
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   282
      CFLAGS_DEBUG_SYMBOLS="-g"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   283
      CXXFLAGS_DEBUG_SYMBOLS="-g"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   284
    fi
23161
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   285
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   286
    CFLAGS_DEBUG_SYMBOLS="-g"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   287
    CXXFLAGS_DEBUG_SYMBOLS="-g"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   288
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   289
    CFLAGS_DEBUG_SYMBOLS="-g -xs"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   290
    CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   291
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   292
    CFLAGS_DEBUG_SYMBOLS="-g"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   293
    CXXFLAGS_DEBUG_SYMBOLS="-g"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   294
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   295
  AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   296
  AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   297
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   298
  # Optimization levels
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   299
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
22730
c6ac76f2c90c 8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents: 22721
diff changeset
   300
    CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   301
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   302
    if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   303
      # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global?
22730
c6ac76f2c90c 8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents: 22721
diff changeset
   304
      C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   305
      C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   306
      C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   307
      C_O_FLAG_NONE="-xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   308
      CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   309
      CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   310
      CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   311
      CXX_O_FLAG_NONE="-xregs=no%frameptr"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   312
      if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   313
        C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   314
        CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   315
      fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   316
    elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
22730
c6ac76f2c90c 8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents: 22721
diff changeset
   317
      C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   318
      C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   319
      C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   320
      C_O_FLAG_NONE=""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   321
      CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   322
      CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   323
      CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   324
      CXX_O_FLAG_NONE=""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   325
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   326
  else
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   327
    # The remaining toolchains share opt flags between CC and CXX;
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   328
    # setup for C and duplicate afterwards.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   329
    if test "x$TOOLCHAIN_TYPE" = xgcc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   330
      if test "x$OPENJDK_TARGET_OS" = xmacosx; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   331
        # On MacOSX we optimize for size, something
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   332
        # we should do for all platforms?
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   333
        C_O_FLAG_HIGHEST="-Os"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   334
        C_O_FLAG_HI="-Os"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   335
        C_O_FLAG_NORM="-Os"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   336
        C_O_FLAG_NONE=""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   337
      else
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   338
        C_O_FLAG_HIGHEST="-O3"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   339
        C_O_FLAG_HI="-O3"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   340
        C_O_FLAG_NORM="-O2"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   341
        C_O_FLAG_NONE="-O0"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   342
      fi
23161
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   343
    elif test "x$TOOLCHAIN_TYPE" = xclang; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   344
      if test "x$OPENJDK_TARGET_OS" = xmacosx; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   345
        # On MacOSX we optimize for size, something
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   346
        # we should do for all platforms?
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   347
        C_O_FLAG_HIGHEST="-Os"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   348
        C_O_FLAG_HI="-Os"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   349
        C_O_FLAG_NORM="-Os"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   350
        C_O_FLAG_NONE=""
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   351
      else
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   352
        C_O_FLAG_HIGHEST="-O3"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   353
        C_O_FLAG_HI="-O3"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   354
        C_O_FLAG_NORM="-O2"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   355
        C_O_FLAG_NONE="-O0"
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   356
      fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   357
    elif test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   358
      C_O_FLAG_HIGHEST="-O3"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   359
      C_O_FLAG_HI="-O3 -qstrict"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   360
      C_O_FLAG_NORM="-O2"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   361
      C_O_FLAG_NONE=""
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   362
    elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   363
      C_O_FLAG_HIGHEST="-O2"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   364
      C_O_FLAG_HI="-O1"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   365
      C_O_FLAG_NORM="-O1"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   366
      C_O_FLAG_NONE="-Od"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   367
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   368
    CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   369
    CXX_O_FLAG_HI="$C_O_FLAG_HI"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   370
    CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   371
    CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   372
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   373
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   374
  AC_SUBST(C_O_FLAG_HIGHEST)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   375
  AC_SUBST(C_O_FLAG_HI)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   376
  AC_SUBST(C_O_FLAG_NORM)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   377
  AC_SUBST(C_O_FLAG_NONE)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   378
  AC_SUBST(CXX_O_FLAG_HIGHEST)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   379
  AC_SUBST(CXX_O_FLAG_HI)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   380
  AC_SUBST(CXX_O_FLAG_NORM)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   381
  AC_SUBST(CXX_O_FLAG_NONE)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   382
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   383
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   384
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   385
[
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   386
  # Special extras...
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   387
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   388
    if test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   389
      CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   390
      CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   391
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   392
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   393
    LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   394
    CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   395
    CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   396
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   397
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   398
  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   399
    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   400
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   401
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   402
  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   403
    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   404
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   405
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   406
  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   407
    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   408
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   409
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   410
  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   411
      [extra flags to be used when compiling jdk c-files])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   412
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   413
  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   414
      [extra flags to be used when compiling jdk c++-files])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   415
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   416
  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   417
      [extra flags to be used when linking jdk])])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   418
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   419
  CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   420
  CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   421
  LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   422
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   423
  # Hotspot needs these set in their legacy form
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   424
  LEGACY_EXTRA_CFLAGS=$with_extra_cflags
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   425
  LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   426
  LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   427
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   428
  AC_SUBST(LEGACY_EXTRA_CFLAGS)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   429
  AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   430
  AC_SUBST(LEGACY_EXTRA_LDFLAGS)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   431
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   432
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   433
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   434
  # Now setup the CFLAGS and LDFLAGS for the JDK build.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   435
  # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   436
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   437
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   438
  # Setup compiler/platform specific flags to CFLAGS_JDK,
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   439
  # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   440
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   441
    # these options are used for both C and C++ compiles
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   442
    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   443
        -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   444
    case $OPENJDK_TARGET_CPU_ARCH in
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   445
      arm )
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   446
        # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   447
        CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   448
        ;;
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   449
      ppc )
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   450
        # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   451
        ;;
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   452
      * )
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   453
        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   454
        CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   455
        ;;
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   456
    esac
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   457
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   458
    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   459
    if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   460
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   461
      CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   462
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   463
  
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   464
    CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   465
    CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   466
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   467
    CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   468
    CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   469
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   470
    CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   471
    -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   472
    -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   473
    -DWIN32 -DIAL"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   474
    if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   475
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   476
    else
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   477
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   478
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   479
  fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   480
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   481
  ###############################################################################
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   482
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   483
  # Adjust flags according to debug level.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   484
  case $DEBUG_LEVEL in
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   485
    fastdebug )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   486
      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   487
      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   488
      C_O_FLAG_HI="$C_O_FLAG_NORM"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   489
      C_O_FLAG_NORM="$C_O_FLAG_NORM"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   490
      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   491
      CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   492
      JAVAC_FLAGS="$JAVAC_FLAGS -g"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   493
      ;;
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   494
    slowdebug )
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   495
      CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   496
      CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   497
      C_O_FLAG_HI="$C_O_FLAG_NONE"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   498
      C_O_FLAG_NORM="$C_O_FLAG_NONE"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   499
      CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   500
      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   501
      JAVAC_FLAGS="$JAVAC_FLAGS -g"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   502
      ;;
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   503
  esac
18020
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   504
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   505
  # Setup LP64
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   506
  CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   507
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   508
  # Set some common defines. These works for all compilers, but assume
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   509
  # -D is universally accepted.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   510
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   511
  # Setup endianness
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   512
  if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   513
    # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   514
    #   Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   515
    #   (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   516
    #   Note: -Dmacro         is the same as    #define macro 1
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   517
    #         -Dmacro=        is the same as    #define macro
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   518
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   519
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   520
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   521
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   522
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   523
  else
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   524
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   525
  fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   526
  
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   527
  # Setup target OS define. Use OS target name but in upper case.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   528
  OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   529
  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   530
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   531
  # Setup target CPU
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   532
  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   533
  
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   534
  # Setup debug/release defines
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   535
  if test "x$DEBUG_LEVEL" = xrelease; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   536
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   537
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   538
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   539
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   540
  else
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   541
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   542
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   543
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   544
  # Setup release name
22035
897e2da883cd 8030781: System.setProperties(null) drops all system properties (RELEASE not set)
erikj
parents: 21055
diff changeset
   545
  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   546
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   547
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   548
  # Set some additional per-OS defines.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   549
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   550
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   551
  elif test "x$OPENJDK_TARGET_OS" = xaix; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   552
    # FIXME: PPC64 should not be here.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   553
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   554
  elif test "x$OPENJDK_TARGET_OS" = xbsd; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   555
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   556
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   557
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   558
  # Additional macosx handling
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   559
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   560
    if test "x$TOOLCHAIN_TYPE" = xgcc; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   561
      # FIXME: This needs to be exported in spec.gmk due to closed legacy code.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   562
      # FIXME: clean this up, and/or move it elsewhere.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   563
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   564
      # Setting these parameters makes it an error to link to macosx APIs that are
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   565
      # newer than the given OS version and makes the linked binaries compatible 
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   566
      # even if built on a newer version of the OS.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   567
      # The expected format is X.Y.Z
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   568
      MACOSX_VERSION_MIN=10.7.0
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   569
      AC_SUBST(MACOSX_VERSION_MIN)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   570
    
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   571
      # The macro takes the version with no dots, ex: 1070
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   572
      # Let the flags variables get resolved in make for easier override on make
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   573
      # command line.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   574
      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   575
      LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   576
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   577
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   578
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   579
  # Setup some hard coded includes
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   580
  CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   581
      -I${JDK_OUTPUTDIR}/include \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   582
      -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   583
      -I${JDK_TOPDIR}/src/share/javavm/export \
21055
d52217bb8e80 8016096: [macosx] jawt_md.h shipped with jdk is outdated
dholmes
parents: 20643
diff changeset
   584
      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   585
      -I${JDK_TOPDIR}/src/share/native/common \
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   586
      -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   587
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   588
  # The shared libraries are compiled using the picflag.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   589
  CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   590
  CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   591
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   592
  # Executable flags
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   593
  CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   594
  CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   595
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   596
  AC_SUBST(CFLAGS_JDKLIB)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   597
  AC_SUBST(CFLAGS_JDKEXE)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   598
  AC_SUBST(CXXFLAGS_JDKLIB)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   599
  AC_SUBST(CXXFLAGS_JDKEXE)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   600
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   601
  # Setup LDFLAGS et al.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   602
  #
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   603
  # Now this is odd. The JDK native libraries have to link against libjvm.so
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   604
  # On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   605
  # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   606
  # is identical for client and server? Yes. Which is picked at runtime (client or server)?
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   607
  # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   608
  # libraries will link to whatever is in memory. Yuck.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   609
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   610
  # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   611
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   612
    LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   613
    if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   614
      LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   615
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   616
    # TODO: make -debug optional "--disable-full-debug-symbols"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   617
    LDFLAGS_JDK="$LDFLAGS_JDK -debug"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   618
    LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   619
    LDFLAGS_JDKLIB_SUFFIX=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   620
    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   621
      LDFLAGS_STACK_SIZE=1048576
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   622
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   623
      LDFLAGS_STACK_SIZE=327680
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   624
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   625
    LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   626
  else
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   627
    if test "x$TOOLCHAIN_TYPE" = xgcc; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   628
      # If this is a --hash-style=gnu system, use --hash-style=both, why?
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   629
      # We have previously set HAS_GNU_HASH if this is the case
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   630
      if test -n "$HAS_GNU_HASH"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   631
        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   632
      fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   633
      if test "x$OPENJDK_TARGET_OS" = xlinux; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   634
        # And since we now know that the linker is gnu, then add -z defs, to forbid
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   635
        # undefined symbols in object files.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   636
        LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   637
        if test "x$DEBUG_LEVEL" = "xrelease"; then
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   638
          # When building release libraries, tell the linker optimize them.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   639
          # Should this be supplied to the OSS linker as well?
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   640
          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   641
        fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   642
      fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   643
    fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   644
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   645
    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   646
      LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   647
      LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   648
    fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   649
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   650
    LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   651
        -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   652
14465
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
   653
    # On some platforms (mac) the linker warns about non existing -L dirs.
14467
a973c0a1bd5d 8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents: 14465
diff changeset
   654
    # Add server first if available. Linking aginst client does not always produce the same results.
14810
4e7fee179b4a 7190137: Add support for JVM_VARIANT minimal1
dholmes
parents: 14614
diff changeset
   655
    # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
4e7fee179b4a 7190137: Add support for JVM_VARIANT minimal1
dholmes
parents: 14614
diff changeset
   656
    # Default to server for other variants.
14467
a973c0a1bd5d 8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents: 14465
diff changeset
   657
    if test "x$JVM_VARIANT_SERVER" = xtrue; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   658
      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
14467
a973c0a1bd5d 8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents: 14465
diff changeset
   659
    elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   660
      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client"
14810
4e7fee179b4a 7190137: Add support for JVM_VARIANT minimal1
dholmes
parents: 14614
diff changeset
   661
    elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   662
      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
14465
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
   663
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   664
      LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
14465
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
   665
    fi
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
   666
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   667
    LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   668
    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   669
      LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   670
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   671
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   672
    LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   673
    if test "x$OPENJDK_TARGET_OS" = xlinux; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   674
      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   675
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   676
  fi
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   677
  AC_SUBST(LDFLAGS_JDKLIB)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   678
  AC_SUBST(LDFLAGS_JDKEXE)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   679
  AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   680
  AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   681
  AC_SUBST(LDFLAGS_CXX_JDK)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   682
])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   683
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   684
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   685
# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   686
#                                   [RUN-IF-FALSE])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   687
# ------------------------------------------------------------
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   688
# Check that the c and c++ compilers support an argument
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   689
AC_DEFUN([FLAGS_COMPILER_CHECK_ARGUMENTS],
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   690
[
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   691
  AC_MSG_CHECKING([if compiler supports "$1"])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   692
  supports=yes
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   693
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   694
  saved_cflags="$CFLAGS"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   695
  CFLAGS="$CFLAGS $1"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   696
  AC_LANG_PUSH([C])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   697
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], 
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   698
      [supports=no])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   699
  AC_LANG_POP([C])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   700
  CFLAGS="$saved_cflags"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   701
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   702
  saved_cxxflags="$CXXFLAGS"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   703
  CXXFLAGS="$CXXFLAG $1"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   704
  AC_LANG_PUSH([C++])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   705
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], 
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   706
      [supports=no])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   707
  AC_LANG_POP([C++])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   708
  CXXFLAGS="$saved_cxxflags"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   709
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   710
  AC_MSG_RESULT([$supports])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   711
  if test "x$supports" = "xyes" ; then
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   712
    m4_ifval([$2], [$2], [:])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   713
  else
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   714
    m4_ifval([$3], [$3], [:])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   715
  fi
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   716
])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   717
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   718
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   719
[
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   720
  # Some Zero and Shark settings.
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   721
  # ZERO_ARCHFLAG tells the compiler which mode to build for
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   722
  case "${OPENJDK_TARGET_CPU}" in
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   723
    s390)
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   724
      ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31"
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   725
      ;;
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   726
    *)
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   727
      ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   728
  esac
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   729
  FLAGS_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   730
  AC_SUBST(ZERO_ARCHFLAG)
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   731
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   732
  # Check that the compiler supports -mX (or -qX on AIX) flags
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   733
  # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   734
  FLAGS_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   735
      [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   736
      [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   737
  AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   738
])