From 9c670850bd4f71893fc2802d0d849747467772e6 Mon Sep 17 00:00:00 2001 From: kevinw Date: Thu, 5 Apr 2018 07:59:52 -0700 Subject: [PATCH] 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform. Reviewed-by: ihse, henryjen, erikj --- common/autoconf/basics.m4 | 4 +- common/autoconf/build-performance.m4 | 4 +- common/autoconf/configure | 9 +- common/autoconf/configure.ac | 48 +- common/autoconf/flags.m4 | 767 ++ common/autoconf/generated-configure.sh | 12712 ++++++++++++----------- common/autoconf/help.m4 | 28 +- common/autoconf/hotspot-spec.gmk.in | 4 +- common/autoconf/jdk-options.m4 | 4 +- common/autoconf/libraries.m4 | 17 +- common/autoconf/spec.gmk.in | 9 +- common/autoconf/toolchain.m4 | 1667 +-- make/common/NativeCompilation.gmk | 14 +- 13 files changed, 8076 insertions(+), 7211 deletions(-) create mode 100644 common/autoconf/flags.m4 diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index d4b4791..8d3d932 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -126,7 +126,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE], done IFS="$IFS_save" else - AC_MSG_NOTICE([Resolving $1 (as $path) failed, using $path directly.]) + # This is an absolute path, we can use it without further modifications. new_path="$path" fi diff --git a/common/autoconf/build-performance.m4 b/common/autoconf/build-performance.m4 index 1bf5628..eab91f3 100644 --- a/common/autoconf/build-performance.m4 +++ b/common/autoconf/build-performance.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -261,7 +261,7 @@ AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS], if test "x$ENABLE_PRECOMPH" = xyes; then # Check that the compiler actually supports precomp headers. - if test "x$GCC" = xyes; then + if test "x$TOOLCHAIN_TYPE" = xgcc; then AC_MSG_CHECKING([that precompiled headers work]) echo "int alfa();" > conftest.h $CXX -x c++-header conftest.h -o conftest.hpp.gch 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD diff --git a/common/autoconf/configure b/common/autoconf/configure index aedbe19..483b9fd 100644 --- a/common/autoconf/configure +++ b/common/autoconf/configure @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -222,6 +222,13 @@ Additional (non-autoconf) OpenJDK Options: --debug-configure Run the configure script with additional debug logging enabled. +EOT + + # Print list of toolchains. This must be done by the autoconf script. + ( CONFIGURE_PRINT_TOOLCHAIN_LIST=true . $conf_script_to_run PRINTF=printf ) + + cat < if you have libraries in a @@ -2005,18 +2005,22 @@ Some influential environment variables: you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags - OBJC Objective C compiler command - OBJCFLAGS Objective C compiler flags - AR Override default value for AR CPP C preprocessor CXXCPP C++ preprocessor AS Override default value for AS + AR Override default value for AR + OBJC Objective C compiler command + OBJCFLAGS Objective C compiler flags + LIPO Override default value for LIPO + STRIP Override default value for STRIP NM Override default value for NM GNM Override default value for GNM - STRIP Override default value for STRIP MCS Override default value for MCS OBJCOPY Override default value for OBJCOPY OBJDUMP Override default value for OBJDUMP + BUILD_CC Override default value for BUILD_CC + BUILD_CXX Override default value for BUILD_CXX + BUILD_LD Override default value for BUILD_LD JTREGEXE Override default value for JTREGEXE XMKMF Path to xmkmf, Makefile generator for X Window System FREETYPE_CFLAGS @@ -2187,21 +2191,20 @@ fi } # ac_fn_cxx_try_compile -# ac_fn_objc_try_compile LINENO -# ----------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_objc_try_compile () +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" + if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 @@ -2209,26 +2212,26 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_objc_werror_flag" || + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_objc_try_compile +} # ac_fn_c_try_cpp -# ac_fn_c_try_cpp LINENO -# ---------------------- +# ac_fn_cxx_try_cpp LINENO +# ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () +ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" @@ -2247,7 +2250,7 @@ $as_echo "$ac_try_echo"; } >&5 fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 @@ -2260,22 +2263,23 @@ fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_c_try_cpp +} # ac_fn_cxx_try_cpp -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () +# ac_fn_objc_try_compile LINENO +# ----------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_objc_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 @@ -2283,21 +2287,21 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test $ac_status = 0; } && { + test -z "$ac_objc_werror_flag" || test ! -s conftest.err - }; then : + } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval -} # ac_fn_cxx_try_cpp +} # ac_fn_objc_try_compile # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- @@ -3261,7 +3265,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Include these first... # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3570,7 +3574,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3614,7 +3618,95 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Oracle designates this +# particular file as subject to the "Classpath" exception as provided +# by Oracle in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + + + + + +# Documentation on common flags used for solstudio in HIGHEST. +# +# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be +# done with care, there are some assumptions below that need to +# be understood about the use of pointers, and IEEE behavior. +# +# -fns: Use non-standard floating point mode (not IEEE 754) +# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754) +# -fsingle: Use single precision floating point with 'float' +# -xalias_level=basic: Assume memory references via basic pointer types do not alias +# (Source with excessing pointer casting and data access with mixed +# pointer types are not recommended) +# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions +# (If you expect perfect errno behavior, do not use this) +# -xdepend: Loop data dependency optimizations (need -xO3 or higher) +# -xrestrict: Pointer parameters to functions do not overlap +# (Similar to -xalias_level=basic usage, but less obvious sometimes. +# If you pass in multiple pointers to the same data, do not use this) +# -xlibmil: Inline some library routines +# (If you expect perfect errno behavior, do not use this) +# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED) +# (If you expect perfect errno behavior, do not use this) +# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now + + # FIXME: this will never happen since sparc != sparcv9, ie 32 bit, which we don't build anymore. + # Bug? + #if test "x$OPENJDK_TARGET_CPU" = xsparc; then + # CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" + # CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" + #fi + + + + + + +# FLAGS_C_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], +# [RUN-IF-FALSE]) +# ------------------------------------------------------------ +# Check that the C compiler supports an argument + + +# FLAGS_CXX_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], +# [RUN-IF-FALSE]) +# ------------------------------------------------------------ +# Check that the C++ compiler supports an argument + + +# FLAGS_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], +# [RUN-IF-FALSE]) +# ------------------------------------------------------------ +# Check that the C and C++ compilers support an argument + + + + + + + +# +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3733,10 +3825,16 @@ pkgadd_help() { PKGHANDLER_COMMAND="" } +# This function will check if we're called from the "configure" wrapper while +# printing --help. If so, we will print out additional information that can +# only be extracted within the autoconf script, and then exit. This must be +# called at the very beginning in configure.ac. + + # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3800,7 +3898,7 @@ fi # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3840,6 +3938,8 @@ fi + + # # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3964,8 +4064,37 @@ fi # questions. # +######################################################################## +# This file is responsible for detecting, verifying and setting up the +# toolchain, i.e. the compiler, linker and related utilities. It will setup +# proper paths to the binaries, but it will not setup any flags. +# +# The binaries used is determined by the toolchain type, which is the family of +# compilers and related tools that are used. +######################################################################## + + +# All valid toolchains, regardless of platform (used by help.m4) +VALID_TOOLCHAINS_all="gcc clang solstudio xlc microsoft" + +# These toolchains are valid on different platforms +VALID_TOOLCHAINS_linux="gcc clang" +VALID_TOOLCHAINS_solaris="solstudio" +VALID_TOOLCHAINS_macosx="gcc clang" +VALID_TOOLCHAINS_aix="xlc" +VALID_TOOLCHAINS_windows="microsoft" + +# Toolchain descriptions +TOOLCHAIN_DESCRIPTION_clang="clang/LLVM" +TOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection" +TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio" +TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio" +TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" + # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called. # Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER. +# $1 - optional variable prefix for compiler and version variables (BUILD_) +# $2 - optional variable prefix for comparable variable (OPENJDK_BUILD_) # Check if the configured compiler (C and C++) is of a specific version or @@ -3977,51 +4106,65 @@ fi # $3: block to run if the compiler is older than this version (<) -# $1 = compiler to test (CC or CXX) -# $2 = human readable name of compiler (C or C++) - - - +# Setup a number of variables describing how native output files are +# named on this platform/toolchain. -# $1 = compiler to test (CC or CXX) -# $2 = human readable name of compiler (C or C++) -# $3 = list of compiler names to search for +# Determine which toolchain type to use, and make sure it is valid for this +# platform. Setup various information about the selected toolchain. +# Before we start detecting the toolchain executables, we might need some +# special setup, e.g. additional paths etc. +# Restore path, etc +# Check if a compiler is of the toolchain type we expect, and save the version +# information from it. If the compiler does not match the expected type, +# this function will abort using AC_MSG_ERROR. If it matches, the version will +# be stored in CC_VERSION_NUMBER/CXX_VERSION_NUMBER (as a dotted number), and +# the full version string in CC_VERSION_STRING/CXX_VERSION_STRING. +# +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +# Try to locate the given C or C++ compiler in the path, or otherwise. +# +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +# $3 = list of compiler names to search for +# Detect the core components of the toolchain, i.e. the compilers (CC and CXX), +# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the +# archiver (AR). Verify that the compilers are correct according to the +# toolchain type. -# TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], -# [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C compiler supports an argument +# Setup additional tools that is considered a part of the toolchain, but not the +# core part. Many of these are highly platform-specific and do not exist, +# and/or are not needed on all platforms. -# TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], -# [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C++ compiler supports an argument +# Setup the build tools (i.e, the compiler and linker used to build programs +# that should be run on the build platform, not the target platform, as a build +# helper). Since the non-cross-compile case uses the normal, target compilers +# for this, we can only do this after these have been setup. -# TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], -# [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C and C++ compilers support an argument +# Setup legacy variables that are still needed as alternative ways to refer to +# parts of the toolchain. +# Do some additional checks on the detected tools. -# Setup the JTREG paths +# Setup the JTReg Regression Test Harness. @@ -4076,7 +4219,7 @@ fi #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1521626909 +DATE_WHEN_GENERATED=1522940332 ############################################################################### # @@ -4087,7 +4230,25 @@ DATE_WHEN_GENERATED=1521626909 # ############################################################################### -# Basic initialization that must happen first of all +# If we are requested to print additional help, do that and then exit. +# This must be the very first call. + + if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then + $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" + $PRINTF "Which are valid to use depends on the build platform.\n" + for toolchain in $VALID_TOOLCHAINS_all; do + # Use indirect variable referencing + toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain + TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} + $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" + done + + # And now exit directly + exit 0 + fi + + +# Basic initialization that must happen first of all in the normal process. # Save the original command line. This is passed to us by the wrapper configure script. @@ -15177,8 +15338,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -15534,8 +15694,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -15888,8 +16047,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -16247,8 +16405,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -16600,8 +16757,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving FOUND_MAKE (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -24648,277 +24804,174 @@ $as_echo "yes from $HOTSPOT_DIST" >&6; } ############################################################################### # -# Setup the toolchain (compilers etc), i.e. the tools that need to be -# cross-compilation aware. +# Setup the toolchain (compilers etc), i.e. tools used to compile and process +# native code. # ############################################################################### +# First determine the toolchain type (compiler family) - ############################################################################### - # - # Configure the development tool paths and potential sysroot. - # - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +# Check whether --with-toolchain-type was given. +if test "${with_toolchain_type+set}" = set; then : + withval=$with_toolchain_type; +fi - # The option used to specify the target .o,.a or .so file. - # When compiling, how to specify the to be created object file. - CC_OUT_OPTION='-o$(SPACE)' - # When linking, how to specify the to be created executable. - EXE_OUT_OPTION='-o$(SPACE)' - # When linking, how to specify the to be created dynamically linkable library. - LD_OUT_OPTION='-o$(SPACE)' - # When archiving, how to specify the to be create static archive for object files. - AR_OUT_OPTION='rcs$(SPACE)' + # Use indirect variable referencing + toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS + VALID_TOOLCHAINS=${!toolchain_var_name} + # First toolchain type in the list is the default + DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} + if test "x$with_toolchain_type" = xlist; then + # List all toolchains + { $as_echo "$as_me:${as_lineno-$LINENO}: The following toolchains are valid on this platform:" >&5 +$as_echo "$as_me: The following toolchains are valid on this platform:" >&6;} + for toolchain in $VALID_TOOLCHAINS; do + toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain + TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} + $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" + done + exit 0 + elif test "x$with_toolchain_type" != x; then + # User override; check that it is valid + if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Toolchain type $with_toolchain_type is not valid on this platform." >&5 +$as_echo "$as_me: Toolchain type $with_toolchain_type is not valid on this platform." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Valid toolchains: $VALID_TOOLCHAINS." >&5 +$as_echo "$as_me: Valid toolchains: $VALID_TOOLCHAINS." >&6;} + as_fn_error $? "Cannot continue." "$LINENO" 5 + fi + TOOLCHAIN_TYPE=$with_toolchain_type + else + # No flag given, use default + TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN + fi -# Locate the actual tools + TOOLCHAIN_CC_BINARY_clang="clang" + TOOLCHAIN_CC_BINARY_gcc="gcc" + TOOLCHAIN_CC_BINARY_microsoft="cl" + TOOLCHAIN_CC_BINARY_solstudio="cc" + TOOLCHAIN_CC_BINARY_xlc="xlc_r" + TOOLCHAIN_CXX_BINARY_clang="clang++" + TOOLCHAIN_CXX_BINARY_gcc="g++" + TOOLCHAIN_CXX_BINARY_microsoft="cl" + TOOLCHAIN_CXX_BINARY_solstudio="CC" + TOOLCHAIN_CXX_BINARY_xlc="xlC_r" -# Check whether --with-jtreg was given. -if test "${with_jtreg+set}" = set; then : - withval=$with_jtreg; -else - with_jtreg=no -fi + # Use indirect variable referencing + toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE + TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} + toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE + TOOLCHAIN_CC_BINARY=${!toolchain_var_name} + toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE + TOOLCHAIN_CXX_BINARY=${!toolchain_var_name} - if test "x$with_jtreg" = xno; then - # jtreg disabled - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5 -$as_echo_n "checking for jtreg... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # Define filename patterns + if test "x$OPENJDK_TARGET_OS" = xwindows; then + LIBRARY_PREFIX= + SHARED_LIBRARY_SUFFIX='.dll' + STATIC_LIBRARY_SUFFIX='.lib' + SHARED_LIBRARY='$1.dll' + STATIC_LIBRARY='$1.lib' + OBJ_SUFFIX='.obj' + EXE_SUFFIX='.exe' else - if test "x$with_jtreg" != xyes; then - # with path specified. - JT_HOME="$with_jtreg" + LIBRARY_PREFIX=lib + SHARED_LIBRARY_SUFFIX='.so' + STATIC_LIBRARY_SUFFIX='.a' + SHARED_LIBRARY='lib$1.so' + STATIC_LIBRARY='lib$1.a' + OBJ_SUFFIX='.o' + EXE_SUFFIX='' + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + SHARED_LIBRARY='lib$1.dylib' + SHARED_LIBRARY_SUFFIX='.dylib' fi + fi - if test "x$JT_HOME" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5 -$as_echo_n "checking for jtreg... " >&6; } - # use JT_HOME enviroment var. - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - # Input might be given as Windows format, start by converting to - # unix format. - path="$JT_HOME" - new_path=`$CYGPATH -u "$path"` - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5 - fi - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-stile (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - if test "x$path" != "x$new_path"; then - JT_HOME="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)" >&5 +$as_echo "$as_me: Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)" >&6;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN." >&5 +$as_echo "$as_me: Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN." >&6;} fi - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$JT_HOME" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi +# Then detect the actual binaries needed - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi + # FIXME: Is this needed? + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - JT_HOME="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} - fi + # Store the CFLAGS etal passed to the configure script. + ORG_CFLAGS="$CFLAGS" + ORG_CXXFLAGS="$CXXFLAGS" + ORG_OBJCFLAGS="$OBJCFLAGS" - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + # autoconf magic only relies on PATH, so update it if tools dir is specified + OLD_PATH="$PATH" - else - # We're on a posix platform. Hooray! :) - path="$JT_HOME" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi + # Before we locate the compilers, we need to sanitize the Xcode build environment + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + # determine path to Xcode developer directory + # can be empty in which case all the tools will rely on a sane Xcode 4 installation + SET_DEVELOPER_DIR= - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 + if test -n "$XCODE_PATH"; then + DEVELOPER_DIR="$XCODE_PATH"/Contents/Developer fi - JT_HOME="`cd "$path"; $THEPWDCMD -L`" - fi - - - # jtreg win32 script works for everybody - JTREGEXE="$JT_HOME/bin/jtreg" - - if test ! -f "$JTREGEXE"; then - as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5 + # DEVELOPER_DIR could also be provided directly + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining if we need to set DEVELOPER_DIR" >&5 +$as_echo_n "checking Determining if we need to set DEVELOPER_DIR... " >&6; } + if test -n "$DEVELOPER_DIR"; then + if test ! -d "$DEVELOPER_DIR"; then + as_fn_error $? "Xcode Developer path does not exist: $DEVELOPER_DIR, please provide a path to the Xcode 4 application bundle using --with-xcode-path" "$LINENO" 5 fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } + if test ! -f "$DEVELOPER_DIR"/usr/bin/xcodebuild; then + as_fn_error $? "Xcode Developer path is not valid: $DEVELOPER_DIR, it must point to Contents/Developer inside an Xcode application bundle" "$LINENO" 5 + fi + # make it visible to all the tools immediately + export DEVELOPER_DIR + SET_DEVELOPER_DIR="export DEVELOPER_DIR := $DEVELOPER_DIR" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEVELOPER_DIR)" >&5 +$as_echo "yes ($DEVELOPER_DIR)" >&6; } else - # try to find jtreg on path - - - - # Publish this variable in the help. - - - if test "x$JTREGEXE" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in jtreg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JTREGEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JTREGEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -JTREGEXE=$ac_cv_path_JTREGEXE -if test -n "$JTREGEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -fi - + fi - test -n "$JTREGEXE" && break -done - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !JTREGEXE! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JTREGEXE!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xJTREGEXE" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JTREGEXE from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of JTREGEXE from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in jtreg -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + # Extract the first word of "xcodebuild", so it can be a program name with args. +set dummy xcodebuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JTREGEXE+:} false; then : +if ${ac_cv_path_XCODEBUILD+:} false; then : $as_echo_n "(cached) " >&6 else - case $JTREGEXE in + case $XCODEBUILD in [\\/]* | ?:[\\/]*) - ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. + ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -24928,7 +24981,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -24939,110 +24992,82 @@ IFS=$as_save_IFS ;; esac fi -JTREGEXE=$ac_cv_path_JTREGEXE -if test -n "$JTREGEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } +XCODEBUILD=$ac_cv_path_XCODEBUILD +if test -n "$XCODEBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 +$as_echo "$XCODEBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$JTREGEXE" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. + if test -z "$XCODEBUILD"; then + as_fn_error $? "The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X" "$LINENO" 5 + fi - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later + XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'` + XC_VERSION_PARTS=( ${XCODE_VERSION//./ } ) + if test ! "${XC_VERSION_PARTS[0]}" = "4"; then + as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5 + fi - # Check if the provided tool contains a complete path. - tool_specified="$JTREGEXE" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JTREGEXE=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool JTREGEXE=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_JTREGEXE+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $JTREGEXE in - [\\/]* | ?:[\\/]*) - ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + # Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to + # clang and clang++, which will break the build. So handle that here if we need to. + if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then + # use xcrun to find the real gcc and add it's directory to PATH + # then autoconf magic will find it + { $as_echo "$as_me:${as_lineno-$LINENO}: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&5 +$as_echo "$as_me: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&6;} + XCODE_BIN_PATH=$(dirname `xcrun -find gcc`) + PATH="$XCODE_BIN_PATH":$PATH + fi - ;; -esac -fi -JTREGEXE=$ac_cv_path_JTREGEXE -if test -n "$JTREGEXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 -$as_echo "$JTREGEXE" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + # Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining Xcode SDK path" >&5 +$as_echo_n "checking Determining Xcode SDK path... " >&6; } + # allow SDKNAME to be set to override the default SDK selection + SDKPATH=`"$XCODEBUILD" -sdk ${SDKNAME:-macosx} -version | grep '^Path: ' | sed 's/Path: //'` + if test -n "$SDKPATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKPATH" >&5 +$as_echo "$SDKPATH" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: (none, will use system headers and frameworks)" >&5 +$as_echo "(none, will use system headers and frameworks)" >&6; } + fi - if test "x$JTREGEXE" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JTREGEXE=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool JTREGEXE=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTREGEXE" >&5 -$as_echo_n "checking for JTREGEXE... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool JTREGEXE=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi + # Perform a basic sanity test + if test ! -f "$SDKPATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then + as_fn_error $? "Unable to find required framework headers, provide a valid path to Xcode 4 using --with-xcode-path" "$LINENO" 5 fi - fi - + # if SDKPATH is non-empty then we need to add -isysroot and -iframework for gcc and g++ + if test -n "$SDKPATH"; then + # We need -isysroot and -iframework/System/Library/Frameworks + CFLAGS_JDK="${CFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" + LDFLAGS_JDK="${LDFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" + fi - if test "x$JTREGEXE" = x; then - as_fn_error $? "Could not find required tool for JTREGEXE" "$LINENO" 5 + # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework + # setting this here means it doesn't have to be peppered throughout the forest + CFLAGS_JDK="$CFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" + CXXFLAGS_JDK="$CXXFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" + LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" fi - - JT_HOME="`$DIRNAME $JTREGEXE`" - fi + # For solaris we really need solaris tools, and not the GNU equivalent. + # The build tools on Solaris reside in /usr/ccs (C Compilation System), + # so add that to path before starting to probe. + # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. + if test "x$OPENJDK_BUILD_OS" = xsolaris; then + PATH="/usr/ccs/bin:$PATH" fi - - - - - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + # On Windows, we need to detect the visual studio installation first. + if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then # Store path to cygwin link.exe to help excluding it when searching for # VS linker. This must be done before changing the PATH when looking for VS. @@ -25714,8 +25739,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving VS_ENV_CMD (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -25851,666 +25875,403 @@ $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run c as_fn_error $? "Cannot continue" "$LINENO" 5 fi + fi + # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to + # override all other locations. + if test "x$TOOLS_DIR" != x; then + PATH=$TOOLS_DIR:$PATH + fi -# Check whether --with-msvcr-dll was given. -if test "${with_msvcr_dll+set}" = set; then : - withval=$with_msvcr_dll; -fi - + # If a devkit is found on the builddeps server, then prepend its path to the + # PATH variable. If there are cross compilers available in the devkit, these + # will be found by AC_PROG_CC et al. + DEVKIT= - if test "x$with_msvcr_dll" != x; then - # If given explicitely by user, do not probe. If not present, fail directly. - POSSIBLE_MSVCR_DLL="$with_msvcr_dll" - METHOD="--with-msvcr-dll" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then + # Source the builddeps file again, to make sure it uses the latest variables! + . $builddepsfile + # Look for a target and build machine specific resource! + eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} + if test "x$resource" = x; then + # Ok, lets instead look for a target specific resource + eval resource=\${builddep_devkit_TARGET_${rewritten_target_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a build specific resource + eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}} + fi + if test "x$resource" = x; then + # Ok, lets instead look for a generic resource + # (The devkit comes from M4 and not the shell, thus no need for eval here.) + resource=${builddep_devkit} + fi + if test "x$resource" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for devkit" >&5 +$as_echo "$as_me: Using builddeps $resource for devkit" >&6;} + # If the resource in the builddeps.conf file is an existing directory, + # for example /java/linux/cups + if test -d ${resource}; then + depdir=${resource} + else - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 + # devkit is for example mymodule + # $resource is for example libs/general/libmymod_1_2_3.zip + # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps + # $with_builddeps_dir is for example /localhome/builddeps + # depdir is the name of the variable into which we store the depdir, eg MYMOD + # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and + # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 + filename=`basename $resource` + filebase=`echo $filename | sed 's/\.[^\.]*$//'` + filebase=${filename%%.*} + extension=${filename#*.} + installdir=$with_builddeps_dir/$filebase + if test ! -f $installdir/$filename.unpacked; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5 +$as_echo "$as_me: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&6;} + if test ! -d $installdir; then + mkdir -p $installdir fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + if test ! -d $installdir; then + as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 + fi + tmpfile=`mktemp $installdir/devkit.XXXXXXXXX` + touch $tmpfile + if test ! -f $tmpfile; then + as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 + fi + + # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip + # $tmpfile is the local file name for the downloaded file. + VALID_TOOL=no + if test "x$BDEPS_FTP" = xwget; then + VALID_TOOL=yes + wget -O $tmpfile $with_builddeps_server/$resource + fi + if test "x$BDEPS_FTP" = xlftp; then + VALID_TOOL=yes + lftp -c "get $with_builddeps_server/$resource -o $tmpfile" + fi + if test "x$BDEPS_FTP" = xftp; then + VALID_TOOL=yes + FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` + FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` + FTPUSERPWD=${FTPSERVER%%@*} + if test "x$FTPSERVER" != "x$FTPUSERPWD"; then + FTPUSER=${userpwd%%:*} + FTPPWD=${userpwd#*@} + FTPSERVER=${FTPSERVER#*@} else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + FTPUSER=ftp + FTPPWD=ftp fi + # the "pass" command does not work on some + # ftp clients (read ftp.exe) but if it works, + # passive mode is better! + ( \ + echo "user $FTPUSER $FTPPWD" ; \ + echo "pass" ; \ + echo "bin" ; \ + echo "get $FTPPATH $tmpfile" ; \ + ) | ftp -in $FTPSERVER + fi + if test "x$VALID_TOOL" != xyes; then + as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 fi - if test "x$MSVCR_DLL" = x; then - as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5 + mv $tmpfile $installdir/$filename + if test ! -s $installdir/$filename; then + as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 fi + case "$extension" in + zip) echo "Unzipping $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) + ;; + tar.gz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + tgz) echo "Untaring $installdir/$filename..." + (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) + ;; + *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 + ;; + esac fi - - if test "x$MSVCR_DLL" = x; then - # Probe: Using well-known location from Visual Studio 10.0 - if test "x$VCINSTALLDIR" != x; then - CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" - - windows_path="$CYGWIN_VC_INSTALL_DIR" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_VC_INSTALL_DIR="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_VC_INSTALL_DIR="$unix_path" + if test -f $installdir/$filename.unpacked; then + depdir=$installdir fi - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" - else - POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + fi + # Source the builddeps file again, because in the previous command, the depdir + # was updated to point at the current build dependency install directory. + . $builddepsfile + # Now extract variables from the builddeps.conf files. + theroot=${builddep_devkit_ROOT} + thecflags=${builddep_devkit_CFLAGS} + thelibs=${builddep_devkit_LIBS} + if test "x$depdir" = x; then + as_fn_error $? "Could not download build dependency devkit" "$LINENO" 5 + fi + DEVKIT=$depdir + if test "x$theroot" != x; then + DEVKIT="$theroot" + fi + if test "x$thecflags" != x; then + DEVKIT_CFLAGS="$thecflags" + fi + if test "x$thelibs" != x; then + DEVKIT_LIBS="$thelibs" fi - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - METHOD="well-known location in VCINSTALLDIR" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + # Found devkit + PATH="$DEVKIT/bin:$PATH" + SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" + if test "x$x_includes" = "xNONE"; then + x_includes="$SYS_ROOT/usr/include/X11" + fi + if test "x$x_libraries" = "xNONE"; then + x_libraries="$SYS_ROOT/usr/lib" + fi + - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} fi + fi - fi + + + # + # Setup the compilers (CC and CXX) + # + + COMPILER_NAME=C + SEARCH_LIST="$TOOLCHAIN_CC_BINARY" + + if test "x$CC" != x; then + # User has supplied compiler name already, always let that override. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied compiler CC=$CC" >&5 +$as_echo "$as_me: Will use user supplied compiler CC=$CC" >&6;} + if test "x`basename $CC`" = "x$CC"; then + # A command without a complete path is provided, search $PATH. + + for ac_prog in $CC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_POTENTIAL_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $POTENTIAL_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_POTENTIAL_CC="$POTENTIAL_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS - if test "x$MSVCR_DLL" = x; then - # Probe: Check in the Boot JDK directory. - POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + ;; +esac +fi +POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC +if test -n "$POTENTIAL_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5 +$as_echo "$POTENTIAL_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - METHOD="well-known location in Boot JDK" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + test -n "$POTENTIAL_CC" && break +done + + if test "x$POTENTIAL_CC" != x; then + CC=$POTENTIAL_CC + else + as_fn_error $? "User supplied compiler CC=$CC could not be found" "$LINENO" 5 + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + # Otherwise it might already be a complete path + if test ! -x "$CC"; then + as_fn_error $? "User supplied compiler CC=$CC does not exist" "$LINENO" 5 + fi fi - fi + else + # No user supplied value. Locate compiler ourselves. + + # If we are cross compiling, assume cross compilation tools follows the + # cross compilation standard where they are prefixed with the autoconf + # standard name for the target. For example the binary + # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. + # If we are not cross compiling, then the default compiler name will be + # used. + CC= + # If TOOLS_DIR is set, check for all compiler names in there first + # before checking the rest of the PATH. + # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION + # step, this should not be necessary. + if test -n "$TOOLS_DIR"; then + PATH_save="$PATH" + PATH="$TOOLS_DIR" + for ac_prog in $TOOLCHAIN_CC_BINARY +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_TOOLS_DIR_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $TOOLS_DIR_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_TOOLS_DIR_CC="$TOOLS_DIR_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_TOOLS_DIR_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS - if test "x$MSVCR_DLL" = x; then - # Probe: Look in the Windows system32 directory - CYGWIN_SYSTEMROOT="$SYSTEMROOT" + ;; +esac +fi +TOOLS_DIR_CC=$ac_cv_path_TOOLS_DIR_CC +if test -n "$TOOLS_DIR_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CC" >&5 +$as_echo "$TOOLS_DIR_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - windows_path="$CYGWIN_SYSTEMROOT" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_SYSTEMROOT="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_SYSTEMROOT="$unix_path" + + test -n "$TOOLS_DIR_CC" && break +done + + CC=$TOOLS_DIR_CC + PATH="$PATH_save" + fi + + # AC_PATH_PROGS can't be run multiple times with the same variable, + # so create a new name for this run. + if test "x$CC" = x; then + for ac_prog in $TOOLCHAIN_CC_BINARY +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_POTENTIAL_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $POTENTIAL_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_POTENTIAL_CC="$POTENTIAL_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS - POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + ;; +esac +fi +POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC +if test -n "$POTENTIAL_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5 +$as_echo "$POTENTIAL_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - METHOD="well-known location in SYSTEMROOT" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + test -n "$POTENTIAL_CC" && break +done + + CC=$POTENTIAL_CC fi - fi - fi + if test "x$CC" = x; then - if test "x$MSVCR_DLL" = x; then - # Probe: If Visual Studio Express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + # Print a helpful message on how to acquire the necessary build dependency. + # devkit is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=devkit - windows_path="$CYGWIN_VS_TOOLS_DIR" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - CYGWIN_VS_TOOLS_DIR="$unix_path" + cygwin_help $MISSING_DEPENDENCY elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - CYGWIN_VS_TOOLS_DIR="$unix_path" - fi - - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` - else - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` - fi + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - METHOD="search of VS100COMNTOOLS" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + esac - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." fi fi + as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 fi fi - if test "x$MSVCR_DLL" = x; then - # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. - # (This was the original behaviour; kept since it might turn up something) - if test "x$CYGWIN_VC_INSTALL_DIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` - else - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` - if test "x$POSSIBLE_MSVCR_DLL" = x; then - # We're grasping at straws now... - POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` - fi - fi + # Now we have a compiler binary in CC. Make sure it's okay. - - POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - METHOD="search of VCINSTALLDIR" - if test -e "$POSSIBLE_MSVCR_DLL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 -$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} - - # Need to check if the found msvcr is correct architecture - { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 -$as_echo_n "checking found msvcr100.dll architecture... " >&6; } - MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - CORRECT_MSVCR_ARCH=386 - else - CORRECT_MSVCR_ARCH=x86-64 - fi - if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } - MSVCR_DLL="$POSSIBLE_MSVCR_DLL" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 -$as_echo "incorrect, ignoring" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 -$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} - fi - fi - - fi - fi - - if test "x$MSVCR_DLL" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5 - fi - - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # Input might be given as Windows format, start by converting to - # unix format. - path="$MSVCR_DLL" - new_path=`$CYGPATH -u "$path"` - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file precense. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of MSVCR_DLL" "$LINENO" 5 - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-stile (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - - if test "x$path" != "x$new_path"; then - MSVCR_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} - fi - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - path="$MSVCR_DLL" - has_colon=`$ECHO $path | $GREP ^.:` - new_path="$path" - if test "x$has_colon" = x; then - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $path` - fi - - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - if test "x$path" != "x$new_path"; then - MSVCR_DLL="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} - fi - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - - else - # We're on a posix platform. Hooray! :) - path="$MSVCR_DLL" - has_space=`$ECHO "$path" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 - fi - - # Use eval to expand a potential ~ - eval path="$path" - if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 - fi - - MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`" - fi - - - - -# Check whether --with-dxsdk was given. -if test "${with_dxsdk+set}" = set; then : - withval=$with_dxsdk; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-dxsdk is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-dxsdk-lib was given. -if test "${with_dxsdk_lib+set}" = set; then : - withval=$with_dxsdk_lib; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk-lib is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-dxsdk-lib is deprecated and will be ignored." >&2;} -fi - - - - -# Check whether --with-dxsdk-include was given. -if test "${with_dxsdk_include+set}" = set; then : - withval=$with_dxsdk_include; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk-include is deprecated and will be ignored." >&5 -$as_echo "$as_me: WARNING: Option --with-dxsdk-include is deprecated and will be ignored." >&2;} -fi - - - fi - - - - # If --build AND --host is set, then the configure script will find any - # cross compilation tools in the PATH. Cross compilation tools - # follows the cross compilation standard where they are prefixed with ${host}. - # For example the binary i686-sun-solaris2.10-gcc - # will cross compile for i686-sun-solaris2.10 - # If neither of build and host is not set, then build=host and the - # default compiler found in the path will be used. - # Setting only --host, does not seem to be really supported. - # Please set both --build and --host if you want to cross compile. - - if test "x$COMPILE_TYPE" = "xcross"; then - # Now we to find a C/C++ compiler that can build executables for the build - # platform. We can't use the AC_PROG_CC macro, since it can only be used - # once. Also, we need to do this before adding a tools dir to the path, - # otherwise we might pick up cross-compilers which don't use standard naming. - # Otherwise, we'll set the BUILD_tools to the native tools, but that'll have - # to wait until they are properly discovered. - - - # Publish this variable in the help. - - - if test "x$BUILD_CC" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cl cc gcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CC=$ac_cv_path_BUILD_CC -if test -n "$BUILD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_CC" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_CC! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_CC!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_CC" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_CC from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_CC from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cl cc gcc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CC=$ac_cv_path_BUILD_CC -if test -n "$BUILD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$BUILD_CC" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_CC" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_CC=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_CC=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -BUILD_CC=$ac_cv_path_BUILD_CC -if test -n "$BUILD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_CC" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_CC=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_CC=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CC" >&5 -$as_echo_n "checking for BUILD_CC... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_CC=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi - fi - - - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_CC" + complete="$CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -26546,14 +26307,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 fi fi @@ -26573,11 +26334,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -26624,7 +26385,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_CC" + complete="$CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -26669,14 +26430,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 fi fi @@ -26722,7 +26483,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_CC" + complete="$CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -26741,20 +26502,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving BUILD_CC (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 fi fi @@ -26766,40 +26526,107 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - BUILD_CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;} + CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;} fi + TEST_COMPILER="$CC" + # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links + # to 'xlc' but it is crucial that we invoke the compiler with the right name! + if test "x$OPENJDK_BUILD_OS" != xaix; then + # FIXME: This test should not be needed anymore; we don't do that for any platform. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5 +$as_echo_n "checking resolved symbolic links for CC... " >&6; } + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi - # Publish this variable in the help. + if test "x$READLINK" != x; then + TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $TEST_COMPILER` + sym_link_file=`$BASENAME $TEST_COMPILER` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + TEST_COMPILER=$sym_link_dir/$sym_link_file + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 +$as_echo "$TEST_COMPILER" >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CC is disguised ccache" >&5 +$as_echo_n "checking if CC is disguised ccache... " >&6; } - if test "x$BUILD_CXX" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in cl CC g++ -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` + if test "x$COMPILER_BASENAME" = "xccache"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5 +$as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } + # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. + # We want to control ccache invocation ourselves, so ignore this cc and try + # searching again. + + # Remove the path to the fake ccache cc from the PATH + RETRY_COMPILER_SAVED_PATH="$PATH" + COMPILER_DIRNAME=`$DIRNAME $CC` + PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + + # Try again looking for our compiler + if test -n "$ac_tool_prefix"; then + for ac_prog in $TOOLCHAIN_CC_BINARY + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CXX+:} false; then : +if ${ac_cv_prog_PROPER_COMPILER_CC+:} false; then : $as_echo_n "(cached) " >&6 else - case $BUILD_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$PROPER_COMPILER_CC"; then + ac_cv_prog_PROPER_COMPILER_CC="$PROPER_COMPILER_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_PROPER_COMPILER_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -26807,57 +26634,43 @@ done done IFS=$as_save_IFS - ;; -esac fi -BUILD_CXX=$ac_cv_path_BUILD_CXX -if test -n "$BUILD_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 -$as_echo "$BUILD_CXX" >&6; } +fi +PROPER_COMPILER_CC=$ac_cv_prog_PROPER_COMPILER_CC +if test -n "$PROPER_COMPILER_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 +$as_echo "$PROPER_COMPILER_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$BUILD_CXX" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_CXX! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_CXX!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_CXX" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_CXX from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_CXX from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in cl CC g++ + test -n "$PROPER_COMPILER_CC" && break + done +fi +if test -z "$PROPER_COMPILER_CC"; then + ac_ct_PROPER_COMPILER_CC=$PROPER_COMPILER_CC + for ac_prog in $TOOLCHAIN_CC_BINARY do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CXX+:} false; then : +if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+:} false; then : $as_echo_n "(cached) " >&6 else - case $BUILD_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_PROPER_COMPILER_CC"; then + ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_ct_PROPER_COMPILER_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -26865,104 +26678,40 @@ done done IFS=$as_save_IFS - ;; -esac fi -BUILD_CXX=$ac_cv_path_BUILD_CXX -if test -n "$BUILD_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 -$as_echo "$BUILD_CXX" >&6; } +fi +ac_ct_PROPER_COMPILER_CC=$ac_cv_prog_ac_ct_PROPER_COMPILER_CC +if test -n "$ac_ct_PROPER_COMPILER_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CC" >&5 +$as_echo "$ac_ct_PROPER_COMPILER_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$BUILD_CXX" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_CXX" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_CXX=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_CXX=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + test -n "$ac_ct_PROPER_COMPILER_CC" && break done - done -IFS=$as_save_IFS - ;; + if test "x$ac_ct_PROPER_COMPILER_CC" = x; then + PROPER_COMPILER_CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac -fi -BUILD_CXX=$ac_cv_path_BUILD_CXX -if test -n "$BUILD_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 -$as_echo "$BUILD_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "x$BUILD_CXX" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_CXX=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_CXX=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CXX" >&5 -$as_echo_n "checking for BUILD_CXX... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_CXX=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi + PROPER_COMPILER_CC=$ac_ct_PROPER_COMPILER_CC fi - +fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_CXX" + complete="$PROPER_COMPILER_CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -26998,14 +26747,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 fi fi @@ -27025,11 +26774,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -27076,7 +26825,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_CXX" + complete="$PROPER_COMPILER_CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -27121,14 +26870,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 fi fi @@ -27174,7 +26923,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_CXX" + complete="$PROPER_COMPILER_CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -27193,20 +26942,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving BUILD_CXX (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 fi fi @@ -27218,40 +26966,221 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - BUILD_CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;} + PROPER_COMPILER_CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;} fi + PATH="$RETRY_COMPILER_SAVED_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CC" >&5 +$as_echo_n "checking for resolved symbolic links for CC... " >&6; } - # Publish this variable in the help. + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi + fi + + if test "x$READLINK" != x; then + PROPER_COMPILER_CC=`$READLINK -f $PROPER_COMPILER_CC` + else + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $PROPER_COMPILER_CC` + sym_link_file=`$BASENAME $PROPER_COMPILER_CC` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break + fi + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + PROPER_COMPILER_CC=$sym_link_dir/$sym_link_file + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 +$as_echo "$PROPER_COMPILER_CC" >&6; } + CC="$PROPER_COMPILER_CC" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CC" >&5 +$as_echo "no, keeping CC" >&6; } + CC="$TEST_COMPILER" + fi - if test "x$BUILD_LD" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in ld -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + + COMPILER=$CC + COMPILER_NAME=$COMPILER_NAME + + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then + # cc -V output typically looks like + # cc: Sun C 5.12 Linux_i386 2011/11/16 + COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` + # Check that this is likely to be the Solaris Studio cc. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null + if test $? -ne 0; then + ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Remove usage instructions (if present), and + # collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *[Uu]sage:.*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/"` + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + # xlc -qversion output typically looks like + # IBM XL C/C++ for AIX, V11.1 (5724-X13) + # Version: 11.01.0000.0015 + COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` + # Check that this is likely to be the IBM XL C compiler. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null + if test $? -ne 0; then + ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*, V\([1-9][0-9.]*\).*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # There is no specific version flag, but all output starts with a version string. + # First line typically looks something like: + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 + COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` + # Check that this is likely to be Microsoft CL.EXE. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*ersion.\([1-9][0-9.]*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xgcc; then + # gcc --version output typically looks like + # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 + # Copyright (C) 2013 Free Software Foundation, Inc. + # This is free software; see the source for copying conditions. There is NO + # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` + # Check that this is likely to be GCC. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Remove Copyright and legalese from version string, and + # collapse into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *Copyright .*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.* \([1-9]\.[0-9.]*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xclang; then + # clang --version output typically looks like + # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) + # clang version 3.3 (tags/RELEASE_33/final) + # or + # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) + # Target: x86_64-pc-linux-gnu + # Thread model: posix + COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` + # Check that this is likely to be clang + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*clang version \([1-9][0-9.]*\).*$/\1/'` + + else + as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5 + fi + # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) + CC_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" + # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) + CC_VERSION_STRING="$COMPILER_VERSION_STRING" + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&5 +$as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&6;} + + + # Now that we have resolved CC ourself, let autoconf have its go at it + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_LD+:} false; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - case $BUILD_LD in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_LD="$BUILD_LD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27259,57 +27188,43 @@ done done IFS=$as_save_IFS - ;; -esac fi -BUILD_LD=$ac_cv_path_BUILD_LD -if test -n "$BUILD_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5 -$as_echo "$BUILD_LD" >&6; } +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$BUILD_LD" && break -done - - else - # The variable is set, but is it from the command line or the environment? - - # Try to remove the string !BUILD_LD! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_LD!/} - if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then - # If it failed, the variable was not from the command line. Ignore it, - # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xBUILD_LD" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_LD from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of BUILD_LD from the environment. Use command line variables instead." >&2;} - fi - # Try to locate tool using the code snippet - for ac_prog in ld + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in $CC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_LD+:} false; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else - case $BUILD_LD in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_LD="$BUILD_LD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -27317,130 +27232,780 @@ done done IFS=$as_save_IFS - ;; -esac fi -BUILD_LD=$ac_cv_path_BUILD_LD -if test -n "$BUILD_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5 -$as_echo "$BUILD_LD" >&6; } +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$BUILD_LD" && break -done - - else - # If it succeeded, then it was overridden by the user. We will use it - # for the tool. - - # First remove it from the list of overridden variables, so we can test - # for unknown variables in the end. - CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" - - # Check if the provided tool contains a complete path. - tool_specified="$BUILD_LD" - tool_basename="${tool_specified##*/}" - if test "x$tool_basename" = "x$tool_specified"; then - # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_LD=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool BUILD_LD=$tool_basename" >&6;} - # Extract the first word of "$tool_basename", so it can be a program name with args. -set dummy $tool_basename; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BUILD_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $BUILD_LD in - [\\/]* | ?:[\\/]*) - ac_cv_path_BUILD_LD="$BUILD_LD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + test -n "$ac_ct_CC" && break done - done -IFS=$as_save_IFS - ;; + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac -fi -BUILD_LD=$ac_cv_path_BUILD_LD -if test -n "$BUILD_LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5 -$as_echo "$BUILD_LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + CC=$ac_ct_CC + fi fi - if test "x$BUILD_LD" = x; then - as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 - fi - else - # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_LD=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool BUILD_LD=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_LD" >&5 -$as_echo_n "checking for BUILD_LD... " >&6; } - if test ! -x "$tool_specified"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } - as_fn_error $? "User supplied tool BUILD_LD=$tool_specified does not exist or is not executable" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 -$as_echo "$tool_specified" >&6; } - fi - fi +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - # First separate the path from the arguments. This will split at the first - # space. - complete="$BUILD_LD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + COMPILER_NAME=C++ + SEARCH_LIST="$TOOLCHAIN_CXX_BINARY" + + if test "x$CXX" != x; then + # User has supplied compiler name already, always let that override. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied compiler CXX=$CXX" >&5 +$as_echo "$as_me: Will use user supplied compiler CXX=$CXX" >&6;} + if test "x`basename $CXX`" = "x$CXX"; then + # A command without a complete path is provided, search $PATH. + + for ac_prog in $CXX +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_POTENTIAL_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $POTENTIAL_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_POTENTIAL_CXX="$POTENTIAL_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX +if test -n "$POTENTIAL_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5 +$as_echo "$POTENTIAL_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$POTENTIAL_CXX" && break +done + + if test "x$POTENTIAL_CXX" != x; then + CXX=$POTENTIAL_CXX + else + as_fn_error $? "User supplied compiler CXX=$CXX could not be found" "$LINENO" 5 + fi + else + # Otherwise it might already be a complete path + if test ! -x "$CXX"; then + as_fn_error $? "User supplied compiler CXX=$CXX does not exist" "$LINENO" 5 + fi + fi + else + # No user supplied value. Locate compiler ourselves. + + # If we are cross compiling, assume cross compilation tools follows the + # cross compilation standard where they are prefixed with the autoconf + # standard name for the target. For example the binary + # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. + # If we are not cross compiling, then the default compiler name will be + # used. + + CXX= + # If TOOLS_DIR is set, check for all compiler names in there first + # before checking the rest of the PATH. + # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION + # step, this should not be necessary. + if test -n "$TOOLS_DIR"; then + PATH_save="$PATH" + PATH="$TOOLS_DIR" + for ac_prog in $TOOLCHAIN_CXX_BINARY +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_TOOLS_DIR_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $TOOLS_DIR_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_TOOLS_DIR_CXX="$TOOLS_DIR_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_TOOLS_DIR_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +TOOLS_DIR_CXX=$ac_cv_path_TOOLS_DIR_CXX +if test -n "$TOOLS_DIR_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CXX" >&5 +$as_echo "$TOOLS_DIR_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$TOOLS_DIR_CXX" && break +done + + CXX=$TOOLS_DIR_CXX + PATH="$PATH_save" + fi + + # AC_PATH_PROGS can't be run multiple times with the same variable, + # so create a new name for this run. + if test "x$CXX" = x; then + for ac_prog in $TOOLCHAIN_CXX_BINARY +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_POTENTIAL_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $POTENTIAL_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_POTENTIAL_CXX="$POTENTIAL_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX +if test -n "$POTENTIAL_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5 +$as_echo "$POTENTIAL_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$POTENTIAL_CXX" && break +done + + CXX=$POTENTIAL_CXX + fi + + if test "x$CXX" = x; then + + # Print a helpful message on how to acquire the necessary build dependency. + # devkit is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=devkit + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= + + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi + fi + + as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 + fi + fi + + # Now we have a compiler binary in CXX. Make sure it's okay. + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXX" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` # bat and cmd files are not always considered executable in cygwin causing which # to not find them if test "x$new_path" = x \ @@ -27450,14 +28015,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 fi fi @@ -27477,11 +28042,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -27528,7 +28093,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_LD" + complete="$CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -27573,14 +28138,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 fi fi @@ -27626,7 +28191,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$BUILD_LD" + complete="$CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -27645,20 +28210,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving BUILD_LD (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 fi fi @@ -27670,362 +28234,107 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - BUILD_LD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;} - fi - + CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;} fi + TEST_COMPILER="$CXX" + # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links + # to 'xlc' but it is crucial that we invoke the compiler with the right name! + if test "x$OPENJDK_BUILD_OS" != xaix; then + # FIXME: This test should not be needed anymore; we don't do that for any platform. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5 +$as_echo_n "checking resolved symbolic links for CXX... " >&6; } - - - # If a devkit is found on the builddeps server, then prepend its path to the - # PATH variable. If there are cross compilers available in the devkit, these - # will be found by AC_PROG_CC et al. - DEVKIT= - - - if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then - # Source the builddeps file again, to make sure it uses the latest variables! - . $builddepsfile - # Look for a target and build machine specific resource! - eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}} - if test "x$resource" = x; then - # Ok, lets instead look for a target specific resource - eval resource=\${builddep_devkit_TARGET_${rewritten_target_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a build specific resource - eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}} - fi - if test "x$resource" = x; then - # Ok, lets instead look for a generic resource - # (The devkit comes from M4 and not the shell, thus no need for eval here.) - resource=${builddep_devkit} - fi - if test "x$resource" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for devkit" >&5 -$as_echo "$as_me: Using builddeps $resource for devkit" >&6;} - # If the resource in the builddeps.conf file is an existing directory, - # for example /java/linux/cups - if test -d ${resource}; then - depdir=${resource} - else - - # devkit is for example mymodule - # $resource is for example libs/general/libmymod_1_2_3.zip - # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps - # $with_builddeps_dir is for example /localhome/builddeps - # depdir is the name of the variable into which we store the depdir, eg MYMOD - # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and - # unzip into the directory: /localhome/builddeps/libmymod_1_2_3 - filename=`basename $resource` - filebase=`echo $filename | sed 's/\.[^\.]*$//'` - filebase=${filename%%.*} - extension=${filename#*.} - installdir=$with_builddeps_dir/$filebase - if test ! -f $installdir/$filename.unpacked; then - { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5 -$as_echo "$as_me: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&6;} - if test ! -d $installdir; then - mkdir -p $installdir - fi - if test ! -d $installdir; then - as_fn_error $? "Could not create directory $installdir" "$LINENO" 5 - fi - tmpfile=`mktemp $installdir/devkit.XXXXXXXXX` - touch $tmpfile - if test ! -f $tmpfile; then - as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5 + if test "x$OPENJDK_BUILD_OS" != xwindows; then + # Follow a chain of symbolic links. Use readlink + # where it exists, else fall back to horribly + # complicated shell code. + if test "x$READLINK_TESTED" != yes; then + # On MacOSX there is a readlink tool with a different + # purpose than the GNU readlink tool. Check the found readlink. + ISGNU=`$READLINK --version 2>&1 | $GREP GNU` + if test "x$ISGNU" = x; then + # A readlink that we do not know how to use. + # Are there other non-GNU readlinks out there? + READLINK_TESTED=yes + READLINK= + fi fi - # $with_builddeps_server/$resource is the ftp://abuilddeps.server.com/libs/cups.zip - # $tmpfile is the local file name for the downloaded file. - VALID_TOOL=no - if test "x$BDEPS_FTP" = xwget; then - VALID_TOOL=yes - wget -O $tmpfile $with_builddeps_server/$resource - fi - if test "x$BDEPS_FTP" = xlftp; then - VALID_TOOL=yes - lftp -c "get $with_builddeps_server/$resource -o $tmpfile" - fi - if test "x$BDEPS_FTP" = xftp; then - VALID_TOOL=yes - FTPSERVER=`echo $with_builddeps_server/$resource | cut -f 3 -d '/'` - FTPPATH=`echo $with_builddeps_server/$resource | cut -f 4- -d '/'` - FTPUSERPWD=${FTPSERVER%%@*} - if test "x$FTPSERVER" != "x$FTPUSERPWD"; then - FTPUSER=${userpwd%%:*} - FTPPWD=${userpwd#*@} - FTPSERVER=${FTPSERVER#*@} + if test "x$READLINK" != x; then + TEST_COMPILER=`$READLINK -f $TEST_COMPILER` else - FTPUSER=ftp - FTPPWD=ftp - fi - # the "pass" command does not work on some - # ftp clients (read ftp.exe) but if it works, - # passive mode is better! - ( \ - echo "user $FTPUSER $FTPPWD" ; \ - echo "pass" ; \ - echo "bin" ; \ - echo "get $FTPPATH $tmpfile" ; \ - ) | ftp -in $FTPSERVER - fi - if test "x$VALID_TOOL" != xyes; then - as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5 - fi - - mv $tmpfile $installdir/$filename - if test ! -s $installdir/$filename; then - as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5 - fi - case "$extension" in - zip) echo "Unzipping $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked) - ;; - tar.gz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - tgz) echo "Untaring $installdir/$filename..." - (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked) - ;; - *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5 - ;; - esac - fi - if test -f $installdir/$filename.unpacked; then - depdir=$installdir - fi - - fi - # Source the builddeps file again, because in the previous command, the depdir - # was updated to point at the current build dependency install directory. - . $builddepsfile - # Now extract variables from the builddeps.conf files. - theroot=${builddep_devkit_ROOT} - thecflags=${builddep_devkit_CFLAGS} - thelibs=${builddep_devkit_LIBS} - if test "x$depdir" = x; then - as_fn_error $? "Could not download build dependency devkit" "$LINENO" 5 - fi - DEVKIT=$depdir - if test "x$theroot" != x; then - DEVKIT="$theroot" - fi - if test "x$thecflags" != x; then - DEVKIT_CFLAGS="$thecflags" - fi - if test "x$thelibs" != x; then - DEVKIT_LIBS="$thelibs" - fi - - # Found devkit - PATH="$DEVKIT/bin:$PATH" - SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" - if test "x$x_includes" = "xNONE"; then - x_includes="$SYS_ROOT/usr/include/X11" - fi - if test "x$x_libraries" = "xNONE"; then - x_libraries="$SYS_ROOT/usr/lib" + # Save the current directory for restoring afterwards + STARTDIR=$PWD + COUNTER=0 + sym_link_dir=`$DIRNAME $TEST_COMPILER` + sym_link_file=`$BASENAME $TEST_COMPILER` + cd $sym_link_dir + # Use -P flag to resolve symlinks in directories. + cd `$THEPWDCMD -P` + sym_link_dir=`$THEPWDCMD -P` + # Resolve file symlinks + while test $COUNTER -lt 20; do + ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` + if test "x$ISLINK" == x; then + # This is not a symbolic link! We are done! + break fi - - + # Again resolve directory symlinks since the target of the just found + # link could be in a different directory + cd `$DIRNAME $ISLINK` + sym_link_dir=`$THEPWDCMD -P` + sym_link_file=`$BASENAME $ISLINK` + let COUNTER=COUNTER+1 + done + cd $STARTDIR + TEST_COMPILER=$sym_link_dir/$sym_link_file fi - fi - - # Store the CFLAGS etal passed to the configure script. - ORG_CFLAGS="$CFLAGS" - ORG_CXXFLAGS="$CXXFLAGS" - ORG_OBJCFLAGS="$OBJCFLAGS" - - # autoconf magic only relies on PATH, so update it if tools dir is specified - OLD_PATH="$PATH" - if test "x$TOOLS_DIR" != x; then - PATH=$TOOLS_DIR:$PATH + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 +$as_echo "$TEST_COMPILER" >&6; } fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CXX is disguised ccache" >&5 +$as_echo_n "checking if CXX is disguised ccache... " >&6; } - # Before we locate the compilers, we need to sanitize the Xcode build environment - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - # determine path to Xcode developer directory - # can be empty in which case all the tools will rely on a sane Xcode 4 installation - SET_DEVELOPER_DIR= - - if test -n "$XCODE_PATH"; then - DEVELOPER_DIR="$XCODE_PATH"/Contents/Developer - fi - - # DEVELOPER_DIR could also be provided directly - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining if we need to set DEVELOPER_DIR" >&5 -$as_echo_n "checking Determining if we need to set DEVELOPER_DIR... " >&6; } - if test -n "$DEVELOPER_DIR"; then - if test ! -d "$DEVELOPER_DIR"; then - as_fn_error $? "Xcode Developer path does not exist: $DEVELOPER_DIR, please provide a path to the Xcode 4 application bundle using --with-xcode-path" "$LINENO" 5 - fi - if test ! -f "$DEVELOPER_DIR"/usr/bin/xcodebuild; then - as_fn_error $? "Xcode Developer path is not valid: $DEVELOPER_DIR, it must point to Contents/Developer inside an Xcode application bundle" "$LINENO" 5 - fi - # make it visible to all the tools immediately - export DEVELOPER_DIR - SET_DEVELOPER_DIR="export DEVELOPER_DIR := $DEVELOPER_DIR" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEVELOPER_DIR)" >&5 -$as_echo "yes ($DEVELOPER_DIR)" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi + COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` + if test "x$COMPILER_BASENAME" = "xccache"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5 +$as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } + # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. + # We want to control ccache invocation ourselves, so ignore this cc and try + # searching again. + # Remove the path to the fake ccache cc from the PATH + RETRY_COMPILER_SAVED_PATH="$PATH" + COMPILER_DIRNAME=`$DIRNAME $CXX` + PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" - # Extract the first word of "xcodebuild", so it can be a program name with args. -set dummy xcodebuild; ac_word=$2 + # Try again looking for our compiler + if test -n "$ac_tool_prefix"; then + for ac_prog in $TOOLCHAIN_CXX_BINARY + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XCODEBUILD+:} false; then : +if ${ac_cv_prog_PROPER_COMPILER_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - case $XCODEBUILD in - [\\/]* | ?:[\\/]*) - ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XCODEBUILD=$ac_cv_path_XCODEBUILD -if test -n "$XCODEBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 -$as_echo "$XCODEBUILD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test -z "$XCODEBUILD"; then - as_fn_error $? "The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X" "$LINENO" 5 - fi - - # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later - XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'` - XC_VERSION_PARTS=( ${XCODE_VERSION//./ } ) - if test ! "${XC_VERSION_PARTS[0]}" = "4"; then - as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5 - fi - - # Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to - # clang and clang++, which will break the build. So handle that here if we need to. - if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then - # use xcrun to find the real gcc and add it's directory to PATH - # then autoconf magic will find it - { $as_echo "$as_me:${as_lineno-$LINENO}: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&5 -$as_echo "$as_me: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&6;} - XCODE_BIN_PATH=$(dirname `xcrun -find gcc`) - PATH="$XCODE_BIN_PATH":$PATH - fi - - # Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining Xcode SDK path" >&5 -$as_echo_n "checking Determining Xcode SDK path... " >&6; } - # allow SDKNAME to be set to override the default SDK selection - SDKPATH=`"$XCODEBUILD" -sdk ${SDKNAME:-macosx} -version | grep '^Path: ' | sed 's/Path: //'` - if test -n "$SDKPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKPATH" >&5 -$as_echo "$SDKPATH" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (none, will use system headers and frameworks)" >&5 -$as_echo "(none, will use system headers and frameworks)" >&6; } - fi - - - # Perform a basic sanity test - if test ! -f "$SDKPATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then - as_fn_error $? "Unable to find required framework headers, provide a valid path to Xcode 4 using --with-xcode-path" "$LINENO" 5 - fi - - # if SDKPATH is non-empty then we need to add -isysroot and -iframework for gcc and g++ - if test -n "$SDKPATH"; then - # We need -isysroot and -iframework/System/Library/Frameworks - CFLAGS_JDK="${CFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" - LDFLAGS_JDK="${LDFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" - fi - - # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework - # setting this here means it doesn't have to be peppered throughout the forest - CFLAGS_JDK="$CFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" - CXXFLAGS_JDK="$CXXFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" - LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" - fi - - ### Locate C compiler (CC) - - # On windows, only cl.exe is supported. - # On Solaris, cc is preferred to gcc. - # Elsewhere, gcc is preferred to cc. - - if test "x$CC" != x; then - COMPILER_CHECK_LIST="$CC" - elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" - elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="cc gcc" - elif test "x$OPENJDK_TARGET_OS" = "xaix"; then - # Do not probe for cc on AIX. - COMPILER_CHECK_LIST="xlc_r" - else - COMPILER_CHECK_LIST="gcc cc" - fi - - - COMPILER_NAME=C - - CC= - # If TOOLS_DIR is set, check for all compiler names in there first - # before checking the rest of the PATH. - if test -n "$TOOLS_DIR"; then - PATH_save="$PATH" - PATH="$TOOLS_DIR" - for ac_prog in $COMPILER_CHECK_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOOLS_DIR_CC+:} false; then : - $as_echo_n "(cached) " >&6 + if test -n "$PROPER_COMPILER_CXX"; then + ac_cv_prog_PROPER_COMPILER_CXX="$PROPER_COMPILER_CXX" # Let the user override the test. else - case $TOOLS_DIR_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOOLS_DIR_CC="$TOOLS_DIR_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOOLS_DIR_CC="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_PROPER_COMPILER_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -28033,51 +28342,43 @@ done done IFS=$as_save_IFS - ;; -esac fi -TOOLS_DIR_CC=$ac_cv_path_TOOLS_DIR_CC -if test -n "$TOOLS_DIR_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CC" >&5 -$as_echo "$TOOLS_DIR_CC" >&6; } +fi +PROPER_COMPILER_CXX=$ac_cv_prog_PROPER_COMPILER_CXX +if test -n "$PROPER_COMPILER_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 +$as_echo "$PROPER_COMPILER_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$TOOLS_DIR_CC" && break -done +$as_echo "no" >&6; } +fi - CC=$TOOLS_DIR_CC - PATH="$PATH_save" - fi - # AC_PATH_PROGS can't be run multiple times with the same variable, - # so create a new name for this run. - if test "x$CC" = x; then - for ac_prog in $COMPILER_CHECK_LIST + test -n "$PROPER_COMPILER_CXX" && break + done +fi +if test -z "$PROPER_COMPILER_CXX"; then + ac_ct_PROPER_COMPILER_CXX=$PROPER_COMPILER_CXX + for ac_prog in $TOOLCHAIN_CXX_BINARY do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_POTENTIAL_CC+:} false; then : +if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - case $POTENTIAL_CC in - [\\/]* | ?:[\\/]*) - ac_cv_path_POTENTIAL_CC="$POTENTIAL_CC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_PROPER_COMPILER_CXX"; then + ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_ct_PROPER_COMPILER_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -28085,64 +28386,40 @@ done done IFS=$as_save_IFS - ;; -esac fi -POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC -if test -n "$POTENTIAL_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5 -$as_echo "$POTENTIAL_CC" >&6; } +fi +ac_ct_PROPER_COMPILER_CXX=$ac_cv_prog_ac_ct_PROPER_COMPILER_CXX +if test -n "$ac_ct_PROPER_COMPILER_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CXX" >&5 +$as_echo "$ac_ct_PROPER_COMPILER_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$POTENTIAL_CC" && break + test -n "$ac_ct_PROPER_COMPILER_CXX" && break done - CC=$POTENTIAL_CC - fi - - if test "x$CC" = x; then - - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetype, cups, pulse, alsa etc - MISSING_DEPENDENCY=devkit - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY + if test "x$ac_ct_PROPER_COMPILER_CXX" = x; then + PROPER_COMPILER_CXX="" else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PROPER_COMPILER_CXX=$ac_ct_PROPER_COMPILER_CXX fi +fi - as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 - fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$CC" + complete="$PROPER_COMPILER_CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -28178,14 +28455,14 @@ done fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 fi fi @@ -28205,11 +28482,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -28256,7 +28533,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$CC" + complete="$PROPER_COMPILER_CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -28301,14 +28578,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 fi fi @@ -28354,7 +28631,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$CC" + complete="$PROPER_COMPILER_CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -28373,20 +28650,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving CC (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 fi fi @@ -28398,17 +28674,15 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;} + PROPER_COMPILER_CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;} fi - TEST_COMPILER="$CC" - # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links - # to 'xlc' but it is crucial that we invoke the compiler with the right name! - if test "x$OPENJDK_BUILD_OS" != xaix; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5 -$as_echo_n "checking resolved symbolic links for CC... " >&6; } + PATH="$RETRY_COMPILER_SAVED_PATH" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CXX" >&5 +$as_echo_n "checking for resolved symbolic links for CXX... " >&6; } if test "x$OPENJDK_BUILD_OS" != xwindows; then # Follow a chain of symbolic links. Use readlink @@ -28427,13 +28701,13 @@ $as_echo_n "checking resolved symbolic links for CC... " >&6; } fi if test "x$READLINK" != x; then - TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + PROPER_COMPILER_CXX=`$READLINK -f $PROPER_COMPILER_CXX` else # Save the current directory for restoring afterwards STARTDIR=$PWD COUNTER=0 - sym_link_dir=`$DIRNAME $TEST_COMPILER` - sym_link_file=`$BASENAME $TEST_COMPILER` + sym_link_dir=`$DIRNAME $PROPER_COMPILER_CXX` + sym_link_file=`$BASENAME $PROPER_COMPILER_CXX` cd $sym_link_dir # Use -P flag to resolve symlinks in directories. cd `$THEPWDCMD -P` @@ -28453,42 +28727,163 @@ $as_echo_n "checking resolved symbolic links for CC... " >&6; } let COUNTER=COUNTER+1 done cd $STARTDIR - TEST_COMPILER=$sym_link_dir/$sym_link_file + PROPER_COMPILER_CXX=$sym_link_dir/$sym_link_file fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 -$as_echo "$TEST_COMPILER" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 +$as_echo "$PROPER_COMPILER_CXX" >&6; } + CXX="$PROPER_COMPILER_CXX" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CXX" >&5 +$as_echo "no, keeping CXX" >&6; } + CXX="$TEST_COMPILER" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CC is disguised ccache" >&5 -$as_echo_n "checking if CC is disguised ccache... " >&6; } - COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` - if test "x$COMPILER_BASENAME" = "xccache"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5 -$as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } - # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. - # We want to control ccache invocation ourselves, so ignore this cc and try - # searching again. - # Remove the path to the fake ccache cc from the PATH - RETRY_COMPILER_SAVED_PATH="$PATH" - COMPILER_DIRNAME=`$DIRNAME $CC` - PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + COMPILER=$CXX + COMPILER_NAME=$COMPILER_NAME - # Try again looking for our compiler + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then + # cc -V output typically looks like + # cc: Sun C 5.12 Linux_i386 2011/11/16 + COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` + # Check that this is likely to be the Solaris Studio cc. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null + if test $? -ne 0; then + ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Remove usage instructions (if present), and + # collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *[Uu]sage:.*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/"` + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + # xlc -qversion output typically looks like + # IBM XL C/C++ for AIX, V11.1 (5724-X13) + # Version: 11.01.0000.0015 + COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` + # Check that this is likely to be the IBM XL C compiler. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null + if test $? -ne 0; then + ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with -qversion was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$ALT_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*, V\([1-9][0-9.]*\).*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # There is no specific version flag, but all output starts with a version string. + # First line typically looks something like: + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 + COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` + # Check that this is likely to be Microsoft CL.EXE. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running it was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*ersion.\([1-9][0-9.]*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xgcc; then + # gcc --version output typically looks like + # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 + # Copyright (C) 2013 Free Software Foundation, Inc. + # This is free software; see the source for copying conditions. There is NO + # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` + # Check that this is likely to be GCC. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Remove Copyright and legalese from version string, and + # collapse into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *Copyright .*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.* \([1-9]\.[0-9.]*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xclang; then + # clang --version output typically looks like + # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) + # clang version 3.3 (tags/RELEASE_33/final) + # or + # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) + # Target: x86_64-pc-linux-gnu + # Thread model: posix + COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` + # Check that this is likely to be clang + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null + if test $? -ne 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&5 +$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&5 +$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_OUTPUT\"" >&6;} + as_fn_error $? "A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir." "$LINENO" 5 + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*clang version \([1-9][0-9.]*\).*$/\1/'` + + else + as_fn_error $? "Unknown toolchain type $TOOLCHAIN_TYPE." "$LINENO" 5 + fi + # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) + CXX_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" + # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) + CXX_VERSION_STRING="$COMPILER_VERSION_STRING" + + { $as_echo "$as_me:${as_lineno-$LINENO}: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&5 +$as_echo "$as_me: Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER [$COMPILER_VERSION_STRING]" >&6;} + + + # Now that we have resolved CXX ourself, let autoconf have its go at it + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else if test -n "$ac_tool_prefix"; then - for ac_prog in $COMPILER_CHECK_LIST + for ac_prog in $CXX do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PROPER_COMPILER_CC+:} false; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$PROPER_COMPILER_CC"; then - ac_cv_prog_PROPER_COMPILER_CC="$PROPER_COMPILER_CC" # Let the user override the test. + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -28497,7 +28892,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PROPER_COMPILER_CC="$ac_tool_prefix$ac_prog" + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -28507,32 +28902,32 @@ IFS=$as_save_IFS fi fi -PROPER_COMPILER_CC=$ac_cv_prog_PROPER_COMPILER_CC -if test -n "$PROPER_COMPILER_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 -$as_echo "$PROPER_COMPILER_CC" >&6; } +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$PROPER_COMPILER_CC" && break + test -n "$CXX" && break done fi -if test -z "$PROPER_COMPILER_CC"; then - ac_ct_PROPER_COMPILER_CC=$PROPER_COMPILER_CC - for ac_prog in $COMPILER_CHECK_LIST +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CXX do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+:} false; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_PROPER_COMPILER_CC"; then - ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_ct_PROPER_COMPILER_CC" # Let the user override the test. + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -28541,7 +28936,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_prog" + ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -28549,40 +28944,355 @@ done done IFS=$as_save_IFS -fi -fi -ac_ct_PROPER_COMPILER_CC=$ac_cv_prog_ac_ct_PROPER_COMPILER_CC -if test -n "$ac_ct_PROPER_COMPILER_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CC" >&5 -$as_echo "$ac_ct_PROPER_COMPILER_CC" >&6; } +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + # This is the compiler version number on the form X.Y[.Z] + + + + + if test "x$CC_VERSION" != "x$CXX_VERSION"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler has different version numbers, $CC_VERSION vs $CXX_VERSION." >&5 +$as_echo "$as_me: WARNING: C and C++ compiler has different version numbers, $CC_VERSION vs $CXX_VERSION." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5 +$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;} + fi + + # We only check CC_VERSION since we assume CXX_VERSION is equal. + if [[ "$CC_VERSION" =~ (.*\.){3} ]] ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION. Comparisons might be wrong." >&5 +$as_echo "$as_me: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION. Comparisons might be wrong." >&2;} + fi + + if [[ "$CC_VERSION" =~ [0-9]{6} ]] ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION. Comparisons might be wrong." >&5 +$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION. Comparisons might be wrong." >&2;} + fi + + COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", $1, $2, $3) }' <<< "$CC_VERSION"` + + + # + # Setup the preprocessor (CPP and CXXCPP) + # + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + # Broken: fails on valid input. +continue fi +rm -f conftest.err conftest.i conftest.$ac_ext + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext - test -n "$ac_ct_PROPER_COMPILER_CC" && break done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : - if test "x$ac_ct_PROPER_COMPILER_CC" = x; then - PROPER_COMPILER_CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PROPER_COMPILER_CC=$ac_ct_PROPER_COMPILER_CC - fi +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$PROPER_COMPILER_CC" + complete="$CPP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -28618,14 +29328,14 @@ fi fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 fi fi @@ -28645,11 +29355,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -28696,7 +29406,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$PROPER_COMPILER_CC" + complete="$CPP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -28741,14 +29451,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 fi fi @@ -28780,906 +29490,497 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh new_path="$unix_path" elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a posix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$PROPER_COMPILER_CC" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) failed, using $path directly." >&6;} - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5 - fi - fi - - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - PROPER_COMPILER_CC="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;} - fi - - PATH="$RETRY_COMPILER_SAVED_PATH" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CC" >&5 -$as_echo_n "checking for resolved symbolic links for CC... " >&6; } - - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - PROPER_COMPILER_CC=`$READLINK -f $PROPER_COMPILER_CC` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $PROPER_COMPILER_CC` - sym_link_file=`$BASENAME $PROPER_COMPILER_CC` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - PROPER_COMPILER_CC=$sym_link_dir/$sym_link_file - fi - fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5 -$as_echo "$PROPER_COMPILER_CC" >&6; } - CC="$PROPER_COMPILER_CC" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CC" >&5 -$as_echo "no, keeping CC" >&6; } - CC="$TEST_COMPILER" - fi - - COMPILER=$CC - COMPILER_NAME=$COMPILER_NAME - - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work - COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` - $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` - - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5 -$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&6;} - as_fn_error $? "Sun Studio compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - else - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p"` - COMPILER_VENDOR="Sun Studio" - fi - elif test "x$OPENJDK_TARGET_OS" = xaix; then - COMPILER_VERSION_TEST=`$COMPILER -qversion 2>&1 | $TAIL -n 1` - $ECHO $COMPILER_VERSION_TEST | $GREP "^Version: " > /dev/null - if test $? -ne 0; then - as_fn_error $? "Failed to detect the compiler version of $COMPILER ...." "$LINENO" 5 - else - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n 's/Version: \(0-90-9\.0-90-9*\).*/\1/p'` - COMPILER_VENDOR='IBM' - fi - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` - COMPILER_VENDOR="Microsoft CL.EXE" - COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` - if test "x$OPENJDK_TARGET_CPU" = "xx86"; then - if test "x$COMPILER_CPU_TEST" != "x80x86"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5 - fi - elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then - if test "x$COMPILER_CPU_TEST" != "xx64"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5 - fi - fi - else - COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` - # Check that this is likely to be GCC. - $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;} - as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - - # First line typically looks something like: - # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | \ - $SED -e 's/^.* \([1-9]\.[0-9.]*\)[^0-9.].*$/\1/'` - COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) [1-9][0-9.]*/\1/p"` - fi - # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) - CC_VERSION="$COMPILER_VERSION" - # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) - CC_VENDOR="$COMPILER_VENDOR" - - { $as_echo "$as_me:${as_lineno-$LINENO}: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5 -$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;} - - - # Now that we have resolved CC ourself, let autoconf have its go at it - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in $CC -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no else - if test "$cross_compiling" = maybe; then - cross_compiling=yes + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Cannot rely on the command "which" here since it doesn't always work. + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test -z "$is_absolute_path"; then + # Path to executable is not absolute. Find it. + IFS_save="$IFS" + IFS=: + for p in $PATH; do + if test -f "$p/$path" && test -x "$p/$path"; then + new_path="$p/$path" + break + fi + done + IFS="$IFS_save" else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } + # This is an absolute path, we can use it without further modifications. + new_path="$path" + fi + + if test "x$new_path" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 fi fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + CPP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;} + fi + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : -int -main () -{ +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext - ; - return 0; -} + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include _ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext + + done + ac_cv_prog_CXXCPP=$CXXCPP + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 + CXXCPP=$ac_cv_prog_CXXCPP else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me +#ifdef __STDC__ +# include +#else +# include #endif - - ; - return 0; -} + Syntax error _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes +if ac_fn_cxx_try_cpp "$LINENO"; then : + else - ac_compiler_gnu=no + # Broken: fails on valid input. +continue fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu +rm -f conftest.err conftest.i conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - GCC= + # Passes both tests. +ac_preproc_ok=: +break fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +rm -f conftest.err conftest.i conftest.$ac_ext -int -main () -{ +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi -int -main () -{ +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then -int -main () -{ + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file presence. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi else - CFLAGS= + input_to_shortpath="$new_path" fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then -fi + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi - # Option used to tell the compiler whether to create 32- or 64-bit executables - # Notice that CC contains the full compiler path at this point. - case $CC in - *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";; - *) COMPILER_TARGET_BITS_FLAG="-m";; - esac + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi - ### Locate C++ compiler (CXX) - if test "x$CXX" != x; then - COMPILER_CHECK_LIST="$CXX" - elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" - elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="CC g++" - elif test "x$OPENJDK_TARGET_OS" = "xaix"; then - # Do not probe for CC on AIX . - COMPILER_CHECK_LIST="xlC_r" + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! else - COMPILER_CHECK_LIST="g++ CC" + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` fi + # Output is in $new_path - COMPILER_NAME=C++ + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi - CXX= - # If TOOLS_DIR is set, check for all compiler names in there first - # before checking the rest of the PATH. - if test -n "$TOOLS_DIR"; then - PATH_save="$PATH" - PATH="$TOOLS_DIR" - for ac_prog in $COMPILER_CHECK_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TOOLS_DIR_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TOOLS_DIR_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_TOOLS_DIR_CXX="$TOOLS_DIR_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TOOLS_DIR_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -TOOLS_DIR_CXX=$ac_cv_path_TOOLS_DIR_CXX -if test -n "$TOOLS_DIR_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CXX" >&5 -$as_echo "$TOOLS_DIR_CXX" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$CXXCPP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + # Cannot rely on the command "which" here since it doesn't always work. + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test -z "$is_absolute_path"; then + # Path to executable is not absolute. Find it. + IFS_save="$IFS" + IFS=: + for p in $PATH; do + if test -f "$p/$path" && test -x "$p/$path"; then + new_path="$p/$path" + break + fi + done + IFS="$IFS_save" + else + # This is an absolute path, we can use it without further modifications. + new_path="$path" + fi - test -n "$TOOLS_DIR_CXX" && break -done + if test "x$new_path" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + fi + fi - CXX=$TOOLS_DIR_CXX - PATH="$PATH_save" + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, - # so create a new name for this run. - if test "x$CXX" = x; then - for ac_prog in $COMPILER_CHECK_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test "x$complete" != "x$new_complete"; then + CXXCPP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;} + fi + + + # + # Setup the linker (LD) + # + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # In the Microsoft toolchain we have a separate LD command "link". + # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is + # a cygwin program for something completely different. + # Extract the first word of "link", so it can be a program name with args. +set dummy link; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_POTENTIAL_CXX+:} false; then : +if ${ac_cv_prog_LD+:} false; then : $as_echo_n "(cached) " >&6 else - case $POTENTIAL_CXX in - [\\/]* | ?:[\\/]*) - ac_cv_path_POTENTIAL_CXX="$POTENTIAL_CXX" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" + if test "$as_dir/$ac_word$ac_exec_ext" = "$CYGWIN_LINK"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_LD="link" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -29687,64 +29988,36 @@ done done IFS=$as_save_IFS - ;; -esac +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_LD + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set LD to just the basename; use the full file name. + shift + ac_cv_prog_LD="$as_dir/$ac_word${1+' '}$@" + fi fi -POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX -if test -n "$POTENTIAL_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5 -$as_echo "$POTENTIAL_CXX" >&6; } +fi +fi +LD=$ac_cv_prog_LD +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +$as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$POTENTIAL_CXX" && break -done - - CXX=$POTENTIAL_CXX - fi - - if test "x$CXX" = x; then - - # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetype, cups, pulse, alsa etc - MISSING_DEPENDENCY=devkit - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - cygwin_help $MISSING_DEPENDENCY - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - msys_help $MISSING_DEPENDENCY - else - PKGHANDLER_COMMAND= - - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - esac - - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." - fi - fi - - as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 - fi if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$CXX" + complete="$LD" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -29780,14 +30053,14 @@ done fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 fi fi @@ -29807,11 +30080,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of LD, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -29858,7 +30131,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$CXX" + complete="$LD" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -29903,14 +30176,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 fi fi @@ -29956,7 +30229,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$CXX" + complete="$LD" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -29975,20 +30248,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving CXX (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LD, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LD" "$LINENO" 5 fi fi @@ -30000,106 +30272,67 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;} + LD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LD to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting LD to \"$new_complete\"" >&6;} fi - TEST_COMPILER="$CXX" - # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links - # to 'xlc' but it is crucial that we invoke the compiler with the right name! - if test "x$OPENJDK_BUILD_OS" != xaix; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5 -$as_echo_n "checking resolved symbolic links for CXX... " >&6; } - - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - - if test "x$READLINK" != x; then - TEST_COMPILER=`$READLINK -f $TEST_COMPILER` + # Verify that we indeed succeeded with this trick. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5 +$as_echo_n "checking if the found link.exe is actually the Visual Studio linker... " >&6; } + "$LD" --version > /dev/null + if test $? -eq 0 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "This is the Cygwin link tool. Please check your PATH and rerun configure." "$LINENO" 5 else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $TEST_COMPILER` - sym_link_file=`$BASENAME $TEST_COMPILER` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - TEST_COMPILER=$sym_link_dir/$sym_link_file + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi + LDCXX="$LD" + else + # All other toolchains use the compiler to link. + LD="$CC" + LDCXX="$CXX" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5 -$as_echo "$TEST_COMPILER" >&6; } - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CXX is disguised ccache" >&5 -$as_echo_n "checking if CXX is disguised ccache... " >&6; } + # FIXME: it should be CXXLD, according to standard (cf CXXCPP) - COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` - if test "x$COMPILER_BASENAME" = "xccache"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5 -$as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; } - # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. - # We want to control ccache invocation ourselves, so ignore this cc and try - # searching again. - # Remove the path to the fake ccache cc from the PATH - RETRY_COMPILER_SAVED_PATH="$PATH" - COMPILER_DIRNAME=`$DIRNAME $CXX` - PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + # + # Setup the assembler (AS) + # + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # FIXME: should this really be solaris, or solstudio? - # Try again looking for our compiler - if test -n "$ac_tool_prefix"; then - for ac_prog in $COMPILER_CHECK_LIST - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + + # Publish this variable in the help. + + + if test "x$AS" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in as +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PROPER_COMPILER_CXX+:} false; then : +if ${ac_cv_path_AS+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$PROPER_COMPILER_CXX"; then - ac_cv_prog_PROPER_COMPILER_CXX="$PROPER_COMPILER_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $AS in + [\\/]* | ?:[\\/]*) + ac_cv_path_AS="$AS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PROPER_COMPILER_CXX="$ac_tool_prefix$ac_prog" + ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -30107,43 +30340,57 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -PROPER_COMPILER_CXX=$ac_cv_prog_PROPER_COMPILER_CXX -if test -n "$PROPER_COMPILER_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 -$as_echo "$PROPER_COMPILER_CXX" >&6; } +AS=$ac_cv_path_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$PROPER_COMPILER_CXX" && break - done -fi -if test -z "$PROPER_COMPILER_CXX"; then - ac_ct_PROPER_COMPILER_CXX=$PROPER_COMPILER_CXX - for ac_prog in $COMPILER_CHECK_LIST + test -n "$AS" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !AS! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AS!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xAS" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AS from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of AS from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in as do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+:} false; then : +if ${ac_cv_path_AS+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_PROPER_COMPILER_CXX"; then - ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_ct_PROPER_COMPILER_CXX" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $AS in + [\\/]* | ?:[\\/]*) + ac_cv_path_AS="$AS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_prog" + ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -30151,40 +30398,104 @@ done done IFS=$as_save_IFS + ;; +esac +fi +AS=$ac_cv_path_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + + + test -n "$AS" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$AS" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AS=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool AS=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_AS+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $AS in + [\\/]* | ?:[\\/]*) + ac_cv_path_AS="$AS" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac fi -ac_ct_PROPER_COMPILER_CXX=$ac_cv_prog_ac_ct_PROPER_COMPILER_CXX -if test -n "$ac_ct_PROPER_COMPILER_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CXX" >&5 -$as_echo "$ac_ct_PROPER_COMPILER_CXX" >&6; } +AS=$ac_cv_path_AS +if test -n "$AS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +$as_echo "$AS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_PROPER_COMPILER_CXX" && break -done - - if test "x$ac_ct_PROPER_COMPILER_CXX" = x; then - PROPER_COMPILER_CXX="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PROPER_COMPILER_CXX=$ac_ct_PROPER_COMPILER_CXX + if test "x$AS" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AS=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool AS=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AS" >&5 +$as_echo_n "checking for AS... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool AS=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi fi -fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$PROPER_COMPILER_CXX" + complete="$AS" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -30220,14 +30531,14 @@ fi fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 fi fi @@ -30247,11 +30558,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -30298,7 +30609,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$PROPER_COMPILER_CXX" + complete="$AS" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -30343,14 +30654,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 fi fi @@ -30396,7 +30707,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$PROPER_COMPILER_CXX" + complete="$AS" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -30415,20 +30726,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 fi fi @@ -30440,165 +30750,192 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - PROPER_COMPILER_CXX="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;} + AS="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;} fi - PATH="$RETRY_COMPILER_SAVED_PATH" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CXX" >&5 -$as_echo_n "checking for resolved symbolic links for CXX... " >&6; } + else + # FIXME: is this correct for microsoft? + AS="$CC -c" + fi - if test "x$OPENJDK_BUILD_OS" != xwindows; then - # Follow a chain of symbolic links. Use readlink - # where it exists, else fall back to horribly - # complicated shell code. - if test "x$READLINK_TESTED" != yes; then - # On MacOSX there is a readlink tool with a different - # purpose than the GNU readlink tool. Check the found readlink. - ISGNU=`$READLINK --version 2>&1 | $GREP GNU` - if test "x$ISGNU" = x; then - # A readlink that we do not know how to use. - # Are there other non-GNU readlinks out there? - READLINK_TESTED=yes - READLINK= - fi - fi - if test "x$READLINK" != x; then - PROPER_COMPILER_CXX=`$READLINK -f $PROPER_COMPILER_CXX` - else - # Save the current directory for restoring afterwards - STARTDIR=$PWD - COUNTER=0 - sym_link_dir=`$DIRNAME $PROPER_COMPILER_CXX` - sym_link_file=`$BASENAME $PROPER_COMPILER_CXX` - cd $sym_link_dir - # Use -P flag to resolve symlinks in directories. - cd `$THEPWDCMD -P` - sym_link_dir=`$THEPWDCMD -P` - # Resolve file symlinks - while test $COUNTER -lt 20; do - ISLINK=`$LS -l $sym_link_dir/$sym_link_file | $GREP '\->' | $SED -e 's/.*-> \(.*\)/\1/'` - if test "x$ISLINK" == x; then - # This is not a symbolic link! We are done! - break - fi - # Again resolve directory symlinks since the target of the just found - # link could be in a different directory - cd `$DIRNAME $ISLINK` - sym_link_dir=`$THEPWDCMD -P` - sym_link_file=`$BASENAME $ISLINK` - let COUNTER=COUNTER+1 - done - cd $STARTDIR - PROPER_COMPILER_CXX=$sym_link_dir/$sym_link_file - fi + # + # Setup the archiver (AR) + # + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # The corresponding ar tool is lib.exe (used to create static libraries) + # Extract the first word of "lib", so it can be a program name with args. +set dummy lib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="lib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5 -$as_echo "$PROPER_COMPILER_CXX" >&6; } - CXX="$PROPER_COMPILER_CXX" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CXX" >&5 -$as_echo "no, keeping CXX" >&6; } - CXX="$TEST_COMPILER" - fi - COMPILER=$CXX - COMPILER_NAME=$COMPILER_NAME - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work - COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` - $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` + # Publish this variable in the help. - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5 -$as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&6;} - as_fn_error $? "Sun Studio compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - else - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p"` - COMPILER_VENDOR="Sun Studio" - fi - elif test "x$OPENJDK_TARGET_OS" = xaix; then - COMPILER_VERSION_TEST=`$COMPILER -qversion 2>&1 | $TAIL -n 1` - $ECHO $COMPILER_VERSION_TEST | $GREP "^Version: " > /dev/null - if test $? -ne 0; then - as_fn_error $? "Failed to detect the compiler version of $COMPILER ...." "$LINENO" 5 - else - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n 's/Version: \(0-90-9\.0-90-9*\).*/\1/p'` - COMPILER_VENDOR='IBM' - fi - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \([1-9][0-9.]*\) .*/\1/p"` - COMPILER_VENDOR="Microsoft CL.EXE" - COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` - if test "x$OPENJDK_TARGET_CPU" = "xx86"; then - if test "x$COMPILER_CPU_TEST" != "x80x86"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5 - fi - elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then - if test "x$COMPILER_CPU_TEST" != "xx64"; then - as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5 - fi - fi - else - COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` - # Check that this is likely to be GCC. - $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5 -$as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5 -$as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;} - as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5 - fi - # First line typically looks something like: - # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | \ - $SED -e 's/^.* \([1-9]\.[0-9.]*\)[^0-9.].*$/\1/'` - COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) [1-9][0-9.]*/\1/p"` + if test "x$AR" = x; then + # The variable is not set by user, try to locate tool using the code snippet + if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) - CXX_VERSION="$COMPILER_VERSION" - # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) - CXX_VENDOR="$COMPILER_VENDOR" +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5 -$as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;} +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # Now that we have resolved CXX ourself, let autoconf have its go at it - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="" else - if test -n "$ac_tool_prefix"; then - for ac_prog in $CXX + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !AR! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AR!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xAR" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + if test -n "$ac_tool_prefix"; then + for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -30607,7 +30944,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -30617,32 +30954,32 @@ IFS=$as_save_IFS fi fi -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CXX" && break + test -n "$AR" && break done fi -if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CXX +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -30651,7 +30988,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" + ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -30661,21 +30998,21 @@ IFS=$as_save_IFS fi fi -ac_ct_CXX=$ac_cv_prog_ac_ct_CXX -if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_CXX" && break + test -n "$ac_ct_AR" && break done - if test "x$ac_ct_CXX" = x; then - CXX="g++" + if test "x$ac_ct_AR" = x; then + AR="" else case $cross_compiling:$ac_tool_warned in yes:) @@ -30683,188 +31020,355 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CXX=$ac_ct_CXX + AR=$ac_ct_AR + fi +fi + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$AR" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AR=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool AR=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $AR in + [\\/]* | ?:[\\/]*) + ac_cv_path_AR="$AR" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +AR=$ac_cv_path_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$AR" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AR=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool AR=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AR" >&5 +$as_echo_n "checking for AR... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool AR=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + + fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file presence. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" fi -fi + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi fi -fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + # remove trailing .exe if any + new_path="${new_path/%.exe/}" -int -main () -{ -#ifndef __GNUC__ - choke me -#endif + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" -int -main () -{ + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" -else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! else - CXXFLAGS= + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` fi -fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Output is in $new_path - # This is the compiler version number on the form X.Y[.Z] + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + else + # We're on a posix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$AR" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + # Cannot rely on the command "which" here since it doesn't always work. + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test -z "$is_absolute_path"; then + # Path to executable is not absolute. Find it. + IFS_save="$IFS" + IFS=: + for p in $PATH; do + if test -f "$p/$path" && test -x "$p/$path"; then + new_path="$p/$path" + break + fi + done + IFS="$IFS_save" + else + # This is an absolute path, we can use it without further modifications. + new_path="$path" + fi - if test "x$CC_VERSION" != "x$CXX_VERSION"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C and C++ compiler has different version numbers, $CC_VERSION vs $CXX_VERSION." >&5 -$as_echo "$as_me: WARNING: C and C++ compiler has different version numbers, $CC_VERSION vs $CXX_VERSION." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This typically indicates a broken setup, and is not supported" >&5 -$as_echo "$as_me: WARNING: This typically indicates a broken setup, and is not supported" >&2;} + if test "x$new_path" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + fi fi - # We only check CC_VERSION since we assume CXX_VERSION is equal. - if [[ "$CC_VERSION" =~ (.*\.){3} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has more than three parts (X.Y.Z): $CC_VERSION. Comparisons might be wrong." >&2;} + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" fi - if [[ "$CC_VERSION" =~ [0-9]{6} ]] ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION. Comparisons might be wrong." >&5 -$as_echo "$as_me: WARNING: C compiler version number has a part larger than 99999: $CC_VERSION. Comparisons might be wrong." >&2;} + if test "x$complete" != "x$new_complete"; then + AR="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;} fi - COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", $1, $2, $3) }' <<< "$CC_VERSION"` - - ### Locate other tools - if test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then ac_ext=m ac_cpp='$OBJCPP $CPPFLAGS' ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -31352,8 +31856,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving OBJC (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -31382,101 +31885,35 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow $as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;} fi - else - OBJC= - fi - - # Restore the flags to the user specified values. - # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" - CFLAGS="$ORG_CFLAGS" - CXXFLAGS="$ORG_CXXFLAGS" - OBJCFLAGS="$ORG_OBJCFLAGS" - - LD="$CC" - LDEXE="$CC" - LDCXX="$CXX" - LDEXECXX="$CXX" - - # LDEXE is the linker to use, when creating executables. - - # Linking C++ libraries. - - # Linking C++ executables. - - - if test "x$OPENJDK_TARGET_OS" != xwindows; then # Publish this variable in the help. - if test "x$AR" = x; then + if test "x$LIPO" = x; then # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar + for ac_prog in lipo do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if ${ac_cv_path_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $LIPO in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" + ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -31484,112 +31921,57 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } +LIPO=$ac_cv_path_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_AR" && break + test -n "$LIPO" && break done - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !AR! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AR!/} + # Try to remove the string !LIPO! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!LIPO!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xAR" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of AR from the environment. Use command line variables instead." >&2;} + if test "xLIPO" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of LIPO from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of LIPO from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar + for ac_prog in lipo do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : +if ${ac_cv_path_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $LIPO in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" + ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -31597,34 +31979,22 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } +LIPO=$ac_cv_path_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_AR" && break + test -n "$LIPO" && break done - if test "x$ac_ct_AR" = x; then - AR="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -31634,22 +32004,22 @@ fi CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$AR" + tool_specified="$LIPO" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AR=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool AR=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool LIPO=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool LIPO=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AR+:} false; then : +if ${ac_cv_path_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else - case $AR in + case $LIPO in [\\/]* | ?:[\\/]*) - ac_cv_path_AR="$AR" # Let the user override the test with a path. + ac_cv_path_LIPO="$LIPO" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -31659,7 +32029,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -31670,29 +32040,29 @@ IFS=$as_save_IFS ;; esac fi -AR=$ac_cv_path_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +LIPO=$ac_cv_path_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$AR" = x; then + if test "x$LIPO" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AR=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool AR=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AR" >&5 -$as_echo_n "checking for AR... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool LIPO=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool LIPO=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIPO" >&5 +$as_echo_n "checking for LIPO... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool AR=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool LIPO=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -31706,7 +32076,7 @@ $as_echo "$tool_specified" >&6; } # First separate the path from the arguments. This will split at the first # space. - complete="$AR" + complete="$LIPO" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -31742,14 +32112,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 fi fi @@ -31769,11 +32139,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -31820,7 +32190,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$AR" + complete="$LIPO" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -31865,14 +32235,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 fi fi @@ -31918,7 +32288,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$AR" + complete="$LIPO" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -31937,20 +32307,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving AR (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5 fi fi @@ -31962,377 +32331,16 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - AR="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;} - fi - - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ARFLAGS="-r" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - ARFLAGS="-X64" - else - ARFLAGS="" - fi - - - # For hotspot, we need these in Windows mixed path; other platforms keep them the same - HOTSPOT_CXX="$CXX" - HOTSPOT_LD="$LD" - - - - COMPILER_NAME=gcc - COMPILER_TYPE=CC - if test "x$OPENJDK_TARGET_OS" = xwindows; then : - - # For now, assume that we are always compiling using cl.exe. - CC_OUT_OPTION=-Fo - EXE_OUT_OPTION=-out: - LD_OUT_OPTION=-out: - AR_OUT_OPTION=-out: - # On Windows, reject /usr/bin/link (as determined in CYGWIN_LINK), which is a cygwin - # program for something completely different. - # Extract the first word of "link", so it can be a program name with args. -set dummy link; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WINLD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$WINLD"; then - ac_cv_prog_WINLD="$WINLD" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "$CYGWIN_LINK"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_WINLD="link" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_WINLD - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set WINLD to just the basename; use the full file name. - shift - ac_cv_prog_WINLD="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -WINLD=$ac_cv_prog_WINLD -if test -n "$WINLD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINLD" >&5 -$as_echo "$WINLD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - # Since we must ignore the first found link, WINLD will contain - # the full path to the link.exe program. - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$WINLD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 - fi - fi - - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of WINLD, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" - fi - - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-stile (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" - fi - fi - - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$WINLD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 - fi - fi - - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - fi - - # Output is in $new_path - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" - fi - - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - - else - # We're on a posix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$WINLD" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving WINLD (as $path) failed, using $path directly." >&6;} - new_path="$path" - fi - - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5 - fi + LIPO="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;} fi - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" else - new_complete="$new_path" - fi - - if test "x$complete" != "x$new_complete"; then - WINLD="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting WINLD to \"$new_complete\"" >&6;} + OBJC= fi - printf "Windows linker was found at $WINLD\n" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5 -$as_echo_n "checking if the found link.exe is actually the Visual Studio linker... " >&6; } - "$WINLD" --version > /dev/null - if test $? -eq 0 ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "This is the Cygwin link tool. Please check your PATH and rerun configure." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - fi - LD="$WINLD" - LDEXE="$WINLD" - LDCXX="$WINLD" - LDEXECXX="$WINLD" - + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -32623,8 +32631,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving MT (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -32653,7 +32660,7 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow $as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;} fi - # The resource compiler + # Setup the resource compiler (RC) # Extract the first word of "rc", so it can be a program name with args. set dummy rc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -32944,8 +32951,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving RC (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi @@ -32974,87 +32980,15 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow $as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;} fi - - # For hotspot, we need these in Windows mixed path, - # so rewrite them all. Need added .exe suffix. - HOTSPOT_CXX="$CXX.exe" - HOTSPOT_LD="$LD.exe" - HOTSPOT_MT="$MT.exe" - HOTSPOT_RC="$RC.exe" - - unix_path="$HOTSPOT_CXX" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - HOTSPOT_CXX="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - HOTSPOT_CXX="$windows_path" - fi - - - unix_path="$HOTSPOT_LD" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - HOTSPOT_LD="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - HOTSPOT_LD="$windows_path" - fi - - - unix_path="$HOTSPOT_MT" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - HOTSPOT_MT="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - HOTSPOT_MT="$windows_path" - fi - - - unix_path="$HOTSPOT_RC" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - windows_path=`$CYGPATH -m "$unix_path"` - HOTSPOT_RC="$windows_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - windows_path=`cmd //c echo $unix_path` - HOTSPOT_RC="$windows_path" - fi - - - - - RC_FLAGS="-nologo -l 0x409 -r" - if test "x$VARIANT" = xOPT; then : - - RC_FLAGS="$RC_FLAGS -d NDEBUG" - -fi - - # The version variables used to create RC_FLAGS may be overridden - # in a custom configure script, or possibly the command line. - # Let those variables be expanded at make time in spec.gmk. - # The \$ are escaped to the shell, and the $(...) variables - # are evaluated by make. - RC_FLAGS="$RC_FLAGS \ - -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ - -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ - -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ - -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(COOKED_JDK_UPDATE_VERSION).\$(COOKED_BUILD_NUMBER)\" \ - -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ - -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ - -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(COOKED_JDK_UPDATE_VERSION),\$(COOKED_BUILD_NUMBER)\"" - - # lib.exe is used to create static libraries. - # Extract the first word of "lib", so it can be a program name with args. -set dummy lib; ac_word=$2 + # Extract the first word of "dumpbin", so it can be a program name with args. +set dummy dumpbin; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_WINAR+:} false; then : +if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$WINAR"; then - ac_cv_prog_WINAR="$WINAR" # Let the user override the test. + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -33063,7 +32997,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_WINAR="lib" + ac_cv_prog_DUMPBIN="dumpbin" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -33073,10 +33007,10 @@ IFS=$as_save_IFS fi fi -WINAR=$ac_cv_prog_WINAR -if test -n "$WINAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINAR" >&5 -$as_echo "$WINAR" >&6; } +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -33088,7 +33022,7 @@ fi # First separate the path from the arguments. This will split at the first # space. - complete="$WINAR" + complete="$DUMPBIN" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33124,14 +33058,14 @@ fi fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 fi fi @@ -33151,11 +33085,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of WINAR, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -33202,7 +33136,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$WINAR" + complete="$DUMPBIN" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33247,14 +33181,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 fi fi @@ -33300,7 +33234,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$WINAR" + complete="$DUMPBIN" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33319,20 +33253,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving WINAR (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 fi fi @@ -33344,32 +33277,101 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - WINAR="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;} + DUMPBIN="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} + fi + fi - AR="$WINAR" - ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + - # Extract the first word of "dumpbin", so it can be a program name with args. -set dummy dumpbin; ac_word=$2 + # Publish this variable in the help. + + + if test "x$STRIP" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : +if ${ac_cv_path_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. + case $STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +STRIP=$ac_cv_path_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$STRIP" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !STRIP! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STRIP!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xSTRIP" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="dumpbin" + ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -33377,24 +33379,104 @@ done done IFS=$as_save_IFS + ;; +esac fi +STRIP=$ac_cv_path_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + + + test -n "$STRIP" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$STRIP" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STRIP=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool STRIP=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +STRIP=$ac_cv_path_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + if test "x$STRIP" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STRIP=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool STRIP=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 +$as_echo_n "checking for STRIP... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$DUMPBIN" + complete="$STRIP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33430,14 +33512,14 @@ fi fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi fi @@ -33457,11 +33539,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -33508,7 +33590,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$DUMPBIN" + complete="$STRIP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33553,14 +33635,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi fi @@ -33606,7 +33688,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$DUMPBIN" + complete="$STRIP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33625,20 +33707,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving DUMPBIN (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi fi @@ -33650,163 +33731,203 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - DUMPBIN="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;} + STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} fi - COMPILER_TYPE=CL - # silence copyright notice and other headers. - COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" - -fi + # Publish this variable in the help. - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "x$NM" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in nm +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes + case $NM in + [\\/]* | ?:[\\/]*) + ac_cv_path_NM="$NM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue + ;; +esac fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +NM=$ac_cv_path_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext + + test -n "$NM" && break done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CPP=$CPP + else + # The variable is set, but is it from the command line or the environment? -fi - CPP=$ac_cv_prog_CPP + # Try to remove the string !NM! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xNM" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in nm +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes + case $NM in + [\\/]* | ?:[\\/]*) + ac_cv_path_NM="$NM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue + ;; +esac fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +NM=$ac_cv_path_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext + + test -n "$NM" && break done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$NM" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + case $NM in + [\\/]* | ?:[\\/]*) + ac_cv_path_NM="$NM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +NM=$ac_cv_path_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test "x$NM" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 +$as_echo_n "checking for NM... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$CPP" + complete="$NM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33842,14 +33963,14 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi fi @@ -33869,11 +33990,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -33920,7 +34041,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$CPP" + complete="$NM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -33965,14 +34086,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi fi @@ -34018,7 +34139,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$CPP" + complete="$NM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34037,20 +34158,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving CPP (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi fi @@ -34062,151 +34182,203 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - CPP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;} + NM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} fi - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } -if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : + + # Publish this variable in the help. + + + if test "x$GNM" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in gnm +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GNM+:} false; then : $as_echo_n "(cached) " >&6 else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" - do - ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes + case $GNM in + [\\/]* | ?:[\\/]*) + ac_cv_path_GNM="$GNM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue + ;; +esac fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +GNM=$ac_cv_path_GNM +if test -n "$GNM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 +$as_echo "$GNM" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext + + test -n "$GNM" && break done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - done - ac_cv_prog_CXXCPP=$CXXCPP + else + # The variable is set, but is it from the command line or the environment? -fi - CXXCPP=$ac_cv_prog_CXXCPP + # Try to remove the string !GNM! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GNM!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xGNM" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GNM from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of GNM from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in gnm +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GNM+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_CXXCPP=$CXXCPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } -ac_preproc_ok=false -for ac_cxx_preproc_warn_flag in '' yes + case $GNM in + [\\/]* | ?:[\\/]*) + ac_cv_path_GNM="$GNM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -else - # Broken: fails on valid input. -continue + ;; +esac fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue +GNM=$ac_cv_path_GNM +if test -n "$GNM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 +$as_echo "$GNM" >&6; } else - # Passes both tests. -ac_preproc_ok=: -break + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f conftest.err conftest.i conftest.$ac_ext + + test -n "$GNM" && break done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if the provided tool contains a complete path. + tool_specified="$GNM" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GNM=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool GNM=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GNM+:} false; then : + $as_echo_n "(cached) " >&6 else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + case $GNM in + [\\/]* | ?:[\\/]*) + ac_cv_path_GNM="$GNM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GNM=$ac_cv_path_GNM +if test -n "$GNM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 +$as_echo "$GNM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + if test "x$GNM" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GNM=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool GNM=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNM" >&5 +$as_echo_n "checking for GNM... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool GNM=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$CXXCPP" + complete="$GNM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34242,14 +34414,14 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 fi fi @@ -34269,11 +34441,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of GNM, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -34320,7 +34492,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$CXXCPP" + complete="$GNM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34365,14 +34537,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 fi fi @@ -34418,7 +34590,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$CXXCPP" + complete="$GNM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34437,20 +34609,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving CXXCPP (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 fi fi @@ -34462,53 +34633,31 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - CXXCPP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;} - fi - - - if test "x$COMPILE_TYPE" != "xcross"; then - # If we are not cross compiling, use the same compilers for - # building the build platform executables. The cross-compilation - # case needed to be done earlier, but this can only be done after - # the native tools have been localized. - BUILD_CC="$CC" - BUILD_CXX="$CXX" - BUILD_LD="$LD" + GNM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;} fi - # for solaris we really need solaris tools, and not gnu equivalent - # these seems to normally reside in /usr/ccs/bin so add that to path before - # starting to probe - # - # NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH - # so that it can be overriden --with-tools-dir - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}" - fi - # Find the right assembler. - if test "x$OPENJDK_TARGET_OS" = xsolaris; then # Publish this variable in the help. - if test "x$AS" = x; then + if test "x$MCS" = x; then # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in as + for ac_prog in mcs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AS+:} false; then : +if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else - case $AS in + case $MCS in [\\/]* | ?:[\\/]*) - ac_cv_path_AS="$AS" # Let the user override the test with a path. + ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -34518,7 +34667,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -34529,44 +34678,44 @@ IFS=$as_save_IFS ;; esac fi -AS=$ac_cv_path_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } +MCS=$ac_cv_path_MCS +if test -n "$MCS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 +$as_echo "$MCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$AS" && break + test -n "$MCS" && break done else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !AS! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!AS!/} + # Try to remove the string !MCS! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MCS!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xAS" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of AS from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of AS from the environment. Use command line variables instead." >&2;} + if test "xMCS" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - for ac_prog in as + for ac_prog in mcs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AS+:} false; then : +if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else - case $AS in + case $MCS in [\\/]* | ?:[\\/]*) - ac_cv_path_AS="$AS" # Let the user override the test with a path. + ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -34576,7 +34725,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -34587,17 +34736,17 @@ IFS=$as_save_IFS ;; esac fi -AS=$ac_cv_path_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } +MCS=$ac_cv_path_MCS +if test -n "$MCS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 +$as_echo "$MCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$AS" && break + test -n "$MCS" && break done else @@ -34609,22 +34758,22 @@ done CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$AS" + tool_specified="$MCS" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool AS=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool AS=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MCS=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool MCS=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_AS+:} false; then : +if ${ac_cv_path_MCS+:} false; then : $as_echo_n "(cached) " >&6 else - case $AS in + case $MCS in [\\/]* | ?:[\\/]*) - ac_cv_path_AS="$AS" # Let the user override the test with a path. + ac_cv_path_MCS="$MCS" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -34634,7 +34783,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -34645,29 +34794,29 @@ IFS=$as_save_IFS ;; esac fi -AS=$ac_cv_path_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } +MCS=$ac_cv_path_MCS +if test -n "$MCS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 +$as_echo "$MCS" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$AS" = x; then + if test "x$MCS" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool AS=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool AS=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AS" >&5 -$as_echo_n "checking for AS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MCS=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool MCS=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MCS" >&5 +$as_echo_n "checking for MCS... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool AS=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool MCS=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -34681,7 +34830,7 @@ $as_echo "$tool_specified" >&6; } # First separate the path from the arguments. This will split at the first # space. - complete="$AS" + complete="$MCS" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34717,14 +34866,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 fi fi @@ -34744,11 +34893,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -34795,7 +34944,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$AS" + complete="$MCS" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34840,14 +34989,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 fi fi @@ -34893,7 +35042,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$AS" + complete="$MCS" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -34912,20 +35061,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving AS (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 fi fi @@ -34937,46 +35085,85 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - AS="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;} + MCS="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;} fi - else - AS="$CC -c" - fi + elif test "x$OPENJDK_TARGET_OS" != xwindows; then + # FIXME: we should unify this with the solaris case above. - if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # Publish this variable in the help. - # Publish this variable in the help. + if test "x$STRIP" = x; then + # The variable is not set by user, try to locate tool using the code snippet + if test -n "$ac_tool_prefix"; then + for ac_prog in strip + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - if test "x$NM" = x; then - # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in nm + test -n "$STRIP" && break + done +fi +if test -z "$STRIP"; then + ac_ct_STRIP=$STRIP + for ac_prog in strip do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_STRIP="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -34984,57 +35171,112 @@ done done IFS=$as_save_IFS - ;; -esac fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$NM" && break + test -n "$ac_ct_STRIP" && break done + if test "x$ac_ct_STRIP" = x; then + STRIP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +fi + else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !NM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} + # Try to remove the string !STRIP! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STRIP!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} + if test "xSTRIP" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - for ac_prog in nm + if test -n "$ac_tool_prefix"; then + for ac_prog in strip + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$STRIP" && break + done +fi +if test -z "$STRIP"; then + ac_ct_STRIP=$STRIP + for ac_prog in strip do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - case $NM in - [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_STRIP="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35042,22 +35284,34 @@ done done IFS=$as_save_IFS - ;; -esac fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$NM" && break + test -n "$ac_ct_STRIP" && break done + if test "x$ac_ct_STRIP" = x; then + STRIP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +fi + else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -35067,22 +35321,22 @@ done CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$NM" + tool_specified="$STRIP" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STRIP=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool STRIP=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : +if ${ac_cv_path_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else - case $NM in + case $STRIP in [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. + ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -35092,7 +35346,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35103,29 +35357,29 @@ IFS=$as_save_IFS ;; esac fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } +STRIP=$ac_cv_path_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$NM" = x; then + if test "x$STRIP" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STRIP=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool STRIP=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 +$as_echo_n "checking for STRIP... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -35139,7 +35393,7 @@ $as_echo "$tool_specified" >&6; } # First separate the path from the arguments. This will split at the first # space. - complete="$NM" + complete="$STRIP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -35175,14 +35429,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi fi @@ -35202,11 +35456,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -35253,7 +35507,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$NM" + complete="$STRIP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -35298,14 +35552,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi fi @@ -35351,7 +35605,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$NM" + complete="$STRIP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -35370,20 +35624,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 fi fi @@ -35395,40 +35648,126 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} + STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} + fi + + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OTOOL in + [\\/]* | ?:[\\/]*) + ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +OTOOL=$ac_cv_path_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$OTOOL" = "x"; then + OTOOL="true" + fi + # Publish this variable in the help. - if test "x$GNM" = x; then + if test "x$NM" = x; then # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in gnm + if test -n "$ac_tool_prefix"; then + for ac_prog in nm + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$NM" && break + done +fi +if test -z "$NM"; then + ac_ct_NM=$NM + for ac_prog in nm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNM+:} false; then : +if ${ac_cv_prog_ac_ct_NM+:} false; then : $as_echo_n "(cached) " >&6 else - case $GNM in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNM="$GNM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_NM"; then + ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_NM="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35436,57 +35775,112 @@ done done IFS=$as_save_IFS - ;; -esac fi -GNM=$ac_cv_path_GNM -if test -n "$GNM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 -$as_echo "$GNM" >&6; } +fi +ac_ct_NM=$ac_cv_prog_ac_ct_NM +if test -n "$ac_ct_NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$GNM" && break + test -n "$ac_ct_NM" && break done + if test "x$ac_ct_NM" = x; then + NM="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi +fi + else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !GNM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!GNM!/} + # Try to remove the string !NM! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xGNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of GNM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of GNM from the environment. Use command line variables instead." >&2;} + if test "xNM" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - for ac_prog in gnm + if test -n "$ac_tool_prefix"; then + for ac_prog in nm + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NM="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NM=$ac_cv_prog_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$NM" && break + done +fi +if test -z "$NM"; then + ac_ct_NM=$NM + for ac_prog in nm do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNM+:} false; then : +if ${ac_cv_prog_ac_ct_NM+:} false; then : $as_echo_n "(cached) " >&6 else - case $GNM in - [\\/]* | ?:[\\/]*) - ac_cv_path_GNM="$GNM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_NM"; then + ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_NM="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35494,22 +35888,34 @@ done done IFS=$as_save_IFS - ;; -esac fi -GNM=$ac_cv_path_GNM -if test -n "$GNM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 -$as_echo "$GNM" >&6; } +fi +ac_ct_NM=$ac_cv_prog_ac_ct_NM +if test -n "$ac_ct_NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$GNM" && break + test -n "$ac_ct_NM" && break done + if test "x$ac_ct_NM" = x; then + NM="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi +fi + else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -35519,22 +35925,22 @@ done CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$GNM" + tool_specified="$NM" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool GNM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool GNM=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_GNM+:} false; then : +if ${ac_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else - case $GNM in + case $NM in [\\/]* | ?:[\\/]*) - ac_cv_path_GNM="$GNM" # Let the user override the test with a path. + ac_cv_path_NM="$NM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -35544,7 +35950,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_GNM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35555,29 +35961,29 @@ IFS=$as_save_IFS ;; esac fi -GNM=$ac_cv_path_GNM -if test -n "$GNM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNM" >&5 -$as_echo "$GNM" >&6; } +NM=$ac_cv_path_NM +if test -n "$NM"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 +$as_echo "$NM" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$GNM" = x; then + if test "x$NM" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool GNM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool GNM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNM" >&5 -$as_echo_n "checking for GNM... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 +$as_echo_n "checking for NM... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool GNM=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -35591,7 +35997,7 @@ $as_echo "$tool_specified" >&6; } # First separate the path from the arguments. This will split at the first # space. - complete="$GNM" + complete="$NM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -35627,14 +36033,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi fi @@ -35654,11 +36060,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -35705,7 +36111,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$GNM" + complete="$NM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -35750,14 +36156,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi fi @@ -35803,7 +36209,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$GNM" + complete="$NM" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -35822,20 +36228,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving GNM (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving GNM (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of GNM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of GNM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of GNM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 fi fi @@ -35847,40 +36252,90 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - GNM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting GNM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting GNM to \"$new_complete\"" >&6;} + NM="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} fi + GNM="$NM" + + fi + + # objcopy is used for moving debug symbols to separate files when + # full debug symbols are enabled. + if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then # Publish this variable in the help. - if test "x$STRIP" = x; then + if test "x$OBJCOPY" = x; then # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in strip + if test -n "$ac_tool_prefix"; then + for ac_prog in gobjcopy objcopy + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJCOPY=$ac_cv_prog_OBJCOPY +if test -n "$OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJCOPY" && break + done +fi +if test -z "$OBJCOPY"; then + ac_ct_OBJCOPY=$OBJCOPY + for ac_prog in gobjcopy objcopy do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : +if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : $as_echo_n "(cached) " >&6 else - case $STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_OBJCOPY"; then + ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35888,57 +36343,112 @@ done done IFS=$as_save_IFS - ;; -esac fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +fi +ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY +if test -n "$ac_ct_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$STRIP" && break + test -n "$ac_ct_OBJCOPY" && break done + if test "x$ac_ct_OBJCOPY" = x; then + OBJCOPY="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJCOPY=$ac_ct_OBJCOPY + fi +fi + else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !STRIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STRIP!/} + # Try to remove the string !OBJCOPY! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OBJCOPY!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSTRIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&2;} + if test "xOBJCOPY" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OBJCOPY from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of OBJCOPY from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - for ac_prog in strip + if test -n "$ac_tool_prefix"; then + for ac_prog in gobjcopy objcopy + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJCOPY=$ac_cv_prog_OBJCOPY +if test -n "$OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJCOPY" && break + done +fi +if test -z "$OBJCOPY"; then + ac_ct_OBJCOPY=$OBJCOPY + for ac_prog in gobjcopy objcopy do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : +if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : $as_echo_n "(cached) " >&6 else - case $STRIP in - [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_OBJCOPY"; then + ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -35946,22 +36456,34 @@ done done IFS=$as_save_IFS - ;; -esac fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +fi +ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY +if test -n "$ac_ct_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$STRIP" && break + test -n "$ac_ct_OBJCOPY" && break done + if test "x$ac_ct_OBJCOPY" = x; then + OBJCOPY="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJCOPY=$ac_ct_OBJCOPY + fi +fi + else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -35971,22 +36493,22 @@ done CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$STRIP" + tool_specified="$OBJCOPY" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STRIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool STRIP=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OBJCOPY=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool OBJCOPY=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : +if ${ac_cv_path_OBJCOPY+:} false; then : $as_echo_n "(cached) " >&6 else - case $STRIP in + case $OBJCOPY in [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. + ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -35996,7 +36518,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -36007,29 +36529,29 @@ IFS=$as_save_IFS ;; esac fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +OBJCOPY=$ac_cv_path_OBJCOPY +if test -n "$OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$STRIP" = x; then + if test "x$OBJCOPY" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STRIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool STRIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 -$as_echo_n "checking for STRIP... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OBJCOPY=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool OBJCOPY=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJCOPY" >&5 +$as_echo_n "checking for OBJCOPY... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool OBJCOPY=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -36038,12 +36560,14 @@ $as_echo "$tool_specified" >&6; } fi + # Only call fixup if objcopy was found. + if test -n "$OBJCOPY"; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$STRIP" + complete="$OBJCOPY" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -36079,14 +36603,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 fi fi @@ -36106,11 +36630,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -36157,7 +36681,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$STRIP" + complete="$OBJCOPY" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -36202,14 +36726,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 fi fi @@ -36255,7 +36779,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$STRIP" + complete="$OBJCOPY" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -36274,20 +36798,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 fi fi @@ -36299,9 +36822,12 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} + OBJCOPY="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;} + fi + + fi fi @@ -36309,30 +36835,73 @@ $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} # Publish this variable in the help. - if test "x$MCS" = x; then + if test "x$OBJDUMP" = x; then # The variable is not set by user, try to locate tool using the code snippet - for ac_prog in mcs + if test -n "$ac_tool_prefix"; then + for ac_prog in gobjdump objdump + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJDUMP" && break + done +fi +if test -z "$OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + for ac_prog in gobjdump objdump do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MCS+:} false; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - case $MCS in - [\\/]* | ?:[\\/]*) - ac_cv_path_MCS="$MCS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -36340,57 +36909,112 @@ done done IFS=$as_save_IFS - ;; -esac fi -MCS=$ac_cv_path_MCS -if test -n "$MCS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 -$as_echo "$MCS" >&6; } +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$MCS" && break + test -n "$ac_ct_OBJDUMP" && break done + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +fi + else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !MCS! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!MCS!/} + # Try to remove the string !OBJDUMP! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OBJDUMP!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xMCS" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of MCS from the environment. Use command line variables instead." >&2;} + if test "xOBJDUMP" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OBJDUMP from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of OBJDUMP from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - for ac_prog in mcs + if test -n "$ac_tool_prefix"; then + for ac_prog in gobjdump objdump + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OBJDUMP" && break + done +fi +if test -z "$OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + for ac_prog in gobjdump objdump do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MCS+:} false; then : +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - case $MCS in - [\\/]* | ?:[\\/]*) - ac_cv_path_MCS="$MCS" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -36398,22 +37022,34 @@ done done IFS=$as_save_IFS - ;; -esac fi -MCS=$ac_cv_path_MCS -if test -n "$MCS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 -$as_echo "$MCS" >&6; } +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$MCS" && break + test -n "$ac_ct_OBJDUMP" && break done + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +fi + else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -36423,22 +37059,22 @@ done CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$MCS" + tool_specified="$OBJDUMP" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool MCS=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool MCS=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OBJDUMP=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool OBJDUMP=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MCS+:} false; then : +if ${ac_cv_path_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else - case $MCS in + case $OBJDUMP in [\\/]* | ?:[\\/]*) - ac_cv_path_MCS="$MCS" # Let the user override the test with a path. + ac_cv_path_OBJDUMP="$OBJDUMP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -36448,7 +37084,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_OBJDUMP="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -36459,29 +37095,29 @@ IFS=$as_save_IFS ;; esac fi -MCS=$ac_cv_path_MCS -if test -n "$MCS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5 -$as_echo "$MCS" >&6; } +OBJDUMP=$ac_cv_path_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$MCS" = x; then + if test "x$OBJDUMP" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool MCS=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool MCS=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MCS" >&5 -$as_echo_n "checking for MCS... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OBJDUMP=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool OBJDUMP=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJDUMP" >&5 +$as_echo_n "checking for OBJDUMP... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool MCS=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool OBJDUMP=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -36490,12 +37126,15 @@ $as_echo "$tool_specified" >&6; } fi + if test "x$OBJDUMP" != x; then + # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE + # bails if argument is missing. if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$MCS" + complete="$OBJDUMP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -36531,14 +37170,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 fi fi @@ -36558,11 +37197,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of MCS, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -36609,7 +37248,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$MCS" + complete="$OBJDUMP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -36654,14 +37293,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 fi fi @@ -36707,7 +37346,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$MCS" + complete="$OBJDUMP" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -36726,20 +37365,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving MCS (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 fi fi @@ -36751,127 +37389,65 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - MCS="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;} + OBJDUMP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;} fi - elif test "x$OPENJDK_TARGET_OS" != xwindows; then - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $OTOOL in - [\\/]* | ?:[\\/]*) - ac_cv_path_OTOOL="$OTOOL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 fi -done - done -IFS=$as_save_IFS - ;; -esac -fi -OTOOL=$ac_cv_path_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + # Restore old path. + PATH="$OLD_PATH" - if test "x$OTOOL" = "x"; then - OTOOL="true" - fi + # Restore the flags to the user specified values. + # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" + CFLAGS="$ORG_CFLAGS" + CXXFLAGS="$ORG_CXXFLAGS" + OBJCFLAGS="$ORG_OBJCFLAGS" - # Publish this variable in the help. +# Finally do some processing after the detection phase + if test "x$COMPILE_TYPE" = "xcross"; then + # Now we need to find a C/C++ compiler that can build executables for the + # build platform. We can't use the AC_PROG_CC macro, since it can only be + # used once. Also, we need to do this without adding a tools dir to the + # path, otherwise we might pick up cross-compilers which don't use standard + # naming. - if test "x$NM" = x; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in nm - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + # FIXME: we should list the discovered compilers as an exclude pattern! + # If we do that, we can do this detection before POST_DETECTION, and still + # find the build compilers in the tools dir, if needed. -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + # Publish this variable in the help. - test -n "$NM" && break - done -fi -if test -z "$NM"; then - ac_ct_NM=$NM - for ac_prog in nm + + if test "x$BUILD_CC" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in cl cc gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : +if ${ac_cv_path_BUILD_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $BUILD_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="$ac_prog" + ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -36879,112 +37455,57 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } +BUILD_CC=$ac_cv_path_BUILD_CC +if test -n "$BUILD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 +$as_echo "$BUILD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_NM" && break + test -n "$BUILD_CC" && break done - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -fi - else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !NM! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!NM!/} + # Try to remove the string !BUILD_CC! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_CC!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xNM" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of NM from the environment. Use command line variables instead." >&2;} + if test "xBUILD_CC" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_CC from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of BUILD_CC from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in nm - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NM="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$NM" && break - done -fi -if test -z "$NM"; then - ac_ct_NM=$NM - for ac_prog in nm + for ac_prog in cl cc gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NM+:} false; then : +if ${ac_cv_path_BUILD_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $BUILD_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NM="$ac_prog" + ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -36992,34 +37513,22 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } +BUILD_CC=$ac_cv_path_BUILD_CC +if test -n "$BUILD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 +$as_echo "$BUILD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_NM" && break + test -n "$BUILD_CC" && break done - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -fi - else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -37029,22 +37538,22 @@ fi CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$NM" + tool_specified="$BUILD_CC" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool NM=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool NM=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_CC=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool BUILD_CC=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_NM+:} false; then : +if ${ac_cv_path_BUILD_CC+:} false; then : $as_echo_n "(cached) " >&6 else - case $NM in + case $BUILD_CC in [\\/]* | ?:[\\/]*) - ac_cv_path_NM="$NM" # Let the user override the test with a path. + ac_cv_path_BUILD_CC="$BUILD_CC" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -37054,7 +37563,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -37063,31 +37572,31 @@ done IFS=$as_save_IFS ;; -esac -fi -NM=$ac_cv_path_NM -if test -n "$NM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5 -$as_echo "$NM" >&6; } +esac +fi +BUILD_CC=$ac_cv_path_BUILD_CC +if test -n "$BUILD_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5 +$as_echo "$BUILD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$NM" = x; then + if test "x$BUILD_CC" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool NM=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool NM=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NM" >&5 -$as_echo_n "checking for NM... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_CC=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool BUILD_CC=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CC" >&5 +$as_echo_n "checking for BUILD_CC... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool NM=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool BUILD_CC=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -37101,7 +37610,7 @@ $as_echo "$tool_specified" >&6; } # First separate the path from the arguments. This will split at the first # space. - complete="$NM" + complete="$BUILD_CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -37137,14 +37646,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 fi fi @@ -37164,11 +37673,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -37215,7 +37724,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$NM" + complete="$BUILD_CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -37260,14 +37769,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 fi fi @@ -37313,7 +37822,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$NM" + complete="$BUILD_CC" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -37332,20 +37841,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving NM (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5 fi fi @@ -37357,85 +37865,40 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - NM="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;} + BUILD_CC="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;} fi - GNM="$NM" - # Publish this variable in the help. - if test "x$STRIP" = x; then + if test "x$BUILD_CXX" = x; then # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in strip - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STRIP" && break - done -fi -if test -z "$STRIP"; then - ac_ct_STRIP=$STRIP - for ac_prog in strip + for ac_prog in cl CC g++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if ${ac_cv_path_BUILD_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $BUILD_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="$ac_prog" + ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -37443,112 +37906,57 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } +BUILD_CXX=$ac_cv_path_BUILD_CXX +if test -n "$BUILD_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 +$as_echo "$BUILD_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_STRIP" && break + test -n "$BUILD_CXX" && break done - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -fi - else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !STRIP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!STRIP!/} + # Try to remove the string !BUILD_CXX! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_CXX!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xSTRIP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of STRIP from the environment. Use command line variables instead." >&2;} + if test "xBUILD_CXX" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_CXX from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of BUILD_CXX from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in strip - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$STRIP" && break - done -fi -if test -z "$STRIP"; then - ac_ct_STRIP=$STRIP - for ac_prog in strip + for ac_prog in cl CC g++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : +if ${ac_cv_path_BUILD_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $BUILD_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="$ac_prog" + ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -37556,34 +37964,22 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } +BUILD_CXX=$ac_cv_path_BUILD_CXX +if test -n "$BUILD_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 +$as_echo "$BUILD_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_STRIP" && break + test -n "$BUILD_CXX" && break done - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -fi - else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -37593,22 +37989,22 @@ fi CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$STRIP" + tool_specified="$BUILD_CXX" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool STRIP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool STRIP=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_CXX=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool BUILD_CXX=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_STRIP+:} false; then : +if ${ac_cv_path_BUILD_CXX+:} false; then : $as_echo_n "(cached) " >&6 else - case $STRIP in + case $BUILD_CXX in [\\/]* | ?:[\\/]*) - ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path. + ac_cv_path_BUILD_CXX="$BUILD_CXX" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -37618,7 +38014,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -37629,29 +38025,29 @@ IFS=$as_save_IFS ;; esac fi -STRIP=$ac_cv_path_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } +BUILD_CXX=$ac_cv_path_BUILD_CXX +if test -n "$BUILD_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5 +$as_echo "$BUILD_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$STRIP" = x; then + if test "x$BUILD_CXX" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool STRIP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool STRIP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STRIP" >&5 -$as_echo_n "checking for STRIP... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_CXX=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool BUILD_CXX=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_CXX" >&5 +$as_echo_n "checking for BUILD_CXX... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool BUILD_CXX=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -37665,7 +38061,7 @@ $as_echo "$tool_specified" >&6; } # First separate the path from the arguments. This will split at the first # space. - complete="$STRIP" + complete="$BUILD_CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -37701,14 +38097,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 fi fi @@ -37728,11 +38124,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -37779,7 +38175,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$STRIP" + complete="$BUILD_CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -37824,14 +38220,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 fi fi @@ -37877,7 +38273,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$STRIP" + complete="$BUILD_CXX" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -37896,20 +38292,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving STRIP (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5 fi fi @@ -37921,88 +38316,40 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - STRIP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;} - fi - + BUILD_CXX="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;} fi - # objcopy is used for moving debug symbols to separate files when - # full debug symbols are enabled. - if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then # Publish this variable in the help. - if test "x$OBJCOPY" = x; then + if test "x$BUILD_LD" = x; then # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjcopy objcopy - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJCOPY" && break - done -fi -if test -z "$OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - for ac_prog in gobjcopy objcopy + for ac_prog in ld do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : +if ${ac_cv_path_BUILD_LD+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $BUILD_LD in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_LD="$BUILD_LD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" + ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -38010,112 +38357,57 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } +BUILD_LD=$ac_cv_path_BUILD_LD +if test -n "$BUILD_LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5 +$as_echo "$BUILD_LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_OBJCOPY" && break + test -n "$BUILD_LD" && break done - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -fi - else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !OBJCOPY! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OBJCOPY!/} + # Try to remove the string !BUILD_LD! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_LD!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xOBJCOPY" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OBJCOPY from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of OBJCOPY from the environment. Use command line variables instead." >&2;} + if test "xBUILD_LD" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_LD from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of BUILD_LD from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjcopy objcopy - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJCOPY+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJCOPY" && break - done -fi -if test -z "$OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - for ac_prog in gobjcopy objcopy + for ac_prog in ld do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJCOPY+:} false; then : +if ${ac_cv_path_BUILD_LD+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $BUILD_LD in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_LD="$BUILD_LD" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_prog" + ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -38123,34 +38415,22 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } +BUILD_LD=$ac_cv_path_BUILD_LD +if test -n "$BUILD_LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5 +$as_echo "$BUILD_LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_OBJCOPY" && break + test -n "$BUILD_LD" && break done - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -fi - else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -38160,22 +38440,22 @@ fi CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$OBJCOPY" + tool_specified="$BUILD_LD" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OBJCOPY=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool OBJCOPY=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_LD=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool BUILD_LD=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OBJCOPY+:} false; then : +if ${ac_cv_path_BUILD_LD+:} false; then : $as_echo_n "(cached) " >&6 else - case $OBJCOPY in + case $BUILD_LD in [\\/]* | ?:[\\/]*) - ac_cv_path_OBJCOPY="$OBJCOPY" # Let the user override the test with a path. + ac_cv_path_BUILD_LD="$BUILD_LD" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -38185,7 +38465,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -38196,29 +38476,29 @@ IFS=$as_save_IFS ;; esac fi -OBJCOPY=$ac_cv_path_OBJCOPY -if test -n "$OBJCOPY"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } +BUILD_LD=$ac_cv_path_BUILD_LD +if test -n "$BUILD_LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5 +$as_echo "$BUILD_LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$OBJCOPY" = x; then + if test "x$BUILD_LD" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OBJCOPY=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool OBJCOPY=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJCOPY" >&5 -$as_echo_n "checking for OBJCOPY... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_LD=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool BUILD_LD=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_LD" >&5 +$as_echo_n "checking for BUILD_LD... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool OBJCOPY=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool BUILD_LD=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -38227,14 +38507,12 @@ $as_echo "$tool_specified" >&6; } fi - # Only call fixup if objcopy was found. - if test -n "$OBJCOPY"; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # First separate the path from the arguments. This will split at the first # space. - complete="$OBJCOPY" + complete="$BUILD_LD" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -38270,14 +38548,14 @@ $as_echo "$tool_specified" >&6; } fi if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 fi fi @@ -38297,11 +38575,11 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh elif test -f "${new_path}.cmd"; then input_to_shortpath="${new_path}.cmd" else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&6;} { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 fi else input_to_shortpath="$new_path" @@ -38348,7 +38626,7 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" # First separate the path from the arguments. This will split at the first # space. - complete="$OBJCOPY" + complete="$BUILD_LD" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -38393,14 +38671,14 @@ $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" if test "x$new_path" = x; then # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 fi fi @@ -38446,7 +38724,7 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh # We're on a posix platform. Hooray! :) # First separate the path from the arguments. This will split at the first # space. - complete="$OBJCOPY" + complete="$BUILD_LD" path="${complete%% *}" tmp="$complete EOL" arguments="${tmp#* }" @@ -38465,20 +38743,19 @@ $as_echo "$as_me: You might be mixing spaces in the path and extra arguments, wh done IFS="$IFS_save" else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving OBJCOPY (as $path) failed, using $path directly." >&6;} + # This is an absolute path, we can use it without further modifications. new_path="$path" fi if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;} has_space=`$ECHO "$complete" | $GREP " "` if test "x$has_space" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} fi - as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5 + as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5 fi fi @@ -38490,86 +38767,330 @@ $as_echo "$as_me: This might be caused by spaces in the path, which is not allow fi if test "x$complete" != "x$new_complete"; then - OBJCOPY="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;} + BUILD_LD="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;} fi - fi + else + # If we are not cross compiling, use the normal target compilers for + # building the build platform executables. + BUILD_CC="$CC" + BUILD_CXX="$CXX" + BUILD_LD="$LD" fi + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # For hotspot, we need these in Windows mixed path, + # so rewrite them all. Need added .exe suffix. + HOTSPOT_CXX="$CXX.exe" + HOTSPOT_LD="$LD.exe" + HOTSPOT_MT="$MT.exe" + HOTSPOT_RC="$RC.exe" - # Publish this variable in the help. + unix_path="$HOTSPOT_CXX" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_CXX="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_CXX="$windows_path" + fi - if test "x$OBJDUMP" = x; then - # The variable is not set by user, try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjdump objdump - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + unix_path="$HOTSPOT_LD" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_LD="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_LD="$windows_path" fi -done - done -IFS=$as_save_IFS -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + + unix_path="$HOTSPOT_MT" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_MT="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_MT="$windows_path" + fi + + + unix_path="$HOTSPOT_RC" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + windows_path=`$CYGPATH -m "$unix_path"` + HOTSPOT_RC="$windows_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + windows_path=`cmd //c echo $unix_path` + HOTSPOT_RC="$windows_path" + fi + + + + else + HOTSPOT_CXX="$CXX" + HOTSPOT_LD="$LD" + fi + + + + if test "x$TOOLCHAIN_TYPE" = xclang; then + USE_CLANG=true + fi + + + # LDEXE is the linker to use, when creating executables. Not really used. + # FIXME: These should just be removed! + LDEXE="$LD" + LDEXECXX="$LDCXX" + + + + + # The package path is used only on macosx? + # FIXME: clean this up, and/or move it elsewhere. + PACKAGE_PATH=/opt/local + + + # Check for extra potential brokenness. + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # On Windows, double-check that we got the right compiler. + CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` + COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` + if test "x$OPENJDK_TARGET_CPU" = "xx86"; then + if test "x$COMPILER_CPU_TEST" != "x80x86"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5 + fi + elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then + if test "x$COMPILER_CPU_TEST" != "xx64"; then + as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5 + fi + fi + fi + + if test "x$TOOLCHAIN_TYPE" = xgcc; then + # If this is a --hash-style=gnu system, use --hash-style=both, why? + HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + # This is later checked when setting flags. + fi + + # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed + # in executable.' + USING_BROKEN_SUSE_LD=no + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5 +$as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; } + echo "SUNWprivate_1.1 { local: *; };" > version-script.map + echo "int main() { }" > main.c + if $CXX -Xlinker -version-script=version-script.map main.c 2>&5 >&5; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -fi + USING_BROKEN_SUSE_LD=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + USING_BROKEN_SUSE_LD=yes + fi + rm -rf version-script.map main.c + fi - test -n "$OBJDUMP" && break - done + +# Setup the JTReg Regression Test Harness. + + +# Check whether --with-jtreg was given. +if test "${with_jtreg+set}" = set; then : + withval=$with_jtreg; +else + with_jtreg=no fi -if test -z "$OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - for ac_prog in gobjdump objdump + + + if test "x$with_jtreg" = xno; then + # jtreg disabled + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5 +$as_echo_n "checking for jtreg... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + if test "x$with_jtreg" != xyes; then + # with path specified. + JT_HOME="$with_jtreg" + fi + + if test "x$JT_HOME" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jtreg" >&5 +$as_echo_n "checking for jtreg... " >&6; } + + # use JT_HOME enviroment var. + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$JT_HOME" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of JT_HOME" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + JT_HOME="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$JT_HOME" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + JT_HOME="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JT_HOME to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting JT_HOME to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$JT_HOME" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JT_HOME, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of JT_HOME, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of JT_HOME, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + JT_HOME="`cd "$path"; $THEPWDCMD -L`" + fi + + + # jtreg win32 script works for everybody + JTREGEXE="$JT_HOME/bin/jtreg" + + if test ! -f "$JTREGEXE"; then + as_fn_error $? "JTReg executable does not exist: $JTREGEXE" "$LINENO" 5 + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 +$as_echo "$JTREGEXE" >&6; } + else + # try to find jtreg on path + + + + # Publish this variable in the help. + + + if test "x$JTREGEXE" = x; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in jtreg do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if ${ac_cv_path_JTREGEXE+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $JTREGEXE in + [\\/]* | ?:[\\/]*) + ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" + ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -38577,112 +39098,57 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } +JTREGEXE=$ac_cv_path_JTREGEXE +if test -n "$JTREGEXE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 +$as_echo "$JTREGEXE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_OBJDUMP" && break + test -n "$JTREGEXE" && break done - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -fi - else # The variable is set, but is it from the command line or the environment? - # Try to remove the string !OBJDUMP! from our list. - try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!OBJDUMP!/} + # Try to remove the string !JTREGEXE! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!JTREGEXE!/} if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then # If it failed, the variable was not from the command line. Ignore it, # but warn the user (except for BASH, which is always set by the calling BASH). - if test "xOBJDUMP" != xBASH; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of OBJDUMP from the environment. Use command line variables instead." >&5 -$as_echo "$as_me: WARNING: Ignoring value of OBJDUMP from the environment. Use command line variables instead." >&2;} + if test "xJTREGEXE" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of JTREGEXE from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of JTREGEXE from the environment. Use command line variables instead." >&2;} fi # Try to locate tool using the code snippet - if test -n "$ac_tool_prefix"; then - for ac_prog in gobjdump objdump - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$OBJDUMP" && break - done -fi -if test -z "$OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - for ac_prog in gobjdump objdump + for ac_prog in jtreg do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : +if ${ac_cv_path_JTREGEXE+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + case $JTREGEXE in + [\\/]* | ?:[\\/]*) + ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_prog" + ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -38690,34 +39156,22 @@ done done IFS=$as_save_IFS + ;; +esac fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } +JTREGEXE=$ac_cv_path_JTREGEXE +if test -n "$JTREGEXE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 +$as_echo "$JTREGEXE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$ac_ct_OBJDUMP" && break + test -n "$JTREGEXE" && break done - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -fi - else # If it succeeded, then it was overridden by the user. We will use it # for the tool. @@ -38727,22 +39181,22 @@ fi CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" # Check if the provided tool contains a complete path. - tool_specified="$OBJDUMP" + tool_specified="$JTREGEXE" tool_basename="${tool_specified##*/}" if test "x$tool_basename" = "x$tool_specified"; then # A command without a complete path is provided, search $PATH. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool OBJDUMP=$tool_basename" >&5 -$as_echo "$as_me: Will search for user supplied tool OBJDUMP=$tool_basename" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool JTREGEXE=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool JTREGEXE=$tool_basename" >&6;} # Extract the first word of "$tool_basename", so it can be a program name with args. set dummy $tool_basename; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_OBJDUMP+:} false; then : +if ${ac_cv_path_JTREGEXE+:} false; then : $as_echo_n "(cached) " >&6 else - case $OBJDUMP in + case $JTREGEXE in [\\/]* | ?:[\\/]*) - ac_cv_path_OBJDUMP="$OBJDUMP" # Let the user override the test with a path. + ac_cv_path_JTREGEXE="$JTREGEXE" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -38752,7 +39206,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_OBJDUMP="$as_dir/$ac_word$ac_exec_ext" + ac_cv_path_JTREGEXE="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -38763,29 +39217,29 @@ IFS=$as_save_IFS ;; esac fi -OBJDUMP=$ac_cv_path_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } +JTREGEXE=$ac_cv_path_JTREGEXE +if test -n "$JTREGEXE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JTREGEXE" >&5 +$as_echo "$JTREGEXE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$OBJDUMP" = x; then + if test "x$JTREGEXE" = x; then as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 fi else # Otherwise we believe it is a complete path. Use it as it is. - { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool OBJDUMP=$tool_specified" >&5 -$as_echo "$as_me: Will use user supplied tool OBJDUMP=$tool_specified" >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OBJDUMP" >&5 -$as_echo_n "checking for OBJDUMP... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool JTREGEXE=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool JTREGEXE=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JTREGEXE" >&5 +$as_echo_n "checking for JTREGEXE... " >&6; } if test ! -x "$tool_specified"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } - as_fn_error $? "User supplied tool OBJDUMP=$tool_specified does not exist or is not executable" "$LINENO" 5 + as_fn_error $? "User supplied tool JTREGEXE=$tool_specified does not exist or is not executable" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 $as_echo "$tool_specified" >&6; } @@ -38794,285 +39248,120 @@ $as_echo "$tool_specified" >&6; } fi - if test "x$OBJDUMP" != x; then - # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. - - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJDUMP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - - # Input might be given as Windows format, start by converting to - # unix format. - new_path=`$CYGPATH -u "$path"` - - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path=`$CYGPATH -u "$path"` - new_path=`$WHICH "$new_path" 2> /dev/null` - # bat and cmd files are not always considered executable in cygwin causing which - # to not find them - if test "x$new_path" = x \ - && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ - && test "x`$LS \"$path\" 2>/dev/null`" != x; then - new_path=`$CYGPATH -u "$path"` - fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi - fi - # Cygwin tries to hide some aspects of the Windows file system, such that binaries are - # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered - # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then - # "foo.exe" is OK but "foo" is an error. - # - # This test is therefore slightly more accurate than "test -f" to check for file presence. - # It is also a way to make sure we got the proper file name for the real test later on. - test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` - if test "x$test_shortpath" = x; then - # Short path failed, file does not exist as specified. - # Try adding .exe or .cmd - if test -f "${new_path}.exe"; then - input_to_shortpath="${new_path}.exe" - elif test -f "${new_path}.cmd"; then - input_to_shortpath="${new_path}.cmd" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&6;} - { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 -$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi - else - input_to_shortpath="$new_path" + if test "x$JTREGEXE" = x; then + as_fn_error $? "Could not find required tool for JTREGEXE" "$LINENO" 5 fi - # Call helper function which possibly converts this using DOS-style short mode. - # If so, the updated path is stored in $new_path. - new_path="$input_to_shortpath" - input_path="$input_to_shortpath" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - shortmode_path=`$CYGPATH -s -m -a "$input_path"` - path_after_shortmode=`$CYGPATH -u "$shortmode_path"` - if test "x$path_after_shortmode" != "x$input_to_shortpath"; then - # Going to short mode and back again did indeed matter. Since short mode is - # case insensitive, let's make it lowercase to improve readability. - shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Now convert it back to Unix-stile (cygpath) - input_path=`$CYGPATH -u "$shortmode_path"` - new_path="$input_path" + JT_HOME="`$DIRNAME $JTREGEXE`" fi fi - test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` - if test "x$test_cygdrive_prefix" = x; then - # As a simple fix, exclude /usr/bin since it's not a real path. - if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then - # The path is in a Cygwin special directory (e.g. /home). We need this converted to - # a path prefixed by /cygdrive for fixpath to work. - new_path="$CYGWIN_ROOT_PATH$input_path" - fi - fi - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJDUMP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - # Input might be given as Windows format, start by converting to - # unix format. - new_path="$path" - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" + # Option used to tell the compiler whether to create 32- or 64-bit executables + if test "x$TOOLCHAIN_TYPE" = xxlc; then + COMPILER_TARGET_BITS_FLAG="-q" + else + COMPILER_TARGET_BITS_FLAG="-m" fi - # Now try to locate executable using which - new_path=`$WHICH "$new_path" 2> /dev/null` - - if test "x$new_path" = x; then - # Oops. Which didn't find the executable. - # The splitting of arguments from the executable at a space might have been incorrect, - # since paths with space are more likely in Windows. Give it another try with the whole - # argument. - path="$complete" - arguments="EOL" - new_path="$path" - - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" + # FIXME: figure out if we should select AR flags depending on OS or toolchain. + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + ARFLAGS="-r" + elif test "x$OPENJDK_TARGET_OS" = xaix; then + ARFLAGS="-X64" + elif test "x$OPENJDK_TARGET_OS" = xwindows; then + # lib.exe is used as AR to create static libraries. + ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" + else + ARFLAGS="" fi - new_path=`$WHICH "$new_path" 2> /dev/null` + ## Setup strip. + # FIXME: should this really be per platform, or should it be per toolchain type? + # strip is not provided by clang or solstudio; so guessing platform makes most sense. + # FIXME: we should really only export STRIPFLAGS from here, not POST_STRIP_CMD. + if test "x$OPENJDK_TARGET_OS" = xlinux; then + STRIPFLAGS="-g" + elif test "x$OPENJDK_TARGET_OS" = xsolaris; then + STRIPFLAGS="-x" + elif test "x$OPENJDK_TARGET_OS" = xmacosx; then + STRIPFLAGS="-S" + elif test "x$OPENJDK_TARGET_OS" = xaix; then + STRIPFLAGS="-X32_64" + fi - if test "x$new_path" = x; then - # It's still not found. Now this is an unrecoverable error. - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 -$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 - fi + if test "x$OPENJDK_TARGET_OS" != xwindows; then + POST_STRIP_CMD="$STRIP $STRIPFLAGS" fi - # Now new_path has a complete unix path to the binary - if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then - # Keep paths in /bin as-is, but remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Do not save /bin paths to all_fixpath_prefixes! - else - # Not in mixed or Windows style, start by that. - new_path=`cmd //c echo $new_path` - input_path="$new_path" - # Check if we need to convert this using DOS-style short mode. If the path - # contains just simple characters, use it. Otherwise (spaces, weird characters), - # take no chances and rewrite it. - # Note: m4 eats our [], so we need to use [ and ] instead. - has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` - if test "x$has_forbidden_chars" != x; then - # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) - new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # FIXME: break out into MCSFLAGS + POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" fi - # Output is in $new_path - windows_path="$new_path" - if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - unix_path=`$CYGPATH -u "$windows_path"` - new_path="$unix_path" - elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` - new_path="$unix_path" + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + CC_OUT_OPTION=-Fo + EXE_OUT_OPTION=-out: + LD_OUT_OPTION=-out: + AR_OUT_OPTION=-out: + else + # The option used to specify the target .o,.a or .so file. + # When compiling, how to specify the to be created object file. + CC_OUT_OPTION='-o$(SPACE)' + # When linking, how to specify the to be created executable. + EXE_OUT_OPTION='-o$(SPACE)' + # When linking, how to specify the to be created dynamically linkable library. + LD_OUT_OPTION='-o$(SPACE)' + # When archiving, how to specify the to be create static archive for object files. + AR_OUT_OPTION='rcs$(SPACE)' fi - # remove trailing .exe if any - new_path="${new_path/%.exe/}" - # Save the first 10 bytes of this path to the storage, so fixpath can work. - all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") - fi - else - # We're on a posix platform. Hooray! :) - # First separate the path from the arguments. This will split at the first - # space. - complete="$OBJDUMP" - path="${complete%% *}" - tmp="$complete EOL" - arguments="${tmp#* }" - # Cannot rely on the command "which" here since it doesn't always work. - is_absolute_path=`$ECHO "$path" | $GREP ^/` - if test -z "$is_absolute_path"; then - # Path to executable is not absolute. Find it. - IFS_save="$IFS" - IFS=: - for p in $PATH; do - if test -f "$p/$path" && test -x "$p/$path"; then - new_path="$p/$path" - break - fi - done - IFS="$IFS_save" - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) failed, using $path directly." >&5 -$as_echo "$as_me: Resolving OBJDUMP (as $path) failed, using $path directly." >&6;} - new_path="$path" - fi - if test "x$new_path" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5 -$as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;} - has_space=`$ECHO "$complete" | $GREP " "` - if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 -$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} - fi - as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5 + # On Windows, we need to set RC flags. + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + RC_FLAGS="-nologo -l 0x409 -r" + if test "x$VARIANT" = xOPT; then + RC_FLAGS="$RC_FLAGS -d NDEBUG" fi - fi - # Now join together the path and the arguments once again - if test "x$arguments" != xEOL; then - new_complete="$new_path ${arguments% *}" - else - new_complete="$new_path" + # The version variables used to create RC_FLAGS may be overridden + # in a custom configure script, or possibly the command line. + # Let those variables be expanded at make time in spec.gmk. + # The \$ are escaped to the shell, and the $(...) variables + # are evaluated by make. + RC_FLAGS="$RC_FLAGS \ + -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ + -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ + -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ + -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ + -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ + -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ + -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" fi - if test "x$complete" != "x$new_complete"; then - OBJDUMP="$new_complete" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5 -$as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;} - fi + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # FIXME: likely bug, should be CCXXFLAGS_JDK? or one for C or CXX. + CCXXFLAGS="$CCXXFLAGS -nologo" fi +# FIXME: Currently we must test this after toolchain but before flags. Fix! - # Restore old path without tools dir - PATH="$OLD_PATH" - - -# FIXME: Currently we must test this after paths but before flags. Fix! - -# And we can test some aspects on the target using configure macros. +# Now we can test some aspects on the target using configure macros. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 @@ -39639,114 +39928,58 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # Configure flags for the tools - ############################################################################### # # How to compile shared libraries. # - if test "x$GCC" = xyes; then - COMPILER_NAME=gcc + if test "x$TOOLCHAIN_TYPE" = xgcc; then PICFLAG="-fPIC" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib$1.so' - STATIC_LIBRARY='lib$1.a' - SHARED_LIBRARY_FLAGS="-shared" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1' - SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1' C_FLAG_REORDER='' CXX_FLAG_REORDER='' - SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN$1' - SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1' - LD="$CC" - LDEXE="$CC" - LDCXX="$CXX" - LDEXECXX="$CXX" - POST_STRIP_CMD="$STRIP -g" - # Linking is different on MacOSX if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # Might change in the future to clang. - COMPILER_NAME=gcc - SHARED_LIBRARY='lib$1.dylib' + # Linking is different on MacOSX SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SHARED_LIBRARY_SUFFIX='.dylib' - EXE_SUFFIX='' + SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' + SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/$1' SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - POST_STRIP_CMD="$STRIP -S" - fi - else - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler - COMPILER_NAME=ossc - PICFLAG="-KPIC" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib$1.so' - STATIC_LIBRARY='lib$1.a' - SHARED_LIBRARY_FLAGS="-G" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='-M$1' - C_FLAG_REORDER='-xF' - CXX_FLAG_REORDER='-xF' - SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN$1' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" - CFLAGS_JDKLIB_EXTRA='-xstrconst' - POST_STRIP_CMD="$STRIP -x" - POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" - fi - if test "x$OPENJDK_TARGET_OS" = xaix; then - COMPILER_NAME=xlc - PICFLAG="-qpic=large" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib$1.so' - STATIC_LIBRARY='lib$1.a' - SHARED_LIBRARY_FLAGS="-qmkshrobj" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_EXECUTABLE_ORIGIN="" - CFLAGS_JDK="" - CXXFLAGS_JDK="" - CFLAGS_JDKLIB_EXTRA='' - POST_STRIP_CMD="$STRIP -X32_64" - POST_MCS_CMD="" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # If it is not gcc, then assume it is the MS Visual Studio compiler - COMPILER_NAME=cl - PICFLAG="" - LIBRARY_PREFIX= - SHARED_LIBRARY='$1.dll' - STATIC_LIBRARY='$1.lib' - SHARED_LIBRARY_FLAGS="-LD" - SHARED_LIBRARY_SUFFIX='.dll' - STATIC_LIBRARY_SUFFIX='.lib' - OBJ_SUFFIX='.obj' - EXE_SUFFIX='.exe' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_EXECUTABLE_ORIGIN='' - fi + else + # Default works for linux, might work on other platforms as well. + SHARED_LIBRARY_FLAGS='-shared' + SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN$1' + SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN" + SET_SHARED_LIBRARY_NAME='-Xlinker -soname=$1' + SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=$1' + fi + elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then + PICFLAG="-KPIC" + C_FLAG_REORDER='-xF' + CXX_FLAG_REORDER='-xF' + SHARED_LIBRARY_FLAGS="-G" + SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN$1' + SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='-M$1' + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + PICFLAG="-qpic=large" + C_FLAG_REORDER='' + CXX_FLAG_REORDER='' + SHARED_LIBRARY_FLAGS="-qmkshrobj" + SET_EXECUTABLE_ORIGIN="" + SET_SHARED_LIBRARY_ORIGIN='' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='' + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + PICFLAG="" + C_FLAG_REORDER='' + CXX_FLAG_REORDER='' + SHARED_LIBRARY_FLAGS="-LD" + SET_EXECUTABLE_ORIGIN='' + SET_SHARED_LIBRARY_ORIGIN='' + SET_SHARED_LIBRARY_NAME='' + SET_SHARED_LIBRARY_MAPFILE='' fi @@ -39757,16 +39990,11 @@ $as_echo "$ac_cv_c_bigendian" >&6; } - - - - - - - - - - + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" + CFLAGS_JDKLIB_EXTRA='-xstrconst' + fi # The (cross) compiler is now configured, we can now test capabilities # of the target platform. @@ -39778,182 +40006,104 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # and different operating systems. # - # - # NOTE: check for -mstackrealign needs to be below potential addition of -m32 - # - if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then - # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. - # While waiting for a better solution, the current workaround is to use -mstackrealign. - CFLAGS="$CFLAGS -mstackrealign" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 32-bit compiler supports -mstackrealign" >&5 -$as_echo_n "checking if 32-bit compiler supports -mstackrealign... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main() { return 0; } -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path." "$LINENO" 5 - + # FIXME: this was indirectly the old default, but just inherited. + # if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # C_FLAG_DEPS="-MMD -MF" + # fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + # Generate make dependency files + if test "x$TOOLCHAIN_TYPE" = xgcc; then + C_FLAG_DEPS="-MMD -MF" + elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then + C_FLAG_DEPS="-xMMD -xMF" + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + C_FLAG_DEPS="-qmakedep=gcc -MF" fi + CXX_FLAG_DEPS="$C_FLAG_DEPS" - C_FLAG_DEPS="-MMD -MF" - CXX_FLAG_DEPS="-MMD -MF" - - case $COMPILER_TYPE in - CC ) - case $COMPILER_NAME in - gcc ) - case $OPENJDK_TARGET_OS in - macosx ) - # On MacOSX we optimize for size, something - # we should do for all platforms? - C_O_FLAG_HI="-Os" - C_O_FLAG_NORM="-Os" - C_O_FLAG_NONE="" - ;; - *) - C_O_FLAG_HI="-O3" - C_O_FLAG_NORM="-O2" - C_O_FLAG_NONE="-O0" - ;; - esac - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then - CFLAGS_DEBUG_SYMBOLS="-g1" - CXXFLAGS_DEBUG_SYMBOLS="-g1" - fi - ;; - ossc ) - # - # Forte has different names for this with their C++ compiler... - # - C_FLAG_DEPS="-xMMD -xMF" - CXX_FLAG_DEPS="-xMMD -xMF" - - # Extra options used with HIGHEST - # - # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be - # done with care, there are some assumptions below that need to - # be understood about the use of pointers, and IEEE behavior. - # - # Use non-standard floating point mode (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fns" - # Do some simplification of floating point arithmetic (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fsimple" - # Use single precision floating point with 'float' - CC_HIGHEST="$CC_HIGHEST -fsingle" - # Assume memory references via basic pointer types do not alias - # (Source with excessing pointer casting and data access with mixed - # pointer types are not recommended) - CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" - # Use intrinsic or inline versions for math/std functions - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" - # Loop data dependency optimizations (need -xO3 or higher) - CC_HIGHEST="$CC_HIGHEST -xdepend" - # Pointer parameters to functions do not overlap - # (Similar to -xalias_level=basic usage, but less obvious sometimes. - # If you pass in multiple pointers to the same data, do not use this) - CC_HIGHEST="$CC_HIGHEST -xrestrict" - # Inline some library routines - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xlibmil" - # Use optimized math routines - # (If you expect perfect errno behavior, do not use this) - # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now - #CC_HIGHEST="$CC_HIGHEST -xlibmopt" - - if test "x$OPENJDK_TARGET_CPU" = xsparc; then - CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" - fi - case $OPENJDK_TARGET_CPU_ARCH in - x86) - C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" - C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" - C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" - C_O_FLAG_NONE="-xregs=no%frameptr" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" - CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" - CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" - CXX_O_FLAG_NONE="-xregs=no%frameptr" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" - fi - ;; - sparc) - CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NONE="" - ;; - esac - - CFLAGS_DEBUG_SYMBOLS="-g -xs" - CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" - ;; - xlc ) - C_FLAG_DEPS="-qmakedep=gcc -MF" - CXX_FLAG_DEPS="-qmakedep=gcc -MF" - C_O_FLAG_HIGHEST="-O3" - C_O_FLAG_HI="-O3 -qstrict" - C_O_FLAG_NORM="-O2" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST="-O3" - CXX_O_FLAG_HI="-O3 -qstrict" - CXX_O_FLAG_NORM="-O2" - CXX_O_FLAG_NONE="" - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" - CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" - ;; - esac - ;; - CL ) + + # Debug symbols + if test "x$TOOLCHAIN_TYPE" = xgcc; then + if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then + CFLAGS_DEBUG_SYMBOLS="-g1" + CXXFLAGS_DEBUG_SYMBOLS="-g1" + else + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" + fi + elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then + CFLAGS_DEBUG_SYMBOLS="-g -xs" + CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + CFLAGS_DEBUG_SYMBOLS="-g" + CXXFLAGS_DEBUG_SYMBOLS="-g" + fi + + + + # Optimization levels + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then + CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xalias_level=basic -xbuiltin=%all -xdepend -xrestrict -xlibmil" + + if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then + # FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global? + C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" + C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" + C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" + C_O_FLAG_NONE="-xregs=no%frameptr" + CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" + CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" + CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" + CXX_O_FLAG_NONE="-xregs=no%frameptr" + if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then + C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" + CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" + fi + elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then + C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" + C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" + C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" + C_O_FLAG_NONE="" + CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" + CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" + CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" + CXX_O_FLAG_NONE="" + fi + else + # The remaining toolchains share opt flags between CC and CXX; + # setup for C and duplicate afterwards. + if test "x$TOOLCHAIN_TYPE" = xgcc; then + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + # On MacOSX we optimize for size, something + # we should do for all platforms? + C_O_FLAG_HIGHEST="-Os" + C_O_FLAG_HI="-Os" + C_O_FLAG_NORM="-Os" + C_O_FLAG_NONE="" + else + C_O_FLAG_HIGHEST="-O3" + C_O_FLAG_HI="-O3" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="-O0" + fi + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + C_O_FLAG_HIGHEST="-O3" + C_O_FLAG_HI="-O3 -qstrict" + C_O_FLAG_NORM="-O2" + C_O_FLAG_NONE="" + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then C_O_FLAG_HIGHEST="-O2" C_O_FLAG_HI="-O1" C_O_FLAG_NORM="-O1" C_O_FLAG_NONE="-Od" - CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - ;; - esac - - if test -z "$C_O_FLAG_HIGHEST"; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HI" + fi + CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" + CXX_O_FLAG_HI="$C_O_FLAG_HI" + CXX_O_FLAG_NORM="$C_O_FLAG_NORM" + CXX_O_FLAG_NONE="$C_O_FLAG_NONE" fi - if test -z "$CXX_O_FLAG_HIGHEST"; then - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" - fi @@ -39964,9 +40114,61 @@ rm -f core conftest.err conftest.$ac_objext \ + # Special extras... + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then + if test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then + CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" + CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" + fi + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" + CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" + CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" + elif test "x$TOOLCHAIN_TYPE" = xgcc; then + CXXSTD_CXXFLAG="-std=gnu++98" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$CXXSTD_CXXFLAG -Werror\"" >&5 +$as_echo_n "checking if the C++ compiler supports \"$CXXSTD_CXXFLAG -Werror\"... " >&6; } + supports=yes + + saved_cxxflags="$CXXFLAGS" + CXXFLAGS="$CXXFLAG $CXXSTD_CXXFLAG -Werror" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + supports=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + CXXFLAGS="$saved_cxxflags" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 +$as_echo "$supports" >&6; } + if test "x$supports" = "xyes" ; then + : + else + CXXSTD_CXXFLAG="" + fi + CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}" + JVM_CFLAGS="${JVM_CFLAGS} ${CXXSTD_CXXFLAG}" + fi if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5 @@ -40021,70 +40223,27 @@ fi # # Now setup the CFLAGS and LDFLAGS for the JDK build. # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. - # CFLAGS_JDK - C Compiler flags - # CXXFLAGS_JDK - C++ Compiler flags - # COMMON_CCXXFLAGS_JDK - common to C and C++ # - case $COMPILER_NAME in - gcc ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ - -pipe \ - -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - CXXSTD_CXXFLAG="-std=gnu++98" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the C++ compiler supports \"$CXXSTD_CXXFLAG $CFLAGS_WARNINGS_ARE_ERRORS\"" >&5 -$as_echo_n "checking if the C++ compiler supports \"$CXXSTD_CXXFLAG $CFLAGS_WARNINGS_ARE_ERRORS\"... " >&6; } - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $CXXSTD_CXXFLAG $CFLAGS_WARNINGS_ARE_ERRORS" - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - -else - supports=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - CXXFLAGS="$saved_cxxflags" - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supports" >&5 -$as_echo "$supports" >&6; } - if test "x$supports" = "xyes" ; then - : - else - CXXSTD_CXXFLAG="" - fi - CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}" - - case $OPENJDK_TARGET_CPU_ARCH in - arm ) - # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - ppc ) - # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac + # Setup compiler/platform specific flags to CFLAGS_JDK, + # CXXFLAGS_JDK and CCXXFLAGS_JDK (common to C and CXX?) + if test "x$TOOLCHAIN_TYPE" = xgcc; then + # these options are used for both C and C++ compiles + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wno-parentheses -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \ + -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" + case $OPENJDK_TARGET_CPU_ARCH in + arm ) + # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + ppc ) + # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing + ;; + * ) + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer" + CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" + ;; + esac REFERENCE_VERSION=6 @@ -40303,44 +40462,29 @@ $as_echo "$supports" >&6; } : fi - ;; - ossc ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" - case $OPENJDK_TARGET_CPU_ARCH in - x86 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" - ;; - esac - - CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" - CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" - - LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" - ;; - xlc ) - CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" + elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" + if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" + CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" + fi - LDFLAGS_JDK="$LDFLAGS_JDK" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK" - ;; - cl ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ - -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DWIN32 -DIAL" - case $OPENJDK_TARGET_CPU in - x86 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" - ;; - x86_64 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" - ;; - esac - ;; - esac + CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" + CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" + CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ + -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ + -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ + -DWIN32 -DIAL" + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" + else + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" + fi + fi ############################################################################### @@ -40366,12 +40510,13 @@ $as_echo "$supports" >&6; } ;; esac - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64" - - # The package path is used only on macosx? - PACKAGE_PATH=/opt/local + # Setup LP64 + CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" + # Set some common defines. These works for all compilers, but assume + # -D is universally accepted. + # Setup endianness if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN @@ -40379,55 +40524,68 @@ $as_echo "$supports" >&6; } # Note: -Dmacro is the same as #define macro 1 # -Dmacro= is the same as #define macro if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" fi else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" - fi - if test "x$OPENJDK_TARGET_OS" = xlinux; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DLINUX" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DWINDOWS" - fi - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DSOLARIS" - fi - if test "x$OPENJDK_TARGET_OS" = xaix; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DAIX -DPPC64" - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" - # Setting these parameters makes it an error to link to macosx APIs that are - # newer than the given OS version and makes the linked binaries compatible even - # if built on a newer version of the OS. - # The expected format is X.Y.Z - MACOSX_VERSION_MIN=10.7.0 - - # The macro takes the version with no dots, ex: 1070 - # Let the flags variables get resolved in make for easier override on make - # command line. - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - fi - if test "x$OPENJDK_TARGET_OS" = xbsd; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" fi + + # Setup target OS define. Use OS target name but in upper case. + OPENJDK_TARGET_OS_UPPERCASE=`$ECHO $OPENJDK_TARGET_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE" + + # Setup target CPU + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" + + # Setup debug/release defines if test "x$DEBUG_LEVEL" = xrelease; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED" - fi + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED" + fi else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG" + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" + fi + + # Setup release name + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'" + + + # Set some additional per-OS defines. + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" + elif test "x$OPENJDK_TARGET_OS" = xaix; then + # FIXME: PPC64 should not be here. + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DPPC64" + elif test "x$OPENJDK_TARGET_OS" = xbsd; then + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_ALLBSD_SOURCE" fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'" + # Additional macosx handling + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + if test "x$TOOLCHAIN_TYPE" = xgcc; then + # FIXME: This needs to be exported in spec.gmk due to closed legacy code. + # FIXME: clean this up, and/or move it elsewhere. + + # Setting these parameters makes it an error to link to macosx APIs that are + # newer than the given OS version and makes the linked binaries compatible + # even if built on a newer version of the OS. + # The expected format is X.Y.Z + MACOSX_VERSION_MIN=10.7.0 + + + # The macro takes the version with no dots, ex: 1070 + # Let the flags variables get resolved in make for easier override on make + # command line. + CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" + LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" + fi + fi - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ + # Setup some hard coded includes + CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ -I${JDK_OUTPUTDIR}/include \ -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ -I${JDK_TOPDIR}/src/share/javavm/export \ @@ -40436,13 +40594,20 @@ $as_echo "$supports" >&6; } -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" # The shared libraries are compiled using the picflag. - CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" - CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " + CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" + CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " # Executable flags - CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" - CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" + CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" + CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" + + + + + + # Setup LDFLAGS et al. + # # Now this is odd. The JDK native libraries have to link against libjvm.so # On 32-bit machines there is normally two distinct libjvm.so:s, client and server. # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library @@ -40451,9 +40616,9 @@ $as_echo "$supports" >&6; } # libraries will link to whatever is in memory. Yuck. # # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. - if test "x$COMPILER_NAME" = xcl; then + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" - if test "x$OPENJDK_TARGET_CPU" = xx86; then + if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" fi # TODO: make -debug optional "--disable-full-debug-symbols" @@ -40467,17 +40632,16 @@ $as_echo "$supports" >&6; } fi LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" else - if test "x$COMPILER_NAME" = xgcc; then + if test "x$TOOLCHAIN_TYPE" = xgcc; then # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + # We have previously set HAS_GNU_HASH if this is the case if test -n "$HAS_GNU_HASH"; then LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " fi if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add: - # -z defs, to forbid undefined symbols in object files - # -z noexecstack, to mark stack regions as non-executable - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack" + # And since we now know that the linker is gnu, then add -z defs, to forbid + # undefined symbols in object files. + LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs" if test "x$DEBUG_LEVEL" = "xrelease"; then # When building release libraries, tell the linker optimize them. # Should this be supplied to the OSS linker as well? @@ -40485,6 +40649,12 @@ $as_echo "$supports" >&6; } fi fi fi + + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then + LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" + LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" + fi + LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" @@ -40503,7 +40673,7 @@ $as_echo "$supports" >&6; } fi LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm" - if test "x$COMPILER_NAME" = xossc; then + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" fi @@ -40519,13 +40689,6 @@ $as_echo "$supports" >&6; } - - - - - - - # Some Zero and Shark settings. # ZERO_ARCHFLAG tells the compiler which mode to build for case "${OPENJDK_TARGET_CPU}" in @@ -40728,27 +40891,6 @@ $as_echo "$supports" >&6; } - # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed in executable.' - USING_BROKEN_SUSE_LD=no - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$GCC" = xyes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken SuSE 'ld' which only understands anonymous version tags in executables" >&5 -$as_echo_n "checking for broken SuSE 'ld' which only understands anonymous version tags in executables... " >&6; } - echo "SUNWprivate_1.1 { local: *; };" > version-script.map - echo "int main() { }" > main.c - if $CXX -Xlinker -version-script=version-script.map main.c 2>&5 >&5; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - USING_BROKEN_SUSE_LD=no - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - USING_BROKEN_SUSE_LD=yes - fi - rm -rf version-script.map main.c - fi - - - # Setup debug symbols (need objcopy from the toolchain for that) # @@ -40814,8 +40956,6 @@ $as_echo "${enable_zip_debug_info}" >&6; } - - ############################################################################### # # Check dependencies for external and internal libraries. @@ -46225,18 +46365,469 @@ fi fi # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then + if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" fi # TODO better (platform agnostic) test - if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then + if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then LIBCXX="-lstdc++" fi + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + + +# Check whether --with-msvcr-dll was given. +if test "${with_msvcr_dll+set}" = set; then : + withval=$with_msvcr_dll; +fi + + + if test "x$with_msvcr_dll" != x; then + # If given explicitely by user, do not probe. If not present, fail directly. + + POSSIBLE_MSVCR_DLL="$with_msvcr_dll" + METHOD="--with-msvcr-dll" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + if test "x$MSVCR_DLL" = x; then + as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5 + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Using well-known location from Visual Studio 10.0 + if test "x$VCINSTALLDIR" != x; then + CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" + + windows_path="$CYGWIN_VC_INSTALL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VC_INSTALL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_VC_INSTALL_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + else + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + fi + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in VCINSTALLDIR" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Check in the Boot JDK directory. + POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in Boot JDK" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Look in the Windows system32 directory + CYGWIN_SYSTEMROOT="$SYSTEMROOT" + + windows_path="$CYGWIN_SYSTEMROOT" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_SYSTEMROOT="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_SYSTEMROOT="$unix_path" + fi + + POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in SYSTEMROOT" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: If Visual Studio Express is installed, there is usually one with the debugger + if test "x$VS100COMNTOOLS" != x; then + CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + + windows_path="$CYGWIN_VS_TOOLS_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VS_TOOLS_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_VS_TOOLS_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + fi + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="search of VS100COMNTOOLS" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. + # (This was the original behaviour; kept since it might turn up something) + if test "x$CYGWIN_VC_INSTALL_DIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVCR_DLL" = x; then + # We're grasping at straws now... + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + fi + fi + + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="search of VCINSTALLDIR" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5 + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$MSVCR_DLL" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of MSVCR_DLL" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + MSVCR_DLL="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$MSVCR_DLL" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + MSVCR_DLL="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$MSVCR_DLL" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + MSVCR_DLL="`cd "$path"; $THEPWDCMD -L`" + fi + + + + +# Check whether --with-dxsdk was given. +if test "${with_dxsdk+set}" = set; then : + withval=$with_dxsdk; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk is deprecated and will be ignored." >&5 +$as_echo "$as_me: WARNING: Option --with-dxsdk is deprecated and will be ignored." >&2;} +fi + + + + +# Check whether --with-dxsdk-lib was given. +if test "${with_dxsdk_lib+set}" = set; then : + withval=$with_dxsdk_lib; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk-lib is deprecated and will be ignored." >&5 +$as_echo "$as_me: WARNING: Option --with-dxsdk-lib is deprecated and will be ignored." >&2;} +fi + + + + +# Check whether --with-dxsdk-include was given. +if test "${with_dxsdk_include+set}" = set; then : + withval=$with_dxsdk_include; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --with-dxsdk-include is deprecated and will be ignored." >&5 +$as_echo "$as_me: WARNING: Option --with-dxsdk-include is deprecated and will be ignored." >&2;} +fi + + + fi + + ############################################################################### # @@ -46664,7 +47255,7 @@ fi if test "x$ENABLE_PRECOMPH" = xyes; then # Check that the compiler actually supports precomp headers. - if test "x$GCC" = xyes; then + if test "x$TOOLCHAIN_TYPE" = xgcc; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking that precompiled headers work" >&5 $as_echo_n "checking that precompiled headers work... " >&6; } echo "int alfa();" > conftest.h @@ -48385,8 +48976,9 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" fi printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" - printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" + printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" + printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" + printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" printf "\n" printf "Build performance summary:\n" diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4 index 89ecfbe..03474bc 100644 --- a/common/autoconf/help.m4 +++ b/common/autoconf/help.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -151,6 +151,27 @@ pkgadd_help() { PKGHANDLER_COMMAND="" } +# This function will check if we're called from the "configure" wrapper while +# printing --help. If so, we will print out additional information that can +# only be extracted within the autoconf script, and then exit. This must be +# called at the very beginning in configure.ac. +AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], +[ + if test "x$CONFIGURE_PRINT_TOOLCHAIN_LIST" != x; then + $PRINTF "The following toolchains are available as arguments to --with-toolchain-type.\n" + $PRINTF "Which are valid to use depends on the build platform.\n" + for toolchain in $VALID_TOOLCHAINS_all; do + # Use indirect variable referencing + toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain + TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} + $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" + done + + # And now exit directly + exit 0 + fi +]) + AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], [ # Finally output some useful information to the user @@ -178,8 +199,9 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS], printf "* Environment: $WINDOWS_ENV_VENDOR version $WINDOWS_ENV_VERSION (root at $WINDOWS_ENV_ROOT_PATH)\n" fi printf "* Boot JDK: $BOOT_JDK_VERSION (at $BOOT_JDK)\n" - printf "* C Compiler: $CC_VENDOR version $CC_VERSION (at $CC)\n" - printf "* C++ Compiler: $CXX_VENDOR version $CXX_VERSION (at $CXX)\n" + printf "* Toolchain: $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n" + printf "* C Compiler: Version $CC_VERSION_NUMBER (at $CC)\n" + printf "* C++ Compiler: Version $CXX_VERSION_NUMBER (at $CXX)\n" printf "\n" printf "Build performance summary:\n" diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index 8146fe5..850133e 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -102,6 +102,8 @@ HOTSPOT_BUILD_JOBS:=$(JOBS) # Control wether Hotspot runs Queens test after building TEST_IN_BUILD=@TEST_IN_BUILD@ +USE_CLANG := @USE_CLANG@ + # For hotspot, override compiler/tools definition to not include FIXPATH prefix. # Hotspot has its own handling on the Windows path situation. CXX:=@CCACHE@ @HOTSPOT_CXX@ diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index a8f7170..77d1e8d 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -606,8 +606,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], AC_SUBST(ENABLE_DEBUG_SYMBOLS) AC_SUBST(ZIP_DEBUGINFO_FILES) - AC_SUBST(CFLAGS_DEBUG_SYMBOLS) - AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) ]) # Support for customization of the build process. Some build files diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index 91b8ed7..6cbbe26 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -863,14 +863,25 @@ AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP], fi # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then + if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1" fi # TODO better (platform agnostic) test - if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then + if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$TOOLCHAIN_TYPE" = xgcc; then LIBCXX="-lstdc++" fi AC_SUBST(LIBCXX) ]) + +AC_DEFUN_ONCE([LIB_SETUP_ON_WINDOWS], +[ + if test "x$OPENJDK_TARGET_OS" = "xwindows"; then + TOOLCHAIN_SETUP_MSVCR_DLL + BASIC_DEPRECATED_ARG_WITH([dxsdk]) + BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) + BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) + fi + AC_SUBST(MSVCR_DLL) +]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 1c418f2..b34dc7d 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -292,11 +292,8 @@ OPENWIN_HOME:=@OPENWIN_HOME@ # The lowest required version of macosx to enforce compatiblity for MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@ -# There are two types: CC or CL -# CC is gcc and others behaving reasonably similar. -# CL is cl.exe only. -COMPILER_TYPE:=@COMPILER_TYPE@ -COMPILER_NAME:=@COMPILER_NAME@ +# Toolchain type: gcc, clang, solstudio, lxc, microsoft... +TOOLCHAIN_TYPE:=@TOOLCHAIN_TYPE@ # Option used to tell the compiler whether to create 32- or 64-bit executables COMPILER_TARGET_BITS_FLAG:=@COMPILER_TARGET_BITS_FLAG@ diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 17439ec..30393e3 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -23,8 +23,37 @@ # questions. # +######################################################################## +# This file is responsible for detecting, verifying and setting up the +# toolchain, i.e. the compiler, linker and related utilities. It will setup +# proper paths to the binaries, but it will not setup any flags. +# +# The binaries used is determined by the toolchain type, which is the family of +# compilers and related tools that are used. +######################################################################## + + +# All valid toolchains, regardless of platform (used by help.m4) +VALID_TOOLCHAINS_all="gcc clang solstudio xlc microsoft" + +# These toolchains are valid on different platforms +VALID_TOOLCHAINS_linux="gcc clang" +VALID_TOOLCHAINS_solaris="solstudio" +VALID_TOOLCHAINS_macosx="gcc clang" +VALID_TOOLCHAINS_aix="xlc" +VALID_TOOLCHAINS_windows="microsoft" + +# Toolchain descriptions +TOOLCHAIN_DESCRIPTION_clang="clang/LLVM" +TOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection" +TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio" +TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio" +TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" + # Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called. # Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER. +# $1 - optional variable prefix for compiler and version variables (BUILD_) +# $2 - optional variable prefix for comparable variable (OPENJDK_BUILD_) AC_DEFUN([TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS], [ if test "x$CC_VERSION" != "x$CXX_VERSION"; then @@ -41,7 +70,7 @@ AC_DEFUN([TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS], AC_MSG_WARN([C compiler version number has a part larger than 99999: $CC_VERSION. Comparisons might be wrong.]) fi - COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", [$]1, [$]2, [$]3) }' <<< "$CC_VERSION"` + $2COMPARABLE_ACTUAL_VERSION=`$AWK -F. '{ printf("%05d%05d%05d\n", [$]1, [$]2, [$]3) }' <<< "$CC_VERSION"` ]) # Check if the configured compiler (C and C++) is of a specific version or @@ -73,226 +102,115 @@ AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], fi ]) -# $1 = compiler to test (CC or CXX) -# $2 = human readable name of compiler (C or C++) -AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION], -[ - COMPILER=[$]$1 - COMPILER_NAME=$2 - - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # Make sure we use the Sun Studio compiler and not gcc on Solaris, which won't work - COMPILER_VERSION_TEST=`$COMPILER -V 2>&1 | $HEAD -n 1` - $ECHO $COMPILER_VERSION_TEST | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null - if test $? -ne 0; then - GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` - AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler.]) - AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_TEST" and with --version: "$GCC_VERSION_TEST"]) - AC_MSG_ERROR([Sun Studio compiler is required. Try setting --with-tools-dir.]) - else - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/p"` - COMPILER_VENDOR="Sun Studio" - fi - elif test "x$OPENJDK_TARGET_OS" = xaix; then - COMPILER_VERSION_TEST=`$COMPILER -qversion 2>&1 | $TAIL -n 1` - $ECHO $COMPILER_VERSION_TEST | $GREP "^Version: " > /dev/null - if test $? -ne 0; then - AC_MSG_ERROR([Failed to detect the compiler version of $COMPILER ....]) - else - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n 's/Version: \([0-9][0-9]\.[0-9][0-9]*\).*/\1/p'` - COMPILER_VENDOR='IBM' - fi - elif test "x$OPENJDK_TARGET_OS" = xwindows; then - # First line typically looks something like: - # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 - COMPILER_VERSION_TEST=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*Version \(@<:@1-9@:>@@<:@0-9.@:>@*\) .*/\1/p"` - COMPILER_VENDOR="Microsoft CL.EXE" - COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"` - if test "x$OPENJDK_TARGET_CPU" = "xx86"; then - if test "x$COMPILER_CPU_TEST" != "x80x86"; then - AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".]) - fi - elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then - if test "x$COMPILER_CPU_TEST" != "xx64"; then - AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".]) - fi - fi +# Setup a number of variables describing how native output files are +# named on this platform/toolchain. +AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS], +[ + # Define filename patterns + if test "x$OPENJDK_TARGET_OS" = xwindows; then + LIBRARY_PREFIX= + SHARED_LIBRARY_SUFFIX='.dll' + STATIC_LIBRARY_SUFFIX='.lib' + SHARED_LIBRARY='[$]1.dll' + STATIC_LIBRARY='[$]1.lib' + OBJ_SUFFIX='.obj' + EXE_SUFFIX='.exe' else - COMPILER_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1` - # Check that this is likely to be GCC. - $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null - if test $? -ne 0; then - AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler.]) - AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_TEST"]) - AC_MSG_ERROR([GCC compiler is required. Try setting --with-tools-dir.]) + LIBRARY_PREFIX=lib + SHARED_LIBRARY_SUFFIX='.so' + STATIC_LIBRARY_SUFFIX='.a' + SHARED_LIBRARY='lib[$]1.so' + STATIC_LIBRARY='lib[$]1.a' + OBJ_SUFFIX='.o' + EXE_SUFFIX='' + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + SHARED_LIBRARY='lib[$]1.dylib' + SHARED_LIBRARY_SUFFIX='.dylib' fi - - # First line typically looks something like: - # gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 - COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | \ - $SED -e 's/^.* \(@<:@1-9@:>@\.@<:@0-9.@:>@*\)@<:@^0-9.@:>@.*$/\1/'` - COMPILER_VENDOR=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^\(.*\) @<:@1-9@:>@@<:@0-9.@:>@*/\1/p"` fi - # This sets CC_VERSION or CXX_VERSION. (This comment is a grep marker) - $1_VERSION="$COMPILER_VERSION" - # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker) - $1_VENDOR="$COMPILER_VENDOR" - - AC_MSG_NOTICE([Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)]) -]) - -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS], -[ - ############################################################################### - # - # Configure the development tool paths and potential sysroot. - # - AC_LANG(C++) - - # The option used to specify the target .o,.a or .so file. - # When compiling, how to specify the to be created object file. - CC_OUT_OPTION='-o$(SPACE)' - # When linking, how to specify the to be created executable. - EXE_OUT_OPTION='-o$(SPACE)' - # When linking, how to specify the to be created dynamically linkable library. - LD_OUT_OPTION='-o$(SPACE)' - # When archiving, how to specify the to be create static archive for object files. - AR_OUT_OPTION='rcs$(SPACE)' - AC_SUBST(CC_OUT_OPTION) - AC_SUBST(EXE_OUT_OPTION) - AC_SUBST(LD_OUT_OPTION) - AC_SUBST(AR_OUT_OPTION) + AC_SUBST(LIBRARY_PREFIX) + AC_SUBST(SHARED_LIBRARY_SUFFIX) + AC_SUBST(STATIC_LIBRARY_SUFFIX) + AC_SUBST(SHARED_LIBRARY) + AC_SUBST(STATIC_LIBRARY) + AC_SUBST(OBJ_SUFFIX) + AC_SUBST(EXE_SUFFIX) ]) -# $1 = compiler to test (CC or CXX) -# $2 = human readable name of compiler (C or C++) -# $3 = list of compiler names to search for -AC_DEFUN([TOOLCHAIN_FIND_COMPILER], +# Determine which toolchain type to use, and make sure it is valid for this +# platform. Setup various information about the selected toolchain. +AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE], [ - COMPILER_NAME=$2 - - $1= - # If TOOLS_DIR is set, check for all compiler names in there first - # before checking the rest of the PATH. - if test -n "$TOOLS_DIR"; then - PATH_save="$PATH" - PATH="$TOOLS_DIR" - AC_PATH_PROGS(TOOLS_DIR_$1, $3) - $1=$TOOLS_DIR_$1 - PATH="$PATH_save" - fi - - # AC_PATH_PROGS can't be run multiple times with the same variable, - # so create a new name for this run. - if test "x[$]$1" = x; then - AC_PATH_PROGS(POTENTIAL_$1, $3) - $1=$POTENTIAL_$1 - fi - - if test "x[$]$1" = x; then - HELP_MSG_MISSING_DEPENDENCY([devkit]) - AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) - fi - BASIC_FIXUP_EXECUTABLE($1) - TEST_COMPILER="[$]$1" - # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links - # to 'xlc' but it is crucial that we invoke the compiler with the right name! - if test "x$OPENJDK_BUILD_OS" != xaix; then - AC_MSG_CHECKING([resolved symbolic links for $1]) - BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) - AC_MSG_RESULT([$TEST_COMPILER]) - fi - AC_MSG_CHECKING([if $1 is disguised ccache]) - - COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` - if test "x$COMPILER_BASENAME" = "xccache"; then - AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) - # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. - # We want to control ccache invocation ourselves, so ignore this cc and try - # searching again. - - # Remove the path to the fake ccache cc from the PATH - RETRY_COMPILER_SAVED_PATH="$PATH" - COMPILER_DIRNAME=`$DIRNAME [$]$1` - PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" - - # Try again looking for our compiler - AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) - BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) - PATH="$RETRY_COMPILER_SAVED_PATH" - - AC_MSG_CHECKING([for resolved symbolic links for $1]) - BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) - AC_MSG_RESULT([$PROPER_COMPILER_$1]) - $1="$PROPER_COMPILER_$1" + AC_ARG_WITH(toolchain-type, [AS_HELP_STRING([--with-toolchain-type], + [the toolchain type (or family) to use, use '--help' to show possible values @<:@platform dependent@:>@])]) + + # Use indirect variable referencing + toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS + VALID_TOOLCHAINS=${!toolchain_var_name} + # First toolchain type in the list is the default + DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} + + if test "x$with_toolchain_type" = xlist; then + # List all toolchains + AC_MSG_NOTICE([The following toolchains are valid on this platform:]) + for toolchain in $VALID_TOOLCHAINS; do + toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain + TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} + $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" + done + + exit 0 + elif test "x$with_toolchain_type" != x; then + # User override; check that it is valid + if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then + AC_MSG_NOTICE([Toolchain type $with_toolchain_type is not valid on this platform.]) + AC_MSG_NOTICE([Valid toolchains: $VALID_TOOLCHAINS.]) + AC_MSG_ERROR([Cannot continue.]) + fi + TOOLCHAIN_TYPE=$with_toolchain_type else - AC_MSG_RESULT([no, keeping $1]) - $1="$TEST_COMPILER" - fi - TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME]) + # No flag given, use default + TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN + fi + AC_SUBST(TOOLCHAIN_TYPE) + + TOOLCHAIN_CC_BINARY_clang="clang" + TOOLCHAIN_CC_BINARY_gcc="gcc" + TOOLCHAIN_CC_BINARY_microsoft="cl" + TOOLCHAIN_CC_BINARY_solstudio="cc" + TOOLCHAIN_CC_BINARY_xlc="xlc_r" + + TOOLCHAIN_CXX_BINARY_clang="clang++" + TOOLCHAIN_CXX_BINARY_gcc="g++" + TOOLCHAIN_CXX_BINARY_microsoft="cl" + TOOLCHAIN_CXX_BINARY_solstudio="CC" + TOOLCHAIN_CXX_BINARY_xlc="xlC_r" + + # Use indirect variable referencing + toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE + TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} + toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE + TOOLCHAIN_CC_BINARY=${!toolchain_var_name} + toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE + TOOLCHAIN_CXX_BINARY=${!toolchain_var_name} + + TOOLCHAIN_SETUP_FILENAME_PATTERNS + + if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then + AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)]) + else + AC_MSG_NOTICE([Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN.]) + fi ]) - -AC_DEFUN([TOOLCHAIN_SETUP_PATHS], +# Before we start detecting the toolchain executables, we might need some +# special setup, e.g. additional paths etc. +AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION], [ - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV - TOOLCHAIN_SETUP_MSVCR_DLL - BASIC_DEPRECATED_ARG_WITH([dxsdk]) - BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) - BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) - fi - - AC_SUBST(MSVCR_DLL) - - # If --build AND --host is set, then the configure script will find any - # cross compilation tools in the PATH. Cross compilation tools - # follows the cross compilation standard where they are prefixed with ${host}. - # For example the binary i686-sun-solaris2.10-gcc - # will cross compile for i686-sun-solaris2.10 - # If neither of build and host is not set, then build=host and the - # default compiler found in the path will be used. - # Setting only --host, does not seem to be really supported. - # Please set both --build and --host if you want to cross compile. - - if test "x$COMPILE_TYPE" = "xcross"; then - # Now we to find a C/C++ compiler that can build executables for the build - # platform. We can't use the AC_PROG_CC macro, since it can only be used - # once. Also, we need to do this before adding a tools dir to the path, - # otherwise we might pick up cross-compilers which don't use standard naming. - # Otherwise, we'll set the BUILD_tools to the native tools, but that'll have - # to wait until they are properly discovered. - BASIC_PATH_PROGS(BUILD_CC, [cl cc gcc]) - BASIC_FIXUP_EXECUTABLE(BUILD_CC) - BASIC_PATH_PROGS(BUILD_CXX, [cl CC g++]) - BASIC_FIXUP_EXECUTABLE(BUILD_CXX) - BASIC_PATH_PROGS(BUILD_LD, ld) - BASIC_FIXUP_EXECUTABLE(BUILD_LD) - fi - AC_SUBST(BUILD_CC) - AC_SUBST(BUILD_CXX) - AC_SUBST(BUILD_LD) - - # If a devkit is found on the builddeps server, then prepend its path to the - # PATH variable. If there are cross compilers available in the devkit, these - # will be found by AC_PROG_CC et al. - DEVKIT= - BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, - [ - # Found devkit - PATH="$DEVKIT/bin:$PATH" - SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" - if test "x$x_includes" = "xNONE"; then - x_includes="$SYS_ROOT/usr/include/X11" - fi - if test "x$x_libraries" = "xNONE"; then - x_libraries="$SYS_ROOT/usr/lib" - fi - ], - []) + # FIXME: Is this needed? + AC_LANG(C++) # Store the CFLAGS etal passed to the configure script. ORG_CFLAGS="$CFLAGS" @@ -301,9 +219,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS], # autoconf magic only relies on PATH, so update it if tools dir is specified OLD_PATH="$PATH" - if test "x$TOOLS_DIR" != x; then - PATH=$TOOLS_DIR:$PATH - fi # Before we locate the compilers, we need to sanitize the Xcode build environment if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then @@ -386,235 +301,404 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS], LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" fi - ### Locate C compiler (CC) - - # On windows, only cl.exe is supported. - # On Solaris, cc is preferred to gcc. - # Elsewhere, gcc is preferred to cc. - - if test "x$CC" != x; then - COMPILER_CHECK_LIST="$CC" - elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" - elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="cc gcc" - elif test "x$OPENJDK_TARGET_OS" = "xaix"; then - # Do not probe for cc on AIX. - COMPILER_CHECK_LIST="xlc_r" - else - COMPILER_CHECK_LIST="gcc cc" + # For solaris we really need solaris tools, and not the GNU equivalent. + # The build tools on Solaris reside in /usr/ccs (C Compilation System), + # so add that to path before starting to probe. + # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. + if test "x$OPENJDK_BUILD_OS" = xsolaris; then + PATH="/usr/ccs/bin:$PATH" fi - TOOLCHAIN_FIND_COMPILER([CC],[C],[$COMPILER_CHECK_LIST]) - # Now that we have resolved CC ourself, let autoconf have its go at it - AC_PROG_CC([$CC]) - - # Option used to tell the compiler whether to create 32- or 64-bit executables - # Notice that CC contains the full compiler path at this point. - case $CC in - *xlc_r) COMPILER_TARGET_BITS_FLAG="-q";; - *) COMPILER_TARGET_BITS_FLAG="-m";; - esac - AC_SUBST(COMPILER_TARGET_BITS_FLAG) - - ### Locate C++ compiler (CXX) - - if test "x$CXX" != x; then - COMPILER_CHECK_LIST="$CXX" - elif test "x$OPENJDK_TARGET_OS" = "xwindows"; then - COMPILER_CHECK_LIST="cl" - elif test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - COMPILER_CHECK_LIST="CC g++" - elif test "x$OPENJDK_TARGET_OS" = "xaix"; then - # Do not probe for CC on AIX . - COMPILER_CHECK_LIST="xlC_r" - else - COMPILER_CHECK_LIST="g++ CC" + # On Windows, we need to detect the visual studio installation first. + if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then + TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV fi - TOOLCHAIN_FIND_COMPILER([CXX],[C++],[$COMPILER_CHECK_LIST]) - # Now that we have resolved CXX ourself, let autoconf have its go at it - AC_PROG_CXX([$CXX]) - - # This is the compiler version number on the form X.Y[.Z] - AC_SUBST(CC_VERSION) - AC_SUBST(CXX_VERSION) - - TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS + # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to + # override all other locations. + if test "x$TOOLS_DIR" != x; then + PATH=$TOOLS_DIR:$PATH + fi - ### Locate other tools + # If a devkit is found on the builddeps server, then prepend its path to the + # PATH variable. If there are cross compilers available in the devkit, these + # will be found by AC_PROG_CC et al. + DEVKIT= + BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, + [ + # Found devkit + PATH="$DEVKIT/bin:$PATH" + SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root" + if test "x$x_includes" = "xNONE"; then + x_includes="$SYS_ROOT/usr/include/X11" + fi + if test "x$x_libraries" = "xNONE"; then + x_libraries="$SYS_ROOT/usr/lib" + fi + ], + []) +]) - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - AC_PROG_OBJC - BASIC_FIXUP_EXECUTABLE(OBJC) - else - OBJC= - fi +# Restore path, etc +AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION], +[ + # Restore old path. + PATH="$OLD_PATH" # Restore the flags to the user specified values. # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" CFLAGS="$ORG_CFLAGS" CXXFLAGS="$ORG_CXXFLAGS" OBJCFLAGS="$ORG_OBJCFLAGS" +]) - LD="$CC" - LDEXE="$CC" - LDCXX="$CXX" - LDEXECXX="$CXX" - AC_SUBST(LD) - # LDEXE is the linker to use, when creating executables. - AC_SUBST(LDEXE) - # Linking C++ libraries. - AC_SUBST(LDCXX) - # Linking C++ executables. - AC_SUBST(LDEXECXX) +# Check if a compiler is of the toolchain type we expect, and save the version +# information from it. If the compiler does not match the expected type, +# this function will abort using AC_MSG_ERROR. If it matches, the version will +# be stored in CC_VERSION_NUMBER/CXX_VERSION_NUMBER (as a dotted number), and +# the full version string in CC_VERSION_STRING/CXX_VERSION_STRING. +# +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION], +[ + COMPILER=[$]$1 + COMPILER_NAME=$2 + + if test "x$TOOLCHAIN_TYPE" = xsolstudio; then + # cc -V output typically looks like + # cc: Sun C 5.12 Linux_i386 2011/11/16 + COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` + # Check that this is likely to be the Solaris Studio cc. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null + if test $? -ne 0; then + ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) + AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_OUTPUT"]) + AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"]) + AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) + fi + # Remove usage instructions (if present), and + # collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *@<:@Uu@:>@sage:.*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/"` + elif test "x$TOOLCHAIN_TYPE" = xxlc; then + # xlc -qversion output typically looks like + # IBM XL C/C++ for AIX, V11.1 (5724-X13) + # Version: 11.01.0000.0015 + COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` + # Check that this is likely to be the IBM XL C compiler. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null + if test $? -ne 0; then + ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) + AC_MSG_NOTICE([The result from running with -qversion was: "$COMPILER_VERSION_OUTPUT"]) + AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"]) + AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*, V\(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # There is no specific version flag, but all output starts with a version string. + # First line typically looks something like: + # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 + COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` + # Check that this is likely to be Microsoft CL.EXE. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null + if test $? -ne 0; then + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) + AC_MSG_NOTICE([The result from running it was: "$COMPILER_VERSION_OUTPUT"]) + AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*ersion.\(@<:@1-9@:>@@<:@0-9.@:>@*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xgcc; then + # gcc --version output typically looks like + # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 + # Copyright (C) 2013 Free Software Foundation, Inc. + # This is free software; see the source for copying conditions. There is NO + # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` + # Check that this is likely to be GCC. + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null + if test $? -ne 0; then + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) + AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION"]) + AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) + fi + # Remove Copyright and legalese from version string, and + # collapse into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/ *Copyright .*//'` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.* \(@<:@1-9@:>@\.@<:@0-9.@:>@*\) .*$/\1/'` + elif test "x$TOOLCHAIN_TYPE" = xclang; then + # clang --version output typically looks like + # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) + # clang version 3.3 (tags/RELEASE_33/final) + # or + # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) + # Target: x86_64-pc-linux-gnu + # Thread model: posix + COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` + # Check that this is likely to be clang + $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null + if test $? -ne 0; then + AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) + AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_OUTPUT"]) + AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) + fi + # Collapse compiler output into a single line + COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` + COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ + $SED -e 's/^.*clang version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'` - if test "x$OPENJDK_TARGET_OS" != xwindows; then - BASIC_CHECK_TOOLS(AR, ar) - BASIC_FIXUP_EXECUTABLE(AR) - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ARFLAGS="-r" - elif test "x$OPENJDK_TARGET_OS" = xaix; then - ARFLAGS="-X64" else - ARFLAGS="" + AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.]) fi - AC_SUBST(ARFLAGS) + # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) + $1_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" + # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) + $1_VERSION_STRING="$COMPILER_VERSION_STRING" - # For hotspot, we need these in Windows mixed path; other platforms keep them the same - HOTSPOT_CXX="$CXX" - HOTSPOT_LD="$LD" - AC_SUBST(HOTSPOT_CXX) - AC_SUBST(HOTSPOT_LD) + AC_MSG_NOTICE([Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER @<:@$COMPILER_VERSION_STRING@:>@]) +]) - COMPILER_NAME=gcc - COMPILER_TYPE=CC - AS_IF([test "x$OPENJDK_TARGET_OS" = xwindows], [ - # For now, assume that we are always compiling using cl.exe. - CC_OUT_OPTION=-Fo - EXE_OUT_OPTION=-out: - LD_OUT_OPTION=-out: - AR_OUT_OPTION=-out: - # On Windows, reject /usr/bin/link (as determined in CYGWIN_LINK), which is a cygwin - # program for something completely different. - AC_CHECK_PROG([WINLD], [link],[link],,, [$CYGWIN_LINK]) - # Since we must ignore the first found link, WINLD will contain - # the full path to the link.exe program. - BASIC_FIXUP_EXECUTABLE(WINLD) - printf "Windows linker was found at $WINLD\n" - AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) - "$WINLD" --version > /dev/null - if test $? -eq 0 ; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.]) + +# Try to locate the given C or C++ compiler in the path, or otherwise. +# +# $1 = compiler to test (CC or CXX) +# $2 = human readable name of compiler (C or C++) +# $3 = list of compiler names to search for +AC_DEFUN([TOOLCHAIN_FIND_COMPILER], +[ + COMPILER_NAME=$2 + SEARCH_LIST="$3" + + if test "x[$]$1" != x; then + # User has supplied compiler name already, always let that override. + AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1]) + if test "x`basename [$]$1`" = "x[$]$1"; then + # A command without a complete path is provided, search $PATH. + + AC_PATH_PROGS(POTENTIAL_$1, [$]$1) + if test "x$POTENTIAL_$1" != x; then + $1=$POTENTIAL_$1 + else + AC_MSG_ERROR([User supplied compiler $1=[$]$1 could not be found]) + fi else - AC_MSG_RESULT([yes]) + # Otherwise it might already be a complete path + if test ! -x "[$]$1"; then + AC_MSG_ERROR([User supplied compiler $1=[$]$1 does not exist]) + fi + fi + else + # No user supplied value. Locate compiler ourselves. + + # If we are cross compiling, assume cross compilation tools follows the + # cross compilation standard where they are prefixed with the autoconf + # standard name for the target. For example the binary + # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. + # If we are not cross compiling, then the default compiler name will be + # used. + + $1= + # If TOOLS_DIR is set, check for all compiler names in there first + # before checking the rest of the PATH. + # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION + # step, this should not be necessary. + if test -n "$TOOLS_DIR"; then + PATH_save="$PATH" + PATH="$TOOLS_DIR" + AC_PATH_PROGS(TOOLS_DIR_$1, $3) + $1=$TOOLS_DIR_$1 + PATH="$PATH_save" fi - LD="$WINLD" - LDEXE="$WINLD" - LDCXX="$WINLD" - LDEXECXX="$WINLD" - AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) - BASIC_FIXUP_EXECUTABLE(MT) - # The resource compiler - AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) - BASIC_FIXUP_EXECUTABLE(RC) + # AC_PATH_PROGS can't be run multiple times with the same variable, + # so create a new name for this run. + if test "x[$]$1" = x; then + AC_PATH_PROGS(POTENTIAL_$1, $3) + $1=$POTENTIAL_$1 + fi - # For hotspot, we need these in Windows mixed path, - # so rewrite them all. Need added .exe suffix. - HOTSPOT_CXX="$CXX.exe" - HOTSPOT_LD="$LD.exe" - HOTSPOT_MT="$MT.exe" - HOTSPOT_RC="$RC.exe" - BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) - BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) - BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) - BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) - AC_SUBST(HOTSPOT_MT) - AC_SUBST(HOTSPOT_RC) + if test "x[$]$1" = x; then + HELP_MSG_MISSING_DEPENDENCY([devkit]) + AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) + fi + fi + + # Now we have a compiler binary in $1. Make sure it's okay. + BASIC_FIXUP_EXECUTABLE($1) + TEST_COMPILER="[$]$1" + # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links + # to 'xlc' but it is crucial that we invoke the compiler with the right name! + if test "x$OPENJDK_BUILD_OS" != xaix; then + # FIXME: This test should not be needed anymore; we don't do that for any platform. + AC_MSG_CHECKING([resolved symbolic links for $1]) + BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) + AC_MSG_RESULT([$TEST_COMPILER]) + fi + AC_MSG_CHECKING([if $1 is disguised ccache]) + + COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` + if test "x$COMPILER_BASENAME" = "xccache"; then + AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) + # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. + # We want to control ccache invocation ourselves, so ignore this cc and try + # searching again. + + # Remove the path to the fake ccache cc from the PATH + RETRY_COMPILER_SAVED_PATH="$PATH" + COMPILER_DIRNAME=`$DIRNAME [$]$1` + PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" + + # Try again looking for our compiler + AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) + BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) + PATH="$RETRY_COMPILER_SAVED_PATH" + + AC_MSG_CHECKING([for resolved symbolic links for $1]) + BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) + AC_MSG_RESULT([$PROPER_COMPILER_$1]) + $1="$PROPER_COMPILER_$1" + else + AC_MSG_RESULT([no, keeping $1]) + $1="$TEST_COMPILER" + fi + + TOOLCHAIN_EXTRACT_COMPILER_VERSION([$1], [$COMPILER_NAME]) +]) + +# Detect the core components of the toolchain, i.e. the compilers (CC and CXX), +# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the +# archiver (AR). Verify that the compilers are correct according to the +# toolchain type. +AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE], +[ + # + # Setup the compilers (CC and CXX) + # + TOOLCHAIN_FIND_COMPILER([CC], [C], $TOOLCHAIN_CC_BINARY) + # Now that we have resolved CC ourself, let autoconf have its go at it + AC_PROG_CC([$CC]) + + TOOLCHAIN_FIND_COMPILER([CXX], [C++], $TOOLCHAIN_CXX_BINARY) + # Now that we have resolved CXX ourself, let autoconf have its go at it + AC_PROG_CXX([$CXX]) + + # This is the compiler version number on the form X.Y[.Z] + AC_SUBST(CC_VERSION_NUMBER) + AC_SUBST(CXX_VERSION_NUMBER) - RC_FLAGS="-nologo -l 0x409 -r" - AS_IF([test "x$VARIANT" = xOPT], [ - RC_FLAGS="$RC_FLAGS -d NDEBUG" - ]) - - # The version variables used to create RC_FLAGS may be overridden - # in a custom configure script, or possibly the command line. - # Let those variables be expanded at make time in spec.gmk. - # The \$ are escaped to the shell, and the $(...) variables - # are evaluated by make. - RC_FLAGS="$RC_FLAGS \ - -d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ - -d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ - -d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ - -d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(COOKED_JDK_UPDATE_VERSION).\$(COOKED_BUILD_NUMBER)\" \ - -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ - -d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ - -d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(COOKED_JDK_UPDATE_VERSION),\$(COOKED_BUILD_NUMBER)\"" - - # lib.exe is used to create static libraries. - AC_CHECK_PROG([WINAR], [lib],[lib],,,) - BASIC_FIXUP_EXECUTABLE(WINAR) - AR="$WINAR" - ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" - - AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) - BASIC_FIXUP_EXECUTABLE(DUMPBIN) - - COMPILER_TYPE=CL - # silence copyright notice and other headers. - COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo" - ]) - AC_SUBST(RC_FLAGS) - AC_SUBST(COMPILER_TYPE) + TOOLCHAIN_PREPARE_FOR_VERSION_COMPARISONS + # + # Setup the preprocessor (CPP and CXXCPP) + # AC_PROG_CPP BASIC_FIXUP_EXECUTABLE(CPP) - AC_PROG_CXXCPP BASIC_FIXUP_EXECUTABLE(CXXCPP) - if test "x$COMPILE_TYPE" != "xcross"; then - # If we are not cross compiling, use the same compilers for - # building the build platform executables. The cross-compilation - # case needed to be done earlier, but this can only be done after - # the native tools have been localized. - BUILD_CC="$CC" - BUILD_CXX="$CXX" - BUILD_LD="$LD" - fi - - # for solaris we really need solaris tools, and not gnu equivalent - # these seems to normally reside in /usr/ccs/bin so add that to path before - # starting to probe # - # NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH - # so that it can be overriden --with-tools-dir - if test "x$OPENJDK_BUILD_OS" = xsolaris; then - PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}" + # Setup the linker (LD) + # + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # In the Microsoft toolchain we have a separate LD command "link". + # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is + # a cygwin program for something completely different. + AC_CHECK_PROG([LD], [link],[link],,, [$CYGWIN_LINK]) + BASIC_FIXUP_EXECUTABLE(LD) + # Verify that we indeed succeeded with this trick. + AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) + "$LD" --version > /dev/null + if test $? -eq 0 ; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.]) + else + AC_MSG_RESULT([yes]) + fi + LDCXX="$LD" + else + # All other toolchains use the compiler to link. + LD="$CC" + LDCXX="$CXX" fi + AC_SUBST(LD) + # FIXME: it should be CXXLD, according to standard (cf CXXCPP) + AC_SUBST(LDCXX) - # Find the right assembler. + # + # Setup the assembler (AS) + # if test "x$OPENJDK_TARGET_OS" = xsolaris; then + # FIXME: should this really be solaris, or solstudio? BASIC_PATH_PROGS(AS, as) BASIC_FIXUP_EXECUTABLE(AS) else + # FIXME: is this correct for microsoft? AS="$CC -c" fi AC_SUBST(AS) + # + # Setup the archiver (AR) + # + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # The corresponding ar tool is lib.exe (used to create static libraries) + AC_CHECK_PROG([AR], [lib],[lib],,,) + else + BASIC_CHECK_TOOLS(AR, ar) + fi + BASIC_FIXUP_EXECUTABLE(AR) +]) + +# Setup additional tools that is considered a part of the toolchain, but not the +# core part. Many of these are highly platform-specific and do not exist, +# and/or are not needed on all platforms. +AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA], +[ + if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + AC_PROG_OBJC + BASIC_FIXUP_EXECUTABLE(OBJC) + BASIC_PATH_PROGS(LIPO, lipo) + BASIC_FIXUP_EXECUTABLE(LIPO) + else + OBJC= + fi + + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) + BASIC_FIXUP_EXECUTABLE(MT) + # Setup the resource compiler (RC) + AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) + BASIC_FIXUP_EXECUTABLE(RC) + AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) + BASIC_FIXUP_EXECUTABLE(DUMPBIN) + fi + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + BASIC_PATH_PROGS(STRIP, strip) + BASIC_FIXUP_EXECUTABLE(STRIP) BASIC_PATH_PROGS(NM, nm) BASIC_FIXUP_EXECUTABLE(NM) BASIC_PATH_PROGS(GNM, gnm) BASIC_FIXUP_EXECUTABLE(GNM) - BASIC_PATH_PROGS(STRIP, strip) - BASIC_FIXUP_EXECUTABLE(STRIP) + BASIC_PATH_PROGS(MCS, mcs) BASIC_FIXUP_EXECUTABLE(MCS) elif test "x$OPENJDK_TARGET_OS" != xwindows; then + # FIXME: we should unify this with the solaris case above. + BASIC_CHECK_TOOLS(STRIP, strip) + BASIC_FIXUP_EXECUTABLE(STRIP) AC_PATH_PROG(OTOOL, otool) if test "x$OTOOL" = "x"; then OTOOL="true" @@ -623,8 +707,6 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS], BASIC_FIXUP_EXECUTABLE(NM) GNM="$NM" AC_SUBST(GNM) - BASIC_CHECK_TOOLS(STRIP, strip) - BASIC_FIXUP_EXECUTABLE(STRIP) fi # objcopy is used for moving debug symbols to separate files when @@ -639,731 +721,114 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS], BASIC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) if test "x$OBJDUMP" != x; then - # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE bails if argument is missing. + # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE + # bails if argument is missing. BASIC_FIXUP_EXECUTABLE(OBJDUMP) fi - - TOOLCHAIN_SETUP_JTREG - - # Restore old path without tools dir - PATH="$OLD_PATH" ]) - -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS], +# Setup the build tools (i.e, the compiler and linker used to build programs +# that should be run on the build platform, not the target platform, as a build +# helper). Since the non-cross-compile case uses the normal, target compilers +# for this, we can only do this after these have been setup. +AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS], [ - - ############################################################################### - # - # How to compile shared libraries. - # - - if test "x$GCC" = xyes; then - COMPILER_NAME=gcc - PICFLAG="-fPIC" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib[$]1.so' - STATIC_LIBRARY='lib[$]1.a' - SHARED_LIBRARY_FLAGS="-shared" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1' - SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1' - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' - SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1' - LD="$CC" - LDEXE="$CC" - LDCXX="$CXX" - LDEXECXX="$CXX" - POST_STRIP_CMD="$STRIP -g" - - # Linking is different on MacOSX - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - # Might change in the future to clang. - COMPILER_NAME=gcc - SHARED_LIBRARY='lib[$]1.dylib' - SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SHARED_LIBRARY_SUFFIX='.dylib' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - POST_STRIP_CMD="$STRIP -S" - fi + if test "x$COMPILE_TYPE" = "xcross"; then + # Now we need to find a C/C++ compiler that can build executables for the + # build platform. We can't use the AC_PROG_CC macro, since it can only be + # used once. Also, we need to do this without adding a tools dir to the + # path, otherwise we might pick up cross-compilers which don't use standard + # naming. + + # FIXME: we should list the discovered compilers as an exclude pattern! + # If we do that, we can do this detection before POST_DETECTION, and still + # find the build compilers in the tools dir, if needed. + BASIC_PATH_PROGS(BUILD_CC, [cl cc gcc]) + BASIC_FIXUP_EXECUTABLE(BUILD_CC) + BASIC_PATH_PROGS(BUILD_CXX, [cl CC g++]) + BASIC_FIXUP_EXECUTABLE(BUILD_CXX) + BASIC_PATH_PROGS(BUILD_LD, ld) + BASIC_FIXUP_EXECUTABLE(BUILD_LD) else - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - # If it is not gcc, then assume it is the Oracle Solaris Studio Compiler - COMPILER_NAME=ossc - PICFLAG="-KPIC" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib[$]1.so' - STATIC_LIBRARY='lib[$]1.a' - SHARED_LIBRARY_FLAGS="-G" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='-M[$]1' - C_FLAG_REORDER='-xF' - CXX_FLAG_REORDER='-xF' - SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1' - SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN" - CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" - CFLAGS_JDKLIB_EXTRA='-xstrconst' - POST_STRIP_CMD="$STRIP -x" - POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\"" - fi - if test "x$OPENJDK_TARGET_OS" = xaix; then - COMPILER_NAME=xlc - PICFLAG="-qpic=large" - LIBRARY_PREFIX=lib - SHARED_LIBRARY='lib[$]1.so' - STATIC_LIBRARY='lib[$]1.a' - SHARED_LIBRARY_FLAGS="-qmkshrobj" - SHARED_LIBRARY_SUFFIX='.so' - STATIC_LIBRARY_SUFFIX='.a' - OBJ_SUFFIX='.o' - EXE_SUFFIX='' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - C_FLAG_REORDER='' - CXX_FLAG_REORDER='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_EXECUTABLE_ORIGIN="" - CFLAGS_JDK="" - CXXFLAGS_JDK="" - CFLAGS_JDKLIB_EXTRA='' - POST_STRIP_CMD="$STRIP -X32_64" - POST_MCS_CMD="" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - # If it is not gcc, then assume it is the MS Visual Studio compiler - COMPILER_NAME=cl - PICFLAG="" - LIBRARY_PREFIX= - SHARED_LIBRARY='[$]1.dll' - STATIC_LIBRARY='[$]1.lib' - SHARED_LIBRARY_FLAGS="-LD" - SHARED_LIBRARY_SUFFIX='.dll' - STATIC_LIBRARY_SUFFIX='.lib' - OBJ_SUFFIX='.obj' - EXE_SUFFIX='.exe' - SET_SHARED_LIBRARY_NAME='' - SET_SHARED_LIBRARY_MAPFILE='' - SET_SHARED_LIBRARY_ORIGIN='' - SET_EXECUTABLE_ORIGIN='' - fi + # If we are not cross compiling, use the normal target compilers for + # building the build platform executables. + BUILD_CC="$CC" + BUILD_CXX="$CXX" + BUILD_LD="$LD" fi - - AC_SUBST(COMPILER_NAME) - AC_SUBST(OBJ_SUFFIX) - AC_SUBST(SHARED_LIBRARY) - AC_SUBST(STATIC_LIBRARY) - AC_SUBST(LIBRARY_PREFIX) - AC_SUBST(SHARED_LIBRARY_SUFFIX) - AC_SUBST(STATIC_LIBRARY_SUFFIX) - AC_SUBST(EXE_SUFFIX) - AC_SUBST(SHARED_LIBRARY_FLAGS) - AC_SUBST(SET_SHARED_LIBRARY_NAME) - AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) - AC_SUBST(C_FLAG_REORDER) - AC_SUBST(CXX_FLAG_REORDER) - AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) - AC_SUBST(SET_EXECUTABLE_ORIGIN) - AC_SUBST(POST_STRIP_CMD) - AC_SUBST(POST_MCS_CMD) - - # The (cross) compiler is now configured, we can now test capabilities - # of the target platform. ]) -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], +# Setup legacy variables that are still needed as alternative ways to refer to +# parts of the toolchain. +AC_DEFUN_ONCE([TOOLCHAIN_SETUP_LEGACY], [ - - ############################################################################### - # - # Setup the opt flags for different compilers - # and different operating systems. - # - - # - # NOTE: check for -mstackrealign needs to be below potential addition of -m32 - # - if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then - # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned. - # While waiting for a better solution, the current workaround is to use -mstackrealign. - CFLAGS="$CFLAGS -mstackrealign" - AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign]) - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])], - [ - AC_MSG_RESULT([yes]) - ], - [ - AC_MSG_RESULT([no]) - AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.]) - ] - ) - fi - - C_FLAG_DEPS="-MMD -MF" - CXX_FLAG_DEPS="-MMD -MF" - - case $COMPILER_TYPE in - CC ) - case $COMPILER_NAME in - gcc ) - case $OPENJDK_TARGET_OS in - macosx ) - # On MacOSX we optimize for size, something - # we should do for all platforms? - C_O_FLAG_HI="-Os" - C_O_FLAG_NORM="-Os" - C_O_FLAG_NONE="" - ;; - *) - C_O_FLAG_HI="-O3" - C_O_FLAG_NORM="-O2" - C_O_FLAG_NONE="-O0" - ;; - esac - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then - CFLAGS_DEBUG_SYMBOLS="-g1" - CXXFLAGS_DEBUG_SYMBOLS="-g1" - fi - ;; - ossc ) - # - # Forte has different names for this with their C++ compiler... - # - C_FLAG_DEPS="-xMMD -xMF" - CXX_FLAG_DEPS="-xMMD -xMF" - - # Extra options used with HIGHEST - # - # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be - # done with care, there are some assumptions below that need to - # be understood about the use of pointers, and IEEE behavior. - # - # Use non-standard floating point mode (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fns" - # Do some simplification of floating point arithmetic (not IEEE 754) - CC_HIGHEST="$CC_HIGHEST -fsimple" - # Use single precision floating point with 'float' - CC_HIGHEST="$CC_HIGHEST -fsingle" - # Assume memory references via basic pointer types do not alias - # (Source with excessing pointer casting and data access with mixed - # pointer types are not recommended) - CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" - # Use intrinsic or inline versions for math/std functions - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" - # Loop data dependency optimizations (need -xO3 or higher) - CC_HIGHEST="$CC_HIGHEST -xdepend" - # Pointer parameters to functions do not overlap - # (Similar to -xalias_level=basic usage, but less obvious sometimes. - # If you pass in multiple pointers to the same data, do not use this) - CC_HIGHEST="$CC_HIGHEST -xrestrict" - # Inline some library routines - # (If you expect perfect errno behavior, do not use this) - CC_HIGHEST="$CC_HIGHEST -xlibmil" - # Use optimized math routines - # (If you expect perfect errno behavior, do not use this) - # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now - #CC_HIGHEST="$CC_HIGHEST -xlibmopt" - - if test "x$OPENJDK_TARGET_CPU" = xsparc; then - CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s" - fi - - case $OPENJDK_TARGET_CPU_ARCH in - x86) - C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr" - C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" - C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" - C_O_FLAG_NONE="-xregs=no%frameptr" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" - CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" - CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" - CXX_O_FLAG_NONE="-xregs=no%frameptr" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" - fi - ;; - sparc) - CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl" - C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" - CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" - CXX_O_FLAG_NONE="" - ;; - esac - - CFLAGS_DEBUG_SYMBOLS="-g -xs" - CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" - ;; - xlc ) - C_FLAG_DEPS="-qmakedep=gcc -MF" - CXX_FLAG_DEPS="-qmakedep=gcc -MF" - C_O_FLAG_HIGHEST="-O3" - C_O_FLAG_HI="-O3 -qstrict" - C_O_FLAG_NORM="-O2" - C_O_FLAG_NONE="" - CXX_O_FLAG_HIGHEST="-O3" - CXX_O_FLAG_HI="-O3 -qstrict" - CXX_O_FLAG_NORM="-O2" - CXX_O_FLAG_NONE="" - CFLAGS_DEBUG_SYMBOLS="-g" - CXXFLAGS_DEBUG_SYMBOLS="-g" - LDFLAGS_JDK="${LDFLAGS_JDK} -q64 -brtl -bnolibpath -liconv -bexpall" - CFLAGS_JDK="${CFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" - CXXFLAGS_JDK="${CXXFLAGS_JDK} -qchars=signed -q64 -qfullpath -qsaveopt" - ;; - esac - ;; - CL ) - C_O_FLAG_HIGHEST="-O2" - C_O_FLAG_HI="-O1" - C_O_FLAG_NORM="-O1" - C_O_FLAG_NONE="-Od" - CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" - CXX_O_FLAG_HI="$C_O_FLAG_HI" - CXX_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_NONE="$C_O_FLAG_NONE" - ;; - esac - - if test -z "$C_O_FLAG_HIGHEST"; then - C_O_FLAG_HIGHEST="$C_O_FLAG_HI" + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # For hotspot, we need these in Windows mixed path, + # so rewrite them all. Need added .exe suffix. + HOTSPOT_CXX="$CXX.exe" + HOTSPOT_LD="$LD.exe" + HOTSPOT_MT="$MT.exe" + HOTSPOT_RC="$RC.exe" + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) + BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) + AC_SUBST(HOTSPOT_MT) + AC_SUBST(HOTSPOT_RC) + else + HOTSPOT_CXX="$CXX" + HOTSPOT_LD="$LD" fi + AC_SUBST(HOTSPOT_CXX) + AC_SUBST(HOTSPOT_LD) - if test -z "$CXX_O_FLAG_HIGHEST"; then - CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI" + if test "x$TOOLCHAIN_TYPE" = xclang; then + USE_CLANG=true fi + AC_SUBST(USE_CLANG) - AC_SUBST(C_O_FLAG_HIGHEST) - AC_SUBST(C_O_FLAG_HI) - AC_SUBST(C_O_FLAG_NORM) - AC_SUBST(C_O_FLAG_NONE) - AC_SUBST(CXX_O_FLAG_HIGHEST) - AC_SUBST(CXX_O_FLAG_HI) - AC_SUBST(CXX_O_FLAG_NORM) - AC_SUBST(CXX_O_FLAG_NONE) - AC_SUBST(C_FLAG_DEPS) - AC_SUBST(CXX_FLAG_DEPS) + # LDEXE is the linker to use, when creating executables. Not really used. + # FIXME: These should just be removed! + LDEXE="$LD" + LDEXECXX="$LDCXX" + AC_SUBST(LDEXE) + AC_SUBST(LDEXECXX) ]) -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK], -[ - - if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then - AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags]) - fi - - if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then - AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags]) - fi - - if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then - AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags]) - fi - - AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], - [extra flags to be used when compiling jdk c-files])]) - - AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags], - [extra flags to be used when compiling jdk c++-files])]) - - AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], - [extra flags to be used when linking jdk])]) - - CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" - CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" - LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" - - # Hotspot needs these set in their legacy form - LEGACY_EXTRA_CFLAGS=$with_extra_cflags - LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags - LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags - - AC_SUBST(LEGACY_EXTRA_CFLAGS) - AC_SUBST(LEGACY_EXTRA_CXXFLAGS) - AC_SUBST(LEGACY_EXTRA_LDFLAGS) - - ############################################################################### - # - # Now setup the CFLAGS and LDFLAGS for the JDK build. - # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. - # CFLAGS_JDK - C Compiler flags - # CXXFLAGS_JDK - C++ Compiler flags - # COMMON_CCXXFLAGS_JDK - common to C and C++ - # - case $COMPILER_NAME in - gcc ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ - -pipe \ - -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" - CXXSTD_CXXFLAG="-std=gnu++98" - TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([$CXXSTD_CXXFLAG $CFLAGS_WARNINGS_ARE_ERRORS], - [], [CXXSTD_CXXFLAG=""]) - CXXFLAGS_JDK="${CXXFLAGS_JDK} ${CXXSTD_CXXFLAG}" - AC_SUBST([CXXSTD_CXXFLAG]) - case $OPENJDK_TARGET_CPU_ARCH in - arm ) - # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - ppc ) - # on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing - ;; - * ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer" - CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing" - ;; - esac - TOOLCHAIN_CHECK_COMPILER_VERSION(6, TOOLCHAIN_SETUP_GCC6_COMPILER_FLAGS) - ;; - ossc ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS" - case $OPENJDK_TARGET_CPU_ARCH in - x86 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$OPENJDK_TARGET_CPU_LEGACY_LIB" - CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE" - ;; - esac - - CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal" - CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib" - - LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" - ;; - xlc ) - CFLAGS_JDK="$CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - CXXFLAGS_JDK="$CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC" - - LDFLAGS_JDK="$LDFLAGS_JDK" - LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK" - ;; - cl ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ - -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ - -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ - -DWIN32 -DIAL" - case $OPENJDK_TARGET_CPU in - x86 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86" - ;; - x86_64 ) - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64" - ;; - esac - ;; - esac - - ############################################################################### - - # Adjust flags according to debug level. - case $DEBUG_LEVEL in - fastdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" - C_O_FLAG_HI="$C_O_FLAG_NORM" - C_O_FLAG_NORM="$C_O_FLAG_NORM" - CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" - CXX_O_FLAG_NORM="$CXX_O_FLAG_NORM" - JAVAC_FLAGS="$JAVAC_FLAGS -g" - ;; - slowdebug ) - CFLAGS_JDK="$CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS" - CXXFLAGS_JDK="$CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS" - C_O_FLAG_HI="$C_O_FLAG_NONE" - C_O_FLAG_NORM="$C_O_FLAG_NONE" - CXX_O_FLAG_HI="$CXX_O_FLAG_NONE" - CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE" - JAVAC_FLAGS="$JAVAC_FLAGS -g" - ;; - esac - - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64" - +# Do some additional checks on the detected tools. +AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], + [ # The package path is used only on macosx? + # FIXME: clean this up, and/or move it elsewhere. PACKAGE_PATH=/opt/local AC_SUBST(PACKAGE_PATH) - if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then - # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the - # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN - # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h). - # Note: -Dmacro is the same as #define macro 1 - # -Dmacro= is the same as #define macro - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN=" - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN" - fi - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN" - fi - if test "x$OPENJDK_TARGET_OS" = xlinux; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DLINUX" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DWINDOWS" - fi - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DSOLARIS" - fi - if test "x$OPENJDK_TARGET_OS" = xaix; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DAIX -DPPC64" - fi - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT" - # Setting these parameters makes it an error to link to macosx APIs that are - # newer than the given OS version and makes the linked binaries compatible even - # if built on a newer version of the OS. - # The expected format is X.Y.Z - MACOSX_VERSION_MIN=10.7.0 - AC_SUBST(MACOSX_VERSION_MIN) - # The macro takes the version with no dots, ex: 1070 - # Let the flags variables get resolved in make for easier override on make - # command line. - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MIN)) -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - LDFLAGS_JDK="$LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" - fi - if test "x$OPENJDK_TARGET_OS" = xbsd; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" - fi - if test "x$DEBUG_LEVEL" = xrelease; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DNDEBUG" - if test "x$OPENJDK_TARGET_OS" = xsolaris; then - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DTRIMMED" - fi - else - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DDEBUG" - fi - - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY" - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'" - - COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ - -I${JDK_OUTPUTDIR}/include \ - -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ - -I${JDK_TOPDIR}/src/share/javavm/export \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_EXPORT_DIR/javavm/export \ - -I${JDK_TOPDIR}/src/share/native/common \ - -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common" - - # The shared libraries are compiled using the picflag. - CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" - CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " - - # Executable flags - CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK" - CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK" - - # Now this is odd. The JDK native libraries have to link against libjvm.so - # On 32-bit machines there is normally two distinct libjvm.so:s, client and server. - # Which should we link to? Are we lucky enough that the binary api to the libjvm.so library - # is identical for client and server? Yes. Which is picked at runtime (client or server)? - # Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following - # libraries will link to whatever is in memory. Yuck. - # - # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. - if test "x$COMPILER_NAME" = xcl; then - LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" - if test "x$OPENJDK_TARGET_CPU" = xx86; then - LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" - fi - # TODO: make -debug optional "--disable-full-debug-symbols" - LDFLAGS_JDK="$LDFLAGS_JDK -debug" - LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib" - LDFLAGS_JDKLIB_SUFFIX="" - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - LDFLAGS_STACK_SIZE=1048576 - else - LDFLAGS_STACK_SIZE=327680 - fi - LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE" - else - if test "x$COMPILER_NAME" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - if test -n "$HAS_GNU_HASH"; then - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both " + # Check for extra potential brokenness. + if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then + # On Windows, double-check that we got the right compiler. + CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` + COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` + if test "x$OPENJDK_TARGET_CPU" = "xx86"; then + if test "x$COMPILER_CPU_TEST" != "x80x86"; then + AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".]) fi - if test "x$OPENJDK_TARGET_OS" = xlinux; then - # And since we now know that the linker is gnu, then add: - # -z defs, to forbid undefined symbols in object files - # -z noexecstack, to mark stack regions as non-executable - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs -Xlinker -z -Xlinker noexecstack" - if test "x$DEBUG_LEVEL" = "xrelease"; then - # When building release libraries, tell the linker optimize them. - # Should this be supplied to the OSS linker as well? - LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1" - fi + elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then + if test "x$COMPILER_CPU_TEST" != "xx64"; then + AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".]) fi fi - LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ - -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}" - - # On some platforms (mac) the linker warns about non existing -L dirs. - # Add server first if available. Linking aginst client does not always produce the same results. - # Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1. - # Default to server for other variants. - if test "x$JVM_VARIANT_SERVER" = xtrue; then - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" - elif test "x$JVM_VARIANT_CLIENT" = xtrue; then - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client" - elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/minimal" - else - LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server" - fi - - LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm" - if test "x$COMPILER_NAME" = xossc; then - LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" - fi - - LDFLAGS_JDKEXE="${LDFLAGS_JDK}" - if test "x$OPENJDK_TARGET_OS" = xlinux; then - LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" - fi fi - AC_SUBST(CFLAGS_JDKLIB) - AC_SUBST(CFLAGS_JDKEXE) - - AC_SUBST(CXXFLAGS_JDKLIB) - AC_SUBST(CXXFLAGS_JDKEXE) - - AC_SUBST(LDFLAGS_JDKLIB) - AC_SUBST(LDFLAGS_JDKEXE) - AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) - AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) - AC_SUBST(LDFLAGS_CXX_JDK) -]) - - -# TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], -# [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C compiler supports an argument -AC_DEFUN([TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS], -[ - AC_MSG_CHECKING([if the C compiler supports "$1"]) - supports=yes - - saved_cflags="$CFLAGS" - CFLAGS="$CFLAGS $1" - AC_LANG_PUSH([C]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], - [supports=no]) - AC_LANG_POP([C]) - CFLAGS="$saved_cflags" - - AC_MSG_RESULT([$supports]) - if test "x$supports" = "xyes" ; then - m4_ifval([$2], [$2], [:]) - else - m4_ifval([$3], [$3], [:]) + if test "x$TOOLCHAIN_TYPE" = xgcc; then + # If this is a --hash-style=gnu system, use --hash-style=both, why? + HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` + # This is later checked when setting flags. fi -]) -# TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], -# [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C++ compiler supports an argument -AC_DEFUN([TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS], -[ - AC_MSG_CHECKING([if the C++ compiler supports "$1"]) - supports=yes - - saved_cxxflags="$CXXFLAGS" - CXXFLAGS="$CXXFLAG $1" - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [], - [supports=no]) - AC_LANG_POP([C++]) - CXXFLAGS="$saved_cxxflags" - - AC_MSG_RESULT([$supports]) - if test "x$supports" = "xyes" ; then - m4_ifval([$2], [$2], [:]) - else - m4_ifval([$3], [$3], [:]) - fi -]) - -# TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([ARGUMENT], [RUN-IF-TRUE], -# [RUN-IF-FALSE]) -# ------------------------------------------------------------ -# Check that the C and C++ compilers support an argument -AC_DEFUN([TOOLCHAIN_COMPILER_CHECK_ARGUMENTS], -[ - TOOLCHAIN_C_COMPILER_CHECK_ARGUMENTS([$1], - [C_COMP_SUPPORTS="yes"], - [C_COMP_SUPPORTS="no"]) - TOOLCHAIN_CXX_COMPILER_CHECK_ARGUMENTS([$1], - [CXX_COMP_SUPPORTS="yes"], - [CXX_COMP_SUPPORTS="no"]) - - AC_MSG_CHECKING([if both compilers support "$1"]) - supports=no - if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi - - AC_MSG_RESULT([$supports]) - if test "x$supports" = "xyes" ; then - m4_ifval([$2], [$2], [:]) - else - m4_ifval([$3], [$3], [:]) - fi -]) - -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC], -[ - # Some Zero and Shark settings. - # ZERO_ARCHFLAG tells the compiler which mode to build for - case "${OPENJDK_TARGET_CPU}" in - s390) - ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}31" - ;; - *) - ZERO_ARCHFLAG="${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}" - esac - TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$ZERO_ARCHFLAG], [], [ZERO_ARCHFLAG=""]) - AC_SUBST(ZERO_ARCHFLAG) - - # Check that the compiler supports -mX (or -qX on AIX) flags - # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does - TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}], - [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true], - [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false]) - AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG) - - - # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed in executable.' + # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed + # in executable.' USING_BROKEN_SUSE_LD=no - if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$GCC" = xyes; then + if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables]) echo "SUNWprivate_1.1 { local: *; };" > version-script.map echo "int main() { }" > main.c @@ -1379,7 +844,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_MISC], AC_SUBST(USING_BROKEN_SUSE_LD) ]) -# Setup the JTREG paths +# Setup the JTReg Regression Test Harness. AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], [ AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], @@ -1422,19 +887,3 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], AC_SUBST(JTREGEXE) ]) -AC_DEFUN_ONCE([TOOLCHAIN_SETUP_GCC6_COMPILER_FLAGS], -[ - # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code - # runs afoul of the more aggressive versions of these optimisations. - # Notably, value range propagation now assumes that the this pointer of C++ - # member functions is non-null. - NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks" - TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror], - [], [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""]) - AC_SUBST([NO_DELETE_NULL_POINTER_CHECKS_CFLAG]) - NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse" - TOOLCHAIN_COMPILER_CHECK_ARGUMENTS([$NO_LIFETIME_DSE_CFLAG -Werror], - [], [NO_LIFETIME_DSE_CFLAG=""]) - CFLAGS_JDK="${CFLAGS_JDK} ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}" - AC_SUBST([NO_LIFETIME_DSE_CFLAG]) -]) diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index 670f911..83b4254 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ ifeq (,$(_MAKEBASE_GMK)) $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk) endif -ifeq ($(COMPILER_TYPE),CC) +ifneq ($(TOOLCHAIN_TYPE), microsoft) COMPILING_MSG=echo $(LOG_INFO) "Compiling $(notdir $1) (for $(notdir $2))" LINKING_MSG=echo $(LOG_INFO) "Linking $1" LINKING_EXE_MSG=echo $(LOG_INFO) "Linking executable $1" @@ -86,18 +86,18 @@ define add_native_source # Include previously generated dependency information. (if it exists) -include $$($1_$2_DEP) - ifeq ($(COMPILER_TYPE),CL) + ifeq ($(TOOLCHAIN_TYPE), microsoft) $1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \ -Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ)) endif endif $$($1_$2_OBJ) : $2 - ifeq ($(COMPILER_TYPE),CC) + ifneq ($(TOOLCHAIN_TYPE), microsoft) $$(call COMPILING_MSG,$2,$$($1_TARGET)) - # The Sun studio compiler doesn't output the full path to the object file in the + # The Solaris studio compiler doesn't output the full path to the object file in the # generated deps files. Fixing it with sed. If compiling assembly, don't try this. - ifeq ($(COMPILER_NAME)$$(filter %.s,$2),ossc) + ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio) $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 $(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP) else @@ -107,7 +107,7 @@ define add_native_source # The Visual Studio compiler lacks a feature for generating make dependencies, but by # setting -showIncludes, all included files are printed. These are filtered out and # parsed into make dependences. - ifeq ($(COMPILER_TYPE),CL) + ifeq ($(TOOLCHAIN_TYPE), microsoft) ($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \ $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \ | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v "^Note: including file:" \ -- GitLab