common/autoconf/toolchain.m4
author simonis
Thu, 12 Sep 2013 12:29:17 -0700
changeset 22466 25aaf85d1ada
parent 22465 51cc970b1b88
child 22467 b16a5ae55d50
permissions -rw-r--r--
8024265: Enable new build on AIX Reviewed-by: 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
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     2
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
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
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    26
# $1 = compiler to test (CC or CXX)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    27
# $2 = human readable name of compiler (C or C++)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    28
AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    29
[
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    30
  COMPILER=[$]$1
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    31
  COMPILER_NAME=$2
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    32
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    33
  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    34
    # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    35
    COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    36
    $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    37
    if test $? -ne 0; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    38
      GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
    39
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    40
      AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    41
      AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    42
      AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.])
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    43
    else
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    44
      COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/p"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    45
      COMPILER_VENDOR="Sun Studio"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    46
    fi
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    47
  elif test  "x$OPENJDK_TARGET_OS" = xaix; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    48
      COMPILER_VERSION_TEST=`$COMPILER -qversion  2>&1 | $TAIL -n 1`
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    49
      $ECHO $COMPILER_VERSION_TEST | $GREP "^Version: " > /dev/null
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    50
      if test $? -ne 0; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    51
        AC_MSG_ERROR([Failed to detect the compiler version of $COMPILER ....])
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    52
      else
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    53
        COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n 's/Version: \([0-9][0-9]\.[0-9][0-9]*\).*/\1/p'`
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    54
        COMPILER_VENDOR='IBM'
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
    55
      fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    56
  elif test  "x$OPENJDK_TARGET_OS" = xwindows; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    57
    # First line typically looks something like:
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    58
    # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
18423
5f706ddb73ed 8019229: Build Configuration Fail in Windows Platform
erikj
parents: 18421
diff changeset
    59
    COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    60
    COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    61
    COMPILER_VENDOR="Microsoft CL.EXE"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    62
    COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    63
    if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    64
      if test "x$COMPILER_CPU_TEST" != "x80x86"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    65
        AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    66
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    67
    elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    68
      if test "x$COMPILER_CPU_TEST" != "xx64"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    69
        AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    70
      fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    71
    fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    72
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    73
    COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    74
    # Check that this is likely to be GCC.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    75
    $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    76
    if test $? -ne 0; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    77
      AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler.])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    78
      AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    79
      AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.])
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
    80
    fi
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
    81
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    82
    # First line typically looks something like:
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    83
    # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    84
    COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/p"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    85
    COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) @<:@1-9@:>@@<:@0-9.@:>@*/\1/p"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    86
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    87
  # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    88
  $1_VERSION="$COMPILER_VERSION"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    89
  # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    90
  $1_VENDOR="$COMPILER_VENDOR"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    91
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    92
  AC_MSG_NOTICE([Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    93
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    94
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
    95
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    96
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    97
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    98
###############################################################################
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    99
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   100
# Configure the development tool paths and potential sysroot.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   101
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   102
AC_LANG(C++)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   103
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   104
# The option used to specify the target .o,.a or .so file.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   105
# When compiling, how to specify the to be created object file.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   106
CC_OUT_OPTION='-o$(SPACE)'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   107
# When linking, how to specify the to be created executable.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   108
EXE_OUT_OPTION='-o$(SPACE)'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   109
# When linking, how to specify the to be created dynamically linkable library.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   110
LD_OUT_OPTION='-o$(SPACE)'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   111
# When archiving, how to specify the to be create static archive for object files.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   112
AR_OUT_OPTION='rcs$(SPACE)'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   113
AC_SUBST(CC_OUT_OPTION)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   114
AC_SUBST(EXE_OUT_OPTION)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   115
AC_SUBST(LD_OUT_OPTION)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   116
AC_SUBST(AR_OUT_OPTION)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   117
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   118
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   119
# $1 = compiler to test (CC or CXX)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   120
# $2 = human readable name of compiler (C or C++)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   121
# $3 = list of compiler names to search for
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   122
AC_DEFUN([TOOLCHAIN_FIND_COMPILER],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   123
[
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   124
  COMPILER_NAME=$2
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   125
14614
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   126
  $1=
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   127
  # If TOOLS_DIR is set, check for all compiler names in there first
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   128
  # before checking the rest of the PATH.
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   129
  if test -n "$TOOLS_DIR"; then
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   130
    PATH_save="$PATH"
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   131
    PATH="$TOOLS_DIR"
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   132
    AC_PATH_PROGS(TOOLS_DIR_$1, $3)
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   133
    $1=$TOOLS_DIR_$1
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   134
    PATH="$PATH_save"
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   135
  fi
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   136
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   137
  # AC_PATH_PROGS can't be run multiple times with the same variable,
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   138
  # so create a new name for this run.
14614
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   139
  if test "x[$]$1" = x; then
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   140
    AC_PATH_PROGS(POTENTIAL_$1, $3)
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   141
    $1=$POTENTIAL_$1
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   142
  fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   143
14614
3bb0a6b81bb9 8003945: build-infra: problems finding compiler when using --with-dev-kit
erikj
parents: 14467
diff changeset
   144
  if test "x[$]$1" = x; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   145
      HELP_MSG_MISSING_DEPENDENCY([devkit])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   146
      AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   147
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   148
  BASIC_FIXUP_EXECUTABLE($1)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   149
  TEST_COMPILER="[$]$1"
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   150
  # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   151
  # to 'xlc' but it is crucial that we invoke the compiler with the right name!
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   152
  if test "x$OPENJDK_BUILD_OS" != xaix; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   153
    AC_MSG_CHECKING([resolved symbolic links for $1])
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   154
    BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER)
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   155
    AC_MSG_RESULT([$TEST_COMPILER])
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   156
  fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   157
  AC_MSG_CHECKING([if $1 is disguised ccache])
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
   158
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   159
  COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   160
  if test "x$COMPILER_BASENAME" = "xccache"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   161
    AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   162
    # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   163
    # We want to control ccache invocation ourselves, so ignore this cc and try
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   164
    # searching again.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   165
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   166
    # Remove the path to the fake ccache cc from the PATH
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   167
    RETRY_COMPILER_SAVED_PATH="$PATH"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   168
    COMPILER_DIRNAME=`$DIRNAME [$]$1`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   169
    PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   170
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   171
    # Try again looking for our compiler
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   172
    AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   173
    BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   174
    PATH="$RETRY_COMPILER_SAVED_PATH"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   175
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   176
    AC_MSG_CHECKING([for resolved symbolic links for $1])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   177
    BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   178
    AC_MSG_RESULT([$PROPER_COMPILER_$1])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   179
    $1="$PROPER_COMPILER_$1"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   180
  else
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   181
    AC_MSG_RESULT([no, keeping $1])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   182
    $1="$TEST_COMPILER"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   183
  fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   184
  TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   185
])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   186
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   187
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   188
AC_DEFUN([TOOLCHAIN_SETUP_PATHS],
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   189
[
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   190
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   191
  TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
15842
a33cf9e2d7d8 8008073: build-infra: Need --with-dxsdk option? And awt/sound -I option additions?
erikj
parents: 15786
diff changeset
   192
  TOOLCHAIN_SETUP_DXSDK
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   193
fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   194
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   195
AC_SUBST(MSVCR_DLL)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   196
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   197
# If --build AND --host is set, then the configure script will find any
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   198
# cross compilation tools in the PATH. Cross compilation tools
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   199
# follows the cross compilation standard where they are prefixed with ${host}.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   200
# For example the binary i686-sun-solaris2.10-gcc
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   201
# will cross compile for i686-sun-solaris2.10
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   202
# If neither of build and host is not set, then build=host and the
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   203
# default compiler found in the path will be used.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   204
# Setting only --host, does not seem to be really supported.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   205
# Please set both --build and --host if you want to cross compile.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   206
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   207
if test "x$COMPILE_TYPE" = "xcross"; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   208
    # Now we to find a C/C++ compiler that can build executables for the build
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   209
    # platform. We can't use the AC_PROG_CC macro, since it can only be used
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   210
    # once. Also, we need to do this before adding a tools dir to the path,
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   211
    # otherwise we might pick up cross-compilers which don't use standard naming.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   212
    # Otherwise, we'll set the BUILD_tools to the native tools, but that'll have
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   213
    # to wait until they are properly discovered.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   214
    AC_PATH_PROGS(BUILD_CC, [cl cc gcc])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   215
    BASIC_FIXUP_EXECUTABLE(BUILD_CC)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   216
    AC_PATH_PROGS(BUILD_CXX, [cl CC g++])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   217
    BASIC_FIXUP_EXECUTABLE(BUILD_CXX)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   218
    AC_PATH_PROG(BUILD_LD, ld)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   219
    BASIC_FIXUP_EXECUTABLE(BUILD_LD)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   220
fi
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   221
AC_SUBST(BUILD_CC)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   222
AC_SUBST(BUILD_CXX)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   223
AC_SUBST(BUILD_LD)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   224
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   225
# If a devkit is found on the builddeps server, then prepend its path to the
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   226
# PATH variable. If there are cross compilers available in the devkit, these
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   227
# will be found by AC_PROG_CC et al.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   228
DEVKIT=
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   229
BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   230
                    [# Found devkit
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   231
                     PATH="$DEVKIT/bin:$PATH"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   232
                     SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   233
                     if test "x$x_includes" = "xNONE"; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   234
                         x_includes="$SYS_ROOT/usr/include/X11"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   235
                     fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   236
                     if test "x$x_libraries" = "xNONE"; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   237
                         x_libraries="$SYS_ROOT/usr/lib"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   238
                     fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   239
                    ],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   240
                    [])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   241
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   242
# Store the CFLAGS etal passed to the configure script.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   243
ORG_CFLAGS="$CFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   244
ORG_CXXFLAGS="$CXXFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   245
ORG_OBJCFLAGS="$OBJCFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   246
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   247
# autoconf magic only relies on PATH, so update it if tools dir is specified
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   248
OLD_PATH="$PATH"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   249
if test "x$TOOLS_DIR" != x; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   250
  PATH=$TOOLS_DIR:$PATH
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   251
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   252
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   253
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   254
### Locate C compiler (CC)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   255
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   256
# On windows, only cl.exe is supported.
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   257
# On Solaris, cc is preferred to gcc.
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   258
# Elsewhere, gcc is preferred to cc.
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   259
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   260
if test "x$CC" != x; then
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   261
  COMPILER_CHECK_LIST="$CC"
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   262
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   263
  COMPILER_CHECK_LIST="cl"
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   264
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   265
  COMPILER_CHECK_LIST="cc gcc"
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   266
elif test "x$OPENJDK_TARGET_OS" = "xaix"; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   267
  # Do not probe for cc on AIX.
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   268
  COMPILER_CHECK_LIST="xlc_r"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   269
else
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   270
  COMPILER_CHECK_LIST="gcc cc"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   271
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   272
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   273
TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST])
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   274
# Now that we have resolved CC ourself, let autoconf have its go at it
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   275
AC_PROG_CC([$CC])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   276
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   277
# Option used to tell the compiler whether to create 32- or 64-bit executables
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   278
# Notice that CC contains the full compiler path at this point.
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   279
case $CC in
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   280
  *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";;
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   281
  *)      COMPILER_TARGET_BITS_FLAG="-m";;
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   282
esac
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   283
AC_SUBST(COMPILER_TARGET_BITS_FLAG)
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   284
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   285
### Locate C++ compiler (CXX)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   286
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   287
if test "x$CXX" != x; then
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   288
  COMPILER_CHECK_LIST="$CXX"
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   289
elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   290
  COMPILER_CHECK_LIST="cl"
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   291
elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   292
  COMPILER_CHECK_LIST="CC g++"
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   293
elif test "x$OPENJDK_TARGET_OS" = "xaix"; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   294
  # Do not probe for CC on AIX .
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   295
  COMPILER_CHECK_LIST="xlC_r"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   296
else
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   297
  COMPILER_CHECK_LIST="g++ CC"
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   298
fi
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   299
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   300
TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST])
15906
3c42874d7148 8006988: build-infra: Configure fails if 'cl' is in path on linux
martin
parents: 15581
diff changeset
   301
# Now that we have resolved CXX ourself, let autoconf have its go at it
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   302
AC_PROG_CXX([$CXX])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   303
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   304
### Locate other tools
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   305
14112
1b447f5cb0d1 8001897: build-infra: misc adjustments to configure script
ihse
parents: 14111
diff changeset
   306
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   307
    AC_PROG_OBJC
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   308
    BASIC_FIXUP_EXECUTABLE(OBJC)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   309
else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   310
    OBJC=
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   311
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   312
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   313
# Restore the flags to the user specified values.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   314
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   315
CFLAGS="$ORG_CFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   316
CXXFLAGS="$ORG_CXXFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   317
OBJCFLAGS="$ORG_OBJCFLAGS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   318
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   319
LD="$CC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   320
LDEXE="$CC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   321
LDCXX="$CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   322
LDEXECXX="$CXX"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   323
AC_SUBST(LD)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   324
# LDEXE is the linker to use, when creating executables.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   325
AC_SUBST(LDEXE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   326
# Linking C++ libraries.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   327
AC_SUBST(LDCXX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   328
# Linking C++ executables.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   329
AC_SUBST(LDEXECXX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   330
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   331
if test "x$OPENJDK_TARGET_OS" != xwindows; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   332
    AC_CHECK_TOOL(AR, ar)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   333
    BASIC_FIXUP_EXECUTABLE(AR)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   334
fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   335
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   336
    ARFLAGS="-r"
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   337
elif test "x$OPENJDK_TARGET_OS" = xaix; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   338
    ARFLAGS="-X64"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   339
else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   340
    ARFLAGS=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   341
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   342
AC_SUBST(ARFLAGS)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   343
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   344
# For hotspot, we need these in Windows mixed path; other platforms keep them the same
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   345
HOTSPOT_CXX="$CXX"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   346
HOTSPOT_LD="$LD"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   347
AC_SUBST(HOTSPOT_CXX)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   348
AC_SUBST(HOTSPOT_LD)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   349
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   350
COMPILER_NAME=gcc
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   351
COMPILER_TYPE=CC
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   352
AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
   353
    # For now, assume that we are always compiling using cl.exe.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   354
    CC_OUT_OPTION=-Fo
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   355
    EXE_OUT_OPTION=-out:
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   356
    LD_OUT_OPTION=-out:
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   357
    AR_OUT_OPTION=-out:
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   358
    # On Windows, reject /usr/bin/link (as determined in CYGWIN_LINK), which is a cygwin
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   359
    # program for something completely different.
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   360
    AC_CHECK_PROG([WINLD], [link],[link],,, [$CYGWIN_LINK])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   361
    # Since we must ignore the first found link, WINLD will contain
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   362
    # the full path to the link.exe program.
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   363
    BASIC_FIXUP_EXECUTABLE(WINLD)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   364
    printf "Windows linker was found at $WINLD\n"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   365
    AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   366
    "$WINLD" --version > /dev/null
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   367
    if test $? -eq 0 ; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   368
      AC_MSG_RESULT([no])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   369
      AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   370
    else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   371
      AC_MSG_RESULT([yes])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   372
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   373
    LD="$WINLD"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   374
    LDEXE="$WINLD"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   375
    LDCXX="$WINLD"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   376
    LDEXECXX="$WINLD"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   377
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   378
    AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   379
    BASIC_FIXUP_EXECUTABLE(MT)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   380
    # The resource compiler
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   381
    AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc])
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   382
    BASIC_FIXUP_EXECUTABLE(RC)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   383
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   384
    # For hotspot, we need these in Windows mixed path,
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   385
    # so rewrite them all. Need added .exe suffix.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   386
    HOTSPOT_CXX="$CXX.exe"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   387
    HOTSPOT_LD="$LD.exe"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   388
    HOTSPOT_MT="$MT.exe"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   389
    HOTSPOT_RC="$RC.exe"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   390
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   391
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   392
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   393
    BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   394
    AC_SUBST(HOTSPOT_MT)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   395
    AC_SUBST(HOTSPOT_RC)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   396
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   397
    RC_FLAGS="-nologo -l 0x409 -r"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   398
    AS_IF([test "x$VARIANT" = xOPT], [
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   399
        RC_FLAGS="$RC_FLAGS -d NDEBUG"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   400
    ])
18426
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   401
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   402
    # The version variables used to create RC_FLAGS may be overridden
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   403
    # in a custom configure script, or possibly the command line.
18426
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   404
    # Let those variables be expanded at make time in spec.gmk.
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   405
    # The \$ are escaped to the shell, and the $(...) variables
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   406
    # are evaluated by make.
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   407
    RC_FLAGS="$RC_FLAGS \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   408
        -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   409
        -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   410
        -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   411
        -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   412
        -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   413
        -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
bf9e616c1476 8009744: build-infra: REGRESSION: Publisher was NOT set for some JDK files
erikj
parents: 18423
diff changeset
   414
        -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   415
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   416
    # lib.exe is used to create static libraries.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   417
    AC_CHECK_PROG([WINAR], [lib],[lib],,,)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   418
    BASIC_FIXUP_EXECUTABLE(WINAR)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   419
    AR="$WINAR"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   420
    ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   421
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   422
    AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   423
    BASIC_FIXUP_EXECUTABLE(DUMPBIN)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   424
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   425
    COMPILER_TYPE=CL
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   426
    CCXXFLAGS="$CCXXFLAGS -nologo"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   427
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   428
AC_SUBST(RC_FLAGS)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   429
AC_SUBST(COMPILER_TYPE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   430
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   431
AC_PROG_CPP
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   432
BASIC_FIXUP_EXECUTABLE(CPP)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   433
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   434
AC_PROG_CXXCPP
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   435
BASIC_FIXUP_EXECUTABLE(CXXCPP)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   436
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   437
if test "x$COMPILE_TYPE" != "xcross"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   438
    # If we are not cross compiling, use the same compilers for
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   439
    # building the build platform executables. The cross-compilation
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   440
    # case needed to be done earlier, but this can only be done after
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   441
    # the native tools have been localized.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   442
    BUILD_CC="$CC"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   443
    BUILD_CXX="$CXX"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   444
    BUILD_LD="$LD"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   445
fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   446
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   447
# for solaris we really need solaris tools, and not gnu equivalent
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   448
#   these seems to normally reside in /usr/ccs/bin so add that to path before
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   449
#   starting to probe
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   450
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   451
#   NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   452
#         so that it can be overriden --with-tools-dir
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   453
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   454
    PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   455
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   456
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   457
# Find the right assembler.
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   458
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   459
    AC_PATH_PROG(AS, as)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   460
    BASIC_FIXUP_EXECUTABLE(AS)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   461
else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   462
    AS="$CC -c"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   463
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   464
AC_SUBST(AS)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   465
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   466
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
16582
61f0b8f48036 8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents: 15912
diff changeset
   467
    AC_PATH_PROG(NM, nm)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   468
    BASIC_FIXUP_EXECUTABLE(NM)
16582
61f0b8f48036 8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents: 15912
diff changeset
   469
    AC_PATH_PROG(GNM, gnm)
61f0b8f48036 8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents: 15912
diff changeset
   470
    BASIC_FIXUP_EXECUTABLE(GNM)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   471
    AC_PATH_PROG(STRIP, strip)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   472
    BASIC_FIXUP_EXECUTABLE(STRIP)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   473
    AC_PATH_PROG(MCS, mcs)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   474
    BASIC_FIXUP_EXECUTABLE(MCS)
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   475
elif test "x$OPENJDK_TARGET_OS" != xwindows; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   476
    AC_CHECK_TOOL(NM, nm)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   477
    BASIC_FIXUP_EXECUTABLE(NM)
16582
61f0b8f48036 8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents: 15912
diff changeset
   478
    GNM="$NM"
61f0b8f48036 8006288: build-infra: Use solaris nm and not gnm on solaris
erikj
parents: 15912
diff changeset
   479
    AC_SUBST(GNM)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   480
    AC_CHECK_TOOL(STRIP, strip)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   481
    BASIC_FIXUP_EXECUTABLE(STRIP)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   482
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   483
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   484
# objcopy is used for moving debug symbols to separate files when
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   485
# full debug symbols are enabled.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   486
if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   487
    AC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy])
14464
b82a851468d0 8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents: 14112
diff changeset
   488
    # Only call fixup if objcopy was found.
b82a851468d0 8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents: 14112
diff changeset
   489
    if test -n "$OBJCOPY"; then
b82a851468d0 8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents: 14112
diff changeset
   490
        BASIC_FIXUP_EXECUTABLE(OBJCOPY)
b82a851468d0 8003300: build-infra: fails on solaris when objcopy is not found
tbell
parents: 14112
diff changeset
   491
    fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   492
fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   493
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   494
AC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump])
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   495
if test "x$OBJDUMP" != x; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   496
  # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   497
  BASIC_FIXUP_EXECUTABLE(OBJDUMP)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   498
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   499
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   500
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   501
   AC_PATH_PROG(LIPO, lipo)
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   502
   BASIC_FIXUP_EXECUTABLE(LIPO)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   503
fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   504
17593
de6741d8a142 8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents: 16988
diff changeset
   505
TOOLCHAIN_SETUP_JTREG
de6741d8a142 8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents: 16988
diff changeset
   506
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   507
# Restore old path without tools dir
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   508
PATH="$OLD_PATH"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   509
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   510
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   511
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   512
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   513
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   514
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   515
###############################################################################
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   516
#
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
   517
# How to compile shared libraries.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   518
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   519
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   520
if test "x$GCC" = xyes; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   521
    COMPILER_NAME=gcc
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   522
    PICFLAG="-fPIC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   523
    LIBRARY_PREFIX=lib
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   524
    SHARED_LIBRARY='lib[$]1.so'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   525
    STATIC_LIBRARY='lib[$]1.a'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   526
    SHARED_LIBRARY_FLAGS="-shared"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   527
    SHARED_LIBRARY_SUFFIX='.so'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   528
    STATIC_LIBRARY_SUFFIX='.a'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   529
    OBJ_SUFFIX='.o'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   530
    EXE_SUFFIX=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   531
    SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   532
    SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   533
    C_FLAG_REORDER=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   534
    CXX_FLAG_REORDER=''
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   535
    SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   536
    SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   537
    LD="$CC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   538
    LDEXE="$CC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   539
    LDCXX="$CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   540
    LDEXECXX="$CXX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   541
    POST_STRIP_CMD="$STRIP -g"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   542
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   543
    # Linking is different on MacOSX
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   544
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   545
        # Might change in the future to clang.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   546
        COMPILER_NAME=gcc
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   547
        SHARED_LIBRARY='lib[$]1.dylib'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   548
        SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   549
        SHARED_LIBRARY_SUFFIX='.dylib'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   550
        EXE_SUFFIX=''
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
   551
        SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   552
        SET_SHARED_LIBRARY_MAPFILE=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   553
        SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   554
        SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   555
        POST_STRIP_CMD="$STRIP -S"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   556
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   557
else
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   558
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   559
        # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   560
        COMPILER_NAME=ossc
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   561
        PICFLAG="-KPIC"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   562
        LIBRARY_PREFIX=lib
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   563
        SHARED_LIBRARY='lib[$]1.so'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   564
        STATIC_LIBRARY='lib[$]1.a'
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   565
        SHARED_LIBRARY_FLAGS="-G"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   566
        SHARED_LIBRARY_SUFFIX='.so'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   567
        STATIC_LIBRARY_SUFFIX='.a'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   568
        OBJ_SUFFIX='.o'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   569
        EXE_SUFFIX=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   570
        SET_SHARED_LIBRARY_NAME=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   571
        SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   572
	C_FLAG_REORDER='-xF'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   573
	CXX_FLAG_REORDER='-xF'
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   574
        SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1'
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   575
        SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   576
        CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   577
        CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   578
        CFLAGS_JDKLIB_EXTRA='-xstrconst'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   579
        POST_STRIP_CMD="$STRIP -x"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   580
        POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   581
    fi
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   582
    if test "x$OPENJDK_TARGET_OS" = xaix; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   583
        COMPILER_NAME=xlc
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   584
        PICFLAG="-qpic=large"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   585
        LIBRARY_PREFIX=lib
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   586
        SHARED_LIBRARY='lib[$]1.so'
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   587
        STATIC_LIBRARY='lib[$]1.a'
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   588
        SHARED_LIBRARY_FLAGS="-qmkshrobj"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   589
        SHARED_LIBRARY_SUFFIX='.so'
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   590
        STATIC_LIBRARY_SUFFIX='.a'
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   591
        OBJ_SUFFIX='.o'
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   592
        EXE_SUFFIX=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   593
        SET_SHARED_LIBRARY_NAME=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   594
        SET_SHARED_LIBRARY_MAPFILE=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   595
        C_FLAG_REORDER=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   596
        CXX_FLAG_REORDER=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   597
        SET_SHARED_LIBRARY_ORIGIN=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   598
        SET_EXECUTABLE_ORIGIN=""
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   599
        CFLAGS_JDK=""
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   600
        CXXFLAGS_JDK=""
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   601
        CFLAGS_JDKLIB_EXTRA=''
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   602
        POST_STRIP_CMD="$STRIP -X32_64"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   603
        POST_MCS_CMD=""
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   604
    fi
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   605
    if test "x$OPENJDK_TARGET_OS" = xwindows; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   606
        # If it is not gcc, then assume it is the MS Visual Studio compiler
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   607
        COMPILER_NAME=cl
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   608
        PICFLAG=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   609
        LIBRARY_PREFIX=
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   610
        SHARED_LIBRARY='[$]1.dll'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   611
        STATIC_LIBRARY='[$]1.lib'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   612
        SHARED_LIBRARY_FLAGS="-LD"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   613
        SHARED_LIBRARY_SUFFIX='.dll'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   614
        STATIC_LIBRARY_SUFFIX='.lib'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   615
        OBJ_SUFFIX='.obj'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   616
        EXE_SUFFIX='.exe'
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   617
        SET_SHARED_LIBRARY_NAME=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   618
        SET_SHARED_LIBRARY_MAPFILE=''
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   619
        SET_SHARED_LIBRARY_ORIGIN=''
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   620
        SET_EXECUTABLE_ORIGIN=''
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   621
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   622
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   623
16988
53de314b1c30 8011687: Support correct dependencies from header files on windows and solaris
erikj
parents: 16987
diff changeset
   624
AC_SUBST(COMPILER_NAME)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   625
AC_SUBST(OBJ_SUFFIX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   626
AC_SUBST(SHARED_LIBRARY)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   627
AC_SUBST(STATIC_LIBRARY)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   628
AC_SUBST(LIBRARY_PREFIX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   629
AC_SUBST(SHARED_LIBRARY_SUFFIX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   630
AC_SUBST(STATIC_LIBRARY_SUFFIX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   631
AC_SUBST(EXE_SUFFIX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   632
AC_SUBST(SHARED_LIBRARY_FLAGS)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   633
AC_SUBST(SET_SHARED_LIBRARY_NAME)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   634
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   635
AC_SUBST(C_FLAG_REORDER)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   636
AC_SUBST(CXX_FLAG_REORDER)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   637
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   638
AC_SUBST(SET_EXECUTABLE_ORIGIN)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   639
AC_SUBST(POST_STRIP_CMD)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   640
AC_SUBST(POST_MCS_CMD)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   641
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   642
# The (cross) compiler is now configured, we can now test capabilities
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   643
# of the target platform.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   644
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   645
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   646
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   647
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   648
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   649
###############################################################################
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   650
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   651
# Setup the opt flags for different compilers
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   652
# and different operating systems.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   653
#
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   654
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   655
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   656
# NOTE: check for -mstackrealign needs to be below potential addition of -m32
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   657
#
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   658
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   659
    # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   660
    # While waiting for a better solution, the current workaround is to use -mstackrealign.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   661
    CFLAGS="$CFLAGS -mstackrealign"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   662
    AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   663
    AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   664
                   [
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   665
		        AC_MSG_RESULT([yes])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   666
                   ],
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   667
	           [
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   668
		        AC_MSG_RESULT([no])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   669
	                AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   670
	           ])
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   671
fi
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   672
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   673
C_FLAG_DEPS="-MMD -MF"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   674
CXX_FLAG_DEPS="-MMD -MF"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   675
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   676
case $COMPILER_TYPE in
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   677
  CC )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   678
    case $COMPILER_NAME in
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   679
      gcc )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   680
      	case $OPENJDK_TARGET_OS in
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   681
	  macosx )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   682
	    # On MacOSX we optimize for size, something
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   683
	    # we should do for all platforms?
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   684
	    C_O_FLAG_HI="-Os"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   685
	    C_O_FLAG_NORM="-Os"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   686
	    C_O_FLAG_NONE=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   687
	    ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   688
	  *)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   689
	    C_O_FLAG_HI="-O3"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   690
	    C_O_FLAG_NORM="-O2"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   691
	    C_O_FLAG_NONE="-O0"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   692
	    ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   693
	esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   694
        CXX_O_FLAG_HI="$C_O_FLAG_HI"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   695
        CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   696
        CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
18020
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   697
        CFLAGS_DEBUG_SYMBOLS="-g"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   698
        CXXFLAGS_DEBUG_SYMBOLS="-g"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   699
        if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   700
            CFLAGS_DEBUG_SYMBOLS="-g1"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   701
            CXXFLAGS_DEBUG_SYMBOLS="-g1"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   702
        fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   703
        ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   704
      ossc )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   705
        #
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   706
        # Forte has different names for this with their C++ compiler...
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   707
        #
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   708
        C_FLAG_DEPS="-xMMD -xMF"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   709
        CXX_FLAG_DEPS="-xMMD -xMF"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   710
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   711
        # Extra options used with HIGHEST
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   712
        #
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   713
        # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   714
        #          done with care, there are some assumptions below that need to
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   715
        #          be understood about the use of pointers, and IEEE behavior.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   716
        #
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   717
        # Use non-standard floating point mode (not IEEE 754)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   718
        CC_HIGHEST="$CC_HIGHEST -fns"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   719
        # Do some simplification of floating point arithmetic (not IEEE 754)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   720
        CC_HIGHEST="$CC_HIGHEST -fsimple"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   721
        # Use single precision floating point with 'float'
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   722
        CC_HIGHEST="$CC_HIGHEST -fsingle"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   723
        # Assume memory references via basic pointer types do not alias
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
   724
        #   (Source with excessing pointer casting and data access with mixed
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   725
        #    pointer types are not recommended)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   726
        CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   727
        # Use intrinsic or inline versions for math/std functions
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   728
        #   (If you expect perfect errno behavior, do not use this)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   729
        CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   730
        # Loop data dependency optimizations (need -xO3 or higher)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   731
        CC_HIGHEST="$CC_HIGHEST -xdepend"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   732
        # Pointer parameters to functions do not overlap
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   733
        #   (Similar to -xalias_level=basic usage, but less obvious sometimes.
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   734
        #    If you pass in multiple pointers to the same data, do not use this)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   735
        CC_HIGHEST="$CC_HIGHEST -xrestrict"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   736
        # Inline some library routines
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   737
        #   (If you expect perfect errno behavior, do not use this)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   738
        CC_HIGHEST="$CC_HIGHEST -xlibmil"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   739
        # Use optimized math routines
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   740
        #   (If you expect perfect errno behavior, do not use this)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   741
        #  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   742
        #CC_HIGHEST="$CC_HIGHEST -xlibmopt"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   743
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   744
        if test "x$OPENJDK_TARGET_CPU" = xsparc; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   745
          CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   746
          CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   747
        fi
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   748
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   749
        case $OPENJDK_TARGET_CPU_ARCH in
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   750
          x86)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   751
            C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   752
            C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   753
            C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   754
            C_O_FLAG_NONE="-xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   755
            CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   756
            CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   757
            CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   758
            CXX_O_FLAG_NONE="-xregs=no%frameptr"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   759
            if test "x$OPENJDK_TARGET_CPU" = xx86; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   760
               C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   761
               CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   762
            fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   763
            ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   764
          sparc)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   765
            CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   766
            CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   767
            C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   768
            C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   769
            C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   770
            C_O_FLAG_NONE=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   771
            CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   772
            CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   773
            CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   774
            CXX_O_FLAG_NONE=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   775
            ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   776
        esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   777
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   778
        CFLAGS_DEBUG_SYMBOLS="-g -xs"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   779
        CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   780
        ;;
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   781
      xlc )
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   782
        C_FLAG_DEPS="-qmakedep=gcc -MF"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   783
        CXX_FLAG_DEPS="-qmakedep=gcc -MF"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   784
        C_O_FLAG_HIGHEST="-O3"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   785
        C_O_FLAG_HI="-O3 -qstrict"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   786
        C_O_FLAG_NORM="-O2"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   787
        C_O_FLAG_NONE=""
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   788
        CXX_O_FLAG_HIGHEST="-O3"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   789
        CXX_O_FLAG_HI="-O3 -qstrict"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   790
        CXX_O_FLAG_NORM="-O2"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   791
        CXX_O_FLAG_NONE=""
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   792
        CFLAGS_DEBUG_SYMBOLS="-g"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   793
        CXXFLAGS_DEBUG_SYMBOLS="-g"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   794
        LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   795
        CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   796
        CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   797
        ;;
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   798
    esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   799
    ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   800
  CL )
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   801
    C_O_FLAG_HIGHEST="-O2"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   802
    C_O_FLAG_HI="-O1"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   803
    C_O_FLAG_NORM="-O1"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   804
    C_O_FLAG_NONE="-Od"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   805
    CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   806
    CXX_O_FLAG_HI="$C_O_FLAG_HI"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   807
    CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   808
    CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   809
    ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   810
esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   811
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   812
if test -z "$C_O_FLAG_HIGHEST"; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   813
   C_O_FLAG_HIGHEST="$C_O_FLAG_HI"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   814
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   815
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   816
if test -z "$CXX_O_FLAG_HIGHEST"; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   817
   CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   818
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   819
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   820
AC_SUBST(C_O_FLAG_HIGHEST)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   821
AC_SUBST(C_O_FLAG_HI)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   822
AC_SUBST(C_O_FLAG_NORM)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   823
AC_SUBST(C_O_FLAG_NONE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   824
AC_SUBST(CXX_O_FLAG_HIGHEST)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   825
AC_SUBST(CXX_O_FLAG_HI)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   826
AC_SUBST(CXX_O_FLAG_NORM)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   827
AC_SUBST(CXX_O_FLAG_NONE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   828
AC_SUBST(C_FLAG_DEPS)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   829
AC_SUBST(CXX_FLAG_DEPS)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   830
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   831
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   832
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   833
[
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   834
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   835
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   836
   AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   837
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   838
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   839
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   840
   AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   841
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   842
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   843
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   844
   AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   845
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   846
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   847
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   848
    [extra flags to be used when compiling jdk c-files])])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   849
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   850
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   851
    [extra flags to be used when compiling jdk c++-files])])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   852
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   853
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   854
    [extra flags to be used when linking jdk])])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   855
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   856
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   857
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   858
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   859
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   860
# Hotspot needs these set in their legacy form
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   861
LEGACY_EXTRA_CFLAGS=$with_extra_cflags
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   862
LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   863
LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   864
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   865
AC_SUBST(LEGACY_EXTRA_CFLAGS)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   866
AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   867
AC_SUBST(LEGACY_EXTRA_LDFLAGS)
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   868
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   869
###############################################################################
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   870
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   871
# Now setup the CFLAGS and LDFLAGS for the JDK build.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   872
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   873
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   874
case $COMPILER_NAME in
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   875
      gcc )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   876
      	  CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   877
                          -pipe \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   878
                          -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   879
	  case $OPENJDK_TARGET_CPU_ARCH in
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   880
	  arm )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   881
            # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   882
	    CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   883
	  ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   884
	  ppc )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   885
            # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   886
	  ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   887
	  * )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   888
	    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   889
	    CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   890
          ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   891
	  esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   892
          ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   893
      ossc )
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   894
          CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   895
          case $OPENJDK_TARGET_CPU_ARCH in
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   896
          x86 )
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   897
            CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   898
       	    CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   899
          ;;
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   900
          esac
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   901
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   902
      	  CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   903
      	  CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   904
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   905
          LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   906
          LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   907
          ;;
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   908
      xlc )
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   909
          CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   910
          CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   911
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   912
          LDFLAGS_JDK="$LDFLAGS_JDK"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   913
          LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   914
          ;;
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   915
      cl )
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   916
          CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   917
               -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   918
	       -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   919
	       -DWIN32 -DIAL"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   920
          case $OPENJDK_TARGET_CPU in
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   921
              x86 )
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   922
                  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   923
                  ;;
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   924
              x86_64 )
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   925
                  CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   926
                  ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   927
          esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   928
          ;;
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   929
esac
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   930
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   931
###############################################################################
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   932
18020
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   933
# Adjust flags according to debug level.
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   934
case $DEBUG_LEVEL in
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   935
      fastdebug )
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   936
              CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   937
              CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   938
	      C_O_FLAG_HI="$C_O_FLAG_NORM"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   939
	      C_O_FLAG_NORM="$C_O_FLAG_NORM"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   940
	      CXX_O_FLAG_HI="$CXX_O_FLAG_NORM"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   941
	      CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   942
              JAVAC_FLAGS="$JAVAC_FLAGS -g"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   943
              ;;
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   944
      slowdebug )
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   945
              CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   946
              CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   947
	      C_O_FLAG_HI="$C_O_FLAG_NONE"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   948
	      C_O_FLAG_NORM="$C_O_FLAG_NONE"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   949
	      CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   950
	      CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   951
              JAVAC_FLAGS="$JAVAC_FLAGS -g"
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   952
              ;;
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   953
esac
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   954
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   955
CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   956
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   957
# The package path is used only on macosx?
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   958
PACKAGE_PATH=/opt/local
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   959
AC_SUBST(PACKAGE_PATH)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   960
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   961
if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   962
    # 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
   963
    #   Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   964
    #   (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
   965
    #   Note: -Dmacro         is the same as    #define macro 1
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   966
    #         -Dmacro=	    is the same as    #define macro
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   967
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   968
        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   969
    else
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   970
        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   971
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   972
else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   973
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   974
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   975
if test "x$OPENJDK_TARGET_OS" = xlinux; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   976
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   977
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   978
if test "x$OPENJDK_TARGET_OS" = xwindows; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   979
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   980
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   981
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   982
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   983
fi
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   984
if test "x$OPENJDK_TARGET_OS" = xaix; then
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   985
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DAIX -DPPC64"
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
   986
fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   987
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
19311
741980fe0b33 8021820: Number of opened files used in select() is limited to 1024 [macosx]
aefimov
parents: 18426
diff changeset
   988
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
   989
    # Setting these parameters makes it an error to link to macosx APIs that are
15786
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   990
    # newer than the given OS version and makes the linked binaries compatible even
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   991
    # if built on a newer version of the OS.
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   992
    # The expected format is X.Y.Z
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   993
    MACOSX_VERSION_MIN=10.7.0
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   994
    AC_SUBST(MACOSX_VERSION_MIN)
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   995
    # The macro takes the version with no dots, ex: 1070
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   996
    # Let the flags variables get resolved in make for easier override on make
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   997
    # command line.
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   998
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
abd76d7cd807 8008451: Make mac builds on 10.8 work on 10.7
erikj
parents: 15581
diff changeset
   999
    LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1000
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1001
if test "x$OPENJDK_TARGET_OS" = xbsd; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1002
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1003
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1004
if test "x$DEBUG_LEVEL" = xrelease; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1005
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1006
    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1007
        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1008
    fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1009
else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1010
    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1011
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1012
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1013
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1014
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1015
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1016
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1017
        -I${JDK_OUTPUTDIR}/include \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1018
        -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1019
        -I${JDK_TOPDIR}/src/share/javavm/export \
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1020
        -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1021
        -I${JDK_TOPDIR}/src/share/native/common \
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1022
        -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
  1023
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1024
# The shared libraries are compiled using the picflag.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1025
CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1026
CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1027
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1028
# Executable flags
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1029
CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1030
CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1031
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1032
# Now this is odd. The JDK native libraries have to link against libjvm.so
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1033
# On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1034
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1035
# is identical for client and server? Yes. Which is picked at runtime (client or server)?
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1036
# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1037
# libraries will link to whatever is in memory. Yuck.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1038
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1039
# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1040
if test "x$COMPILER_NAME" = xcl; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1041
    LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1042
    if test "x$OPENJDK_TARGET_CPU" = xx86; then
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1043
        LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1044
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1045
    # TODO: make -debug optional "--disable-full-debug-symbols"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1046
    LDFLAGS_JDK="$LDFLAGS_JDK -debug"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1047
    LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1048
    LDFLAGS_JDKLIB_SUFFIX=""
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1049
    if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1050
        LDFLAGS_STACK_SIZE=1048576
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1051
    else
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1052
        LDFLAGS_STACK_SIZE=327680
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1053
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1054
    LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1055
else
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1056
    if test "x$COMPILER_NAME" = xgcc; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1057
        # If this is a --hash-style=gnu system, use --hash-style=both, why?
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1058
        HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1059
        if test -n "$HAS_GNU_HASH"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1060
            LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both "
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1061
        fi
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1062
        if test "x$OPENJDK_TARGET_OS" = xlinux; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1063
          # And since we now know that the linker is gnu, then add -z defs, to forbid
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1064
          # undefined symbols in object files.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1065
          LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1066
          if test "x$DEBUG_LEVEL" = "xrelease"; then
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1067
              # When building release libraries, tell the linker optimize them.
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1068
              # Should this be supplied to the OSS linker as well?
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1069
              LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
  1070
          fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1071
        fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1072
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1073
    LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1074
                    -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1075
14465
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
  1076
    # 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
  1077
    # 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
  1078
    # 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
  1079
    # Default to server for other variants.
14467
a973c0a1bd5d 8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents: 14465
diff changeset
  1080
    if test "x$JVM_VARIANT_SERVER" = xtrue; then
a973c0a1bd5d 8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents: 14465
diff changeset
  1081
        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
a973c0a1bd5d 8003528: build-infra: Diffs in libjava and hotspot libs on solaris.
erikj
parents: 14465
diff changeset
  1082
    elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
14465
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
  1083
        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
  1084
    elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
4e7fee179b4a 7190137: Add support for JVM_VARIANT minimal1
dholmes
parents: 14614
diff changeset
  1085
        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
  1086
    else
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
  1087
        LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server"
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
  1088
    fi
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
  1089
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1090
    LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1091
    if test "x$COMPILER_NAME" = xossc; then
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1092
        LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1093
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1094
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1095
    LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1096
    if test "x$OPENJDK_TARGET_OS" = xlinux; then
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1097
        LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1098
    fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1099
fi
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1100
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1101
AC_SUBST(CFLAGS_JDKLIB)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1102
AC_SUBST(CFLAGS_JDKEXE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1103
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1104
AC_SUBST(CXXFLAGS_JDKLIB)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1105
AC_SUBST(CXXFLAGS_JDKEXE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1106
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1107
AC_SUBST(LDFLAGS_JDKLIB)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1108
AC_SUBST(LDFLAGS_JDKEXE)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1109
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1110
AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
  1111
AC_SUBST(LDFLAGS_CXX_JDK)
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
  1112
])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1113
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1114
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1115
# TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE],
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1116
#                                   [RUN-IF-FALSE])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1117
# ------------------------------------------------------------
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1118
# Check that the c and c++ compilers support an argument
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1119
AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS],
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1120
[
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1121
  AC_MSG_CHECKING([if compiler supports "$1"])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1122
  supports=yes
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1123
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1124
  saved_cflags="$CFLAGS"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1125
  CFLAGS="$CFLAGS $1"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1126
  AC_LANG_PUSH([C])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1127
  AC_COMPILE_IFELSE([
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1128
    AC_LANG_SOURCE([[int i;]])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1129
  ], [], [supports=no])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1130
  AC_LANG_POP([C])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1131
  CFLAGS="$saved_cflags"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1132
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1133
  saved_cxxflags="$CXXFLAGS"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1134
  CXXFLAGS="$CXXFLAG $1"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1135
  AC_LANG_PUSH([C++])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1136
  AC_COMPILE_IFELSE([
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1137
    AC_LANG_SOURCE([[int i;]])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1138
  ], [], [supports=no])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1139
  AC_LANG_POP([C++])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1140
  CXXFLAGS="$saved_cxxflags"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1141
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1142
  AC_MSG_RESULT([$supports])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1143
  if test "x$supports" = "xyes" ; then
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1144
    m4_ifval([$2], [$2], [:])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1145
  else
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1146
    m4_ifval([$3], [$3], [:])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1147
  fi
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1148
])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1149
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1150
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC],
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1151
[
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1152
  # Some Zero and Shark settings.
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1153
  # ZERO_ARCHFLAG tells the compiler which mode to build for
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1154
  case "${OPENJDK_TARGET_CPU}" in
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1155
    s390)
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
  1156
      ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31"
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1157
      ;;
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1158
    *)
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
  1159
      ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}"
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1160
  esac
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1161
  TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1162
  AC_SUBST(ZERO_ARCHFLAG)
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1163
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
  1164
  # 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
  1165
  # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
  1166
  TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1167
    [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1168
    [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1169
  AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
22460
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1170
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1171
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1172
  # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed in executable.'
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1173
  USING_BROKEN_SUSE_LD=no
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1174
  if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$GCC" = xyes; then
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1175
    AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1176
    echo "SUNWprivate_1.1 { local: *; };" > version-script.map
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1177
    echo "int main() { }" > main.c
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1178
    if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1179
      AC_MSG_RESULT(no)
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1180
      USING_BROKEN_SUSE_LD=no
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1181
    else
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1182
      AC_MSG_RESULT(yes)
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1183
      USING_BROKEN_SUSE_LD=yes
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1184
    fi
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1185
    rm -rf version-script.map main.c
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1186
  fi
0273c023680c 8017568: PPC64: Generic build preparations needed to enable new build on Linux/PPC64
simonis
parents: 18020
diff changeset
  1187
  AC_SUBST(USING_BROKEN_SUSE_LD)
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1188
])
17593
de6741d8a142 8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents: 16988
diff changeset
  1189
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1190
# Setup the JTREG paths
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1191
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1192
[
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1193
  AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg],
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1194
  [Regression Test Harness @<:@probed@:>@])],
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1195
  [],
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1196
  [with_jtreg=no])
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1197
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1198
  if test "x$with_jtreg" = xno; then
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1199
    # jtreg disabled
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1200
    AC_MSG_CHECKING([for jtreg])
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1201
    AC_MSG_RESULT(no)
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1202
  else
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1203
    if test "x$with_jtreg" != xyes; then
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1204
      # with path specified.
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1205
      JT_HOME="$with_jtreg"
17593
de6741d8a142 8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents: 16988
diff changeset
  1206
    fi
17664
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1207
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1208
    if test "x$JT_HOME" != x; then
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1209
      AC_MSG_CHECKING([for jtreg])
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1210
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1211
      # use JT_HOME enviroment var.
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1212
      BASIC_FIXUP_PATH([JT_HOME])
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1213
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1214
      # jtreg win32 script works for everybody
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1215
      JTREGEXE="$JT_HOME/win32/bin/jtreg"
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1216
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1217
      if test ! -f "$JTREGEXE"; then
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1218
        AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE])
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1219
      fi
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1220
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1221
      AC_MSG_RESULT($JTREGEXE)
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1222
    else
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1223
      # try to find jtreg on path
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1224
      BASIC_REQUIRE_PROG(JTREGEXE, jtreg)
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1225
      JT_HOME="`$DIRNAME $JTREGEXE`"
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1226
    fi
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1227
  fi
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1228
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1229
  AC_SUBST(JT_HOME)
2cb42641740b 8015510: (s) Improve JTReg location detection and provide location to test/Makefile
mduigou
parents: 17593
diff changeset
  1230
  AC_SUBST(JTREGEXE)
17593
de6741d8a142 8007129: build-infra Add configure --with-jtreg option for location of JTREG
erikj
parents: 16988
diff changeset
  1231
])