24926 # Store the CFLAGS etal passed to the configure script. |
24926 # Store the CFLAGS etal passed to the configure script. |
24927 ORG_CFLAGS="$CFLAGS" |
24927 ORG_CFLAGS="$CFLAGS" |
24928 ORG_CXXFLAGS="$CXXFLAGS" |
24928 ORG_CXXFLAGS="$CXXFLAGS" |
24929 ORG_OBJCFLAGS="$OBJCFLAGS" |
24929 ORG_OBJCFLAGS="$OBJCFLAGS" |
24930 |
24930 |
24931 # autoconf magic only relies on PATH, so update it if tools dir is specified |
|
24932 OLD_PATH="$PATH" |
|
24933 |
|
24934 # Before we locate the compilers, we need to sanitize the Xcode build environment |
|
24935 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
|
24936 # determine path to Xcode developer directory |
|
24937 # can be empty in which case all the tools will rely on a sane Xcode 4 installation |
|
24938 SET_DEVELOPER_DIR= |
|
24939 |
|
24940 if test -n "$XCODE_PATH"; then |
|
24941 DEVELOPER_DIR="$XCODE_PATH"/Contents/Developer |
|
24942 fi |
|
24943 |
|
24944 # DEVELOPER_DIR could also be provided directly |
|
24945 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining if we need to set DEVELOPER_DIR" >&5 |
|
24946 $as_echo_n "checking Determining if we need to set DEVELOPER_DIR... " >&6; } |
|
24947 if test -n "$DEVELOPER_DIR"; then |
|
24948 if test ! -d "$DEVELOPER_DIR"; then |
|
24949 as_fn_error $? "Xcode Developer path does not exist: $DEVELOPER_DIR, please provide a path to the Xcode 4 application bundle using --with-xcode-path" "$LINENO" 5 |
|
24950 fi |
|
24951 if test ! -f "$DEVELOPER_DIR"/usr/bin/xcodebuild; then |
|
24952 as_fn_error $? "Xcode Developer path is not valid: $DEVELOPER_DIR, it must point to Contents/Developer inside an Xcode application bundle" "$LINENO" 5 |
|
24953 fi |
|
24954 # make it visible to all the tools immediately |
|
24955 export DEVELOPER_DIR |
|
24956 SET_DEVELOPER_DIR="export DEVELOPER_DIR := $DEVELOPER_DIR" |
|
24957 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEVELOPER_DIR)" >&5 |
|
24958 $as_echo "yes ($DEVELOPER_DIR)" >&6; } |
|
24959 else |
|
24960 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
24961 $as_echo "no" >&6; } |
|
24962 fi |
|
24963 |
|
24964 |
|
24965 # Extract the first word of "xcodebuild", so it can be a program name with args. |
|
24966 set dummy xcodebuild; ac_word=$2 |
|
24967 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
|
24968 $as_echo_n "checking for $ac_word... " >&6; } |
|
24969 if ${ac_cv_path_XCODEBUILD+:} false; then : |
|
24970 $as_echo_n "(cached) " >&6 |
|
24971 else |
|
24972 case $XCODEBUILD in |
|
24973 [\\/]* | ?:[\\/]*) |
|
24974 ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. |
|
24975 ;; |
|
24976 *) |
|
24977 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
24978 for as_dir in $PATH |
|
24979 do |
|
24980 IFS=$as_save_IFS |
|
24981 test -z "$as_dir" && as_dir=. |
|
24982 for ac_exec_ext in '' $ac_executable_extensions; do |
|
24983 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
|
24984 ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext" |
|
24985 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
24986 break 2 |
|
24987 fi |
|
24988 done |
|
24989 done |
|
24990 IFS=$as_save_IFS |
|
24991 |
|
24992 ;; |
|
24993 esac |
|
24994 fi |
|
24995 XCODEBUILD=$ac_cv_path_XCODEBUILD |
|
24996 if test -n "$XCODEBUILD"; then |
|
24997 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 |
|
24998 $as_echo "$XCODEBUILD" >&6; } |
|
24999 else |
|
25000 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
25001 $as_echo "no" >&6; } |
|
25002 fi |
|
25003 |
|
25004 |
|
25005 if test -z "$XCODEBUILD"; then |
|
25006 as_fn_error $? "The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X" "$LINENO" 5 |
|
25007 fi |
|
25008 |
|
25009 # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later |
|
25010 XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'` |
|
25011 XC_VERSION_PARTS=( ${XCODE_VERSION//./ } ) |
|
25012 if test ! "${XC_VERSION_PARTS[0]}" = "4"; then |
|
25013 as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5 |
|
25014 fi |
|
25015 |
|
25016 # Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to |
|
25017 # clang and clang++, which will break the build. So handle that here if we need to. |
|
25018 if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then |
|
25019 # use xcrun to find the real gcc and add it's directory to PATH |
|
25020 # then autoconf magic will find it |
|
25021 { $as_echo "$as_me:${as_lineno-$LINENO}: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&5 |
|
25022 $as_echo "$as_me: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&6;} |
|
25023 XCODE_BIN_PATH=$(dirname `xcrun -find gcc`) |
|
25024 PATH="$XCODE_BIN_PATH":$PATH |
|
25025 fi |
|
25026 |
|
25027 # Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools |
|
25028 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining Xcode SDK path" >&5 |
|
25029 $as_echo_n "checking Determining Xcode SDK path... " >&6; } |
|
25030 # allow SDKNAME to be set to override the default SDK selection |
|
25031 SDKPATH=`"$XCODEBUILD" -sdk ${SDKNAME:-macosx} -version | grep '^Path: ' | sed 's/Path: //'` |
|
25032 if test -n "$SDKPATH"; then |
|
25033 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKPATH" >&5 |
|
25034 $as_echo "$SDKPATH" >&6; } |
|
25035 else |
|
25036 { $as_echo "$as_me:${as_lineno-$LINENO}: result: (none, will use system headers and frameworks)" >&5 |
|
25037 $as_echo "(none, will use system headers and frameworks)" >&6; } |
|
25038 fi |
|
25039 |
|
25040 |
|
25041 # Perform a basic sanity test |
|
25042 if test ! -f "$SDKPATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then |
|
25043 as_fn_error $? "Unable to find required framework headers, provide a valid path to Xcode 4 using --with-xcode-path" "$LINENO" 5 |
|
25044 fi |
|
25045 |
|
25046 # if SDKPATH is non-empty then we need to add -isysroot and -iframework for gcc and g++ |
|
25047 if test -n "$SDKPATH"; then |
|
25048 # We need -isysroot <path> and -iframework<path>/System/Library/Frameworks |
|
25049 CFLAGS_JDK="${CFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" |
|
25050 CXXFLAGS_JDK="${CXXFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" |
|
25051 LDFLAGS_JDK="${LDFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" |
|
25052 fi |
|
25053 |
|
25054 # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework |
|
25055 # setting this here means it doesn't have to be peppered throughout the forest |
|
25056 CFLAGS_JDK="$CFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" |
|
25057 CXXFLAGS_JDK="$CXXFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" |
|
25058 LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" |
|
25059 fi |
|
25060 |
|
25061 # For solaris we really need solaris tools, and not the GNU equivalent. |
|
25062 # The build tools on Solaris reside in /usr/ccs (C Compilation System), |
|
25063 # so add that to path before starting to probe. |
|
25064 # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. |
|
25065 if test "x$OPENJDK_BUILD_OS" = xsolaris; then |
|
25066 PATH="/usr/ccs/bin:$PATH" |
|
25067 fi |
|
25068 |
|
25069 # On Windows, we need to detect the visual studio installation first. |
24931 # On Windows, we need to detect the visual studio installation first. |
|
24932 # This will change the PATH, but we need to keep that new PATH even |
|
24933 # after toolchain detection is done, since the compiler (on x86) uses |
|
24934 # it for DLL resolution in runtime. |
25070 if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then |
24935 if test "x$OPENJDK_BUILD_OS" = "xwindows" && test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then |
25071 |
24936 |
25072 # Store path to cygwin link.exe to help excluding it when searching for |
24937 # Store path to cygwin link.exe to help excluding it when searching for |
25073 # VS linker. This must be done before changing the PATH when looking for VS. |
24938 # VS linker. This must be done before changing the PATH when looking for VS. |
25074 # Extract the first word of "link", so it can be a program name with args. |
24939 # Extract the first word of "link", so it can be a program name with args. |
25873 { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5 |
25738 { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5 |
25874 $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;} |
25739 $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;} |
25875 as_fn_error $? "Cannot continue" "$LINENO" 5 |
25740 as_fn_error $? "Cannot continue" "$LINENO" 5 |
25876 fi |
25741 fi |
25877 |
25742 |
|
25743 fi |
|
25744 |
|
25745 # autoconf magic only relies on PATH, so update it if tools dir is specified |
|
25746 OLD_PATH="$PATH" |
|
25747 |
|
25748 # Before we locate the compilers, we need to sanitize the Xcode build environment |
|
25749 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then |
|
25750 # determine path to Xcode developer directory |
|
25751 # can be empty in which case all the tools will rely on a sane Xcode 4 installation |
|
25752 SET_DEVELOPER_DIR= |
|
25753 |
|
25754 if test -n "$XCODE_PATH"; then |
|
25755 DEVELOPER_DIR="$XCODE_PATH"/Contents/Developer |
|
25756 fi |
|
25757 |
|
25758 # DEVELOPER_DIR could also be provided directly |
|
25759 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining if we need to set DEVELOPER_DIR" >&5 |
|
25760 $as_echo_n "checking Determining if we need to set DEVELOPER_DIR... " >&6; } |
|
25761 if test -n "$DEVELOPER_DIR"; then |
|
25762 if test ! -d "$DEVELOPER_DIR"; then |
|
25763 as_fn_error $? "Xcode Developer path does not exist: $DEVELOPER_DIR, please provide a path to the Xcode 4 application bundle using --with-xcode-path" "$LINENO" 5 |
|
25764 fi |
|
25765 if test ! -f "$DEVELOPER_DIR"/usr/bin/xcodebuild; then |
|
25766 as_fn_error $? "Xcode Developer path is not valid: $DEVELOPER_DIR, it must point to Contents/Developer inside an Xcode application bundle" "$LINENO" 5 |
|
25767 fi |
|
25768 # make it visible to all the tools immediately |
|
25769 export DEVELOPER_DIR |
|
25770 SET_DEVELOPER_DIR="export DEVELOPER_DIR := $DEVELOPER_DIR" |
|
25771 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEVELOPER_DIR)" >&5 |
|
25772 $as_echo "yes ($DEVELOPER_DIR)" >&6; } |
|
25773 else |
|
25774 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
25775 $as_echo "no" >&6; } |
|
25776 fi |
|
25777 |
|
25778 |
|
25779 # Extract the first word of "xcodebuild", so it can be a program name with args. |
|
25780 set dummy xcodebuild; ac_word=$2 |
|
25781 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
|
25782 $as_echo_n "checking for $ac_word... " >&6; } |
|
25783 if ${ac_cv_path_XCODEBUILD+:} false; then : |
|
25784 $as_echo_n "(cached) " >&6 |
|
25785 else |
|
25786 case $XCODEBUILD in |
|
25787 [\\/]* | ?:[\\/]*) |
|
25788 ac_cv_path_XCODEBUILD="$XCODEBUILD" # Let the user override the test with a path. |
|
25789 ;; |
|
25790 *) |
|
25791 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR |
|
25792 for as_dir in $PATH |
|
25793 do |
|
25794 IFS=$as_save_IFS |
|
25795 test -z "$as_dir" && as_dir=. |
|
25796 for ac_exec_ext in '' $ac_executable_extensions; do |
|
25797 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
|
25798 ac_cv_path_XCODEBUILD="$as_dir/$ac_word$ac_exec_ext" |
|
25799 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 |
|
25800 break 2 |
|
25801 fi |
|
25802 done |
|
25803 done |
|
25804 IFS=$as_save_IFS |
|
25805 |
|
25806 ;; |
|
25807 esac |
|
25808 fi |
|
25809 XCODEBUILD=$ac_cv_path_XCODEBUILD |
|
25810 if test -n "$XCODEBUILD"; then |
|
25811 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCODEBUILD" >&5 |
|
25812 $as_echo "$XCODEBUILD" >&6; } |
|
25813 else |
|
25814 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 |
|
25815 $as_echo "no" >&6; } |
|
25816 fi |
|
25817 |
|
25818 |
|
25819 if test -z "$XCODEBUILD"; then |
|
25820 as_fn_error $? "The xcodebuild tool was not found, the Xcode command line tools are required to build on Mac OS X" "$LINENO" 5 |
|
25821 fi |
|
25822 |
|
25823 # Fail-fast: verify we're building on Xcode 4, we cannot build with Xcode 5 or later |
|
25824 XCODE_VERSION=`$XCODEBUILD -version | grep '^Xcode ' | sed 's/Xcode //'` |
|
25825 XC_VERSION_PARTS=( ${XCODE_VERSION//./ } ) |
|
25826 if test ! "${XC_VERSION_PARTS[0]}" = "4"; then |
|
25827 as_fn_error $? "Xcode 4 is required to build JDK 8, the version found was $XCODE_VERSION. Use --with-xcode-path to specify the location of Xcode 4 or make Xcode 4 active by using xcode-select." "$LINENO" 5 |
|
25828 fi |
|
25829 |
|
25830 # Some versions of Xcode 5 command line tools install gcc and g++ as symlinks to |
|
25831 # clang and clang++, which will break the build. So handle that here if we need to. |
|
25832 if test -L "/usr/bin/gcc" -o -L "/usr/bin/g++"; then |
|
25833 # use xcrun to find the real gcc and add it's directory to PATH |
|
25834 # then autoconf magic will find it |
|
25835 { $as_echo "$as_me:${as_lineno-$LINENO}: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&5 |
|
25836 $as_echo "$as_me: Found gcc symlinks to clang in /usr/bin, adding path to real gcc to PATH" >&6;} |
|
25837 XCODE_BIN_PATH=$(dirname `xcrun -find gcc`) |
|
25838 PATH="$XCODE_BIN_PATH":$PATH |
|
25839 fi |
|
25840 |
|
25841 # Determine appropriate SDKPATH, don't use SDKROOT as it interferes with the stub tools |
|
25842 { $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining Xcode SDK path" >&5 |
|
25843 $as_echo_n "checking Determining Xcode SDK path... " >&6; } |
|
25844 # allow SDKNAME to be set to override the default SDK selection |
|
25845 SDKPATH=`"$XCODEBUILD" -sdk ${SDKNAME:-macosx} -version | grep '^Path: ' | sed 's/Path: //'` |
|
25846 if test -n "$SDKPATH"; then |
|
25847 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDKPATH" >&5 |
|
25848 $as_echo "$SDKPATH" >&6; } |
|
25849 else |
|
25850 { $as_echo "$as_me:${as_lineno-$LINENO}: result: (none, will use system headers and frameworks)" >&5 |
|
25851 $as_echo "(none, will use system headers and frameworks)" >&6; } |
|
25852 fi |
|
25853 |
|
25854 |
|
25855 # Perform a basic sanity test |
|
25856 if test ! -f "$SDKPATH/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h"; then |
|
25857 as_fn_error $? "Unable to find required framework headers, provide a valid path to Xcode 4 using --with-xcode-path" "$LINENO" 5 |
|
25858 fi |
|
25859 |
|
25860 # if SDKPATH is non-empty then we need to add -isysroot and -iframework for gcc and g++ |
|
25861 if test -n "$SDKPATH"; then |
|
25862 # We need -isysroot <path> and -iframework<path>/System/Library/Frameworks |
|
25863 CFLAGS_JDK="${CFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" |
|
25864 CXXFLAGS_JDK="${CXXFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" |
|
25865 LDFLAGS_JDK="${LDFLAGS_JDK} -isysroot \"$SDKPATH\" -iframework\"$SDKPATH/System/Library/Frameworks\"" |
|
25866 fi |
|
25867 |
|
25868 # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework |
|
25869 # setting this here means it doesn't have to be peppered throughout the forest |
|
25870 CFLAGS_JDK="$CFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" |
|
25871 CXXFLAGS_JDK="$CXXFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" |
|
25872 LDFLAGS_JDK="$LDFLAGS_JDK -F\"$SDKPATH/System/Library/Frameworks/JavaVM.framework/Frameworks\"" |
|
25873 fi |
|
25874 |
|
25875 # For solaris we really need solaris tools, and not the GNU equivalent. |
|
25876 # The build tools on Solaris reside in /usr/ccs (C Compilation System), |
|
25877 # so add that to path before starting to probe. |
|
25878 # FIXME: This was originally only done for AS,NM,GNM,STRIP,MCS,OBJCOPY,OBJDUMP. |
|
25879 if test "x$OPENJDK_BUILD_OS" = xsolaris; then |
|
25880 PATH="/usr/ccs/bin:$PATH" |
25878 fi |
25881 fi |
25879 |
25882 |
25880 # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to |
25883 # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to |
25881 # override all other locations. |
25884 # override all other locations. |
25882 if test "x$TOOLS_DIR" != x; then |
25885 if test "x$TOOLS_DIR" != x; then |