toolchain.m4 revision 1629:f105fbc01fd7
1170808Sdelphij# 2170808Sdelphij# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. 3182739Sdelphij# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4170808Sdelphij# 5170808Sdelphij# This code is free software; you can redistribute it and/or modify it 6170808Sdelphij# under the terms of the GNU General Public License version 2 only, as 7170808Sdelphij# published by the Free Software Foundation. Oracle designates this 8170808Sdelphij# particular file as subject to the "Classpath" exception as provided 9170808Sdelphij# by Oracle in the LICENSE file that accompanied this code. 10170808Sdelphij# 11170808Sdelphij# This code is distributed in the hope that it will be useful, but WITHOUT 12170808Sdelphij# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13170808Sdelphij# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14170808Sdelphij# version 2 for more details (a copy is included in the LICENSE file that 15170808Sdelphij# accompanied this code). 16170808Sdelphij# 17170808Sdelphij# You should have received a copy of the GNU General Public License version 18170808Sdelphij# 2 along with this work; if not, write to the Free Software Foundation, 19170808Sdelphij# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20170808Sdelphij# 21170808Sdelphij# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22170808Sdelphij# or visit www.oracle.com if you need additional information or have any 23170808Sdelphij# questions. 24170808Sdelphij# 25170808Sdelphij 26170808Sdelphij######################################################################## 27170808Sdelphij# This file is responsible for detecting, verifying and setting up the 28170808Sdelphij# toolchain, i.e. the compiler, linker and related utilities. It will setup 29170808Sdelphij# proper paths to the binaries, but it will not setup any flags. 30170808Sdelphij# 31170808Sdelphij# The binaries used is determined by the toolchain type, which is the family of 32170808Sdelphij# compilers and related tools that are used. 33170808Sdelphij######################################################################## 34170808Sdelphij 35170808Sdelphij 36170808Sdelphij# All valid toolchains, regardless of platform (used by help.m4) 37170808SdelphijVALID_TOOLCHAINS_all="gcc clang solstudio xlc microsoft" 38170808Sdelphij 39170808Sdelphij# These toolchains are valid on different platforms 40170808SdelphijVALID_TOOLCHAINS_linux="gcc clang" 41170808SdelphijVALID_TOOLCHAINS_solaris="solstudio" 42170808SdelphijVALID_TOOLCHAINS_macosx="gcc clang" 43170808SdelphijVALID_TOOLCHAINS_aix="xlc" 44170808SdelphijVALID_TOOLCHAINS_windows="microsoft" 45170808Sdelphij 46170808Sdelphij# Toolchain descriptions 47171308SdelphijTOOLCHAIN_DESCRIPTION_clang="clang/LLVM" 48170808SdelphijTOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection" 49170808SdelphijTOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio" 50254741SdelphijTOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio" 51254741SdelphijTOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" 52170808Sdelphij 53170808Sdelphij# Setup a number of variables describing how native output files are 54170808Sdelphij# named on this platform/toolchain. 55170808SdelphijAC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS], 56170808Sdelphij[ 57170808Sdelphij # Define filename patterns 58170808Sdelphij if test "x$OPENJDK_TARGET_OS" = xwindows; then 59170808Sdelphij LIBRARY_PREFIX= 60170808Sdelphij SHARED_LIBRARY_SUFFIX='.dll' 61170808Sdelphij STATIC_LIBRARY_SUFFIX='.lib' 62170808Sdelphij SHARED_LIBRARY='[$]1.dll' 63170808Sdelphij STATIC_LIBRARY='[$]1.lib' 64171070Sdelphij OBJ_SUFFIX='.obj' 65170808Sdelphij EXE_SUFFIX='.exe' 66170808Sdelphij else 67170808Sdelphij LIBRARY_PREFIX=lib 68170808Sdelphij SHARED_LIBRARY_SUFFIX='.so' 69171087Sdelphij STATIC_LIBRARY_SUFFIX='.a' 70170808Sdelphij SHARED_LIBRARY='lib[$]1.so' 71170808Sdelphij STATIC_LIBRARY='lib[$]1.a' 72170808Sdelphij OBJ_SUFFIX='.o' 73191990Sattilio EXE_SUFFIX='' 74191990Sattilio if test "x$OPENJDK_TARGET_OS" = xmacosx; then 75191990Sattilio SHARED_LIBRARY='lib[$]1.dylib' 76222167Srmacklem SHARED_LIBRARY_SUFFIX='.dylib' 77222167Srmacklem fi 78191990Sattilio fi 79170808Sdelphij 80170808Sdelphij AC_SUBST(LIBRARY_PREFIX) 81170808Sdelphij AC_SUBST(SHARED_LIBRARY_SUFFIX) 82170808Sdelphij AC_SUBST(STATIC_LIBRARY_SUFFIX) 83203164Sjh AC_SUBST(SHARED_LIBRARY) 84253573Snwhitehorn AC_SUBST(STATIC_LIBRARY) 85170808Sdelphij AC_SUBST(OBJ_SUFFIX) 86170808Sdelphij AC_SUBST(EXE_SUFFIX) 87234346Sjh]) 88234346Sjh 89234346Sjh# Determine which toolchain type to use, and make sure it is valid for this 90234346Sjh# platform. Setup various information about the selected toolchain. 91170808SdelphijAC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE], 92170808Sdelphij[ 93171029Sdelphij AC_ARG_WITH(toolchain-type, [AS_HELP_STRING([--with-toolchain-type], 94171029Sdelphij [the toolchain type (or family) to use, use '--help' to show possible values @<:@platform dependent@:>@])]) 95171029Sdelphij 96171029Sdelphij # Use indirect variable referencing 97171070Sdelphij toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS 98171362Sdelphij VALID_TOOLCHAINS=${!toolchain_var_name} 99171029Sdelphij 100171029Sdelphij if test "x$OPENJDK_TARGET_OS" = xmacosx; then 101171029Sdelphij if test -n "$XCODEBUILD"; then 102171029Sdelphij # On Mac OS X, default toolchain to clang after Xcode 5 103171029Sdelphij XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1` 104171029Sdelphij $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null 105170808Sdelphij if test $? -ne 0; then 106171029Sdelphij AC_MSG_ERROR([Failed to determine Xcode version.]) 107171029Sdelphij fi 108171029Sdelphij XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ 109171029Sdelphij $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \ 110171029Sdelphij $CUT -f 1 -d .` 111171029Sdelphij AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION]) 112171029Sdelphij if test $XCODE_MAJOR_VERSION -ge 5; then 113171029Sdelphij DEFAULT_TOOLCHAIN="clang" 114171029Sdelphij else 115171029Sdelphij DEFAULT_TOOLCHAIN="gcc" 116171070Sdelphij fi 117171029Sdelphij else 118171029Sdelphij # If Xcode is not installed, but the command line tools are 119171029Sdelphij # then we can't run xcodebuild. On these systems we should 120171029Sdelphij # default to clang 121171029Sdelphij DEFAULT_TOOLCHAIN="clang" 122171029Sdelphij fi 123171362Sdelphij else 124171070Sdelphij # First toolchain type in the list is the default 125171029Sdelphij DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} 126171029Sdelphij fi 127171029Sdelphij 128171029Sdelphij if test "x$with_toolchain_type" = xlist; then 129171029Sdelphij # List all toolchains 130171029Sdelphij AC_MSG_NOTICE([The following toolchains are valid on this platform:]) 131171029Sdelphij for toolchain in $VALID_TOOLCHAINS; do 132171070Sdelphij toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain 133171029Sdelphij TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} 134171029Sdelphij $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" 135171029Sdelphij done 136170808Sdelphij 137191990Sattilio exit 0 138170808Sdelphij elif test "x$with_toolchain_type" != x; then 139234000Sgleb # User override; check that it is valid 140234000Sgleb if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then 141170808Sdelphij AC_MSG_NOTICE([Toolchain type $with_toolchain_type is not valid on this platform.]) 142170808Sdelphij AC_MSG_NOTICE([Valid toolchains: $VALID_TOOLCHAINS.]) 143254741Sdelphij AC_MSG_ERROR([Cannot continue.]) 144170808Sdelphij fi 145171308Sdelphij TOOLCHAIN_TYPE=$with_toolchain_type 146233999Sgleb else 147233999Sgleb # No flag given, use default 148170808Sdelphij TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN 149171308Sdelphij fi 150202187Sjh AC_SUBST(TOOLCHAIN_TYPE) 151202187Sjh 152202187Sjh TOOLCHAIN_CC_BINARY_clang="clang" 153171308Sdelphij TOOLCHAIN_CC_BINARY_gcc="gcc" 154202187Sjh TOOLCHAIN_CC_BINARY_microsoft="cl" 155171308Sdelphij TOOLCHAIN_CC_BINARY_solstudio="cc" 156254741Sdelphij TOOLCHAIN_CC_BINARY_xlc="xlc_r" 157254741Sdelphij 158254741Sdelphij TOOLCHAIN_CXX_BINARY_clang="clang++" 159170808Sdelphij TOOLCHAIN_CXX_BINARY_gcc="g++" 160170808Sdelphij TOOLCHAIN_CXX_BINARY_microsoft="cl" 161170808Sdelphij TOOLCHAIN_CXX_BINARY_solstudio="CC" 162170808Sdelphij TOOLCHAIN_CXX_BINARY_xlc="xlC_r" 163234346Sjh 164234346Sjh # Use indirect variable referencing 165234346Sjh toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE 166234346Sjh TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} 167234346Sjh toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE 168234346Sjh TOOLCHAIN_CC_BINARY=${!toolchain_var_name} 169234346Sjh toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE 170170808Sdelphij TOOLCHAIN_CXX_BINARY=${!toolchain_var_name} 171170808Sdelphij 172175202Sattilio TOOLCHAIN_SETUP_FILENAME_PATTERNS 173182371Sattilio 174175294Sattilio if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then 175171308Sdelphij AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)]) 176171308Sdelphij else 177170808Sdelphij AC_MSG_NOTICE([Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN.]) 178171308Sdelphij fi 179171308Sdelphij]) 180171308Sdelphij 181171308Sdelphij# Before we start detecting the toolchain executables, we might need some 182171308Sdelphij# special setup, e.g. additional paths etc. 183171308SdelphijAC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION], 184171308Sdelphij[ 185173570Sdelphij # FIXME: Is this needed? 186171308Sdelphij AC_LANG(C++) 187233999Sgleb 188171308Sdelphij # Store the CFLAGS etc passed to the configure script. 189233999Sgleb ORG_CFLAGS="$CFLAGS" 190171308Sdelphij ORG_CXXFLAGS="$CXXFLAGS" 191233999Sgleb 192203164Sjh # autoconf magic only relies on PATH, so update it if tools dir is specified 193170808Sdelphij OLD_PATH="$PATH" 194170808Sdelphij 195170808Sdelphij # On Windows, we need to detect the visual studio installation first. 196233998Sgleb # This will change the PATH, but we need to keep that new PATH even 197170808Sdelphij # after toolchain detection is done, since the compiler (on x86) uses 198170808Sdelphij # it for DLL resolution in runtime. 199170808Sdelphij if test "x$OPENJDK_BUILD_OS" = "xwindows" \ 200170808Sdelphij && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then 201170808Sdelphij TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV 202170808Sdelphij # Reset path to VS_PATH. It will include everything that was on PATH at the time we 203233999Sgleb # ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV. 204233999Sgleb PATH="$VS_PATH" 205170808Sdelphij # The microsoft toolchain also requires INCLUDE and LIB to be set. 206170808Sdelphij export INCLUDE="$VS_INCLUDE" 207171308Sdelphij export LIB="$VS_LIB" 208170808Sdelphij fi 209170808Sdelphij 210202708Sjh # For solaris we really need solaris tools, and not the GNU equivalent. 211234000Sgleb # The build tools on Solaris reside in /usr/ccs (C Compilation System), 212234000Sgleb # so add that to path before starting to probe. 213202708Sjh # FIXME: This was originally only done for AS,NM,GNM,STRIP,OBJCOPY,OBJDUMP. 214234000Sgleb if test "x$OPENJDK_BUILD_OS" = xsolaris; then 215233999Sgleb PATH="/usr/ccs/bin:$PATH" 216234000Sgleb fi 217234000Sgleb 218233999Sgleb # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to 219170808Sdelphij # override all other locations. 220170808Sdelphij if test "x$TOOLCHAIN_PATH" != x; then 221170808Sdelphij PATH=$TOOLCHAIN_PATH:$PATH 222170808Sdelphij fi 223171070Sdelphij]) 224170808Sdelphij 225233999Sgleb# Restore path, etc 226170808SdelphijAC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION], 227233999Sgleb[ 228170808Sdelphij # Restore old path. 229171070Sdelphij PATH="$OLD_PATH" 230170808Sdelphij 231170808Sdelphij # Restore the flags to the user specified values. 232171362Sdelphij # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" 233173724Sdelphij CFLAGS="$ORG_CFLAGS" 234173724Sdelphij CXXFLAGS="$ORG_CXXFLAGS" 235173724Sdelphij]) 236173724Sdelphij 237173724Sdelphij# Check if a compiler is of the toolchain type we expect, and save the version 238173724Sdelphij# information from it. If the compiler does not match the expected type, 239173724Sdelphij# this function will abort using AC_MSG_ERROR. If it matches, the version will 240173724Sdelphij# be stored in CC_VERSION_NUMBER/CXX_VERSION_NUMBER (as a dotted number), and 241173724Sdelphij# the full version string in CC_VERSION_STRING/CXX_VERSION_STRING. 242234346Sjh# 243170808Sdelphij# $1 = compiler to test (CC or CXX) 244170808Sdelphij# $2 = human readable name of compiler (C or C++) 245171308SdelphijAC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], 246171308Sdelphij[ 247191990Sattilio COMPILER=[$]$1 248170808Sdelphij COMPILER_NAME=$2 249170808Sdelphij 250171029Sdelphij if test "x$TOOLCHAIN_TYPE" = xsolstudio; then 251171029Sdelphij # cc -V output typically looks like 252171362Sdelphij # cc: Sun C 5.12 Linux_i386 2011/11/16 253170808Sdelphij COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` 254170808Sdelphij # Check that this is likely to be the Solaris Studio cc. 255170808Sdelphij $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null 256241011Smdf if test $? -ne 0; then 257241011Smdf ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` 258170808Sdelphij AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) 259170808Sdelphij AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_OUTPUT"]) 260170808Sdelphij AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"]) 261170808Sdelphij AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) 262170808Sdelphij fi 263171070Sdelphij # Remove usage instructions (if present), and 264170808Sdelphij # collapse compiler output into a single line 265170808Sdelphij COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ 266170808Sdelphij $SED -e 's/ *@<:@Uu@:>@sage:.*//'` 267170808Sdelphij COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ 268170808Sdelphij $SED -e "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/"` 269170808Sdelphij elif test "x$TOOLCHAIN_TYPE" = xxlc; then 270170808Sdelphij # xlc -qversion output typically looks like 271170808Sdelphij # IBM XL C/C++ for AIX, V11.1 (5724-X13) 272170808Sdelphij # Version: 11.01.0000.0015 273170808Sdelphij COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` 274170808Sdelphij # Check that this is likely to be the IBM XL C compiler. 275170808Sdelphij $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null 276191990Sattilio if test $? -ne 0; then 277170808Sdelphij ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` 278170808Sdelphij AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) 279170808Sdelphij AC_MSG_NOTICE([The result from running with -qversion was: "$COMPILER_VERSION_OUTPUT"]) 280170808Sdelphij AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"]) 281170808Sdelphij AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) 282170808Sdelphij fi 283170808Sdelphij # Collapse compiler output into a single line 284170808Sdelphij COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` 285170808Sdelphij COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ 286170808Sdelphij $SED -e 's/^.*, V\(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'` 287170808Sdelphij elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then 288191990Sattilio # There is no specific version flag, but all output starts with a version string. 289170808Sdelphij # First line typically looks something like: 290170808Sdelphij # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 291170808Sdelphij COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` 292170808Sdelphij # Check that this is likely to be Microsoft CL.EXE. 293171070Sdelphij $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null 294170808Sdelphij if test $? -ne 0; then 295170808Sdelphij AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) 296170808Sdelphij AC_MSG_NOTICE([The result from running it was: "$COMPILER_VERSION_OUTPUT"]) 297170808Sdelphij AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) 298170808Sdelphij fi 299170808Sdelphij # Collapse compiler output into a single line 300170808Sdelphij COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` 301170808Sdelphij COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ 302170808Sdelphij $SED -e 's/^.*ersion.\(@<:@1-9@:>@@<:@0-9.@:>@*\) .*$/\1/'` 303245115Sgleb elif test "x$TOOLCHAIN_TYPE" = xgcc; then 304245115Sgleb # gcc --version output typically looks like 305170808Sdelphij # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 306170808Sdelphij # Copyright (C) 2013 Free Software Foundation, Inc. 307170808Sdelphij # This is free software; see the source for copying conditions. There is NO 308170808Sdelphij # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 309170808Sdelphij COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` 310170808Sdelphij # Check that this is likely to be GCC. 311171029Sdelphij $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null 312171029Sdelphij if test $? -ne 0; then 313171362Sdelphij AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) 314170808Sdelphij AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION"]) 315170808Sdelphij AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) 316170808Sdelphij fi 317171308Sdelphij # Remove Copyright and legalese from version string, and 318170808Sdelphij # collapse into a single line 319170808Sdelphij COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ 320170808Sdelphij $SED -e 's/ *Copyright .*//'` 321170808Sdelphij COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ 322171070Sdelphij $SED -e 's/^.* \(@<:@1-9@:>@\.@<:@0-9.@:>@*\) .*$/\1/'` 323170808Sdelphij elif test "x$TOOLCHAIN_TYPE" = xclang; then 324170808Sdelphij # clang --version output typically looks like 325170808Sdelphij # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) 326170808Sdelphij # clang version 3.3 (tags/RELEASE_33/final) 327170808Sdelphij # or 328170808Sdelphij # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) 329170808Sdelphij # Target: x86_64-pc-linux-gnu 330170808Sdelphij # Thread model: posix 331170808Sdelphij COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` 332191990Sattilio # Check that this is likely to be clang 333170808Sdelphij $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null 334170808Sdelphij if test $? -ne 0; then 335191990Sattilio AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) 336170808Sdelphij AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_OUTPUT"]) 337170808Sdelphij AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) 338171029Sdelphij fi 339170808Sdelphij # Collapse compiler output into a single line 340170808Sdelphij COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` 341170808Sdelphij COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ 342170808Sdelphij $SED -e 's/^.*clang version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'` 343170808Sdelphij else 344170808Sdelphij AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.]) 345170808Sdelphij fi 346222167Srmacklem # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) 347222167Srmacklem $1_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" 348170808Sdelphij # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) 349170808Sdelphij $1_VERSION_STRING="$COMPILER_VERSION_STRING" 350170808Sdelphij 351170808Sdelphij AC_MSG_NOTICE([Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER @<:@$COMPILER_VERSION_STRING@:>@]) 352170808Sdelphij]) 353170808Sdelphij 354170808Sdelphij# Try to locate the given C or C++ compiler in the path, or otherwise. 355170808Sdelphij# 356170808Sdelphij# $1 = compiler to test (CC or CXX) 357170808Sdelphij# $2 = human readable name of compiler (C or C++) 358170808Sdelphij# $3 = list of compiler names to search for 359170808SdelphijAC_DEFUN([TOOLCHAIN_FIND_COMPILER], 360170808Sdelphij[ 361170808Sdelphij COMPILER_NAME=$2 362170808Sdelphij SEARCH_LIST="$3" 363170808Sdelphij 364170808Sdelphij if test "x[$]$1" != x; then 365170808Sdelphij # User has supplied compiler name already, always let that override. 366170808Sdelphij AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1]) 367170808Sdelphij if test "x`basename [$]$1`" = "x[$]$1"; then 368170808Sdelphij # A command without a complete path is provided, search $PATH. 369170808Sdelphij 370170808Sdelphij AC_PATH_PROGS(POTENTIAL_$1, [$]$1) 371170808Sdelphij if test "x$POTENTIAL_$1" != x; then 372170808Sdelphij $1=$POTENTIAL_$1 373170808Sdelphij else 374170808Sdelphij AC_MSG_ERROR([User supplied compiler $1=[$]$1 could not be found]) 375171799Sdelphij fi 376191990Sattilio else 377171799Sdelphij # Otherwise it might already be a complete path 378171799Sdelphij if test ! -x "[$]$1"; then 379170808Sdelphij AC_MSG_ERROR([User supplied compiler $1=[$]$1 does not exist]) 380170808Sdelphij fi 381170808Sdelphij fi 382170808Sdelphij else 383170808Sdelphij # No user supplied value. Locate compiler ourselves. 384170808Sdelphij 385191990Sattilio # If we are cross compiling, assume cross compilation tools follows the 386170808Sdelphij # cross compilation standard where they are prefixed with the autoconf 387170808Sdelphij # standard name for the target. For example the binary 388233998Sgleb # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. 389170808Sdelphij # If we are not cross compiling, then the default compiler name will be 390170808Sdelphij # used. 391170808Sdelphij 392171070Sdelphij $1= 393170808Sdelphij # If TOOLCHAIN_PATH is set, check for all compiler names in there first 394170808Sdelphij # before checking the rest of the PATH. 395233998Sgleb # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION 396233998Sgleb # step, this should not be necessary. 397233998Sgleb if test -n "$TOOLCHAIN_PATH"; then 398233998Sgleb PATH_save="$PATH" 399233998Sgleb PATH="$TOOLCHAIN_PATH" 400233998Sgleb AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST) 401233998Sgleb $1=$TOOLCHAIN_PATH_$1 402233998Sgleb PATH="$PATH_save" 403233998Sgleb fi 404233998Sgleb 405233998Sgleb # AC_PATH_PROGS can't be run multiple times with the same variable, 406233998Sgleb # so create a new name for this run. 407233998Sgleb if test "x[$]$1" = x; then 408233998Sgleb AC_PATH_PROGS(POTENTIAL_$1, $SEARCH_LIST) 409233998Sgleb $1=$POTENTIAL_$1 410233998Sgleb fi 411170808Sdelphij 412170808Sdelphij if test "x[$]$1" = x; then 413170808Sdelphij HELP_MSG_MISSING_DEPENDENCY([devkit]) 414170808Sdelphij AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) 415170808Sdelphij fi 416170808Sdelphij fi 417170808Sdelphij 418170808Sdelphij # Now we have a compiler binary in $1. Make sure it's okay. 419170808Sdelphij BASIC_FIXUP_EXECUTABLE($1) 420170808Sdelphij TEST_COMPILER="[$]$1" 421170808Sdelphij # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links 422170808Sdelphij # to 'xlc' but it is crucial that we invoke the compiler with the right name! 423170808Sdelphij if test "x$OPENJDK_BUILD_OS" != xaix; then 424170808Sdelphij # FIXME: This test should not be needed anymore; we don't do that for any platform. 425170808Sdelphij AC_MSG_CHECKING([resolved symbolic links for $1]) 426170808Sdelphij BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) 427170808Sdelphij AC_MSG_RESULT([$TEST_COMPILER]) 428170808Sdelphij fi 429254741Sdelphij AC_MSG_CHECKING([if $1 is disguised ccache]) 430 431 COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` 432 if test "x$COMPILER_BASENAME" = "xccache"; then 433 AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) 434 # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. 435 # We want to control ccache invocation ourselves, so ignore this cc and try 436 # searching again. 437 438 # Remove the path to the fake ccache cc from the PATH 439 RETRY_COMPILER_SAVED_PATH="$PATH" 440 COMPILER_DIRNAME=`$DIRNAME [$]$1` 441 PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" 442 443 # Try again looking for our compiler 444 AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) 445 BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) 446 PATH="$RETRY_COMPILER_SAVED_PATH" 447 448 AC_MSG_CHECKING([for resolved symbolic links for $1]) 449 BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) 450 AC_MSG_RESULT([$PROPER_COMPILER_$1]) 451 $1="$PROPER_COMPILER_$1" 452 else 453 AC_MSG_RESULT([no, keeping $1]) 454 fi 455 456 TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) 457]) 458 459# Detect the core components of the toolchain, i.e. the compilers (CC and CXX), 460# preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the 461# archiver (AR). Verify that the compilers are correct according to the 462# toolchain type. 463AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE], 464[ 465 # 466 # Setup the compilers (CC and CXX) 467 # 468 TOOLCHAIN_FIND_COMPILER([CC], [C], $TOOLCHAIN_CC_BINARY) 469 # Now that we have resolved CC ourself, let autoconf have its go at it 470 AC_PROG_CC([$CC]) 471 472 TOOLCHAIN_FIND_COMPILER([CXX], [C++], $TOOLCHAIN_CXX_BINARY) 473 # Now that we have resolved CXX ourself, let autoconf have its go at it 474 AC_PROG_CXX([$CXX]) 475 476 # 477 # Setup the preprocessor (CPP and CXXCPP) 478 # 479 AC_PROG_CPP 480 BASIC_FIXUP_EXECUTABLE(CPP) 481 AC_PROG_CXXCPP 482 BASIC_FIXUP_EXECUTABLE(CXXCPP) 483 484 # 485 # Setup the linker (LD) 486 # 487 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then 488 # In the Microsoft toolchain we have a separate LD command "link". 489 # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is 490 # a cygwin program for something completely different. 491 AC_CHECK_PROG([LD], [link],[link],,, [$CYGWIN_LINK]) 492 BASIC_FIXUP_EXECUTABLE(LD) 493 # Verify that we indeed succeeded with this trick. 494 AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) 495 "$LD" --version > /dev/null 496 if test $? -eq 0 ; then 497 AC_MSG_RESULT([no]) 498 AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.]) 499 else 500 AC_MSG_RESULT([yes]) 501 fi 502 LDCXX="$LD" 503 else 504 # All other toolchains use the compiler to link. 505 LD="$CC" 506 LDCXX="$CXX" 507 fi 508 AC_SUBST(LD) 509 # FIXME: it should be CXXLD, according to standard (cf CXXCPP) 510 AC_SUBST(LDCXX) 511 512 # 513 # Setup the assembler (AS) 514 # 515 if test "x$OPENJDK_TARGET_OS" = xsolaris; then 516 # FIXME: should this really be solaris, or solstudio? 517 BASIC_PATH_PROGS(AS, as) 518 BASIC_FIXUP_EXECUTABLE(AS) 519 else 520 # FIXME: is this correct for microsoft? 521 AS="$CC -c" 522 fi 523 AC_SUBST(AS) 524 525 # 526 # Setup the archiver (AR) 527 # 528 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then 529 # The corresponding ar tool is lib.exe (used to create static libraries) 530 AC_CHECK_PROG([AR], [lib],[lib],,,) 531 else 532 BASIC_CHECK_TOOLS(AR, ar) 533 fi 534 BASIC_FIXUP_EXECUTABLE(AR) 535]) 536 537# Setup additional tools that is considered a part of the toolchain, but not the 538# core part. Many of these are highly platform-specific and do not exist, 539# and/or are not needed on all platforms. 540AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA], 541[ 542 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then 543 BASIC_PATH_PROGS(LIPO, lipo) 544 BASIC_FIXUP_EXECUTABLE(LIPO) 545 fi 546 547 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then 548 AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) 549 BASIC_FIXUP_EXECUTABLE(MT) 550 # Setup the resource compiler (RC) 551 AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) 552 BASIC_FIXUP_EXECUTABLE(RC) 553 AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) 554 BASIC_FIXUP_EXECUTABLE(DUMPBIN) 555 # We need to check for 'msbuild.exe' because at the place where we expect to 556 # find 'msbuild.exe' there's also a directory called 'msbuild' and configure 557 # won't find the 'msbuild.exe' executable in that case (and the 558 # 'ac_executable_extensions' is unusable due to performance reasons). 559 # Notice that we intentionally don't fix up the path to MSBUILD because we 560 # will call it in a DOS shell during freetype detection on Windows (see 561 # 'LIB_SETUP_FREETYPE' in "libraries.m4" 562 AC_CHECK_PROG([MSBUILD], [msbuild.exe], [msbuild.exe],,,) 563 fi 564 565 if test "x$OPENJDK_TARGET_OS" = xsolaris; then 566 BASIC_PATH_PROGS(STRIP, strip) 567 BASIC_FIXUP_EXECUTABLE(STRIP) 568 BASIC_PATH_PROGS(NM, nm) 569 BASIC_FIXUP_EXECUTABLE(NM) 570 BASIC_PATH_PROGS(GNM, gnm) 571 BASIC_FIXUP_EXECUTABLE(GNM) 572 elif test "x$OPENJDK_TARGET_OS" != xwindows; then 573 # FIXME: we should unify this with the solaris case above. 574 BASIC_CHECK_TOOLS(STRIP, strip) 575 BASIC_FIXUP_EXECUTABLE(STRIP) 576 BASIC_CHECK_TOOLS(NM, nm) 577 BASIC_FIXUP_EXECUTABLE(NM) 578 GNM="$NM" 579 AC_SUBST(GNM) 580 fi 581 582 # objcopy is used for moving debug symbols to separate files when 583 # full debug symbols are enabled. 584 if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then 585 BASIC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy]) 586 # Only call fixup if objcopy was found. 587 if test -n "$OBJCOPY"; then 588 BASIC_FIXUP_EXECUTABLE(OBJCOPY) 589 if test "x$OPENJDK_BUILD_OS" = xsolaris; then 590 # objcopy prior to 2.21.1 on solaris is broken and is not usable. 591 # Rewrite objcopy version output to VALID_VERSION or BAD_VERSION. 592 # - version number is last blank separate word on first line 593 # - version number formats that have been seen: 594 # - <major>.<minor> 595 # - <major>.<minor>.<micro> 596 OBJCOPY_VERSION=`$OBJCOPY --version | $HEAD -n 1` 597 # The outer [ ] is to prevent m4 from eating the [] in the sed expression. 598 [ OBJCOPY_VERSION_CHECK=`$ECHO $OBJCOPY_VERSION | $SED -n \ 599 -e 's/.* //' \ 600 -e '/^[01]\./b bad' \ 601 -e '/^2\./{' \ 602 -e ' s/^2\.//' \ 603 -e ' /^[0-9]$/b bad' \ 604 -e ' /^[0-9]\./b bad' \ 605 -e ' /^1[0-9]$/b bad' \ 606 -e ' /^1[0-9]\./b bad' \ 607 -e ' /^20\./b bad' \ 608 -e ' /^21\.0$/b bad' \ 609 -e ' /^21\.0\./b bad' \ 610 -e '}' \ 611 -e ':good' \ 612 -e 's/.*/VALID_VERSION/p' \ 613 -e 'q' \ 614 -e ':bad' \ 615 -e 's/.*/BAD_VERSION/p' \ 616 -e 'q'` ] 617 if test "x$OBJCOPY_VERSION_CHECK" = xBAD_VERSION; then 618 OBJCOPY= 619 AC_MSG_WARN([Ignoring found objcopy since it is broken (prior to 2.21.1). No debug symbols will be generated.]) 620 AC_MSG_NOTICE([objcopy reports version $OBJCOPY_VERSION]) 621 AC_MSG_NOTICE([Note: patch 149063-01 or newer contains the correct Solaris 10 SPARC version]) 622 AC_MSG_NOTICE([Note: patch 149064-01 or newer contains the correct Solaris 10 X86 version]) 623 AC_MSG_NOTICE([Note: Solaris 11 Update 1 contains the correct version]) 624 fi 625 fi 626 fi 627 fi 628 629 BASIC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) 630 if test "x$OBJDUMP" != x; then 631 # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE 632 # bails if argument is missing. 633 BASIC_FIXUP_EXECUTABLE(OBJDUMP) 634 fi 635]) 636 637# Setup the build tools (i.e, the compiler and linker used to build programs 638# that should be run on the build platform, not the target platform, as a build 639# helper). Since the non-cross-compile case uses the normal, target compilers 640# for this, we can only do this after these have been setup. 641AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS], 642[ 643 if test "x$COMPILE_TYPE" = "xcross"; then 644 # Now we need to find a C/C++ compiler that can build executables for the 645 # build platform. We can't use the AC_PROG_CC macro, since it can only be 646 # used once. Also, we need to do this without adding a tools dir to the 647 # path, otherwise we might pick up cross-compilers which don't use standard 648 # naming. 649 650 # FIXME: we should list the discovered compilers as an exclude pattern! 651 # If we do that, we can do this detection before POST_DETECTION, and still 652 # find the build compilers in the tools dir, if needed. 653 BASIC_PATH_PROGS(BUILD_CC, [cl cc gcc]) 654 BASIC_FIXUP_EXECUTABLE(BUILD_CC) 655 BASIC_PATH_PROGS(BUILD_CXX, [cl CC g++]) 656 BASIC_FIXUP_EXECUTABLE(BUILD_CXX) 657 BASIC_PATH_PROGS(BUILD_LD, ld) 658 BASIC_FIXUP_EXECUTABLE(BUILD_LD) 659 else 660 # If we are not cross compiling, use the normal target compilers for 661 # building the build platform executables. 662 BUILD_CC="$CC" 663 BUILD_CXX="$CXX" 664 BUILD_LD="$LD" 665 fi 666 667 AC_SUBST(BUILD_CC) 668 AC_SUBST(BUILD_CXX) 669 AC_SUBST(BUILD_LD) 670]) 671 672# Setup legacy variables that are still needed as alternative ways to refer to 673# parts of the toolchain. 674AC_DEFUN_ONCE([TOOLCHAIN_SETUP_LEGACY], 675[ 676 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then 677 # For hotspot, we need these in Windows mixed path, 678 # so rewrite them all. Need added .exe suffix. 679 HOTSPOT_CXX="$CXX.exe" 680 HOTSPOT_LD="$LD.exe" 681 HOTSPOT_MT="$MT.exe" 682 HOTSPOT_RC="$RC.exe" 683 BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) 684 BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) 685 BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) 686 BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) 687 AC_SUBST(HOTSPOT_MT) 688 AC_SUBST(HOTSPOT_RC) 689 else 690 HOTSPOT_CXX="$CXX" 691 HOTSPOT_LD="$LD" 692 fi 693 AC_SUBST(HOTSPOT_CXX) 694 AC_SUBST(HOTSPOT_LD) 695 696 if test "x$TOOLCHAIN_TYPE" = xclang; then 697 USE_CLANG=true 698 fi 699 AC_SUBST(USE_CLANG) 700]) 701 702# Do some additional checks on the detected tools. 703AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], 704[ 705 # The package path is used only on macosx? 706 # FIXME: clean this up, and/or move it elsewhere. 707 PACKAGE_PATH=/opt/local 708 AC_SUBST(PACKAGE_PATH) 709 710 # Check for extra potential brokenness. 711 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then 712 # On Windows, double-check that we got the right compiler. 713 CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` 714 COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` 715 if test "x$OPENJDK_TARGET_CPU" = "xx86"; then 716 if test "x$COMPILER_CPU_TEST" != "x80x86" -a "x$COMPILER_CPU_TEST" != "xx86"; then 717 AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86" or "x86".]) 718 fi 719 elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then 720 if test "x$COMPILER_CPU_TEST" != "xx64"; then 721 AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".]) 722 fi 723 fi 724 fi 725 726 if test "x$TOOLCHAIN_TYPE" = xgcc; then 727 # If this is a --hash-style=gnu system, use --hash-style=both, why? 728 HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` 729 # This is later checked when setting flags. 730 731 # "-Og" suppported for GCC 4.8 and later 732 CFLAG_OPTIMIZE_DEBUG_FLAG="-Og" 733 FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG], 734 [HAS_CFLAG_OPTIMIZE_DEBUG=true], 735 [HAS_CFLAG_OPTIMIZE_DEBUG=false]) 736 737 # "-z relro" supported in GNU binutils 2.17 and later 738 LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro" 739 FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG], 740 [HAS_LINKER_RELRO=true], 741 [HAS_LINKER_RELRO=false]) 742 743 # "-z now" supported in GNU binutils 2.11 and later 744 LINKER_NOW_FLAG="-Xlinker -z -Xlinker now" 745 FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG], 746 [HAS_LINKER_NOW=true], 747 [HAS_LINKER_NOW=false]) 748 fi 749 750 # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed 751 # in executable.' 752 USING_BROKEN_SUSE_LD=no 753 if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then 754 AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables]) 755 $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map 756 $ECHO "int main() { }" > main.c 757 if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then 758 AC_MSG_RESULT(no) 759 USING_BROKEN_SUSE_LD=no 760 else 761 AC_MSG_RESULT(yes) 762 USING_BROKEN_SUSE_LD=yes 763 fi 764 rm -rf version-script.map main.c a.out 765 fi 766 AC_SUBST(USING_BROKEN_SUSE_LD) 767]) 768 769# Setup the JTReg Regression Test Harness. 770AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], 771[ 772 AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], 773 [Regression Test Harness @<:@probed@:>@])], 774 [], 775 [with_jtreg=no]) 776 777 if test "x$with_jtreg" = xno; then 778 # jtreg disabled 779 AC_MSG_CHECKING([for jtreg]) 780 AC_MSG_RESULT(no) 781 else 782 if test "x$with_jtreg" != xyes; then 783 # with path specified. 784 JT_HOME="$with_jtreg" 785 fi 786 787 if test "x$JT_HOME" != x; then 788 AC_MSG_CHECKING([for jtreg]) 789 790 # use JT_HOME enviroment var. 791 BASIC_FIXUP_PATH([JT_HOME]) 792 793 # jtreg win32 script works for everybody 794 JTREGEXE="$JT_HOME/bin/jtreg" 795 796 if test ! -f "$JTREGEXE"; then 797 AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE]) 798 fi 799 800 AC_MSG_RESULT($JTREGEXE) 801 else 802 # try to find jtreg on path 803 BASIC_REQUIRE_PROGS(JTREGEXE, jtreg) 804 JT_HOME="`$DIRNAME $JTREGEXE`" 805 fi 806 fi 807 808 AC_SUBST(JT_HOME) 809 AC_SUBST(JTREGEXE) 810]) 811