264 $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
265 done
266
267 exit 0
268 elif test "x$with_toolchain_type" != x; then
269 # User override; check that it is valid
270 if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then
271 AC_MSG_NOTICE([Toolchain type $with_toolchain_type is not valid on this platform.])
272 AC_MSG_NOTICE([Valid toolchains: $VALID_TOOLCHAINS.])
273 AC_MSG_ERROR([Cannot continue.])
274 fi
275 TOOLCHAIN_TYPE=$with_toolchain_type
276 else
277 # No flag given, use default
278 TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN
279 fi
280 AC_SUBST(TOOLCHAIN_TYPE)
281
282 TOOLCHAIN_CC_BINARY_clang="clang"
283 TOOLCHAIN_CC_BINARY_gcc="gcc"
284 TOOLCHAIN_CC_BINARY_microsoft="cl"
285 TOOLCHAIN_CC_BINARY_solstudio="cc"
286 TOOLCHAIN_CC_BINARY_xlc="xlc_r"
287
288 TOOLCHAIN_CXX_BINARY_clang="clang++"
289 TOOLCHAIN_CXX_BINARY_gcc="g++"
290 TOOLCHAIN_CXX_BINARY_microsoft="cl"
291 TOOLCHAIN_CXX_BINARY_solstudio="CC"
292 TOOLCHAIN_CXX_BINARY_xlc="xlC_r"
293
294 # Use indirect variable referencing
295 toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
296 TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
297 toolchain_var_name=TOOLCHAIN_MINIMUM_VERSION_$TOOLCHAIN_TYPE
298 TOOLCHAIN_MINIMUM_VERSION=${!toolchain_var_name}
299 toolchain_var_name=TOOLCHAIN_MINIMUM_LD_VERSION_$TOOLCHAIN_TYPE
300 TOOLCHAIN_MINIMUM_LD_VERSION=${!toolchain_var_name}
301 toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE
302 TOOLCHAIN_CC_BINARY=${!toolchain_var_name}
303 toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE
304 TOOLCHAIN_CXX_BINARY=${!toolchain_var_name}
305
306 TOOLCHAIN_SETUP_FILENAME_PATTERNS
307
308 if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then
309 AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)])
310 else
316 # special setup, e.g. additional paths etc.
317 AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
318 [
319 # FIXME: Is this needed?
320 AC_LANG(C++)
321
322 # Store the CFLAGS etc passed to the configure script.
323 ORG_CFLAGS="$CFLAGS"
324 ORG_CXXFLAGS="$CXXFLAGS"
325
326 # autoconf magic only relies on PATH, so update it if tools dir is specified
327 OLD_PATH="$PATH"
328
329 # On Windows, we need to detect the visual studio installation first.
330 # This will change the PATH, but we need to keep that new PATH even
331 # after toolchain detection is done, since the compiler (on x86) uses
332 # it for DLL resolution in runtime.
333 if test "x$OPENJDK_BUILD_OS" = "xwindows" \
334 && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
335 TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
336 # Reset path to VS_PATH. It will include everything that was on PATH at the time we
337 # ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV.
338 PATH="$VS_PATH"
339 # The microsoft toolchain also requires INCLUDE and LIB to be set.
340 export INCLUDE="$VS_INCLUDE"
341 export LIB="$VS_LIB"
342 else
343 if test "x$XCODE_VERSION_OUTPUT" != x; then
344 # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
345 TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
346 TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION"
347 else
348 # Currently we do not define this for other toolchains. This might change as the need arise.
349 TOOLCHAIN_VERSION=
350 fi
351 fi
352 AC_SUBST(TOOLCHAIN_VERSION)
353
354 # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
355 # override all other locations.
356 if test "x$TOOLCHAIN_PATH" != x; then
357 PATH=$TOOLCHAIN_PATH:$PATH
358 fi
413 # IBM XL C/C++ for AIX, V11.1 (5724-X13)
414 # Version: 11.01.0000.0015
415 COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1`
416 # Check that this is likely to be the IBM XL C compiler.
417 $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null
418 if test $? -ne 0; then
419 ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
420 AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.])
421 AC_MSG_NOTICE([The result from running with -qversion was: "$COMPILER_VERSION_OUTPUT"])
422 AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"])
423 AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
424 fi
425 # Collapse compiler output into a single line
426 COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
427 COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
428 $SED -e 's/^.*, V\(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
429 elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
430 # There is no specific version flag, but all output starts with a version string.
431 # First line typically looks something like:
432 # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
433 COMPILER_VERSION_OUTPUT=`$COMPILER 2>&1 | $HEAD -n 1 | $TR -d '\r'`
434 # Check that this is likely to be Microsoft CL.EXE.
435 $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null
436 if test $? -ne 0; then
437 AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.])
438 AC_MSG_NOTICE([The result from running it was: "$COMPILER_VERSION_OUTPUT"])
439 AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
440 fi
441 # Collapse compiler output into a single line
442 COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
443 COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
444 $SED -e 's/^.*ersion.\(@<:@1-9@:>@@<:@0-9.@:>@*\) .*$/\1/'`
445 elif test "x$TOOLCHAIN_TYPE" = xgcc; then
446 # gcc --version output typically looks like
447 # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
448 # Copyright (C) 2013 Free Software Foundation, Inc.
449 # This is free software; see the source for copying conditions. There is NO
450 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
451 COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
452 # Check that this is likely to be GCC.
453 $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null
681 AC_MSG_WARN([You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration.])
682 ]
683 )
684 fi
685
686 #
687 # Setup the preprocessor (CPP and CXXCPP)
688 #
689 AC_PROG_CPP
690 BASIC_FIXUP_EXECUTABLE(CPP)
691 AC_PROG_CXXCPP
692 BASIC_FIXUP_EXECUTABLE(CXXCPP)
693
694 #
695 # Setup the linker (LD)
696 #
697 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
698 # In the Microsoft toolchain we have a separate LD command "link".
699 # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is
700 # a cygwin program for something completely different.
701 AC_CHECK_PROG([LD], [link],[link],,, [$CYGWIN_LINK])
702 BASIC_FIXUP_EXECUTABLE(LD)
703 # Verify that we indeed succeeded with this trick.
704 AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
705 "$LD" --version > /dev/null
706 if test $? -eq 0 ; then
707 AC_MSG_RESULT([no])
708 AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
709 else
710 AC_MSG_RESULT([yes])
711 fi
712 LDCXX="$LD"
713 else
714 # All other toolchains use the compiler to link.
715 LD="$CC"
716 LDCXX="$CXX"
717 fi
718 AC_SUBST(LD)
719 # FIXME: it should be CXXLD, according to standard (cf CXXCPP)
720 AC_SUBST(LDCXX)
721
733 #
734 # Setup the assembler (AS)
735 #
736 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
737 BASIC_PATH_PROGS(AS, as)
738 BASIC_FIXUP_EXECUTABLE(AS)
739 if test "x$AS" = x; then
740 AC_MSG_ERROR([Solaris assembler (as) is required. Please install via "pkg install pkg:/developer/assembler".])
741 fi
742 else
743 # FIXME: is this correct for microsoft?
744 AS="$CC -c"
745 fi
746 AC_SUBST(AS)
747
748 #
749 # Setup the archiver (AR)
750 #
751 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
752 # The corresponding ar tool is lib.exe (used to create static libraries)
753 AC_CHECK_PROG([AR], [lib],[lib],,,)
754 elif test "x$TOOLCHAIN_TYPE" = xgcc; then
755 BASIC_CHECK_TOOLS(AR, ar gcc-ar)
756 else
757 BASIC_CHECK_TOOLS(AR, ar)
758 fi
759 BASIC_FIXUP_EXECUTABLE(AR)
760 ])
761
762 # Setup additional tools that is considered a part of the toolchain, but not the
763 # core part. Many of these are highly platform-specific and do not exist,
764 # and/or are not needed on all platforms.
765 AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
766 [
767 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
768 BASIC_PATH_PROGS(LIPO, lipo)
769 BASIC_FIXUP_EXECUTABLE(LIPO)
770 BASIC_REQUIRE_PROGS(OTOOL, otool)
771 BASIC_FIXUP_EXECUTABLE(OTOOL)
772 BASIC_REQUIRE_PROGS(INSTALL_NAME_TOOL, install_name_tool)
773 BASIC_FIXUP_EXECUTABLE(INSTALL_NAME_TOOL)
774 fi
775
776 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
777 AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt])
778 BASIC_FIXUP_EXECUTABLE(MT)
779 # Setup the resource compiler (RC)
780 AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc])
781 BASIC_FIXUP_EXECUTABLE(RC)
782 AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
783 BASIC_FIXUP_EXECUTABLE(DUMPBIN)
784 # We need to check for 'msbuild.exe' because at the place where we expect to
785 # find 'msbuild.exe' there's also a directory called 'msbuild' and configure
786 # won't find the 'msbuild.exe' executable in that case (and the
787 # 'ac_executable_extensions' is unusable due to performance reasons).
788 # Notice that we intentionally don't fix up the path to MSBUILD because we
789 # will call it in a DOS shell during freetype detection on Windows (see
790 # 'LIB_SETUP_FREETYPE' in "libraries.m4"
791 AC_CHECK_PROG([MSBUILD], [msbuild.exe], [msbuild.exe],,,)
792 fi
793
794 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
795 BASIC_PATH_PROGS(STRIP, strip)
796 BASIC_FIXUP_EXECUTABLE(STRIP)
797 BASIC_PATH_PROGS(NM, nm)
798 BASIC_FIXUP_EXECUTABLE(NM)
799 BASIC_PATH_PROGS(GNM, gnm)
800 BASIC_FIXUP_EXECUTABLE(GNM)
801 elif test "x$OPENJDK_TARGET_OS" != xwindows; then
802 # FIXME: we should unify this with the solaris case above.
|
264 $PRINTF " %-10s %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
265 done
266
267 exit 0
268 elif test "x$with_toolchain_type" != x; then
269 # User override; check that it is valid
270 if test "x${VALID_TOOLCHAINS/$with_toolchain_type/}" = "x${VALID_TOOLCHAINS}"; then
271 AC_MSG_NOTICE([Toolchain type $with_toolchain_type is not valid on this platform.])
272 AC_MSG_NOTICE([Valid toolchains: $VALID_TOOLCHAINS.])
273 AC_MSG_ERROR([Cannot continue.])
274 fi
275 TOOLCHAIN_TYPE=$with_toolchain_type
276 else
277 # No flag given, use default
278 TOOLCHAIN_TYPE=$DEFAULT_TOOLCHAIN
279 fi
280 AC_SUBST(TOOLCHAIN_TYPE)
281
282 TOOLCHAIN_CC_BINARY_clang="clang"
283 TOOLCHAIN_CC_BINARY_gcc="gcc"
284 TOOLCHAIN_CC_BINARY_microsoft="cl$EXECUTABLE_SUFFIX"
285 TOOLCHAIN_CC_BINARY_solstudio="cc"
286 TOOLCHAIN_CC_BINARY_xlc="xlc_r"
287
288 TOOLCHAIN_CXX_BINARY_clang="clang++"
289 TOOLCHAIN_CXX_BINARY_gcc="g++"
290 TOOLCHAIN_CXX_BINARY_microsoft="cl$EXECUTABLE_SUFFIX"
291 TOOLCHAIN_CXX_BINARY_solstudio="CC"
292 TOOLCHAIN_CXX_BINARY_xlc="xlC_r"
293
294 # Use indirect variable referencing
295 toolchain_var_name=TOOLCHAIN_DESCRIPTION_$TOOLCHAIN_TYPE
296 TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
297 toolchain_var_name=TOOLCHAIN_MINIMUM_VERSION_$TOOLCHAIN_TYPE
298 TOOLCHAIN_MINIMUM_VERSION=${!toolchain_var_name}
299 toolchain_var_name=TOOLCHAIN_MINIMUM_LD_VERSION_$TOOLCHAIN_TYPE
300 TOOLCHAIN_MINIMUM_LD_VERSION=${!toolchain_var_name}
301 toolchain_var_name=TOOLCHAIN_CC_BINARY_$TOOLCHAIN_TYPE
302 TOOLCHAIN_CC_BINARY=${!toolchain_var_name}
303 toolchain_var_name=TOOLCHAIN_CXX_BINARY_$TOOLCHAIN_TYPE
304 TOOLCHAIN_CXX_BINARY=${!toolchain_var_name}
305
306 TOOLCHAIN_SETUP_FILENAME_PATTERNS
307
308 if test "x$TOOLCHAIN_TYPE" = "x$DEFAULT_TOOLCHAIN"; then
309 AC_MSG_NOTICE([Using default toolchain $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)])
310 else
316 # special setup, e.g. additional paths etc.
317 AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
318 [
319 # FIXME: Is this needed?
320 AC_LANG(C++)
321
322 # Store the CFLAGS etc passed to the configure script.
323 ORG_CFLAGS="$CFLAGS"
324 ORG_CXXFLAGS="$CXXFLAGS"
325
326 # autoconf magic only relies on PATH, so update it if tools dir is specified
327 OLD_PATH="$PATH"
328
329 # On Windows, we need to detect the visual studio installation first.
330 # This will change the PATH, but we need to keep that new PATH even
331 # after toolchain detection is done, since the compiler (on x86) uses
332 # it for DLL resolution in runtime.
333 if test "x$OPENJDK_BUILD_OS" = "xwindows" \
334 && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
335 TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV
336 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl"; then
337 # Append VS_PATH
338 BASIC_APPEND_TO_PATH(PATH, $VS_PATH)
339 BASIC_APPEND_TO_PATH(WSLENV, "PATH/l:LIB:INCLUDE")
340 export WSLENV
341 else
342 # Reset path to VS_PATH. It will include everything that was on PATH at the time we
343 # ran TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV.
344 BASIC_APPEND_TO_PATH(PATH, $VS_PATH)
345 AC_MSG_NOTICE(PATH $PATH)
346 fi
347 # The microsoft toolchain also requires INCLUDE and LIB to be set.
348 export INCLUDE="$VS_INCLUDE"
349 export LIB="$VS_LIB"
350 else
351 if test "x$XCODE_VERSION_OUTPUT" != x; then
352 # For Xcode, we set the Xcode version as TOOLCHAIN_VERSION
353 TOOLCHAIN_VERSION=`$ECHO $XCODE_VERSION_OUTPUT | $CUT -f 2 -d ' '`
354 TOOLCHAIN_DESCRIPTION="$TOOLCHAIN_DESCRIPTION from Xcode $TOOLCHAIN_VERSION"
355 else
356 # Currently we do not define this for other toolchains. This might change as the need arise.
357 TOOLCHAIN_VERSION=
358 fi
359 fi
360 AC_SUBST(TOOLCHAIN_VERSION)
361
362 # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
363 # override all other locations.
364 if test "x$TOOLCHAIN_PATH" != x; then
365 PATH=$TOOLCHAIN_PATH:$PATH
366 fi
421 # IBM XL C/C++ for AIX, V11.1 (5724-X13)
422 # Version: 11.01.0000.0015
423 COMPILER_VERSION_OUTPUT=`$COMPILER -qversion 2>&1`
424 # Check that this is likely to be the IBM XL C compiler.
425 $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "IBM XL C" > /dev/null
426 if test $? -ne 0; then
427 ALT_VERSION_OUTPUT=`$COMPILER --version 2>&1`
428 AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.])
429 AC_MSG_NOTICE([The result from running with -qversion was: "$COMPILER_VERSION_OUTPUT"])
430 AC_MSG_NOTICE([The result from running with --version was: "$ALT_VERSION_OUTPUT"])
431 AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
432 fi
433 # Collapse compiler output into a single line
434 COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
435 COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
436 $SED -e 's/^.*, V\(@<:@1-9@:>@@<:@0-9.@:>@*\).*$/\1/'`
437 elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
438 # There is no specific version flag, but all output starts with a version string.
439 # First line typically looks something like:
440 # Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
441 COMPILER_VERSION_OUTPUT=`"$COMPILER" 2>&1 | $HEAD -n 1 | $TR -d '\r'`
442 # Check that this is likely to be Microsoft CL.EXE.
443 $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Microsoft.*Compiler" > /dev/null
444 if test $? -ne 0; then
445 AC_MSG_NOTICE([The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required $TOOLCHAIN_TYPE compiler.])
446 AC_MSG_NOTICE([The result from running it was: "$COMPILER_VERSION_OUTPUT"])
447 AC_MSG_ERROR([A $TOOLCHAIN_TYPE compiler is required. Try setting --with-tools-dir.])
448 fi
449 # Collapse compiler output into a single line
450 COMPILER_VERSION_STRING=`$ECHO $COMPILER_VERSION_OUTPUT`
451 COMPILER_VERSION_NUMBER=`$ECHO $COMPILER_VERSION_OUTPUT | \
452 $SED -e 's/^.*ersion.\(@<:@1-9@:>@@<:@0-9.@:>@*\) .*$/\1/'`
453 elif test "x$TOOLCHAIN_TYPE" = xgcc; then
454 # gcc --version output typically looks like
455 # gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
456 # Copyright (C) 2013 Free Software Foundation, Inc.
457 # This is free software; see the source for copying conditions. There is NO
458 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
459 COMPILER_VERSION_OUTPUT=`$COMPILER --version 2>&1`
460 # Check that this is likely to be GCC.
461 $ECHO "$COMPILER_VERSION_OUTPUT" | $GREP "Free Software Foundation" > /dev/null
689 AC_MSG_WARN([You are using $TOOLCHAIN_TYPE older than $TOOLCHAIN_MINIMUM_VERSION. This is not a supported configuration.])
690 ]
691 )
692 fi
693
694 #
695 # Setup the preprocessor (CPP and CXXCPP)
696 #
697 AC_PROG_CPP
698 BASIC_FIXUP_EXECUTABLE(CPP)
699 AC_PROG_CXXCPP
700 BASIC_FIXUP_EXECUTABLE(CXXCPP)
701
702 #
703 # Setup the linker (LD)
704 #
705 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
706 # In the Microsoft toolchain we have a separate LD command "link".
707 # Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is
708 # a cygwin program for something completely different.
709 AC_CHECK_PROG([LD], [link.exe],[link.exe],,, [$CYGWIN_LINK])
710 BASIC_FIXUP_EXECUTABLE(LD)
711 # Verify that we indeed succeeded with this trick.
712 AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
713 "$LD" --version > /dev/null
714 if test $? -eq 0 ; then
715 AC_MSG_RESULT([no])
716 AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
717 else
718 AC_MSG_RESULT([yes])
719 fi
720 LDCXX="$LD"
721 else
722 # All other toolchains use the compiler to link.
723 LD="$CC"
724 LDCXX="$CXX"
725 fi
726 AC_SUBST(LD)
727 # FIXME: it should be CXXLD, according to standard (cf CXXCPP)
728 AC_SUBST(LDCXX)
729
741 #
742 # Setup the assembler (AS)
743 #
744 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
745 BASIC_PATH_PROGS(AS, as)
746 BASIC_FIXUP_EXECUTABLE(AS)
747 if test "x$AS" = x; then
748 AC_MSG_ERROR([Solaris assembler (as) is required. Please install via "pkg install pkg:/developer/assembler".])
749 fi
750 else
751 # FIXME: is this correct for microsoft?
752 AS="$CC -c"
753 fi
754 AC_SUBST(AS)
755
756 #
757 # Setup the archiver (AR)
758 #
759 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
760 # The corresponding ar tool is lib.exe (used to create static libraries)
761 AC_CHECK_PROG([AR], [lib.exe],[lib.exe],,,)
762 elif test "x$TOOLCHAIN_TYPE" = xgcc; then
763 BASIC_CHECK_TOOLS(AR, ar gcc-ar)
764 else
765 BASIC_CHECK_TOOLS(AR, ar)
766 fi
767 BASIC_FIXUP_EXECUTABLE(AR)
768 ])
769
770 # Setup additional tools that is considered a part of the toolchain, but not the
771 # core part. Many of these are highly platform-specific and do not exist,
772 # and/or are not needed on all platforms.
773 AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
774 [
775 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
776 BASIC_PATH_PROGS(LIPO, lipo)
777 BASIC_FIXUP_EXECUTABLE(LIPO)
778 BASIC_REQUIRE_PROGS(OTOOL, otool)
779 BASIC_FIXUP_EXECUTABLE(OTOOL)
780 BASIC_REQUIRE_PROGS(INSTALL_NAME_TOOL, install_name_tool)
781 BASIC_FIXUP_EXECUTABLE(INSTALL_NAME_TOOL)
782 fi
783
784 if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
785 AC_CHECK_PROG([MT], [mt.exe], [mt.exe],,, [/usr/bin/mt])
786 BASIC_FIXUP_EXECUTABLE(MT)
787 # Setup the resource compiler (RC)
788 AC_CHECK_PROG([RC], [rc.exe], [rc.exe],,, [/usr/bin/rc])
789 BASIC_FIXUP_EXECUTABLE(RC)
790 AC_CHECK_PROG([DUMPBIN], [dumpbin.exe], [dumpbin.exe],,,)
791 BASIC_FIXUP_EXECUTABLE(DUMPBIN)
792 # We need to check for 'msbuild.exe' because at the place where we expect to
793 # find 'msbuild.exe' there's also a directory called 'msbuild' and configure
794 # won't find the 'msbuild.exe' executable in that case (and the
795 # 'ac_executable_extensions' is unusable due to performance reasons).
796 # Notice that we intentionally don't fix up the path to MSBUILD because we
797 # will call it in a DOS shell during freetype detection on Windows (see
798 # 'LIB_SETUP_FREETYPE' in "libraries.m4"
799 AC_CHECK_PROG([MSBUILD], [msbuild.exe], [msbuild.exe],,,)
800 fi
801
802 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
803 BASIC_PATH_PROGS(STRIP, strip)
804 BASIC_FIXUP_EXECUTABLE(STRIP)
805 BASIC_PATH_PROGS(NM, nm)
806 BASIC_FIXUP_EXECUTABLE(NM)
807 BASIC_PATH_PROGS(GNM, gnm)
808 BASIC_FIXUP_EXECUTABLE(GNM)
809 elif test "x$OPENJDK_TARGET_OS" != xwindows; then
810 # FIXME: we should unify this with the solaris case above.
|