common/autoconf/toolchain.m4
changeset 23166 4cdccd29406c
parent 23161 85635b5bf0a6
child 23428 3c8a05bf4656
equal deleted inserted replaced
23165:3400afa2e4bc 23166:4cdccd29406c
    94       [the toolchain type (or family) to use, use '--help' to show possible values @<:@platform dependent@:>@])])
    94       [the toolchain type (or family) to use, use '--help' to show possible values @<:@platform dependent@:>@])])
    95 
    95 
    96   # Use indirect variable referencing
    96   # Use indirect variable referencing
    97   toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS
    97   toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS
    98   VALID_TOOLCHAINS=${!toolchain_var_name}
    98   VALID_TOOLCHAINS=${!toolchain_var_name}
    99   # First toolchain type in the list is the default
    99 
   100   DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
   100   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
       
   101     # On Mac OS X, default toolchain to clang after Xcode 5
       
   102     XCODE_VERSION_OUTPUT=`xcodebuild -version 2>&1 | $HEAD -n 1`
       
   103     $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null
       
   104     if test $? -ne 0; then
       
   105       AC_MSG_ERROR([Failed to determine Xcode version.])
       
   106     fi
       
   107     XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \
       
   108         $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \
       
   109         $CUT -f 1 -d .`
       
   110     AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION])
       
   111     if test $XCODE_MAJOR_VERSION -ge 5; then
       
   112         DEFAULT_TOOLCHAIN="clang"
       
   113     else
       
   114         DEFAULT_TOOLCHAIN="gcc"
       
   115     fi
       
   116   else
       
   117     # First toolchain type in the list is the default
       
   118     DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *}
       
   119   fi
   101   
   120   
   102   if test "x$with_toolchain_type" = xlist; then
   121   if test "x$with_toolchain_type" = xlist; then
   103     # List all toolchains
   122     # List all toolchains
   104     AC_MSG_NOTICE([The following toolchains are valid on this platform:])
   123     AC_MSG_NOTICE([The following toolchains are valid on this platform:])
   105     for toolchain in $VALID_TOOLCHAINS; do
   124     for toolchain in $VALID_TOOLCHAINS; do