From 6bc5a7b275faa3870a6ba531427c97df51260dff Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Wed, 11 Jan 2017 13:00:05 +0100 Subject: [PATCH] 8171409: Create a smoother configure experience on macosx Reviewed-by: erikj --- common/autoconf/basics.m4 | 4 +- common/autoconf/generated-configure.sh | 404 ++++++++++++++++++++++++- common/autoconf/help.m4 | 17 +- common/autoconf/jdk-options.m4 | 6 +- common/autoconf/lib-freetype.m4 | 6 +- 5 files changed, 420 insertions(+), 17 deletions(-) diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 9d5789e37ca..89b91b0e8e0 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -1011,6 +1011,8 @@ AC_DEFUN([BASIC_CHECK_TAR], # Test which kind of tar was found if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then TAR_TYPE="gnu" + elif test "x$($TAR --version | $GREP "bsdtar")" != "x"; then + TAR_TYPE="bsd" elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then TAR_TYPE="bsd" elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index ad551b650c9..fc3c0cb5aed 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -3564,7 +3564,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Include these first... # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -4122,7 +4122,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -4237,6 +4237,17 @@ yum_help() { esac } +brew_help() { + case $1 in + openjdk) + PKGHANDLER_COMMAND="brew cask install java" ;; + freetype) + PKGHANDLER_COMMAND="brew install freetype" ;; + ccache) + PKGHANDLER_COMMAND="brew install ccache" ;; + esac +} + port_help() { PKGHANDLER_COMMAND="" } @@ -4362,7 +4373,7 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom" # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -4667,7 +4678,7 @@ VALID_JVM_VARIANTS="server client minimal core zero zeroshark custom" # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -5167,7 +5178,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1483542685 +DATE_WHEN_GENERATED=1484135958 ############################################################################### # @@ -17544,7 +17555,7 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval # Must be done before we can call HELP_MSG_MISSING_DEPENDENCY. - for ac_prog in apt-get yum port pkgutil pkgadd + for ac_prog in apt-get yum brew port pkgutil pkgadd do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -21209,6 +21220,8 @@ $as_echo "yes" >&6; } # Test which kind of tar was found if test "x$($TAR --version | $GREP "GNU tar")" != "x"; then TAR_TYPE="gnu" + elif test "x$($TAR --version | $GREP "bsdtar")" != "x"; then + TAR_TYPE="bsd" elif test "x$($TAR -v | $GREP "bsdtar")" != "x"; then TAR_TYPE="bsd" elif test "x$OPENJDK_BUILD_OS" = "xsolaris"; then @@ -24359,15 +24372,13 @@ if test "${enable_keep_packaged_modules+set}" = set; then : fi - if test "x$enable_keep_packaged_modules" = "xyes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if packaged modules are kept" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if packaged modules are kept" >&5 $as_echo_n "checking if packaged modules are kept... " >&6; } + if test "x$enable_keep_packaged_modules" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } JLINK_KEEP_PACKAGED_MODULES=true elif test "x$enable_keep_packaged_modules" = "xno"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if packaged modules are kept" >&5 -$as_echo_n "checking if packaged modules are kept... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } JLINK_KEEP_PACKAGED_MODULES=false @@ -24376,6 +24387,8 @@ $as_echo "no" >&6; } $as_echo "yes (default)" >&6; } JLINK_KEEP_PACKAGED_MODULES=true else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: error" >&5 +$as_echo "error" >&6; } as_fn_error $? "--enable-keep-packaged-modules accepts no argument" "$LINENO" 5 fi @@ -29942,6 +29955,8 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -33235,6 +33250,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -34534,6 +34551,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -48601,6 +48620,8 @@ $as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -48762,6 +48783,8 @@ $as_echo "$as_me: The tested number of bits in the target ($TESTED_TARGET_CPU_BI apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -52844,6 +52867,8 @@ $as_echo "no, missing dependencies" >&6; } apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -56649,6 +56674,8 @@ fi apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -56721,6 +56748,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -56864,6 +56893,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -60683,6 +60714,345 @@ $as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} fi + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + if test -d "$path"; then + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + else + dir="`$DIRNAME "$path"`" + base="`$BASENAME "$path"`" + POTENTIAL_FREETYPE_LIB_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" + fi + fi + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$SYSROOT/usr/local" + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # Let's start with an optimistic view of the world :-) + FOUND_FREETYPE=yes + + # First look for the canonical freetype main include file ft2build.h. + if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # Oh no! Let's try in the freetype2 directory. This is needed at least at Mac OS X Yosemite. + POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH/freetype2" + if ! test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # Fail. + FOUND_FREETYPE=no + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + # Include file found, let's continue the sanity check. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + + # Reset to default value + FREETYPE_BASE_NAME=freetype + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + if test "x$OPENJDK_TARGET_OS" = xmacosx \ + && test -s "$POTENTIAL_FREETYPE_LIB_PATH/${LIBRARY_PREFIX}freetype.6${SHARED_LIBRARY_SUFFIX}"; then + # On Mac OS X Yosemite, the symlink from libfreetype.dylib to libfreetype.6.dylib disappeared. Check + # for the .6 version explicitly. + FREETYPE_BASE_NAME=freetype.6 + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}${FREETYPE_BASE_NAME}${SHARED_LIBRARY_SUFFIX}" + { $as_echo "$as_me:${as_lineno-$LINENO}: Compensating for missing symlink by using version 6 explicitly" >&5 +$as_echo "$as_me: Compensating for missing symlink by using version 6 explicitly" >&6;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/${FREETYPE_BASE_NAME}.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris \ + && test -s "$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR/$FREETYPE_LIB_NAME"; then + # Found lib in isa dir, use that instead. + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH$OPENJDK_TARGET_CPU_ISADIR" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&5 +$as_echo "$as_me: Rewriting to use $POTENTIAL_FREETYPE_LIB_PATH instead" >&6;} + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a unix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + if test -d "$path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + else + dir="`$DIRNAME "$path"`" + base="`$BASENAME "$path"`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$dir"; $THEPWDCMD -L`/$base" + fi + fi + fi + + + # Only process if variable expands to non-empty + + if test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + windows_path="$new_path" if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then unix_path=`$CYGPATH -u "$windows_path"` @@ -62122,6 +62492,8 @@ $as_echo "$FREETYPE_LIB_PATH" >&6; } apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -62477,6 +62849,8 @@ $as_echo "$as_me: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREE apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -62682,6 +63056,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -62870,6 +63246,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -62949,6 +63327,8 @@ $as_echo "$LIBFFI_WORKS" >&6; } apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -64058,6 +64438,8 @@ done apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -64142,6 +64524,8 @@ $as_echo "$LIBELF_WORKS" >&6; } apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4 index 76824e54787..1a313e62236 100644 --- a/common/autoconf/help.m4 +++ b/common/autoconf/help.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], [ - AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) + AC_CHECK_PROGS(PKGHANDLER, apt-get yum brew port pkgutil pkgadd) ]) AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], @@ -46,6 +46,8 @@ AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], apt_help $MISSING_DEPENDENCY ;; yum) yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; port) port_help $MISSING_DEPENDENCY ;; pkgutil) @@ -147,6 +149,17 @@ yum_help() { esac } +brew_help() { + case $1 in + openjdk) + PKGHANDLER_COMMAND="brew cask install java" ;; + freetype) + PKGHANDLER_COMMAND="brew install freetype" ;; + ccache) + PKGHANDLER_COMMAND="brew install ccache" ;; + esac +} + port_help() { PKGHANDLER_COMMAND="" } diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 7b6b1f5fae2..2c21000845b 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -382,18 +382,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS], AC_ARG_ENABLE([keep-packaged-modules], [AS_HELP_STRING([--disable-keep-packaged-modules], [Do not keep packaged modules in jdk image @<:@enable@:>@])]) + AC_MSG_CHECKING([if packaged modules are kept]) if test "x$enable_keep_packaged_modules" = "xyes"; then - AC_MSG_CHECKING([if packaged modules are kept]) AC_MSG_RESULT([yes]) JLINK_KEEP_PACKAGED_MODULES=true elif test "x$enable_keep_packaged_modules" = "xno"; then - AC_MSG_CHECKING([if packaged modules are kept]) AC_MSG_RESULT([no]) JLINK_KEEP_PACKAGED_MODULES=false elif test "x$enable_keep_packaged_modules" = "x"; then AC_MSG_RESULT([yes (default)]) JLINK_KEEP_PACKAGED_MODULES=true else + AC_MSG_RESULT([error]) AC_MSG_ERROR([--enable-keep-packaged-modules accepts no argument]) fi diff --git a/common/autoconf/lib-freetype.m4 b/common/autoconf/lib-freetype.m4 index 99d84a28a7d..e7790caa64b 100644 --- a/common/autoconf/lib-freetype.m4 +++ b/common/autoconf/lib-freetype.m4 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -348,6 +348,10 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], FREETYPE_BASE_DIR="$SYSROOT/usr/X11" LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) fi + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$SYSROOT/usr/local" + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + fi if test "x$OPENJDK_TARGET_OS" = xmacosx; then if test "x$FOUND_FREETYPE" != xyes; then