< prev index next >

make/autoconf/flags-cflags.m4

Print this page


   1 #
   2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 782 
 783   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
 784     if test "x$FLAGS_CPU" = xx86; then
 785       $1_CFLAGS_CPU_JVM="-arch:IA32"
 786     elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
 787       if test "x$DEBUG_LEVEL" != xrelease; then
 788         # NOTE: This is probably redundant; -homeparams is default on
 789         # non-release builds.
 790         $1_CFLAGS_CPU_JVM="-homeparams"
 791       fi
 792     fi
 793   fi
 794 
 795   if test "x$TOOLCHAIN_TYPE" = xgcc; then
 796     FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
 797     $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
 798 
 799     $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
 800   fi
 801 




















 802   # EXPORT to API
 803   CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
 804       $TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
 805       $OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \
 806       $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG"
 807 
 808   CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
 809       $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
 810       $WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK"

 811 
 812   # Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
 813   # (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might
 814   # change in the future.)
 815 
 816   CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY  \
 817       $WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
 818   CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY \
 819       $TOOLCHAIN_CFLAGS_JDK_CXXONLY \
 820       ${$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY} \
 821       $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
 822 
 823   $1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
 824   $1_CFLAGS_JDK="${$1_DEFINES_CPU_JDK} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JDK} ${$1_TOOLCHAIN_CFLAGS}"
 825 
 826   $2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}"
 827 
 828   $2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}"
 829   $2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}"
 830   $2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"


   1 #
   2 # Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 782 
 783   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
 784     if test "x$FLAGS_CPU" = xx86; then
 785       $1_CFLAGS_CPU_JVM="-arch:IA32"
 786     elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
 787       if test "x$DEBUG_LEVEL" != xrelease; then
 788         # NOTE: This is probably redundant; -homeparams is default on
 789         # non-release builds.
 790         $1_CFLAGS_CPU_JVM="-homeparams"
 791       fi
 792     fi
 793   fi
 794 
 795   if test "x$TOOLCHAIN_TYPE" = xgcc; then
 796     FLAGS_SETUP_GCC6_COMPILER_FLAGS($1, $3)
 797     $1_TOOLCHAIN_CFLAGS="${$1_GCC6_CFLAGS}"
 798 
 799     $1_WARNING_CFLAGS_JVM="-Wno-format-zero-length -Wtype-limits -Wuninitialized"
 800   fi
 801 
 802   # Calculate offset to use for getting relative paths from __FILE__ macro.
 803   # On Windows, this needs to be a Windows path
 804   windows_safe_workspace_root="${WORKSPACE_ROOT}"
 805   BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH([windows_safe_workspace_root])
 806   # Add trailing slash if missing
 807   workspace_root_trailing_slash="${windows_safe_workspace_root%/}/"
 808   FILE_MACRO_OFFSET="${#workspace_root_trailing_slash}"
 809   FILE_MACRO_CFLAGS="-DFILE_MACRO_OFFSET=${FILE_MACRO_OFFSET}"
 810   if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
 811     # Check if compiler supports -fmacro-prefix-map. If so, use that instead
 812     # of FILE_MACRO_OFFSET.
 813     FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-fmacro-prefix-map=/=/],
 814         PREFIX: $3,
 815         IF_TRUE: [
 816             FILE_MACRO_CFLAGS="-DFILE_MACRO_OFFSET=0 \
 817                 -fmacro-prefix-map=${workspace_root_trailing_slash}="
 818         ]
 819     )
 820   fi
 821 
 822   # EXPORT to API
 823   CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
 824       $TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
 825       $OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \
 826       $WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS"
 827 
 828   CFLAGS_JDK_COMMON="$ALWAYS_CFLAGS_JDK $ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
 829       $OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
 830       $WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
 831       $FILE_MACRO_CFLAGS"
 832 
 833   # Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
 834   # (Currently we don't have any OPENJDK_BUILD_EXTRA_CFLAGS, but that might
 835   # change in the future.)
 836 
 837   CFLAGS_JDK_COMMON_CONLY="$TOOLCHAIN_CFLAGS_JDK_CONLY  \
 838       $WARNING_CFLAGS_JDK_CONLY ${$2EXTRA_CFLAGS}"
 839   CFLAGS_JDK_COMMON_CXXONLY="$ALWAYS_DEFINES_JDK_CXXONLY \
 840       $TOOLCHAIN_CFLAGS_JDK_CXXONLY \
 841       ${$1_TOOLCHAIN_CFLAGS_JDK_CXXONLY} \
 842       $WARNING_CFLAGS_JDK_CXXONLY ${$2EXTRA_CXXFLAGS}"
 843 
 844   $1_CFLAGS_JVM="${$1_DEFINES_CPU_JVM} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JVM} ${$1_TOOLCHAIN_CFLAGS} ${$1_WARNING_CFLAGS_JVM}"
 845   $1_CFLAGS_JDK="${$1_DEFINES_CPU_JDK} ${$1_CFLAGS_CPU} ${$1_CFLAGS_CPU_JDK} ${$1_TOOLCHAIN_CFLAGS}"
 846 
 847   $2JVM_CFLAGS="$CFLAGS_JVM_COMMON ${$1_CFLAGS_JVM} ${$2EXTRA_CXXFLAGS}"
 848 
 849   $2CFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CONLY ${$1_CFLAGS_JDK}"
 850   $2CXXFLAGS_JDKEXE="$CFLAGS_JDK_COMMON $CFLAGS_JDK_COMMON_CXXONLY ${$1_CFLAGS_JDK}"
 851   $2CFLAGS_JDKLIB="${$2CFLAGS_JDKEXE} $JDK_PICFLAG ${$1_CFLAGS_CPU_JDK_LIBONLY}"


< prev index next >