make/autoconf/flags-other.m4
author michaelm
Wed, 13 Nov 2019 09:09:41 +0000
changeset 59047 6c78185c99d7
parent 54513 2fd0422ac495
child 58665 30a5049a36bb
permissions -rw-r--r--
8233958: Memory retention due to HttpsURLConnection finalizer that serves no purpose Reviewed-by: dfuchs, rriggs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     1
#
54452
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 52735
diff changeset
     2
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     4
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    10
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    15
# accompanied this code).
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    16
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    20
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    23
# questions.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    24
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    25
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    26
################################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    27
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    28
# Setup flags for other tools than C/C++ compiler
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    29
#
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    30
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    31
AC_DEFUN([FLAGS_SETUP_ARFLAGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    32
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    33
  # FIXME: figure out if we should select AR flags depending on OS or toolchain.
51783
4482acfef2a5 8210729: Clean up macosx static library handling
ihse
parents: 49120
diff changeset
    34
  if test "x$OPENJDK_TARGET_OS" = xaix; then
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    35
    ARFLAGS="-X64"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    36
  elif test "x$OPENJDK_TARGET_OS" = xwindows; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    37
    # lib.exe is used as AR to create static libraries.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    38
    ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    39
  else
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    40
    ARFLAGS=""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    41
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    42
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    43
  AC_SUBST(ARFLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    44
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    45
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    46
AC_DEFUN([FLAGS_SETUP_STRIPFLAGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    47
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    48
  ## Setup strip.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    49
  # FIXME: should this really be per platform, or should it be per toolchain type?
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    50
  # strip is not provided by clang or solstudio; so guessing platform makes most sense.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    51
  # FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    52
  if test "x$OPENJDK_TARGET_OS" = xlinux; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    53
    STRIPFLAGS="-g"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    54
  elif test "x$OPENJDK_TARGET_OS" = xsolaris; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    55
    STRIPFLAGS="-x"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    56
  elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    57
    STRIPFLAGS="-S"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    58
  elif test "x$OPENJDK_TARGET_OS" = xaix; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    59
    STRIPFLAGS="-X32_64"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    60
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    61
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    62
  AC_SUBST(STRIPFLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    63
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    64
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    65
AC_DEFUN([FLAGS_SETUP_RCFLAGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    66
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    67
  # On Windows, we need to set RC flags.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    68
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    69
    RC_FLAGS="-nologo -l0x409"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    70
    JVM_RCFLAGS="-nologo"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    71
    if test "x$DEBUG_LEVEL" = xrelease; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    72
      RC_FLAGS="$RC_FLAGS -DNDEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    73
      JVM_RCFLAGS="$JVM_RCFLAGS -DNDEBUG"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    74
    fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    75
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    76
    # The version variables used to create RC_FLAGS may be overridden
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    77
    # in a custom configure script, or possibly the command line.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    78
    # Let those variables be expanded at make time in spec.gmk.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    79
    # The \$ are escaped to the shell, and the $(...) variables
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    80
    # are evaluated by make.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    81
    RC_FLAGS="$RC_FLAGS \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    82
        -D\"JDK_VERSION_STRING=\$(VERSION_STRING)\" \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    83
        -D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
54513
2fd0422ac495 8221979: Cleanups for building Windows resources
clanger
parents: 54452
diff changeset
    84
        -D\"JDK_FILEDESC=\$(JDK_RC_NAME) binary\" \
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    85
        -D\"JDK_VER=\$(VERSION_NUMBER)\" \
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    86
        -D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
54452
0d7fb7f07134 8221880: Better customization for Windows RC properties FileDescription and ProductName
clanger
parents: 52735
diff changeset
    87
        -D\"JDK_NAME=\$(JDK_RC_NAME) \$(VERSION_FEATURE)\" \
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    88
        -D\"JDK_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    89
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    90
    JVM_RCFLAGS="$JVM_RCFLAGS \
54513
2fd0422ac495 8221979: Cleanups for building Windows resources
clanger
parents: 54452
diff changeset
    91
        -D\"HS_VERSION_STRING=\$(VERSION_STRING)\" \
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    92
        -D\"HS_COMPANY=\$(COMPANY_NAME)\" \
54513
2fd0422ac495 8221979: Cleanups for building Windows resources
clanger
parents: 54452
diff changeset
    93
        -D\"HS_VER=\$(VERSION_NUMBER_FOUR_POSITIONS)\" \
2fd0422ac495 8221979: Cleanups for building Windows resources
clanger
parents: 54452
diff changeset
    94
        -D\"HS_INTERNAL_NAME=jvm\" \
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    95
        -D\"HS_COPYRIGHT=Copyright $COPYRIGHT_YEAR\" \
54513
2fd0422ac495 8221979: Cleanups for building Windows resources
clanger
parents: 54452
diff changeset
    96
        -D\"HS_FNAME=jvm.dll\" \
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    97
        -D\"HS_NAME=\$(PRODUCT_NAME) \$(VERSION_SHORT)\" \
54513
2fd0422ac495 8221979: Cleanups for building Windows resources
clanger
parents: 54452
diff changeset
    98
        -D\"HS_FVER=\$(subst .,\$(COMMA),\$(VERSION_NUMBER_FOUR_POSITIONS))\""
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
    99
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   100
  AC_SUBST(RC_FLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   101
  AC_SUBST(JVM_RCFLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   102
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   103
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   104
################################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   105
# platform independent
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   106
AC_DEFUN([FLAGS_SETUP_ASFLAGS],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   107
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   108
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   109
    JVM_BASIC_ASFLAGS="-x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   110
  fi
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   111
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   112
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   113
################################################################################
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   114
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   115
#      conditionals against.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   116
# $2 - Optional prefix for each variable defined.
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   117
AC_DEFUN([FLAGS_SETUP_ASFLAGS_CPU_DEP],
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   118
[
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   119
  # Misuse EXTRA_CFLAGS to mimic old behavior
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   120
  $2JVM_ASFLAGS="$JVM_BASIC_ASFLAGS ${$2EXTRA_CFLAGS}"
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   121
52735
7b9f61b7fd94 8214466: Append assembler flags on ARM targets
dholmes
parents: 51783
diff changeset
   122
  if test "x$1" = "xTARGET" && \
7b9f61b7fd94 8214466: Append assembler flags on ARM targets
dholmes
parents: 51783
diff changeset
   123
      test "x$TOOLCHAIN_TYPE" = xgcc && \
7b9f61b7fd94 8214466: Append assembler flags on ARM targets
dholmes
parents: 51783
diff changeset
   124
      test "x$OPENJDK_TARGET_CPU" = xarm; then
7b9f61b7fd94 8214466: Append assembler flags on ARM targets
dholmes
parents: 51783
diff changeset
   125
    $2JVM_ASFLAGS="${$2JVM_ASFLAGS} $ARM_ARCH_TYPE_ASFLAGS $ARM_FLOAT_TYPE_ASFLAGS"
7b9f61b7fd94 8214466: Append assembler flags on ARM targets
dholmes
parents: 51783
diff changeset
   126
  fi
7b9f61b7fd94 8214466: Append assembler flags on ARM targets
dholmes
parents: 51783
diff changeset
   127
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   128
  AC_SUBST($2JVM_ASFLAGS)
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   129
])
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents:
diff changeset
   130