Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 1 | # |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 2 | # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | # |
| 5 | # This code is free software; you can redistribute it and/or modify it |
| 6 | # under the terms of the GNU General Public License version 2 only, as |
| 7 | # published by the Free Software Foundation. Oracle designates this |
| 8 | # particular file as subject to the "Classpath" exception as provided |
| 9 | # by Oracle in the LICENSE file that accompanied this code. |
| 10 | # |
| 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | # version 2 for more details (a copy is included in the LICENSE file that |
| 15 | # accompanied this code). |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License version |
| 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | # |
| 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
| 22 | # or visit www.oracle.com if you need additional information or have any |
| 23 | # questions. |
| 24 | # |
| 25 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 26 | ######################################################################## |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 27 | # This file is responsible for detecting, verifying and setting up the |
| 28 | # toolchain, i.e. the compiler, linker and related utilities. It will setup |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 29 | # proper paths to the binaries, but it will not setup any flags. |
| 30 | # |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 31 | # The binaries used is determined by the toolchain type, which is the family of |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 32 | # compilers and related tools that are used. |
| 33 | ######################################################################## |
| 34 | |
| 35 | |
| 36 | # All valid toolchains, regardless of platform (used by help.m4) |
| 37 | VALID_TOOLCHAINS_all="gcc clang solstudio xlc microsoft" |
| 38 | |
| 39 | # These toolchains are valid on different platforms |
| 40 | VALID_TOOLCHAINS_linux="gcc clang" |
| 41 | VALID_TOOLCHAINS_solaris="solstudio" |
| 42 | VALID_TOOLCHAINS_macosx="gcc clang" |
| 43 | VALID_TOOLCHAINS_aix="xlc" |
| 44 | VALID_TOOLCHAINS_windows="microsoft" |
| 45 | |
| 46 | # Toolchain descriptions |
| 47 | TOOLCHAIN_DESCRIPTION_clang="clang/LLVM" |
| 48 | TOOLCHAIN_DESCRIPTION_gcc="GNU Compiler Collection" |
| 49 | TOOLCHAIN_DESCRIPTION_microsoft="Microsoft Visual Studio" |
| 50 | TOOLCHAIN_DESCRIPTION_solstudio="Oracle Solaris Studio" |
| 51 | TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++" |
| 52 | |
| 53 | # Setup a number of variables describing how native output files are |
| 54 | # named on this platform/toolchain. |
| 55 | AC_DEFUN([TOOLCHAIN_SETUP_FILENAME_PATTERNS], |
| 56 | [ |
| 57 | # Define filename patterns |
| 58 | if test "x$OPENJDK_TARGET_OS" = xwindows; then |
| 59 | LIBRARY_PREFIX= |
| 60 | SHARED_LIBRARY_SUFFIX='.dll' |
| 61 | STATIC_LIBRARY_SUFFIX='.lib' |
| 62 | SHARED_LIBRARY='[$]1.dll' |
| 63 | STATIC_LIBRARY='[$]1.lib' |
| 64 | OBJ_SUFFIX='.obj' |
| 65 | EXE_SUFFIX='.exe' |
| 66 | else |
| 67 | LIBRARY_PREFIX=lib |
| 68 | SHARED_LIBRARY_SUFFIX='.so' |
| 69 | STATIC_LIBRARY_SUFFIX='.a' |
| 70 | SHARED_LIBRARY='lib[$]1.so' |
| 71 | STATIC_LIBRARY='lib[$]1.a' |
| 72 | OBJ_SUFFIX='.o' |
| 73 | EXE_SUFFIX='' |
| 74 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
| 75 | SHARED_LIBRARY='lib[$]1.dylib' |
| 76 | SHARED_LIBRARY_SUFFIX='.dylib' |
| 77 | fi |
| 78 | fi |
| 79 | |
| 80 | AC_SUBST(LIBRARY_PREFIX) |
| 81 | AC_SUBST(SHARED_LIBRARY_SUFFIX) |
| 82 | AC_SUBST(STATIC_LIBRARY_SUFFIX) |
| 83 | AC_SUBST(SHARED_LIBRARY) |
| 84 | AC_SUBST(STATIC_LIBRARY) |
| 85 | AC_SUBST(OBJ_SUFFIX) |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 86 | AC_SUBST(EXE_SUFFIX) |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 87 | ]) |
| 88 | |
| 89 | # Determine which toolchain type to use, and make sure it is valid for this |
| 90 | # platform. Setup various information about the selected toolchain. |
| 91 | AC_DEFUN_ONCE([TOOLCHAIN_DETERMINE_TOOLCHAIN_TYPE], |
| 92 | [ |
| 93 | AC_ARG_WITH(toolchain-type, [AS_HELP_STRING([--with-toolchain-type], |
| 94 | [the toolchain type (or family) to use, use '--help' to show possible values @<:@platform dependent@:>@])]) |
| 95 | |
| 96 | # Use indirect variable referencing |
| 97 | toolchain_var_name=VALID_TOOLCHAINS_$OPENJDK_BUILD_OS |
| 98 | VALID_TOOLCHAINS=${!toolchain_var_name} |
Henry Jen | 97a80c5 | 2014-02-25 23:38:52 -0800 | [diff] [blame] | 99 | |
| 100 | if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
David Dehaven | 9110c16 | 2014-06-18 12:52:13 -0700 | [diff] [blame] | 101 | if test -n "$XCODEBUILD"; then |
| 102 | # On Mac OS X, default toolchain to clang after Xcode 5 |
| 103 | XCODE_VERSION_OUTPUT=`"$XCODEBUILD" -version 2>&1 | $HEAD -n 1` |
| 104 | $ECHO "$XCODE_VERSION_OUTPUT" | $GREP "Xcode " > /dev/null |
| 105 | if test $? -ne 0; then |
| 106 | AC_MSG_ERROR([Failed to determine Xcode version.]) |
| 107 | fi |
| 108 | XCODE_MAJOR_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | \ |
| 109 | $SED -e 's/^Xcode \(@<:@1-9@:>@@<:@0-9.@:>@*\)/\1/' | \ |
| 110 | $CUT -f 1 -d .` |
| 111 | AC_MSG_NOTICE([Xcode major version: $XCODE_MAJOR_VERSION]) |
| 112 | if test $XCODE_MAJOR_VERSION -ge 5; then |
| 113 | DEFAULT_TOOLCHAIN="clang" |
| 114 | else |
| 115 | DEFAULT_TOOLCHAIN="gcc" |
| 116 | fi |
Henry Jen | 97a80c5 | 2014-02-25 23:38:52 -0800 | [diff] [blame] | 117 | else |
David Dehaven | 9110c16 | 2014-06-18 12:52:13 -0700 | [diff] [blame] | 118 | # If Xcode is not installed, but the command line tools are |
| 119 | # then we can't run xcodebuild. On these systems we should |
| 120 | # default to clang |
| 121 | DEFAULT_TOOLCHAIN="clang" |
Henry Jen | 97a80c5 | 2014-02-25 23:38:52 -0800 | [diff] [blame] | 122 | fi |
| 123 | else |
| 124 | # First toolchain type in the list is the default |
| 125 | DEFAULT_TOOLCHAIN=${VALID_TOOLCHAINS%% *} |
| 126 | fi |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 127 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 128 | if test "x$with_toolchain_type" = xlist; then |
| 129 | # List all toolchains |
| 130 | AC_MSG_NOTICE([The following toolchains are valid on this platform:]) |
| 131 | for toolchain in $VALID_TOOLCHAINS; do |
| 132 | toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain |
| 133 | TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} |
| 134 | $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION" |
| 135 | done |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 136 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 137 | exit 0 |
| 138 | elif test "x$with_toolchain_type" != x; then |
| 139 | # User override; check that it is valid |
| 140 | if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then |
| 141 | AC_MSG_NOTICE([Toolchain type $with_toolchain_type is not valid on this platform.]) |
| 142 | AC_MSG_NOTICE([Valid toolchains: $VALID_TOOLCHAINS.]) |
| 143 | AC_MSG_ERROR([Cannot continue.]) |
| 144 | fi |
| 145 | TOOLCHAIN_TYPE=$with_toolchain_type |
| 146 | else |
| 147 | # No flag given, use default |
| 148 | TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN |
| 149 | fi |
| 150 | AC_SUBST(TOOLCHAIN_TYPE) |
| 151 | |
| 152 | TOOLCHAIN_CC_BINARY_clang="clang" |
| 153 | TOOLCHAIN_CC_BINARY_gcc="gcc" |
| 154 | TOOLCHAIN_CC_BINARY_microsoft="cl" |
| 155 | TOOLCHAIN_CC_BINARY_solstudio="cc" |
| 156 | TOOLCHAIN_CC_BINARY_xlc="xlc_r" |
| 157 | |
| 158 | TOOLCHAIN_CXX_BINARY_clang="clang++" |
| 159 | TOOLCHAIN_CXX_BINARY_gcc="g++" |
| 160 | TOOLCHAIN_CXX_BINARY_microsoft="cl" |
| 161 | TOOLCHAIN_CXX_BINARY_solstudio="CC" |
| 162 | TOOLCHAIN_CXX_BINARY_xlc="xlC_r" |
| 163 | |
| 164 | # Use indirect variable referencing |
| 165 | toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE |
| 166 | TOOLCHAIN_DESCRIPTION=${!toolchain_var_name} |
| 167 | toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE |
| 168 | TOOLCHAIN_CC_BINARY=${!toolchain_var_name} |
| 169 | toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE |
| 170 | TOOLCHAIN_CXX_BINARY=${!toolchain_var_name} |
| 171 | |
| 172 | TOOLCHAIN_SETUP_FILENAME_PATTERNS |
| 173 | |
| 174 | if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then |
| 175 | AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)]) |
| 176 | else |
| 177 | AC_MSG_NOTICE([Using user selected toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION). Default toolchain is $DEFAULT_TOOLCHAIN.]) |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 178 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 179 | ]) |
| 180 | |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 181 | # Before we start detecting the toolchain executables, we might need some |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 182 | # special setup, e.g. additional paths etc. |
| 183 | AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION], |
| 184 | [ |
| 185 | # FIXME: Is this needed? |
| 186 | AC_LANG(C++) |
| 187 | |
| 188 | # Store the CFLAGS etc passed to the configure script. |
| 189 | ORG_CFLAGS="$CFLAGS" |
| 190 | ORG_CXXFLAGS="$CXXFLAGS" |
| 191 | ORG_OBJCFLAGS="$OBJCFLAGS" |
| 192 | |
Magnus Ihse Bursie | e7066f3 | 2014-02-25 15:19:32 +0100 | [diff] [blame] | 193 | # On Windows, we need to detect the visual studio installation first. |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 194 | # This will change the PATH, but we need to keep that new PATH even |
Magnus Ihse Bursie | e7066f3 | 2014-02-25 15:19:32 +0100 | [diff] [blame] | 195 | # after toolchain detection is done, since the compiler (on x86) uses |
| 196 | # it for DLL resolution in runtime. |
| 197 | if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then |
| 198 | TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV |
Magnus Ihse Bursie | 268191c | 2014-03-31 22:30:11 +0200 | [diff] [blame] | 199 | # Reset path to VS_PATH. It will include everything that was on PATH at the time we |
| 200 | # ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV. |
| 201 | PATH="$VS_PATH" |
| 202 | # The microsoft toolchain also requires INCLUDE and LIB to be set. |
| 203 | export INCLUDE="$VS_INCLUDE" |
| 204 | export LIB="$VS_LIB" |
Magnus Ihse Bursie | e7066f3 | 2014-02-25 15:19:32 +0100 | [diff] [blame] | 205 | fi |
| 206 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 207 | # autoconf magic only relies on PATH, so update it if tools dir is specified |
| 208 | OLD_PATH="$PATH" |
| 209 | |
| 210 | # For solaris we really need solaris tools, and not the GNU equivalent. |
| 211 | # The build tools on Solaris reside in /usr/ccs (C Compilation System), |
| 212 | # so add that to path before starting to probe. |
| 213 | # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. |
| 214 | if test "x$OPENJDK_BUILD_OS" = xsolaris; then |
| 215 | PATH="/usr/ccs/bin:$PATH" |
| 216 | fi |
| 217 | |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 218 | # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 219 | # override all other locations. |
Erik Joelsson | 4cbd014 | 2014-03-28 14:59:56 +0100 | [diff] [blame] | 220 | if test "x$TOOLCHAIN_PATH" != x; then |
| 221 | PATH=$TOOLCHAIN_PATH:$PATH |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 222 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 223 | ]) |
| 224 | |
| 225 | # Restore path, etc |
| 226 | AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION], |
| 227 | [ |
| 228 | # Restore old path. |
| 229 | PATH="$OLD_PATH" |
| 230 | |
| 231 | # Restore the flags to the user specified values. |
| 232 | # This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2" |
| 233 | CFLAGS="$ORG_CFLAGS" |
| 234 | CXXFLAGS="$ORG_CXXFLAGS" |
| 235 | OBJCFLAGS="$ORG_OBJCFLAGS" |
| 236 | ]) |
| 237 | |
| 238 | # Check if a compiler is of the toolchain type we expect, and save the version |
| 239 | # information from it. If the compiler does not match the expected type, |
| 240 | # this function will abort using AC_MSG_ERROR. If it matches, the version will |
| 241 | # be stored in CC_VERSION_NUMBER/CXX_VERSION_NUMBER (as a dotted number), and |
| 242 | # the full version string in CC_VERSION_STRING/CXX_VERSION_STRING. |
| 243 | # |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 244 | # $1 = compiler to test (CC or CXX) |
| 245 | # $2 = human readable name of compiler (C or C++) |
| 246 | AC_DEFUN([TOOLCHAIN_CHECK_COMPILER_VERSION], |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 247 | [ |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 248 | COMPILER=[$]$1 |
| 249 | COMPILER_NAME=$2 |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 250 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 251 | if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
| 252 | # cc -V output typically looks like |
| 253 | # cc: Sun C 5.12 Linux_i386 2011/11/16 |
| 254 | COMPILER_VERSION_OUTPUT=`$COMPILER -V 2>&1` |
| 255 | # Check that this is likely to be the Solaris Studio cc. |
| 256 | $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "^.*: Sun $COMPILER_NAME" > /dev/null |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 257 | if test $? -ne 0; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 258 | ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` |
| 259 | AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) |
| 260 | AC_MSG_NOTICE([The result from running with -V was: "$COMPILER_VERSION_OUTPUT"]) |
| 261 | AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"]) |
| 262 | AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 263 | fi |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 264 | # Remove usage instructions (if present), and |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 265 | # collapse compiler output into a single line |
| 266 | COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 267 | $SED -e 's/ *@<:@Uu@:>@sage:.*//'` |
| 268 | COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 269 | $SED -e "s/^.*@<:@ ,\t@:>@$COMPILER_NAME@<:@ ,\t@:>@\(@<:@1-9@:>@\.@<:@0-9@:>@@<:@0-9@:>@*\).*/\1/"` |
| 270 | elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
| 271 | # xlc -qversion output typically looks like |
| 272 | # IBM XL C/C++ for AIX, V11.1 (5724-X13) |
| 273 | # Version: 11.01.0000.0015 |
| 274 | COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1` |
| 275 | # Check that this is likely to be the IBM XL C compiler. |
| 276 | $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null |
| 277 | if test $? -ne 0; then |
| 278 | ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1` |
| 279 | AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) |
| 280 | AC_MSG_NOTICE([The result from running with -qversion was: "$COMPILER_VERSION_OUTPUT"]) |
| 281 | AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"]) |
| 282 | AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) |
| 283 | fi |
| 284 | # Collapse compiler output into a single line |
| 285 | COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` |
| 286 | COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 287 | $SED -e 's/^.*, V\(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'` |
| 288 | elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
| 289 | # There is no specific version flag, but all output starts with a version string. |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 290 | # First line typically looks something like: |
Tim Bell | 3cb6eed | 2013-10-09 18:51:32 -0700 | [diff] [blame] | 291 | # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86 |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 292 | COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'` |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 293 | # Check that this is likely to be Microsoft CL.EXE. |
| 294 | $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 295 | if test $? -ne 0; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 296 | AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) |
| 297 | AC_MSG_NOTICE([The result from running it was: "$COMPILER_VERSION_OUTPUT"]) |
| 298 | AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 299 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 300 | # Collapse compiler output into a single line |
| 301 | COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` |
| 302 | COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 303 | $SED -e 's/^.*ersion.\(@<:@1-9@:>@@<:@0-9.@:>@*\) .*$/\1/'` |
| 304 | elif test "x$TOOLCHAIN_TYPE" = xgcc; then |
| 305 | # gcc --version output typically looks like |
| 306 | # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1 |
| 307 | # Copyright (C) 2013 Free Software Foundation, Inc. |
| 308 | # This is free software; see the source for copying conditions. There is NO |
| 309 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 310 | COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` |
| 311 | # Check that this is likely to be GCC. |
| 312 | $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null |
| 313 | if test $? -ne 0; then |
| 314 | AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) |
| 315 | AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION"]) |
| 316 | AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) |
| 317 | fi |
| 318 | # Remove Copyright and legalese from version string, and |
| 319 | # collapse into a single line |
| 320 | COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 321 | $SED -e 's/ *Copyright .*//'` |
| 322 | COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 323 | $SED -e 's/^.* \(@<:@1-9@:>@\.@<:@0-9.@:>@*\) .*$/\1/'` |
| 324 | elif test "x$TOOLCHAIN_TYPE" = xclang; then |
| 325 | # clang --version output typically looks like |
| 326 | # Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) |
| 327 | # clang version 3.3 (tags/RELEASE_33/final) |
| 328 | # or |
| 329 | # Debian clang version 3.2-7ubuntu1 (tags/RELEASE_32/final) (based on LLVM 3.2) |
| 330 | # Target: x86_64-pc-linux-gnu |
| 331 | # Thread model: posix |
| 332 | COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1` |
| 333 | # Check that this is likely to be clang |
| 334 | $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "clang" > /dev/null |
| 335 | if test $? -ne 0; then |
| 336 | AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.]) |
| 337 | AC_MSG_NOTICE([The result from running with --version was: "$COMPILER_VERSION_OUTPUT"]) |
| 338 | AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.]) |
| 339 | fi |
| 340 | # Collapse compiler output into a single line |
| 341 | COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT` |
| 342 | COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \ |
| 343 | $SED -e 's/^.*clang version \(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'` |
| 344 | else |
| 345 | AC_MSG_ERROR([Unknown toolchain type $TOOLCHAIN_TYPE.]) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 346 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 347 | # This sets CC_VERSION_NUMBER or CXX_VERSION_NUMBER. (This comment is a grep marker) |
| 348 | $1_VERSION_NUMBER="$COMPILER_VERSION_NUMBER" |
| 349 | # This sets CC_VERSION_STRING or CXX_VERSION_STRING. (This comment is a grep marker) |
| 350 | $1_VERSION_STRING="$COMPILER_VERSION_STRING" |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 351 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 352 | AC_MSG_NOTICE([Using $TOOLCHAIN_TYPE $COMPILER_NAME compiler version $COMPILER_VERSION_NUMBER @<:@$COMPILER_VERSION_STRING@:>@]) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 353 | ]) |
| 354 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 355 | # Try to locate the given C or C++ compiler in the path, or otherwise. |
| 356 | # |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 357 | # $1 = compiler to test (CC or CXX) |
| 358 | # $2 = human readable name of compiler (C or C++) |
| 359 | # $3 = list of compiler names to search for |
| 360 | AC_DEFUN([TOOLCHAIN_FIND_COMPILER], |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 361 | [ |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 362 | COMPILER_NAME=$2 |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 363 | SEARCH_LIST="$3" |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 364 | |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 365 | if test "x[$]$1" != x; then |
| 366 | # User has supplied compiler name already, always let that override. |
| 367 | AC_MSG_NOTICE([Will use user supplied compiler $1=[$]$1]) |
| 368 | if test "x`basename [$]$1`" = "x[$]$1"; then |
| 369 | # A command without a complete path is provided, search $PATH. |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 370 | |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 371 | AC_PATH_PROGS(POTENTIAL_$1, [$]$1) |
| 372 | if test "x$POTENTIAL_$1" != x; then |
| 373 | $1=$POTENTIAL_$1 |
| 374 | else |
| 375 | AC_MSG_ERROR([User supplied compiler $1=[$]$1 could not be found]) |
| 376 | fi |
| 377 | else |
| 378 | # Otherwise it might already be a complete path |
| 379 | if test ! -x "[$]$1"; then |
| 380 | AC_MSG_ERROR([User supplied compiler $1=[$]$1 does not exist]) |
| 381 | fi |
| 382 | fi |
| 383 | else |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 384 | # No user supplied value. Locate compiler ourselves. |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 385 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 386 | # If we are cross compiling, assume cross compilation tools follows the |
| 387 | # cross compilation standard where they are prefixed with the autoconf |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 388 | # standard name for the target. For example the binary |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 389 | # i686-sun-solaris2.10-gcc will cross compile for i686-sun-solaris2.10. |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 390 | # If we are not cross compiling, then the default compiler name will be |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 391 | # used. |
| 392 | |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 393 | $1= |
Erik Joelsson | 4cbd014 | 2014-03-28 14:59:56 +0100 | [diff] [blame] | 394 | # If TOOLCHAIN_PATH is set, check for all compiler names in there first |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 395 | # before checking the rest of the PATH. |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 396 | # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION |
| 397 | # step, this should not be necessary. |
Erik Joelsson | 4cbd014 | 2014-03-28 14:59:56 +0100 | [diff] [blame] | 398 | if test -n "$TOOLCHAIN_PATH"; then |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 399 | PATH_save="$PATH" |
Erik Joelsson | 4cbd014 | 2014-03-28 14:59:56 +0100 | [diff] [blame] | 400 | PATH="$TOOLCHAIN_PATH" |
| 401 | AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST) |
| 402 | $1=$TOOLCHAIN_PATH_$1 |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 403 | PATH="$PATH_save" |
| 404 | fi |
| 405 | |
| 406 | # AC_PATH_PROGS can't be run multiple times with the same variable, |
| 407 | # so create a new name for this run. |
| 408 | if test "x[$]$1" = x; then |
| 409 | AC_PATH_PROGS(POTENTIAL_$1, $SEARCH_LIST) |
| 410 | $1=$POTENTIAL_$1 |
| 411 | fi |
| 412 | |
| 413 | if test "x[$]$1" = x; then |
| 414 | HELP_MSG_MISSING_DEPENDENCY([devkit]) |
| 415 | AC_MSG_ERROR([Could not find a $COMPILER_NAME compiler. $HELP_MSG]) |
| 416 | fi |
Erik Joelsson | f5fc8bc | 2012-12-11 11:29:58 +0100 | [diff] [blame] | 417 | fi |
| 418 | |
Magnus Ihse Bursie | 4d64b2e | 2014-01-28 14:47:22 +0100 | [diff] [blame] | 419 | # Now we have a compiler binary in $1. Make sure it's okay. |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 420 | BASIC_FIXUP_EXECUTABLE($1) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 421 | TEST_COMPILER="[$]$1" |
Volker Simonis | 988aff4 | 2013-09-12 12:29:17 -0700 | [diff] [blame] | 422 | # Don't remove symbolic links on AIX because 'xlc_r' and 'xlC_r' may all be links |
| 423 | # to 'xlc' but it is crucial that we invoke the compiler with the right name! |
| 424 | if test "x$OPENJDK_BUILD_OS" != xaix; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 425 | # FIXME: This test should not be needed anymore; we don't do that for any platform. |
Volker Simonis | 988aff4 | 2013-09-12 12:29:17 -0700 | [diff] [blame] | 426 | AC_MSG_CHECKING([resolved symbolic links for $1]) |
| 427 | BASIC_REMOVE_SYMBOLIC_LINKS(TEST_COMPILER) |
| 428 | AC_MSG_RESULT([$TEST_COMPILER]) |
| 429 | fi |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 430 | AC_MSG_CHECKING([if $1 is disguised ccache]) |
Mike Duigou | 22dc46d | 2013-06-04 10:36:00 +0200 | [diff] [blame] | 431 | |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 432 | COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"` |
| 433 | if test "x$COMPILER_BASENAME" = "xccache"; then |
| 434 | AC_MSG_RESULT([yes, trying to find proper $COMPILER_NAME compiler]) |
| 435 | # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache. |
| 436 | # We want to control ccache invocation ourselves, so ignore this cc and try |
| 437 | # searching again. |
| 438 | |
| 439 | # Remove the path to the fake ccache cc from the PATH |
| 440 | RETRY_COMPILER_SAVED_PATH="$PATH" |
| 441 | COMPILER_DIRNAME=`$DIRNAME [$]$1` |
| 442 | PATH="`$ECHO $PATH | $SED -e "s,$COMPILER_DIRNAME,,g" -e "s,::,:,g" -e "s,^:,,g"`" |
| 443 | |
| 444 | # Try again looking for our compiler |
| 445 | AC_CHECK_TOOLS(PROPER_COMPILER_$1, $3) |
| 446 | BASIC_FIXUP_EXECUTABLE(PROPER_COMPILER_$1) |
| 447 | PATH="$RETRY_COMPILER_SAVED_PATH" |
| 448 | |
| 449 | AC_MSG_CHECKING([for resolved symbolic links for $1]) |
| 450 | BASIC_REMOVE_SYMBOLIC_LINKS(PROPER_COMPILER_$1) |
| 451 | AC_MSG_RESULT([$PROPER_COMPILER_$1]) |
| 452 | $1="$PROPER_COMPILER_$1" |
| 453 | else |
| 454 | AC_MSG_RESULT([no, keeping $1]) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 455 | fi |
Mike Duigou | 35219b0 | 2014-01-14 10:25:22 -0800 | [diff] [blame] | 456 | |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 457 | TOOLCHAIN_CHECK_COMPILER_VERSION([$1], [$COMPILER_NAME]) |
| 458 | ]) |
| 459 | |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 460 | # Detect the core components of the toolchain, i.e. the compilers (CC and CXX), |
| 461 | # preprocessor (CPP and CXXCPP), the linker (LD), the assembler (AS) and the |
| 462 | # archiver (AR). Verify that the compilers are correct according to the |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 463 | # toolchain type. |
| 464 | AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE], |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 465 | [ |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 466 | # |
| 467 | # Setup the compilers (CC and CXX) |
| 468 | # |
| 469 | TOOLCHAIN_FIND_COMPILER([CC], [C], $TOOLCHAIN_CC_BINARY) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 470 | # Now that we have resolved CC ourself, let autoconf have its go at it |
| 471 | AC_PROG_CC([$CC]) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 472 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 473 | TOOLCHAIN_FIND_COMPILER([CXX], [C++], $TOOLCHAIN_CXX_BINARY) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 474 | # Now that we have resolved CXX ourself, let autoconf have its go at it |
| 475 | AC_PROG_CXX([$CXX]) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 476 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 477 | # |
| 478 | # Setup the preprocessor (CPP and CXXCPP) |
| 479 | # |
| 480 | AC_PROG_CPP |
| 481 | BASIC_FIXUP_EXECUTABLE(CPP) |
| 482 | AC_PROG_CXXCPP |
| 483 | BASIC_FIXUP_EXECUTABLE(CXXCPP) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 484 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 485 | # |
| 486 | # Setup the linker (LD) |
| 487 | # |
| 488 | if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
| 489 | # In the Microsoft toolchain we have a separate LD command "link". |
| 490 | # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is |
| 491 | # a cygwin program for something completely different. |
| 492 | AC_CHECK_PROG([LD], [link],[link],,, [$CYGWIN_LINK]) |
| 493 | BASIC_FIXUP_EXECUTABLE(LD) |
| 494 | # Verify that we indeed succeeded with this trick. |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 495 | AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker]) |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 496 | "$LD" --version > /dev/null |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 497 | if test $? -eq 0 ; then |
| 498 | AC_MSG_RESULT([no]) |
| 499 | AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.]) |
| 500 | else |
| 501 | AC_MSG_RESULT([yes]) |
| 502 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 503 | LDCXX="$LD" |
| 504 | else |
| 505 | # All other toolchains use the compiler to link. |
| 506 | LD="$CC" |
| 507 | LDCXX="$CXX" |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 508 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 509 | AC_SUBST(LD) |
| 510 | # FIXME: it should be CXXLD, according to standard (cf CXXCPP) |
| 511 | AC_SUBST(LDCXX) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 512 | |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 513 | # |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 514 | # Setup the assembler (AS) |
| 515 | # |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 516 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 517 | # FIXME: should this really be solaris, or solstudio? |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 518 | BASIC_PATH_PROGS(AS, as) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 519 | BASIC_FIXUP_EXECUTABLE(AS) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 520 | else |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 521 | # FIXME: is this correct for microsoft? |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 522 | AS="$CC -c" |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 523 | fi |
| 524 | AC_SUBST(AS) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 525 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 526 | # |
| 527 | # Setup the archiver (AR) |
| 528 | # |
| 529 | if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
| 530 | # The corresponding ar tool is lib.exe (used to create static libraries) |
| 531 | AC_CHECK_PROG([AR], [lib],[lib],,,) |
| 532 | else |
| 533 | BASIC_CHECK_TOOLS(AR, ar) |
| 534 | fi |
| 535 | BASIC_FIXUP_EXECUTABLE(AR) |
| 536 | ]) |
| 537 | |
| 538 | # Setup additional tools that is considered a part of the toolchain, but not the |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 539 | # core part. Many of these are highly platform-specific and do not exist, |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 540 | # and/or are not needed on all platforms. |
| 541 | AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA], |
| 542 | [ |
| 543 | if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
| 544 | AC_PROG_OBJC |
| 545 | BASIC_FIXUP_EXECUTABLE(OBJC) |
| 546 | BASIC_PATH_PROGS(LIPO, lipo) |
| 547 | BASIC_FIXUP_EXECUTABLE(LIPO) |
| 548 | else |
| 549 | OBJC= |
| 550 | fi |
| 551 | |
| 552 | if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
| 553 | AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) |
| 554 | BASIC_FIXUP_EXECUTABLE(MT) |
| 555 | # Setup the resource compiler (RC) |
| 556 | AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) |
| 557 | BASIC_FIXUP_EXECUTABLE(RC) |
| 558 | AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) |
| 559 | BASIC_FIXUP_EXECUTABLE(DUMPBIN) |
Volker Simonis | cdb4a8c | 2014-09-09 17:42:07 +0100 | [diff] [blame] | 560 | # We need to check for 'msbuild.exe' because at the place where we expect to |
| 561 | # find 'msbuild.exe' there's also a directory called 'msbuild' and configure |
| 562 | # won't find the 'msbuild.exe' executable in that case (and the |
| 563 | # 'ac_executable_extensions' is unusable due to performance reasons). |
| 564 | # Notice that we intentionally don't fix up the path to MSBUILD because we |
| 565 | # will call it in a DOS shell during freetype detection on Windows (see |
| 566 | # 'LIB_SETUP_FREETYPE' in "libraries.m4" |
| 567 | AC_CHECK_PROG([MSBUILD], [msbuild.exe], [msbuild.exe],,,) |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 568 | fi |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 569 | |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 570 | if test "x$OPENJDK_TARGET_OS" = xsolaris; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 571 | BASIC_PATH_PROGS(STRIP, strip) |
| 572 | BASIC_FIXUP_EXECUTABLE(STRIP) |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 573 | BASIC_PATH_PROGS(NM, nm) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 574 | BASIC_FIXUP_EXECUTABLE(NM) |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 575 | BASIC_PATH_PROGS(GNM, gnm) |
Erik Joelsson | 2171114 | 2013-04-09 09:42:20 +0200 | [diff] [blame] | 576 | BASIC_FIXUP_EXECUTABLE(GNM) |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 577 | |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 578 | BASIC_PATH_PROGS(MCS, mcs) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 579 | BASIC_FIXUP_EXECUTABLE(MCS) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 580 | elif test "x$OPENJDK_TARGET_OS" != xwindows; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 581 | # FIXME: we should unify this with the solaris case above. |
| 582 | BASIC_CHECK_TOOLS(STRIP, strip) |
| 583 | BASIC_FIXUP_EXECUTABLE(STRIP) |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 584 | BASIC_CHECK_TOOLS(NM, nm) |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 585 | BASIC_FIXUP_EXECUTABLE(NM) |
Erik Joelsson | 2171114 | 2013-04-09 09:42:20 +0200 | [diff] [blame] | 586 | GNM="$NM" |
| 587 | AC_SUBST(GNM) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 588 | fi |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 589 | |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 590 | # objcopy is used for moving debug symbols to separate files when |
| 591 | # full debug symbols are enabled. |
| 592 | if test "x$OPENJDK_TARGET_OS" = xsolaris || test "x$OPENJDK_TARGET_OS" = xlinux; then |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 593 | BASIC_CHECK_TOOLS(OBJCOPY, [gobjcopy objcopy]) |
Erik Joelsson | 4850bec | 2012-11-19 14:06:30 -0800 | [diff] [blame] | 594 | # Only call fixup if objcopy was found. |
| 595 | if test -n "$OBJCOPY"; then |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 596 | BASIC_FIXUP_EXECUTABLE(OBJCOPY) |
Erik Joelsson | 4850bec | 2012-11-19 14:06:30 -0800 | [diff] [blame] | 597 | fi |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 598 | fi |
Kelly O'Hair | f9c6f4b | 2012-10-26 14:29:57 -0700 | [diff] [blame] | 599 | |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 600 | BASIC_CHECK_TOOLS(OBJDUMP, [gobjdump objdump]) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 601 | if test "x$OBJDUMP" != x; then |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 602 | # Only used for compare.sh; we can live without it. BASIC_FIXUP_EXECUTABLE |
| 603 | # bails if argument is missing. |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 604 | BASIC_FIXUP_EXECUTABLE(OBJDUMP) |
| 605 | fi |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 606 | ]) |
| 607 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 608 | # Setup the build tools (i.e, the compiler and linker used to build programs |
| 609 | # that should be run on the build platform, not the target platform, as a build |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 610 | # helper). Since the non-cross-compile case uses the normal, target compilers |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 611 | # for this, we can only do this after these have been setup. |
| 612 | AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS], |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 613 | [ |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 614 | if test "x$COMPILE_TYPE" = "xcross"; then |
| 615 | # Now we need to find a C/C++ compiler that can build executables for the |
| 616 | # build platform. We can't use the AC_PROG_CC macro, since it can only be |
| 617 | # used once. Also, we need to do this without adding a tools dir to the |
| 618 | # path, otherwise we might pick up cross-compilers which don't use standard |
| 619 | # naming. |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 620 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 621 | # FIXME: we should list the discovered compilers as an exclude pattern! |
| 622 | # If we do that, we can do this detection before POST_DETECTION, and still |
| 623 | # find the build compilers in the tools dir, if needed. |
| 624 | BASIC_PATH_PROGS(BUILD_CC, [cl cc gcc]) |
| 625 | BASIC_FIXUP_EXECUTABLE(BUILD_CC) |
| 626 | BASIC_PATH_PROGS(BUILD_CXX, [cl CC g++]) |
| 627 | BASIC_FIXUP_EXECUTABLE(BUILD_CXX) |
| 628 | BASIC_PATH_PROGS(BUILD_LD, ld) |
| 629 | BASIC_FIXUP_EXECUTABLE(BUILD_LD) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 630 | else |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 631 | # If we are not cross compiling, use the normal target compilers for |
| 632 | # building the build platform executables. |
| 633 | BUILD_CC="$CC" |
| 634 | BUILD_CXX="$CXX" |
| 635 | BUILD_LD="$LD" |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 636 | fi |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 637 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 638 | AC_SUBST(BUILD_CC) |
| 639 | AC_SUBST(BUILD_CXX) |
| 640 | AC_SUBST(BUILD_LD) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 641 | ]) |
| 642 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 643 | # Setup legacy variables that are still needed as alternative ways to refer to |
| 644 | # parts of the toolchain. |
| 645 | AC_DEFUN_ONCE([TOOLCHAIN_SETUP_LEGACY], |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 646 | [ |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 647 | if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
| 648 | # For hotspot, we need these in Windows mixed path, |
| 649 | # so rewrite them all. Need added .exe suffix. |
| 650 | HOTSPOT_CXX="$CXX.exe" |
| 651 | HOTSPOT_LD="$LD.exe" |
| 652 | HOTSPOT_MT="$MT.exe" |
| 653 | HOTSPOT_RC="$RC.exe" |
| 654 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_CXX) |
| 655 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_LD) |
| 656 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_MT) |
| 657 | BASIC_WINDOWS_REWRITE_AS_WINDOWS_MIXED_PATH(HOTSPOT_RC) |
| 658 | AC_SUBST(HOTSPOT_MT) |
| 659 | AC_SUBST(HOTSPOT_RC) |
| 660 | else |
| 661 | HOTSPOT_CXX="$CXX" |
| 662 | HOTSPOT_LD="$LD" |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 663 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 664 | AC_SUBST(HOTSPOT_CXX) |
| 665 | AC_SUBST(HOTSPOT_LD) |
Kelly O'Hair | 228c216 | 2012-09-18 11:29:16 -0700 | [diff] [blame] | 666 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 667 | if test "x$TOOLCHAIN_TYPE" = xclang; then |
| 668 | USE_CLANG=true |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 669 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 670 | AC_SUBST(USE_CLANG) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 671 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 672 | # LDEXE is the linker to use, when creating executables. Not really used. |
| 673 | # FIXME: These should just be removed! |
| 674 | LDEXE="$LD" |
| 675 | LDEXECXX="$LDCXX" |
| 676 | AC_SUBST(LDEXE) |
| 677 | AC_SUBST(LDEXECXX) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 678 | ]) |
| 679 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 680 | # Do some additional checks on the detected tools. |
| 681 | AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 682 | [ |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 683 | # The package path is used only on macosx? |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 684 | # FIXME: clean this up, and/or move it elsewhere. |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 685 | PACKAGE_PATH=/opt/local |
| 686 | AC_SUBST(PACKAGE_PATH) |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 687 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 688 | # Check for extra potential brokenness. |
| 689 | if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
| 690 | # On Windows, double-check that we got the right compiler. |
Magnus Ihse Bursie | e7066f3 | 2014-02-25 15:19:32 +0100 | [diff] [blame] | 691 | CC_VERSION_OUTPUT=`$CC 2>&1 | $HEAD -n 1 | $TR -d '\r'` |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 692 | COMPILER_CPU_TEST=`$ECHO $CC_VERSION_OUTPUT | $SED -n "s/^.* \(.*\)$/\1/p"` |
| 693 | if test "x$OPENJDK_TARGET_CPU" = "xx86"; then |
| 694 | if test "x$COMPILER_CPU_TEST" != "x80x86"; then |
| 695 | AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "80x86".]) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 696 | fi |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 697 | elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then |
| 698 | if test "x$COMPILER_CPU_TEST" != "xx64"; then |
| 699 | AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".]) |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 700 | fi |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 701 | fi |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 702 | fi |
Erik Joelsson | 34570ba | 2012-07-05 18:27:07 -0700 | [diff] [blame] | 703 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 704 | if test "x$TOOLCHAIN_TYPE" = xgcc; then |
| 705 | # If this is a --hash-style=gnu system, use --hash-style=both, why? |
| 706 | HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` |
| 707 | # This is later checked when setting flags. |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 708 | |
| 709 | # "-Og" suppported for GCC 4.8 and later |
| 710 | CFLAG_OPTIMIZE_DEBUG_FLAG="-Og" |
| 711 | FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_OPTIMIZE_DEBUG_FLAG], |
| 712 | [HAS_CFLAG_OPTIMIZE_DEBUG=true], |
| 713 | [HAS_CFLAG_OPTIMIZE_DEBUG=false]) |
| 714 | |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 715 | # "-z relro" supported in GNU binutils 2.17 and later |
| 716 | LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro" |
| 717 | FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG], |
| 718 | [HAS_LINKER_RELRO=true], |
| 719 | [HAS_LINKER_RELRO=false]) |
| 720 | |
| 721 | # "-z now" supported in GNU binutils 2.11 and later |
| 722 | LINKER_NOW_FLAG="-Xlinker -z -Xlinker now" |
| 723 | FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG], |
| 724 | [HAS_LINKER_NOW=true], |
| 725 | [HAS_LINKER_NOW=false]) |
Erik Joelsson | e44f5ce | 2013-05-02 15:46:38 +0200 | [diff] [blame] | 726 | fi |
Erik Joelsson | e44f5ce | 2013-05-02 15:46:38 +0200 | [diff] [blame] | 727 | |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 728 | # Check for broken SuSE 'ld' for which 'Only anonymous version tag is allowed |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 729 | # in executable.' |
Volker Simonis | 2304036 | 2013-07-02 17:38:10 -0700 | [diff] [blame] | 730 | USING_BROKEN_SUSE_LD=no |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 731 | if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$TOOLCHAIN_TYPE" = xgcc; then |
Volker Simonis | 2304036 | 2013-07-02 17:38:10 -0700 | [diff] [blame] | 732 | AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables]) |
Mike Duigou | 7b2f1d2 | 2014-06-12 16:33:32 -0700 | [diff] [blame] | 733 | $ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map |
| 734 | $ECHO "int main() { }" > main.c |
Volker Simonis | 2304036 | 2013-07-02 17:38:10 -0700 | [diff] [blame] | 735 | if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then |
| 736 | AC_MSG_RESULT(no) |
| 737 | USING_BROKEN_SUSE_LD=no |
| 738 | else |
| 739 | AC_MSG_RESULT(yes) |
| 740 | USING_BROKEN_SUSE_LD=yes |
| 741 | fi |
Erik Joelsson | 7331f03 | 2014-02-11 10:44:23 +0100 | [diff] [blame] | 742 | rm -rf version-script.map main.c a.out |
Volker Simonis | 2304036 | 2013-07-02 17:38:10 -0700 | [diff] [blame] | 743 | fi |
| 744 | AC_SUBST(USING_BROKEN_SUSE_LD) |
Erik Joelsson | e44f5ce | 2013-05-02 15:46:38 +0200 | [diff] [blame] | 745 | ]) |
Erik Joelsson | e028541 | 2013-05-28 08:50:52 +0200 | [diff] [blame] | 746 | |
Magnus Ihse Bursie | 0bedc5f | 2014-02-24 12:16:58 +0100 | [diff] [blame] | 747 | # Setup the JTReg Regression Test Harness. |
Mike Duigou | 22dc46d | 2013-06-04 10:36:00 +0200 | [diff] [blame] | 748 | AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], |
| 749 | [ |
| 750 | AC_ARG_WITH(jtreg, [AS_HELP_STRING([--with-jtreg], |
Magnus Ihse Bursie | 952d9ce | 2013-10-10 14:58:19 +0200 | [diff] [blame] | 751 | [Regression Test Harness @<:@probed@:>@])], |
| 752 | [], |
| 753 | [with_jtreg=no]) |
Mike Duigou | 22dc46d | 2013-06-04 10:36:00 +0200 | [diff] [blame] | 754 | |
| 755 | if test "x$with_jtreg" = xno; then |
| 756 | # jtreg disabled |
| 757 | AC_MSG_CHECKING([for jtreg]) |
Erik Joelsson | e028541 | 2013-05-28 08:50:52 +0200 | [diff] [blame] | 758 | AC_MSG_RESULT(no) |
Mike Duigou | 22dc46d | 2013-06-04 10:36:00 +0200 | [diff] [blame] | 759 | else |
| 760 | if test "x$with_jtreg" != xyes; then |
| 761 | # with path specified. |
| 762 | JT_HOME="$with_jtreg" |
| 763 | fi |
| 764 | |
| 765 | if test "x$JT_HOME" != x; then |
| 766 | AC_MSG_CHECKING([for jtreg]) |
| 767 | |
| 768 | # use JT_HOME enviroment var. |
| 769 | BASIC_FIXUP_PATH([JT_HOME]) |
| 770 | |
| 771 | # jtreg win32 script works for everybody |
| 772 | JTREGEXE="$JT_HOME/win32/bin/jtreg" |
| 773 | |
| 774 | if test ! -f "$JTREGEXE"; then |
| 775 | AC_MSG_ERROR([JTReg executable does not exist: $JTREGEXE]) |
| 776 | fi |
| 777 | |
| 778 | AC_MSG_RESULT($JTREGEXE) |
| 779 | else |
| 780 | # try to find jtreg on path |
Magnus Ihse Bursie | 57fe89a | 2014-01-29 11:21:54 +0100 | [diff] [blame] | 781 | BASIC_REQUIRE_PROGS(JTREGEXE, jtreg) |
Mike Duigou | 22dc46d | 2013-06-04 10:36:00 +0200 | [diff] [blame] | 782 | JT_HOME="`$DIRNAME $JTREGEXE`" |
| 783 | fi |
| 784 | fi |
| 785 | |
| 786 | AC_SUBST(JT_HOME) |
| 787 | AC_SUBST(JTREGEXE) |
Erik Joelsson | e028541 | 2013-05-28 08:50:52 +0200 | [diff] [blame] | 788 | ]) |