common/autoconf/generated-configure.sh

changeset 2215
7a73b8b4ac8a
parent 2214
fda76d0c4b84
child 2216
0c4c976612d3
     1.1 --- a/common/autoconf/generated-configure.sh	Thu Apr 12 02:54:38 2018 -0700
     1.2 +++ b/common/autoconf/generated-configure.sh	Mon Apr 16 00:48:00 2018 -0700
     1.3 @@ -661,7 +661,6 @@
     1.4  FREETYPE_LIBS
     1.5  FREETYPE_CFLAGS
     1.6  CUPS_CFLAGS
     1.7 -OPENWIN_HOME
     1.8  X_EXTRA_LIBS
     1.9  X_LIBS
    1.10  X_PRE_LIBS
    1.11 @@ -707,6 +706,8 @@
    1.12  SHARED_LIBRARY_FLAGS
    1.13  CXX_FLAG_REORDER
    1.14  C_FLAG_REORDER
    1.15 +SYSROOT_LDFLAGS
    1.16 +SYSROOT_CFLAGS
    1.17  RC_FLAGS
    1.18  AR_OUT_OPTION
    1.19  LD_OUT_OPTION
    1.20 @@ -762,7 +763,7 @@
    1.21  CXX
    1.22  ac_ct_PROPER_COMPILER_CXX
    1.23  PROPER_COMPILER_CXX
    1.24 -TOOLS_DIR_CXX
    1.25 +TOOLCHAIN_PATH_CXX
    1.26  POTENTIAL_CXX
    1.27  OBJEXT
    1.28  EXEEXT
    1.29 @@ -773,7 +774,7 @@
    1.30  CC
    1.31  ac_ct_PROPER_COMPILER_CC
    1.32  PROPER_COMPILER_CC
    1.33 -TOOLS_DIR_CC
    1.34 +TOOLCHAIN_PATH_CC
    1.35  POTENTIAL_CC
    1.36  SDKPATH
    1.37  XCODEBUILD
    1.38 @@ -886,7 +887,6 @@
    1.39  BUILD_LOG_WRAPPER
    1.40  BUILD_LOG_PREVIOUS
    1.41  BUILD_LOG
    1.42 -SYS_ROOT
    1.43  TOPDIR
    1.44  PATH_SEP
    1.45  ZERO_ARCHDEF
    1.46 @@ -1021,16 +1021,19 @@
    1.47  enable_option_checking
    1.48  with_custom_make_dir
    1.49  with_target_bits
    1.50 -with_sys_root
    1.51 -with_tools_dir
    1.52 -with_xcode_path
    1.53 -with_devkit
    1.54  enable_openjdk_only
    1.55  with_jdk_variant
    1.56  with_jvm_interpreter
    1.57  with_jvm_variants
    1.58  enable_debug
    1.59  with_debug_level
    1.60 +with_devkit
    1.61 +with_sys_root
    1.62 +with_sysroot
    1.63 +with_tools_dir
    1.64 +with_toolchain_path
    1.65 +with_extra_path
    1.66 +with_xcode_path
    1.67  with_conf_name
    1.68  with_builddeps_conf
    1.69  with_builddeps_server
    1.70 @@ -1837,14 +1840,6 @@
    1.71    --with-custom-make-dir  use this directory for custom build/make files
    1.72    --with-target-bits      build 32-bit or 64-bit binaries (for platforms that
    1.73                            support it), e.g. --with-target-bits=32 [guessed]
    1.74 -  --with-sys-root         pass this sys-root to the compilers and tools (for
    1.75 -                          cross-compiling)
    1.76 -  --with-tools-dir        search this directory for compilers and tools (for
    1.77 -                          cross-compiling)
    1.78 -  --with-xcode-path       explicit path to Xcode 4 (generally for building on
    1.79 -                          10.9 and later)
    1.80 -  --with-devkit           use this directory as base for tools-dir and
    1.81 -                          sys-root (for cross-compiling)
    1.82    --with-jdk-variant      JDK variant to build (normal) [normal]
    1.83    --with-jvm-interpreter  JVM interpreter to build (template, cpp) [template]
    1.84    --with-jvm-variants     JVM variants (separated by commas) to build (server,
    1.85 @@ -1852,6 +1847,16 @@
    1.86                            [server]
    1.87    --with-debug-level      set the debug level (release, fastdebug, slowdebug)
    1.88                            [release]
    1.89 +  --with-devkit           use this devkit for compilers, tools and resources
    1.90 +  --with-sys-root         alias for --with-sysroot for backwards compatability
    1.91 +  --with-sysroot          use this directory as sysroot)
    1.92 +  --with-tools-dir        alias for --with-toolchain-path for backwards
    1.93 +                          compatibility
    1.94 +  --with-toolchain-path   prepend these directories when searching for
    1.95 +                          toolchain binaries (compilers etc)
    1.96 +  --with-extra-path       prepend these directories to the default path
    1.97 +  --with-xcode-path       explicit path to Xcode 4 (generally for building on
    1.98 +                          10.9 and later)
    1.99    --with-conf-name        use this as the name of the configuration [generated
   1.100                            from important configuration options]
   1.101    --with-builddeps-conf   use this configuration file for the builddeps
   1.102 @@ -3303,6 +3308,9 @@
   1.103  # Appends a string to a path variable, only adding the : when needed.
   1.104  
   1.105  
   1.106 +# Prepends a string to a path variable, only adding the : when needed.
   1.107 +
   1.108 +
   1.109  # This will make sure the given variable points to a full and proper
   1.110  # path. This means:
   1.111  # 1) There will be no spaces in the path. On posix platforms,
   1.112 @@ -3385,6 +3393,8 @@
   1.113  
   1.114  
   1.115  
   1.116 +
   1.117 +
   1.118  #%%% Simple tools %%%
   1.119  
   1.120  # Check if we have found a usable version of make
   1.121 @@ -4225,7 +4235,7 @@
   1.122  #CUSTOM_AUTOCONF_INCLUDE
   1.123  
   1.124  # Do not change or remove the following line, it is needed for consistency checks:
   1.125 -DATE_WHEN_GENERATED=1523526861
   1.126 +DATE_WHEN_GENERATED=1523864865
   1.127  
   1.128  ###############################################################################
   1.129  #
   1.130 @@ -14257,189 +14267,6 @@
   1.131    # Locate the directory of this script.
   1.132    AUTOCONF_DIR=$TOPDIR/common/autoconf
   1.133  
   1.134 -  if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   1.135 -    # Add extra search paths on solaris for utilities like ar and as etc...
   1.136 -    PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
   1.137 -  fi
   1.138 -
   1.139 -  # You can force the sys-root if the sys-root encoded into the cross compiler tools
   1.140 -  # is not correct.
   1.141 -
   1.142 -# Check whether --with-sys-root was given.
   1.143 -if test "${with_sys_root+set}" = set; then :
   1.144 -  withval=$with_sys_root;
   1.145 -fi
   1.146 -
   1.147 -
   1.148 -  if test "x$with_sys_root" != x; then
   1.149 -    SYS_ROOT=$with_sys_root
   1.150 -  else
   1.151 -    SYS_ROOT=/
   1.152 -  fi
   1.153 -
   1.154 -
   1.155 -
   1.156 -# Check whether --with-tools-dir was given.
   1.157 -if test "${with_tools_dir+set}" = set; then :
   1.158 -  withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir
   1.159 -
   1.160 -fi
   1.161 -
   1.162 -
   1.163 -  # Xcode version will be validated later
   1.164 -
   1.165 -# Check whether --with-xcode-path was given.
   1.166 -if test "${with_xcode_path+set}" = set; then :
   1.167 -  withval=$with_xcode_path; XCODE_PATH=$with_xcode_path
   1.168 -
   1.169 -fi
   1.170 -
   1.171 -
   1.172 -
   1.173 -# Check whether --with-devkit was given.
   1.174 -if test "${with_devkit+set}" = set; then :
   1.175 -  withval=$with_devkit;
   1.176 -        if test "x$with_sys_root" != x; then
   1.177 -          as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5
   1.178 -        fi
   1.179 -
   1.180 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.181 -
   1.182 -  # Input might be given as Windows format, start by converting to
   1.183 -  # unix format.
   1.184 -  path="$with_devkit"
   1.185 -  new_path=`$CYGPATH -u "$path"`
   1.186 -
   1.187 -  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   1.188 -  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.189 -  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.190 -  # "foo.exe" is OK but "foo" is an error.
   1.191 -  #
   1.192 -  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   1.193 -  # It is also a way to make sure we got the proper file name for the real test later on.
   1.194 -  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.195 -  if test "x$test_shortpath" = x; then
   1.196 -    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
   1.197 -$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
   1.198 -    as_fn_error $? "Cannot locate the the path of with_devkit" "$LINENO" 5
   1.199 -  fi
   1.200 -
   1.201 -  # Call helper function which possibly converts this using DOS-style short mode.
   1.202 -  # If so, the updated path is stored in $new_path.
   1.203 -
   1.204 -  input_path="$new_path"
   1.205 -  # Check if we need to convert this using DOS-style short mode. If the path
   1.206 -  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.207 -  # take no chances and rewrite it.
   1.208 -  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.209 -  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   1.210 -  if test "x$has_forbidden_chars" != x; then
   1.211 -    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.212 -    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   1.213 -    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   1.214 -    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   1.215 -      # Going to short mode and back again did indeed matter. Since short mode is
   1.216 -      # case insensitive, let's make it lowercase to improve readability.
   1.217 -      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.218 -      # Now convert it back to Unix-stile (cygpath)
   1.219 -      input_path=`$CYGPATH -u "$shortmode_path"`
   1.220 -      new_path="$input_path"
   1.221 -    fi
   1.222 -  fi
   1.223 -
   1.224 -  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   1.225 -  if test "x$test_cygdrive_prefix" = x; then
   1.226 -    # As a simple fix, exclude /usr/bin since it's not a real path.
   1.227 -    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   1.228 -      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   1.229 -      # a path prefixed by /cygdrive for fixpath to work.
   1.230 -      new_path="$CYGWIN_ROOT_PATH$input_path"
   1.231 -    fi
   1.232 -  fi
   1.233 -
   1.234 -
   1.235 -  if test "x$path" != "x$new_path"; then
   1.236 -    with_devkit="$new_path"
   1.237 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5
   1.238 -$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   1.239 -  fi
   1.240 -
   1.241 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.242 -
   1.243 -  path="$with_devkit"
   1.244 -  has_colon=`$ECHO $path | $GREP ^.:`
   1.245 -  new_path="$path"
   1.246 -  if test "x$has_colon" = x; then
   1.247 -    # Not in mixed or Windows style, start by that.
   1.248 -    new_path=`cmd //c echo $path`
   1.249 -  fi
   1.250 -
   1.251 -
   1.252 -  input_path="$new_path"
   1.253 -  # Check if we need to convert this using DOS-style short mode. If the path
   1.254 -  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.255 -  # take no chances and rewrite it.
   1.256 -  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.257 -  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   1.258 -  if test "x$has_forbidden_chars" != x; then
   1.259 -    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.260 -    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.261 -  fi
   1.262 -
   1.263 -
   1.264 -  windows_path="$new_path"
   1.265 -  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.266 -    unix_path=`$CYGPATH -u "$windows_path"`
   1.267 -    new_path="$unix_path"
   1.268 -  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.269 -    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.270 -    new_path="$unix_path"
   1.271 -  fi
   1.272 -
   1.273 -  if test "x$path" != "x$new_path"; then
   1.274 -    with_devkit="$new_path"
   1.275 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5
   1.276 -$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   1.277 -  fi
   1.278 -
   1.279 -  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.280 -  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   1.281 -
   1.282 -  else
   1.283 -    # We're on a posix platform. Hooray! :)
   1.284 -    path="$with_devkit"
   1.285 -    has_space=`$ECHO "$path" | $GREP " "`
   1.286 -    if test "x$has_space" != x; then
   1.287 -      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
   1.288 -$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
   1.289 -      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   1.290 -    fi
   1.291 -
   1.292 -    # Use eval to expand a potential ~
   1.293 -    eval path="$path"
   1.294 -    if test ! -f "$path" && test ! -d "$path"; then
   1.295 -      as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5
   1.296 -    fi
   1.297 -
   1.298 -    with_devkit="`cd "$path"; $THEPWDCMD -L`"
   1.299 -  fi
   1.300 -
   1.301 -
   1.302 -  if test "x$TOOLS_DIR" = x; then
   1.303 -    TOOLS_DIR="$with_devkit/bin"
   1.304 -  else
   1.305 -    TOOLS_DIR="$TOOLS_DIR:$with_devkit/bin"
   1.306 -  fi
   1.307 -
   1.308 -        if test -d "$with_devkit/$host_alias/libc"; then
   1.309 -          SYS_ROOT=$with_devkit/$host_alias/libc
   1.310 -        elif test -d "$with_devkit/$host/sys-root"; then
   1.311 -          SYS_ROOT=$with_devkit/$host/sys-root
   1.312 -        fi
   1.313 -
   1.314 -fi
   1.315 -
   1.316 -
   1.317  
   1.318    # Setup default logging of stdout and stderr to build.log in the output root.
   1.319    BUILD_LOG='$(OUTPUT_ROOT)/build.log'
   1.320 @@ -14793,6 +14620,300 @@
   1.321  # With basic setup done, call the custom early hook.
   1.322  
   1.323  
   1.324 +# Check if we have devkits, extra paths or sysroot set.
   1.325 +
   1.326 +
   1.327 +# Check whether --with-devkit was given.
   1.328 +if test "${with_devkit+set}" = set; then :
   1.329 +  withval=$with_devkit;
   1.330 +
   1.331 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.332 +
   1.333 +  # Input might be given as Windows format, start by converting to
   1.334 +  # unix format.
   1.335 +  path="$with_devkit"
   1.336 +  new_path=`$CYGPATH -u "$path"`
   1.337 +
   1.338 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
   1.339 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
   1.340 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
   1.341 +  # "foo.exe" is OK but "foo" is an error.
   1.342 +  #
   1.343 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
   1.344 +  # It is also a way to make sure we got the proper file name for the real test later on.
   1.345 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
   1.346 +  if test "x$test_shortpath" = x; then
   1.347 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
   1.348 +$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
   1.349 +    as_fn_error $? "Cannot locate the the path of with_devkit" "$LINENO" 5
   1.350 +  fi
   1.351 +
   1.352 +  # Call helper function which possibly converts this using DOS-style short mode.
   1.353 +  # If so, the updated path is stored in $new_path.
   1.354 +
   1.355 +  input_path="$new_path"
   1.356 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.357 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.358 +  # take no chances and rewrite it.
   1.359 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.360 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
   1.361 +  if test "x$has_forbidden_chars" != x; then
   1.362 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.363 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
   1.364 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
   1.365 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
   1.366 +      # Going to short mode and back again did indeed matter. Since short mode is
   1.367 +      # case insensitive, let's make it lowercase to improve readability.
   1.368 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.369 +      # Now convert it back to Unix-stile (cygpath)
   1.370 +      input_path=`$CYGPATH -u "$shortmode_path"`
   1.371 +      new_path="$input_path"
   1.372 +    fi
   1.373 +  fi
   1.374 +
   1.375 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
   1.376 +  if test "x$test_cygdrive_prefix" = x; then
   1.377 +    # As a simple fix, exclude /usr/bin since it's not a real path.
   1.378 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
   1.379 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
   1.380 +      # a path prefixed by /cygdrive for fixpath to work.
   1.381 +      new_path="$CYGWIN_ROOT_PATH$input_path"
   1.382 +    fi
   1.383 +  fi
   1.384 +
   1.385 +
   1.386 +  if test "x$path" != "x$new_path"; then
   1.387 +    with_devkit="$new_path"
   1.388 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5
   1.389 +$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   1.390 +  fi
   1.391 +
   1.392 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.393 +
   1.394 +  path="$with_devkit"
   1.395 +  has_colon=`$ECHO $path | $GREP ^.:`
   1.396 +  new_path="$path"
   1.397 +  if test "x$has_colon" = x; then
   1.398 +    # Not in mixed or Windows style, start by that.
   1.399 +    new_path=`cmd //c echo $path`
   1.400 +  fi
   1.401 +
   1.402 +
   1.403 +  input_path="$new_path"
   1.404 +  # Check if we need to convert this using DOS-style short mode. If the path
   1.405 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
   1.406 +  # take no chances and rewrite it.
   1.407 +  # Note: m4 eats our [], so we need to use [ and ] instead.
   1.408 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
   1.409 +  if test "x$has_forbidden_chars" != x; then
   1.410 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
   1.411 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
   1.412 +  fi
   1.413 +
   1.414 +
   1.415 +  windows_path="$new_path"
   1.416 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
   1.417 +    unix_path=`$CYGPATH -u "$windows_path"`
   1.418 +    new_path="$unix_path"
   1.419 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
   1.420 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
   1.421 +    new_path="$unix_path"
   1.422 +  fi
   1.423 +
   1.424 +  if test "x$path" != "x$new_path"; then
   1.425 +    with_devkit="$new_path"
   1.426 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_devkit to \"$new_path\"" >&5
   1.427 +$as_echo "$as_me: Rewriting with_devkit to \"$new_path\"" >&6;}
   1.428 +  fi
   1.429 +
   1.430 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
   1.431 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
   1.432 +
   1.433 +  else
   1.434 +    # We're on a posix platform. Hooray! :)
   1.435 +    path="$with_devkit"
   1.436 +    has_space=`$ECHO "$path" | $GREP " "`
   1.437 +    if test "x$has_space" != x; then
   1.438 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_devkit, which resolves as \"$path\", is invalid." >&5
   1.439 +$as_echo "$as_me: The path of with_devkit, which resolves as \"$path\", is invalid." >&6;}
   1.440 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
   1.441 +    fi
   1.442 +
   1.443 +    # Use eval to expand a potential ~
   1.444 +    eval path="$path"
   1.445 +    if test ! -f "$path" && test ! -d "$path"; then
   1.446 +      as_fn_error $? "The path of with_devkit, which resolves as \"$path\", is not found." "$LINENO" 5
   1.447 +    fi
   1.448 +
   1.449 +    with_devkit="`cd "$path"; $THEPWDCMD -L`"
   1.450 +  fi
   1.451 +
   1.452 +        DEVKIT_ROOT="$with_devkit"
   1.453 +        # Check for a meta data info file in the root of the devkit
   1.454 +        if test -f "$DEVKIT_ROOT/devkit.info"; then
   1.455 +          # This potentially sets the following:
   1.456 +          # DEVKIT_NAME: A descriptive name of the devkit
   1.457 +          # DEVKIT_TOOLCHAIN_PATH: Corresponds to --with-toolchain-path
   1.458 +          # DEVKIT_EXTRA_PATH: Corresponds to --with-extra-path
   1.459 +          # DEVKIT_SYSROOT: Corresponds to --with-sysroot
   1.460 +          . $DEVKIT_ROOT/devkit.info
   1.461 +        fi
   1.462 +
   1.463 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for devkit" >&5
   1.464 +$as_echo_n "checking for devkit... " >&6; }
   1.465 +        if test "x$DEVKIT_NAME" != x; then
   1.466 +          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_NAME in $DEVKIT_ROOT" >&5
   1.467 +$as_echo "$DEVKIT_NAME in $DEVKIT_ROOT" >&6; }
   1.468 +        else
   1.469 +          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEVKIT_ROOT" >&5
   1.470 +$as_echo "$DEVKIT_ROOT" >&6; }
   1.471 +        fi
   1.472 +
   1.473 +        if test "x$DEVKIT_EXTRA_PATH" != x; then
   1.474 +
   1.475 +  if test "x$DEVKIT_EXTRA_PATH" != x; then
   1.476 +    if test "x$EXTRA_PATH" = x; then
   1.477 +      EXTRA_PATH="$DEVKIT_EXTRA_PATH"
   1.478 +    else
   1.479 +      EXTRA_PATH="$DEVKIT_EXTRA_PATH:$EXTRA_PATH"
   1.480 +    fi
   1.481 +  fi
   1.482 +
   1.483 +        fi
   1.484 +
   1.485 +        # Fallback default of just /bin if DEVKIT_PATH is not defined
   1.486 +        if test "x$DEVKIT_TOOLCHAIN_PATH" = x; then
   1.487 +          DEVKIT_TOOLCHAIN_PATH="$DEVKIT_ROOT/bin"
   1.488 +        fi
   1.489 +
   1.490 +  if test "x$DEVKIT_TOOLCHAIN_PATH" != x; then
   1.491 +    if test "x$TOOLCHAIN_PATH" = x; then
   1.492 +      TOOLCHAIN_PATH="$DEVKIT_TOOLCHAIN_PATH"
   1.493 +    else
   1.494 +      TOOLCHAIN_PATH="$DEVKIT_TOOLCHAIN_PATH:$TOOLCHAIN_PATH"
   1.495 +    fi
   1.496 +  fi
   1.497 +
   1.498 +
   1.499 +        # If DEVKIT_SYSROOT is set, use that, otherwise try a couple of known
   1.500 +        # places for backwards compatiblity.
   1.501 +        if test "x$DEVKIT_SYSROOT" != x; then
   1.502 +          SYSROOT="$DEVKIT_SYSROOT"
   1.503 +        elif test -d "$DEVKIT_ROOT/$host_alias/libc"; then
   1.504 +          SYSROOT="$DEVKIT_ROOT/$host_alias/libc"
   1.505 +        elif test -d "$DEVKIT_ROOT/$host/sys-root"; then
   1.506 +          SYSROOT="$DEVKIT_ROOT/$host/sys-root"
   1.507 +        fi
   1.508 +
   1.509 +
   1.510 +fi
   1.511 +
   1.512 +
   1.513 +  # You can force the sysroot if the sysroot encoded into the compiler tools
   1.514 +  # is not correct.
   1.515 +
   1.516 +# Check whether --with-sys-root was given.
   1.517 +if test "${with_sys_root+set}" = set; then :
   1.518 +  withval=$with_sys_root; SYSROOT=$with_sys_root
   1.519 +
   1.520 +fi
   1.521 +
   1.522 +
   1.523 +
   1.524 +# Check whether --with-sysroot was given.
   1.525 +if test "${with_sysroot+set}" = set; then :
   1.526 +  withval=$with_sysroot; SYSROOT=$with_sysroot
   1.527 +
   1.528 +fi
   1.529 +
   1.530 +
   1.531 +
   1.532 +# Check whether --with-tools-dir was given.
   1.533 +if test "${with_tools_dir+set}" = set; then :
   1.534 +  withval=$with_tools_dir;
   1.535 +  if test "x$with_tools_dir" != x; then
   1.536 +    if test "x$TOOLCHAIN_PATH" = x; then
   1.537 +      TOOLCHAIN_PATH="$with_tools_dir"
   1.538 +    else
   1.539 +      TOOLCHAIN_PATH="$with_tools_dir:$TOOLCHAIN_PATH"
   1.540 +    fi
   1.541 +  fi
   1.542 +
   1.543 +
   1.544 +fi
   1.545 +
   1.546 +
   1.547 +
   1.548 +# Check whether --with-toolchain-path was given.
   1.549 +if test "${with_toolchain_path+set}" = set; then :
   1.550 +  withval=$with_toolchain_path;
   1.551 +  if test "x$with_toolchain_path" != x; then
   1.552 +    if test "x$TOOLCHAIN_PATH" = x; then
   1.553 +      TOOLCHAIN_PATH="$with_toolchain_path"
   1.554 +    else
   1.555 +      TOOLCHAIN_PATH="$with_toolchain_path:$TOOLCHAIN_PATH"
   1.556 +    fi
   1.557 +  fi
   1.558 +
   1.559 +
   1.560 +fi
   1.561 +
   1.562 +
   1.563 +
   1.564 +# Check whether --with-extra-path was given.
   1.565 +if test "${with_extra_path+set}" = set; then :
   1.566 +  withval=$with_extra_path;
   1.567 +  if test "x$with_extra_path" != x; then
   1.568 +    if test "x$EXTRA_PATH" = x; then
   1.569 +      EXTRA_PATH="$with_extra_path"
   1.570 +    else
   1.571 +      EXTRA_PATH="$with_extra_path:$EXTRA_PATH"
   1.572 +    fi
   1.573 +  fi
   1.574 +
   1.575 +
   1.576 +fi
   1.577 +
   1.578 +
   1.579 +  # Prepend the extra path to the global path
   1.580 +
   1.581 +  if test "x$EXTRA_PATH" != x; then
   1.582 +    if test "x$PATH" = x; then
   1.583 +      PATH="$EXTRA_PATH"
   1.584 +    else
   1.585 +      PATH="$EXTRA_PATH:$PATH"
   1.586 +    fi
   1.587 +  fi
   1.588 +
   1.589 +
   1.590 +  if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
   1.591 +    # Add extra search paths on solaris for utilities like ar and as etc...
   1.592 +    PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
   1.593 +  fi
   1.594 +
   1.595 +  # Xcode version will be validated later
   1.596 +
   1.597 +# Check whether --with-xcode-path was given.
   1.598 +if test "${with_xcode_path+set}" = set; then :
   1.599 +  withval=$with_xcode_path; XCODE_PATH=$with_xcode_path
   1.600 +
   1.601 +fi
   1.602 +
   1.603 +
   1.604 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
   1.605 +$as_echo_n "checking for sysroot... " >&6; }
   1.606 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSROOT" >&5
   1.607 +$as_echo "$SYSROOT" >&6; }
   1.608 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for toolchain path" >&5
   1.609 +$as_echo_n "checking for toolchain path... " >&6; }
   1.610 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLCHAIN_PATH" >&5
   1.611 +$as_echo "$TOOLCHAIN_PATH" >&6; }
   1.612 +  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra path" >&5
   1.613 +$as_echo_n "checking for extra path... " >&6; }
   1.614 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXTRA_PATH" >&5
   1.615 +$as_echo "$EXTRA_PATH" >&6; }
   1.616 +
   1.617 +
   1.618  # To properly create a configuration name, we need to have the OpenJDK target
   1.619  # and options (variants and debug level) parsed.
   1.620  
   1.621 @@ -16100,10 +16221,10 @@
   1.622      fi
   1.623  
   1.624      if test "x$FOUND_MAKE" = x; then
   1.625 -      if test "x$TOOLS_DIR" != x; then
   1.626 -        # We have a tools-dir, check that as well before giving up.
   1.627 +      if test "x$TOOLCHAIN_PATH" != x; then
   1.628 +        # We have a toolchain path, check that as well before giving up.
   1.629          OLD_PATH=$PATH
   1.630 -        PATH=$TOOLS_DIR:$PATH
   1.631 +        PATH=$TOOLCHAIN_PATH:$PATH
   1.632          for ac_prog in gmake
   1.633  do
   1.634    # Extract the first word of "$ac_prog", so it can be a program name with args.
   1.635 @@ -25923,169 +26044,11 @@
   1.636      PATH="/usr/ccs/bin:$PATH"
   1.637    fi
   1.638  
   1.639 -  # Finally add TOOLS_DIR at the beginning, to allow --with-tools-dir to
   1.640 +  # Finally add TOOLCHAIN_PATH at the beginning, to allow --with-tools-dir to
   1.641    # override all other locations.
   1.642 -  if test "x$TOOLS_DIR" != x; then
   1.643 -    PATH=$TOOLS_DIR:$PATH
   1.644 -  fi
   1.645 -
   1.646 -  # If a devkit is found on the builddeps server, then prepend its path to the
   1.647 -  # PATH variable. If there are cross compilers available in the devkit, these
   1.648 -  # will be found by AC_PROG_CC et al.
   1.649 -  DEVKIT=
   1.650 -
   1.651 -
   1.652 -  if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
   1.653 -    # Source the builddeps file again, to make sure it uses the latest variables!
   1.654 -    . $builddepsfile
   1.655 -    # Look for a target and build machine specific resource!
   1.656 -    eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}}
   1.657 -    if test "x$resource" = x; then
   1.658 -      # Ok, lets instead look for a target specific resource
   1.659 -      eval resource=\${builddep_devkit_TARGET_${rewritten_target_var}}
   1.660 -    fi
   1.661 -    if test "x$resource" = x; then
   1.662 -      # Ok, lets instead look for a build specific resource
   1.663 -      eval resource=\${builddep_devkit_BUILD_${rewritten_build_var}}
   1.664 -    fi
   1.665 -    if test "x$resource" = x; then
   1.666 -      # Ok, lets instead look for a generic resource
   1.667 -      # (The devkit comes from M4 and not the shell, thus no need for eval here.)
   1.668 -      resource=${builddep_devkit}
   1.669 -    fi
   1.670 -    if test "x$resource" != x; then
   1.671 -      { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for devkit" >&5
   1.672 -$as_echo "$as_me: Using builddeps $resource for devkit" >&6;}
   1.673 -      # If the resource in the builddeps.conf file is an existing directory,
   1.674 -      # for example /java/linux/cups
   1.675 -      if test -d ${resource}; then
   1.676 -        depdir=${resource}
   1.677 -      else
   1.678 -
   1.679 -  # devkit is for example mymodule
   1.680 -  # $resource is for example libs/general/libmymod_1_2_3.zip
   1.681 -  # $with_builddeps_server is for example ftp://mybuilddeps.myserver.com/builddeps
   1.682 -  # $with_builddeps_dir is for example /localhome/builddeps
   1.683 -  # depdir is the name of the variable into which we store the depdir, eg MYMOD
   1.684 -  # Will download ftp://mybuilddeps.myserver.com/builddeps/libs/general/libmymod_1_2_3.zip and
   1.685 -  # unzip into the directory: /localhome/builddeps/libmymod_1_2_3
   1.686 -  filename=`basename $resource`
   1.687 -  filebase=`echo $filename | sed 's/\.[^\.]*$//'`
   1.688 -  filebase=${filename%%.*}
   1.689 -  extension=${filename#*.}
   1.690 -  installdir=$with_builddeps_dir/$filebase
   1.691 -  if test ! -f $installdir/$filename.unpacked; then
   1.692 -    { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5
   1.693 -$as_echo "$as_me: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&6;}
   1.694 -    if test ! -d $installdir; then
   1.695 -      mkdir -p $installdir
   1.696 -    fi
   1.697 -    if test ! -d $installdir; then
   1.698 -      as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
   1.699 -    fi
   1.700 -    tmpfile=`mktemp $installdir/devkit.XXXXXXXXX`
   1.701 -    touch $tmpfile
   1.702 -    if test ! -f $tmpfile; then
   1.703 -      as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
   1.704 -    fi
   1.705 -
   1.706 -  # $with_builddeps_server/$resource  is the ftp://abuilddeps.server.com/libs/cups.zip
   1.707 -  # $tmpfile is the local file name for the downloaded file.
   1.708 -  VALID_TOOL=no
   1.709 -  if test "x$BDEPS_FTP" = xwget; then
   1.710 -    VALID_TOOL=yes
   1.711 -    wget -O $tmpfile $with_builddeps_server/$resource
   1.712 -  fi
   1.713 -  if test "x$BDEPS_FTP" = xlftp; then
   1.714 -    VALID_TOOL=yes
   1.715 -    lftp -c "get $with_builddeps_server/$resource  -o $tmpfile"
   1.716 -  fi
   1.717 -  if test "x$BDEPS_FTP" = xftp; then
   1.718 -    VALID_TOOL=yes
   1.719 -    FTPSERVER=`echo $with_builddeps_server/$resource  | cut -f 3 -d '/'`
   1.720 -    FTPPATH=`echo $with_builddeps_server/$resource  | cut -f 4- -d '/'`
   1.721 -    FTPUSERPWD=${FTPSERVER%%@*}
   1.722 -    if test "x$FTPSERVER" != "x$FTPUSERPWD"; then
   1.723 -      FTPUSER=${userpwd%%:*}
   1.724 -      FTPPWD=${userpwd#*@}
   1.725 -      FTPSERVER=${FTPSERVER#*@}
   1.726 -    else
   1.727 -      FTPUSER=ftp
   1.728 -      FTPPWD=ftp
   1.729 -    fi
   1.730 -    # the "pass" command does not work on some
   1.731 -    # ftp clients (read ftp.exe) but if it works,
   1.732 -    # passive mode is better!
   1.733 -    ( \
   1.734 -        echo "user $FTPUSER $FTPPWD"        ; \
   1.735 -        echo "pass"                         ; \
   1.736 -        echo "bin"                          ; \
   1.737 -        echo "get $FTPPATH $tmpfile"              ; \
   1.738 -    ) | ftp -in $FTPSERVER
   1.739 -  fi
   1.740 -  if test "x$VALID_TOOL" != xyes; then
   1.741 -    as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5
   1.742 -  fi
   1.743 -
   1.744 -    mv $tmpfile $installdir/$filename
   1.745 -    if test ! -s $installdir/$filename; then
   1.746 -      as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5
   1.747 -    fi
   1.748 -    case "$extension" in
   1.749 -      zip)  echo "Unzipping $installdir/$filename..."
   1.750 -        (cd $installdir ; rm -f $installdir/$filename.unpacked ; $BDEPS_UNZIP $installdir/$filename > /dev/null && touch $installdir/$filename.unpacked)
   1.751 -        ;;
   1.752 -      tar.gz) echo "Untaring $installdir/$filename..."
   1.753 -        (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
   1.754 -        ;;
   1.755 -      tgz) echo "Untaring $installdir/$filename..."
   1.756 -        (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
   1.757 -        ;;
   1.758 -      *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5
   1.759 -        ;;
   1.760 -    esac
   1.761 -  fi
   1.762 -  if test -f $installdir/$filename.unpacked; then
   1.763 -    depdir=$installdir
   1.764 -  fi
   1.765 -
   1.766 -      fi
   1.767 -      # Source the builddeps file again, because in the previous command, the depdir
   1.768 -      # was updated to point at the current build dependency install directory.
   1.769 -      . $builddepsfile
   1.770 -      # Now extract variables from the builddeps.conf files.
   1.771 -      theroot=${builddep_devkit_ROOT}
   1.772 -      thecflags=${builddep_devkit_CFLAGS}
   1.773 -      thelibs=${builddep_devkit_LIBS}
   1.774 -      if test "x$depdir" = x; then
   1.775 -        as_fn_error $? "Could not download build dependency devkit" "$LINENO" 5
   1.776 -      fi
   1.777 -      DEVKIT=$depdir
   1.778 -      if test "x$theroot" != x; then
   1.779 -        DEVKIT="$theroot"
   1.780 -      fi
   1.781 -      if test "x$thecflags" != x; then
   1.782 -        DEVKIT_CFLAGS="$thecflags"
   1.783 -      fi
   1.784 -      if test "x$thelibs" != x; then
   1.785 -        DEVKIT_LIBS="$thelibs"
   1.786 -      fi
   1.787 -
   1.788 -        # Found devkit
   1.789 -        PATH="$DEVKIT/bin:$PATH"
   1.790 -        SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root"
   1.791 -        if test "x$x_includes" = "xNONE"; then
   1.792 -          x_includes="$SYS_ROOT/usr/include/X11"
   1.793 -        fi
   1.794 -        if test "x$x_libraries" = "xNONE"; then
   1.795 -          x_libraries="$SYS_ROOT/usr/lib"
   1.796 -        fi
   1.797 -
   1.798 -
   1.799 -    fi
   1.800 -
   1.801 -  fi
   1.802 -
   1.803 +  if test "x$TOOLCHAIN_PATH" != x; then
   1.804 +    PATH=$TOOLCHAIN_PATH:$PATH
   1.805 +  fi
   1.806  
   1.807  
   1.808    #
   1.809 @@ -26169,59 +26132,59 @@
   1.810      # used.
   1.811  
   1.812      CC=
   1.813 -    # If TOOLS_DIR is set, check for all compiler names in there first
   1.814 +    # If TOOLCHAIN_PATH is set, check for all compiler names in there first
   1.815      # before checking the rest of the PATH.
   1.816      # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION
   1.817      # step, this should not be necessary.
   1.818 -    if test -n "$TOOLS_DIR"; then
   1.819 +    if test -n "$TOOLCHAIN_PATH"; then
   1.820        PATH_save="$PATH"
   1.821 -      PATH="$TOOLS_DIR"
   1.822 -      for ac_prog in $TOOLCHAIN_CC_BINARY
   1.823 -do
   1.824 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
   1.825 -set dummy $ac_prog; ac_word=$2
   1.826 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   1.827 -$as_echo_n "checking for $ac_word... " >&6; }
   1.828 -if ${ac_cv_path_TOOLS_DIR_CC+:} false; then :
   1.829 -  $as_echo_n "(cached) " >&6
   1.830 -else
   1.831 -  case $TOOLS_DIR_CC in
   1.832 -  [\\/]* | ?:[\\/]*)
   1.833 -  ac_cv_path_TOOLS_DIR_CC="$TOOLS_DIR_CC" # Let the user override the test with a path.
   1.834 -  ;;
   1.835 -  *)
   1.836 -  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1.837 -for as_dir in $PATH
   1.838 -do
   1.839 -  IFS=$as_save_IFS
   1.840 -  test -z "$as_dir" && as_dir=.
   1.841 -    for ac_exec_ext in '' $ac_executable_extensions; do
   1.842 -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
   1.843 -    ac_cv_path_TOOLS_DIR_CC="$as_dir/$ac_word$ac_exec_ext"
   1.844 -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   1.845 -    break 2
   1.846 -  fi
   1.847 -done
   1.848 -  done
   1.849 -IFS=$as_save_IFS
   1.850 -
   1.851 -  ;;
   1.852 -esac
   1.853 -fi
   1.854 -TOOLS_DIR_CC=$ac_cv_path_TOOLS_DIR_CC
   1.855 -if test -n "$TOOLS_DIR_CC"; then
   1.856 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CC" >&5
   1.857 -$as_echo "$TOOLS_DIR_CC" >&6; }
   1.858 -else
   1.859 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   1.860 -$as_echo "no" >&6; }
   1.861 -fi
   1.862 -
   1.863 -
   1.864 -  test -n "$TOOLS_DIR_CC" && break
   1.865 -done
   1.866 -
   1.867 -      CC=$TOOLS_DIR_CC
   1.868 +      PATH="$TOOLCHAIN_PATH"
   1.869 +      for ac_prog in $SEARCH_LIST
   1.870 +do
   1.871 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
   1.872 +set dummy $ac_prog; ac_word=$2
   1.873 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   1.874 +$as_echo_n "checking for $ac_word... " >&6; }
   1.875 +if ${ac_cv_path_TOOLCHAIN_PATH_CC+:} false; then :
   1.876 +  $as_echo_n "(cached) " >&6
   1.877 +else
   1.878 +  case $TOOLCHAIN_PATH_CC in
   1.879 +  [\\/]* | ?:[\\/]*)
   1.880 +  ac_cv_path_TOOLCHAIN_PATH_CC="$TOOLCHAIN_PATH_CC" # Let the user override the test with a path.
   1.881 +  ;;
   1.882 +  *)
   1.883 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1.884 +for as_dir in $PATH
   1.885 +do
   1.886 +  IFS=$as_save_IFS
   1.887 +  test -z "$as_dir" && as_dir=.
   1.888 +    for ac_exec_ext in '' $ac_executable_extensions; do
   1.889 +  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
   1.890 +    ac_cv_path_TOOLCHAIN_PATH_CC="$as_dir/$ac_word$ac_exec_ext"
   1.891 +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   1.892 +    break 2
   1.893 +  fi
   1.894 +done
   1.895 +  done
   1.896 +IFS=$as_save_IFS
   1.897 +
   1.898 +  ;;
   1.899 +esac
   1.900 +fi
   1.901 +TOOLCHAIN_PATH_CC=$ac_cv_path_TOOLCHAIN_PATH_CC
   1.902 +if test -n "$TOOLCHAIN_PATH_CC"; then
   1.903 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLCHAIN_PATH_CC" >&5
   1.904 +$as_echo "$TOOLCHAIN_PATH_CC" >&6; }
   1.905 +else
   1.906 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   1.907 +$as_echo "no" >&6; }
   1.908 +fi
   1.909 +
   1.910 +
   1.911 +  test -n "$TOOLCHAIN_PATH_CC" && break
   1.912 +done
   1.913 +
   1.914 +      CC=$TOOLCHAIN_PATH_CC
   1.915        PATH="$PATH_save"
   1.916      fi
   1.917  
   1.918 @@ -27877,59 +27840,59 @@
   1.919      # used.
   1.920  
   1.921      CXX=
   1.922 -    # If TOOLS_DIR is set, check for all compiler names in there first
   1.923 +    # If TOOLCHAIN_PATH is set, check for all compiler names in there first
   1.924      # before checking the rest of the PATH.
   1.925      # FIXME: Now that we prefix the TOOLS_DIR to the PATH in the PRE_DETECTION
   1.926      # step, this should not be necessary.
   1.927 -    if test -n "$TOOLS_DIR"; then
   1.928 +    if test -n "$TOOLCHAIN_PATH"; then
   1.929        PATH_save="$PATH"
   1.930 -      PATH="$TOOLS_DIR"
   1.931 -      for ac_prog in $TOOLCHAIN_CXX_BINARY
   1.932 -do
   1.933 -  # Extract the first word of "$ac_prog", so it can be a program name with args.
   1.934 -set dummy $ac_prog; ac_word=$2
   1.935 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   1.936 -$as_echo_n "checking for $ac_word... " >&6; }
   1.937 -if ${ac_cv_path_TOOLS_DIR_CXX+:} false; then :
   1.938 -  $as_echo_n "(cached) " >&6
   1.939 -else
   1.940 -  case $TOOLS_DIR_CXX in
   1.941 -  [\\/]* | ?:[\\/]*)
   1.942 -  ac_cv_path_TOOLS_DIR_CXX="$TOOLS_DIR_CXX" # Let the user override the test with a path.
   1.943 -  ;;
   1.944 -  *)
   1.945 -  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1.946 -for as_dir in $PATH
   1.947 -do
   1.948 -  IFS=$as_save_IFS
   1.949 -  test -z "$as_dir" && as_dir=.
   1.950 -    for ac_exec_ext in '' $ac_executable_extensions; do
   1.951 -  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
   1.952 -    ac_cv_path_TOOLS_DIR_CXX="$as_dir/$ac_word$ac_exec_ext"
   1.953 -    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
   1.954 -    break 2
   1.955 -  fi
   1.956 -done
   1.957 -  done
   1.958 -IFS=$as_save_IFS
   1.959 -
   1.960 -  ;;
   1.961 -esac
   1.962 -fi
   1.963 -TOOLS_DIR_CXX=$ac_cv_path_TOOLS_DIR_CXX
   1.964 -if test -n "$TOOLS_DIR_CXX"; then
   1.965 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLS_DIR_CXX" >&5
   1.966 -$as_echo "$TOOLS_DIR_CXX" >&6; }
   1.967 -else
   1.968 -  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
   1.969 -$as_echo "no" >&6; }
   1.970 -fi
   1.971 -
   1.972 -
   1.973 -  test -n "$TOOLS_DIR_CXX" && break
   1.974 -done
   1.975 -
   1.976 -      CXX=$TOOLS_DIR_CXX
   1.977 +      PATH="$TOOLCHAIN_PATH"
   1.978 +      for ac_prog in $SEARCH_LIST
   1.979 +do
   1.980 +  # Extract the first word of "$ac_prog", so it can be a program name with args.
   1.981 +set dummy $ac_prog; ac_word=$2
   1.982 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
   1.983 +$as_echo_n "checking for $ac_word... " >&6; }
   1.984 +if ${ac_cv_path_TOOLCHAIN_PATH_CXX+:} false; then :
   1.985 +  $as_echo_n "(cached) " >&6
   1.986 +else
   1.987 +  case $TOOLCHAIN_PATH_CXX in
   1.988 +  [\\/]* | ?:[\\/]*)
   1.989 +  ac_cv_path_TOOLCHAIN_PATH_CXX="$TOOLCHAIN_PATH_CXX" # Let the user override the test with a path.
   1.990 +  ;;
   1.991 +  *)
   1.992 +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
   1.993 +for as_dir in $PATH
   1.994 +do
   1.995 +  IFS=$as_save_IFS
   1.996 +  test -z "$as_dir" && as_dir=.
   1.997 +    for ac_exec_ext in '' $ac_executable_extensions; do
   1.998 +  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
   1.999 +    ac_cv_path_TOOLCHAIN_PATH_CXX="$as_dir/$ac_word$ac_exec_ext"
  1.1000 +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
  1.1001 +    break 2
  1.1002 +  fi
  1.1003 +done
  1.1004 +  done
  1.1005 +IFS=$as_save_IFS
  1.1006 +
  1.1007 +  ;;
  1.1008 +esac
  1.1009 +fi
  1.1010 +TOOLCHAIN_PATH_CXX=$ac_cv_path_TOOLCHAIN_PATH_CXX
  1.1011 +if test -n "$TOOLCHAIN_PATH_CXX"; then
  1.1012 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOOLCHAIN_PATH_CXX" >&5
  1.1013 +$as_echo "$TOOLCHAIN_PATH_CXX" >&6; }
  1.1014 +else
  1.1015 +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  1.1016 +$as_echo "no" >&6; }
  1.1017 +fi
  1.1018 +
  1.1019 +
  1.1020 +  test -n "$TOOLCHAIN_PATH_CXX" && break
  1.1021 +done
  1.1022 +
  1.1023 +      CXX=$TOOLCHAIN_PATH_CXX
  1.1024        PATH="$PATH_save"
  1.1025      fi
  1.1026  
  1.1027 @@ -39404,6 +39367,32 @@
  1.1028      CCXXFLAGS="$CCXXFLAGS -nologo"
  1.1029    fi
  1.1030  
  1.1031 +  if test "x$SYSROOT" != "x"; then
  1.1032 +    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
  1.1033 +      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1034 +        # Solaris Studio does not have a concept of sysroot. Instead we must
  1.1035 +        # make sure the default include and lib dirs are appended to each
  1.1036 +        # compile and link command line.
  1.1037 +        SYSROOT_CFLAGS="-I$SYSROOT/usr/include"
  1.1038 +        SYSROOT_LDFLAGS="-L$SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
  1.1039 +            -L$SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR \
  1.1040 +            -L$SYSROOT/usr/ccs/lib$OPENJDK_TARGET_CPU_ISADIR"
  1.1041 +      fi
  1.1042 +    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
  1.1043 +      SYSROOT_CFLAGS="--sysroot=\"$SYSROOT\""
  1.1044 +      SYSROOT_LDFLAGS="--sysroot=\"$SYSROOT\""
  1.1045 +    elif test "x$TOOLCHAIN_TYPE" = xclang; then
  1.1046 +      SYSROOT_CFLAGS="-isysroot \"$SYSROOT\""
  1.1047 +      SYSROOT_LDFLAGS="-isysroot \"$SYSROOT\""
  1.1048 +    fi
  1.1049 +    # Propagate the sysroot args to hotspot
  1.1050 +    LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $SYSROOT_CFLAGS"
  1.1051 +    LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $SYSROOT_CFLAGS"
  1.1052 +    LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $SYSROOT_LDFLAGS"
  1.1053 +  fi
  1.1054 +
  1.1055 +
  1.1056 +
  1.1057  
  1.1058  # FIXME: Currently we must test this after toolchain but before flags. Fix!
  1.1059  
  1.1060 @@ -40257,9 +40246,9 @@
  1.1061    LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
  1.1062  
  1.1063    # Hotspot needs these set in their legacy form
  1.1064 -  LEGACY_EXTRA_CFLAGS=$with_extra_cflags
  1.1065 -  LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
  1.1066 -  LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
  1.1067 +  LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags"
  1.1068 +  LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
  1.1069 +  LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
  1.1070  
  1.1071  
  1.1072  
  1.1073 @@ -40575,7 +40564,13 @@
  1.1074        CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
  1.1075      fi
  1.1076    else
  1.1077 -    CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
  1.1078 +    # Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
  1.1079 +    # are defined in the system?
  1.1080 +    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1081 +      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN="
  1.1082 +    else
  1.1083 +      CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
  1.1084 +    fi
  1.1085    fi
  1.1086  
  1.1087    # Setup target OS define. Use OS target name but in upper case.
  1.1088 @@ -41161,21 +41156,23 @@
  1.1089    # Check if the user has specified sysroot, but not --x-includes or --x-libraries.
  1.1090    # Make a simple check for the libraries at the sysroot, and setup --x-includes and
  1.1091    # --x-libraries for the sysroot, if that seems to be correct.
  1.1092 -  if test "x$SYS_ROOT" != "x/"; then
  1.1093 -    if test "x$x_includes" = xNONE; then
  1.1094 -      if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then
  1.1095 -        x_includes="$SYS_ROOT/usr/X11R6/include"
  1.1096 -      elif test -f "$SYS_ROOT/usr/include/X11/Xlib.h"; then
  1.1097 -        x_includes="$SYS_ROOT/usr/include"
  1.1098 -      fi
  1.1099 -    fi
  1.1100 -    if test "x$x_libraries" = xNONE; then
  1.1101 -      if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then
  1.1102 -        x_libraries="$SYS_ROOT/usr/X11R6/lib"
  1.1103 -      elif test "$SYS_ROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1104 -        x_libraries="$SYS_ROOT/usr/lib64"
  1.1105 -      elif test -f "$SYS_ROOT/usr/lib/libX11.so"; then
  1.1106 -        x_libraries="$SYS_ROOT/usr/lib"
  1.1107 +  if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
  1.1108 +    if test "x$SYSROOT" != "x"; then
  1.1109 +      if test "x$x_includes" = xNONE; then
  1.1110 +        if test -f "$SYSROOT/usr/X11R6/include/X11/Xlib.h"; then
  1.1111 +          x_includes="$SYSROOT/usr/X11R6/include"
  1.1112 +        elif test -f "$SYSROOT/usr/include/X11/Xlib.h"; then
  1.1113 +          x_includes="$SYSROOT/usr/include"
  1.1114 +        fi
  1.1115 +      fi
  1.1116 +      if test "x$x_libraries" = xNONE; then
  1.1117 +        if test -f "$SYSROOT/usr/X11R6/lib/libX11.so"; then
  1.1118 +          x_libraries="$SYSROOT/usr/X11R6/lib"
  1.1119 +        elif test "$SYSROOT/usr/lib64/libX11.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1120 +          x_libraries="$SYSROOT/usr/lib64"
  1.1121 +        elif test -f "$SYSROOT/usr/lib/libX11.so"; then
  1.1122 +          x_libraries="$SYSROOT/usr/lib"
  1.1123 +        fi
  1.1124        fi
  1.1125      fi
  1.1126    fi
  1.1127 @@ -41905,11 +41902,15 @@
  1.1128      as_fn_error $? "Could not find X11 libraries. $HELP_MSG" "$LINENO" 5
  1.1129    fi
  1.1130  
  1.1131 +
  1.1132    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
  1.1133      OPENWIN_HOME="/usr/openwin"
  1.1134 -  fi
  1.1135 -
  1.1136 -
  1.1137 +    X_CFLAGS="-I$SYSROOT$OPENWIN_HOME/include -I$SYSROOT$OPENWIN_HOME/include/X11/extensions"
  1.1138 +    X_LIBS="-L$SYSROOT$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
  1.1139 +        -L$SYSROOT$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR \
  1.1140 +        -R$OPENWIN_HOME/sfw/lib$OPENJDK_TARGET_CPU_ISADIR \
  1.1141 +        -R$OPENWIN_HOME/lib$OPENJDK_TARGET_CPU_ISADIR"
  1.1142 +  fi
  1.1143  
  1.1144    #
  1.1145    # Weird Sol10 something check...TODO change to try compile
  1.1146 @@ -42209,14 +42210,14 @@
  1.1147        # package installation locations.
  1.1148        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
  1.1149  $as_echo_n "checking for cups headers... " >&6; }
  1.1150 -      if test -s /opt/sfw/cups/include/cups/cups.h; then
  1.1151 +      if test -s $SYSROOT/opt/sfw/cups/include/cups/cups.h; then
  1.1152          # An SFW package seems to be installed!
  1.1153          CUPS_FOUND=yes
  1.1154 -        CUPS_CFLAGS="-I/opt/sfw/cups/include"
  1.1155 -      elif test -s /opt/csw/include/cups/cups.h; then
  1.1156 +        CUPS_CFLAGS="-I$SYSROOT/opt/sfw/cups/include"
  1.1157 +      elif test -s $SYSROOT/opt/csw/include/cups/cups.h; then
  1.1158          # A CSW package seems to be installed!
  1.1159          CUPS_FOUND=yes
  1.1160 -        CUPS_CFLAGS="-I/opt/csw/include"
  1.1161 +        CUPS_CFLAGS="-I$SYSROOT/opt/csw/include"
  1.1162        fi
  1.1163        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
  1.1164  $as_echo "$CUPS_FOUND" >&6; }
  1.1165 @@ -42809,9 +42810,11 @@
  1.1166          fi
  1.1167        fi
  1.1168  
  1.1169 -      if test "x$FOUND_FREETYPE" != xyes; then
  1.1170 -        # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
  1.1171 -        if test "x$PKG_CONFIG" != x; then
  1.1172 +      # If we have a sysroot, assume that's where we are supposed to look and skip pkg-config.
  1.1173 +      if test "x$SYSROOT" = x; then
  1.1174 +        if test "x$FOUND_FREETYPE" != xyes; then
  1.1175 +          # Check modules using pkg-config, but only if we have it (ugly output results otherwise)
  1.1176 +          if test "x$PKG_CONFIG" != x; then
  1.1177  
  1.1178  pkg_failed=no
  1.1179  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5
  1.1180 @@ -42879,23 +42882,24 @@
  1.1181  $as_echo "yes" >&6; }
  1.1182  	FOUND_FREETYPE=yes
  1.1183  fi
  1.1184 -          if test "x$FOUND_FREETYPE" = xyes; then
  1.1185 -            # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
  1.1186 -            FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
  1.1187 -            # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
  1.1188 -            if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
  1.1189 -              FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
  1.1190 -            fi
  1.1191 -            # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
  1.1192 -            if test "x$BUNDLE_FREETYPE" = xyes; then
  1.1193 -              { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using pkg-config, but ignoring since we can not bundle that" >&5
  1.1194 +            if test "x$FOUND_FREETYPE" = xyes; then
  1.1195 +              # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us.
  1.1196 +              FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'`
  1.1197 +              # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64
  1.1198 +              if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
  1.1199 +                FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'`
  1.1200 +              fi
  1.1201 +              # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling.
  1.1202 +              if test "x$BUNDLE_FREETYPE" = xyes; then
  1.1203 +                { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using pkg-config, but ignoring since we can not bundle that" >&5
  1.1204  $as_echo "$as_me: Found freetype using pkg-config, but ignoring since we can not bundle that" >&6;}
  1.1205 -              FOUND_FREETYPE=no
  1.1206 -            else
  1.1207 -              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5
  1.1208 +                FOUND_FREETYPE=no
  1.1209 +              else
  1.1210 +                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5
  1.1211  $as_echo_n "checking for freetype... " >&6; }
  1.1212 -              { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using pkg-config)" >&5
  1.1213 +                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using pkg-config)" >&5
  1.1214  $as_echo "yes (using pkg-config)" >&6; }
  1.1215 +              fi
  1.1216              fi
  1.1217            fi
  1.1218          fi
  1.1219 @@ -43509,12 +43513,7 @@
  1.1220  
  1.1221            fi
  1.1222          else
  1.1223 -          if test "x$SYS_ROOT" = "x/"; then
  1.1224 -            FREETYPE_ROOT=
  1.1225 -          else
  1.1226 -            FREETYPE_ROOT="$SYS_ROOT"
  1.1227 -          fi
  1.1228 -          FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
  1.1229 +          FREETYPE_BASE_DIR="$SYSROOT/usr"
  1.1230  
  1.1231    POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include"
  1.1232    POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib"
  1.1233 @@ -43807,7 +43806,7 @@
  1.1234  
  1.1235  
  1.1236            if test "x$FOUND_FREETYPE" != xyes; then
  1.1237 -            FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11"
  1.1238 +            FREETYPE_BASE_DIR="$SYSROOT/usr/X11"
  1.1239  
  1.1240    POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include"
  1.1241    POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib"
  1.1242 @@ -44101,7 +44100,301 @@
  1.1243            fi
  1.1244  
  1.1245            if test "x$FOUND_FREETYPE" != xyes; then
  1.1246 -            FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr"
  1.1247 +            FREETYPE_BASE_DIR="$SYSROOT/usr/sfw"
  1.1248 +
  1.1249 +  POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include"
  1.1250 +  POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib"
  1.1251 +  METHOD="well-known location"
  1.1252 +
  1.1253 +  # First check if the files exists.
  1.1254 +  if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then
  1.1255 +    # We found an arbitrary include file. That's a good sign.
  1.1256 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5
  1.1257 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;}
  1.1258 +    FOUND_FREETYPE=yes
  1.1259 +
  1.1260 +    FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}"
  1.1261 +    if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then
  1.1262 +      { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5
  1.1263 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;}
  1.1264 +      FOUND_FREETYPE=no
  1.1265 +    else
  1.1266 +      if test "x$OPENJDK_TARGET_OS" = xwindows; then
  1.1267 +        # On Windows, we will need both .lib and .dll file.
  1.1268 +        if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then
  1.1269 +          { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5
  1.1270 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;}
  1.1271 +          FOUND_FREETYPE=no
  1.1272 +        fi
  1.1273 +      elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then
  1.1274 +        # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess!
  1.1275 +        POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64"
  1.1276 +      fi
  1.1277 +    fi
  1.1278 +  fi
  1.1279 +
  1.1280 +  if test "x$FOUND_FREETYPE" = xyes; then
  1.1281 +
  1.1282 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1283 +
  1.1284 +  # Input might be given as Windows format, start by converting to
  1.1285 +  # unix format.
  1.1286 +  path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
  1.1287 +  new_path=`$CYGPATH -u "$path"`
  1.1288 +
  1.1289 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
  1.1290 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
  1.1291 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
  1.1292 +  # "foo.exe" is OK but "foo" is an error.
  1.1293 +  #
  1.1294 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
  1.1295 +  # It is also a way to make sure we got the proper file name for the real test later on.
  1.1296 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
  1.1297 +  if test "x$test_shortpath" = x; then
  1.1298 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
  1.1299 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
  1.1300 +    as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5
  1.1301 +  fi
  1.1302 +
  1.1303 +  # Call helper function which possibly converts this using DOS-style short mode.
  1.1304 +  # If so, the updated path is stored in $new_path.
  1.1305 +
  1.1306 +  input_path="$new_path"
  1.1307 +  # Check if we need to convert this using DOS-style short mode. If the path
  1.1308 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
  1.1309 +  # take no chances and rewrite it.
  1.1310 +  # Note: m4 eats our [], so we need to use [ and ] instead.
  1.1311 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
  1.1312 +  if test "x$has_forbidden_chars" != x; then
  1.1313 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  1.1314 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
  1.1315 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
  1.1316 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
  1.1317 +      # Going to short mode and back again did indeed matter. Since short mode is
  1.1318 +      # case insensitive, let's make it lowercase to improve readability.
  1.1319 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  1.1320 +      # Now convert it back to Unix-stile (cygpath)
  1.1321 +      input_path=`$CYGPATH -u "$shortmode_path"`
  1.1322 +      new_path="$input_path"
  1.1323 +    fi
  1.1324 +  fi
  1.1325 +
  1.1326 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
  1.1327 +  if test "x$test_cygdrive_prefix" = x; then
  1.1328 +    # As a simple fix, exclude /usr/bin since it's not a real path.
  1.1329 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
  1.1330 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
  1.1331 +      # a path prefixed by /cygdrive for fixpath to work.
  1.1332 +      new_path="$CYGWIN_ROOT_PATH$input_path"
  1.1333 +    fi
  1.1334 +  fi
  1.1335 +
  1.1336 +
  1.1337 +  if test "x$path" != "x$new_path"; then
  1.1338 +    POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
  1.1339 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
  1.1340 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
  1.1341 +  fi
  1.1342 +
  1.1343 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1344 +
  1.1345 +  path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
  1.1346 +  has_colon=`$ECHO $path | $GREP ^.:`
  1.1347 +  new_path="$path"
  1.1348 +  if test "x$has_colon" = x; then
  1.1349 +    # Not in mixed or Windows style, start by that.
  1.1350 +    new_path=`cmd //c echo $path`
  1.1351 +  fi
  1.1352 +
  1.1353 +
  1.1354 +  input_path="$new_path"
  1.1355 +  # Check if we need to convert this using DOS-style short mode. If the path
  1.1356 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
  1.1357 +  # take no chances and rewrite it.
  1.1358 +  # Note: m4 eats our [], so we need to use [ and ] instead.
  1.1359 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
  1.1360 +  if test "x$has_forbidden_chars" != x; then
  1.1361 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  1.1362 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  1.1363 +  fi
  1.1364 +
  1.1365 +
  1.1366 +  windows_path="$new_path"
  1.1367 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1368 +    unix_path=`$CYGPATH -u "$windows_path"`
  1.1369 +    new_path="$unix_path"
  1.1370 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1371 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
  1.1372 +    new_path="$unix_path"
  1.1373 +  fi
  1.1374 +
  1.1375 +  if test "x$path" != "x$new_path"; then
  1.1376 +    POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path"
  1.1377 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5
  1.1378 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;}
  1.1379 +  fi
  1.1380 +
  1.1381 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
  1.1382 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
  1.1383 +
  1.1384 +  else
  1.1385 +    # We're on a posix platform. Hooray! :)
  1.1386 +    path="$POTENTIAL_FREETYPE_INCLUDE_PATH"
  1.1387 +    has_space=`$ECHO "$path" | $GREP " "`
  1.1388 +    if test "x$has_space" != x; then
  1.1389 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5
  1.1390 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;}
  1.1391 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
  1.1392 +    fi
  1.1393 +
  1.1394 +    # Use eval to expand a potential ~
  1.1395 +    eval path="$path"
  1.1396 +    if test ! -f "$path" && test ! -d "$path"; then
  1.1397 +      as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
  1.1398 +    fi
  1.1399 +
  1.1400 +    POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`"
  1.1401 +  fi
  1.1402 +
  1.1403 +
  1.1404 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1405 +
  1.1406 +  # Input might be given as Windows format, start by converting to
  1.1407 +  # unix format.
  1.1408 +  path="$POTENTIAL_FREETYPE_LIB_PATH"
  1.1409 +  new_path=`$CYGPATH -u "$path"`
  1.1410 +
  1.1411 +  # Cygwin tries to hide some aspects of the Windows file system, such that binaries are
  1.1412 +  # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered
  1.1413 +  # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then
  1.1414 +  # "foo.exe" is OK but "foo" is an error.
  1.1415 +  #
  1.1416 +  # This test is therefore slightly more accurate than "test -f" to check for file precense.
  1.1417 +  # It is also a way to make sure we got the proper file name for the real test later on.
  1.1418 +  test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null`
  1.1419 +  if test "x$test_shortpath" = x; then
  1.1420 +    { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
  1.1421 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
  1.1422 +    as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5
  1.1423 +  fi
  1.1424 +
  1.1425 +  # Call helper function which possibly converts this using DOS-style short mode.
  1.1426 +  # If so, the updated path is stored in $new_path.
  1.1427 +
  1.1428 +  input_path="$new_path"
  1.1429 +  # Check if we need to convert this using DOS-style short mode. If the path
  1.1430 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
  1.1431 +  # take no chances and rewrite it.
  1.1432 +  # Note: m4 eats our [], so we need to use [ and ] instead.
  1.1433 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]`
  1.1434 +  if test "x$has_forbidden_chars" != x; then
  1.1435 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  1.1436 +    shortmode_path=`$CYGPATH -s -m -a "$input_path"`
  1.1437 +    path_after_shortmode=`$CYGPATH -u "$shortmode_path"`
  1.1438 +    if test "x$path_after_shortmode" != "x$input_to_shortpath"; then
  1.1439 +      # Going to short mode and back again did indeed matter. Since short mode is
  1.1440 +      # case insensitive, let's make it lowercase to improve readability.
  1.1441 +      shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  1.1442 +      # Now convert it back to Unix-stile (cygpath)
  1.1443 +      input_path=`$CYGPATH -u "$shortmode_path"`
  1.1444 +      new_path="$input_path"
  1.1445 +    fi
  1.1446 +  fi
  1.1447 +
  1.1448 +  test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/`
  1.1449 +  if test "x$test_cygdrive_prefix" = x; then
  1.1450 +    # As a simple fix, exclude /usr/bin since it's not a real path.
  1.1451 +    if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then
  1.1452 +      # The path is in a Cygwin special directory (e.g. /home). We need this converted to
  1.1453 +      # a path prefixed by /cygdrive for fixpath to work.
  1.1454 +      new_path="$CYGWIN_ROOT_PATH$input_path"
  1.1455 +    fi
  1.1456 +  fi
  1.1457 +
  1.1458 +
  1.1459 +  if test "x$path" != "x$new_path"; then
  1.1460 +    POTENTIAL_FREETYPE_LIB_PATH="$new_path"
  1.1461 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
  1.1462 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
  1.1463 +  fi
  1.1464 +
  1.1465 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1466 +
  1.1467 +  path="$POTENTIAL_FREETYPE_LIB_PATH"
  1.1468 +  has_colon=`$ECHO $path | $GREP ^.:`
  1.1469 +  new_path="$path"
  1.1470 +  if test "x$has_colon" = x; then
  1.1471 +    # Not in mixed or Windows style, start by that.
  1.1472 +    new_path=`cmd //c echo $path`
  1.1473 +  fi
  1.1474 +
  1.1475 +
  1.1476 +  input_path="$new_path"
  1.1477 +  # Check if we need to convert this using DOS-style short mode. If the path
  1.1478 +  # contains just simple characters, use it. Otherwise (spaces, weird characters),
  1.1479 +  # take no chances and rewrite it.
  1.1480 +  # Note: m4 eats our [], so we need to use [ and ] instead.
  1.1481 +  has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]`
  1.1482 +  if test "x$has_forbidden_chars" != x; then
  1.1483 +    # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \)
  1.1484 +    new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  1.1485 +  fi
  1.1486 +
  1.1487 +
  1.1488 +  windows_path="$new_path"
  1.1489 +  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
  1.1490 +    unix_path=`$CYGPATH -u "$windows_path"`
  1.1491 +    new_path="$unix_path"
  1.1492 +  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
  1.1493 +    unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'`
  1.1494 +    new_path="$unix_path"
  1.1495 +  fi
  1.1496 +
  1.1497 +  if test "x$path" != "x$new_path"; then
  1.1498 +    POTENTIAL_FREETYPE_LIB_PATH="$new_path"
  1.1499 +    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5
  1.1500 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;}
  1.1501 +  fi
  1.1502 +
  1.1503 +  # Save the first 10 bytes of this path to the storage, so fixpath can work.
  1.1504 +  all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}")
  1.1505 +
  1.1506 +  else
  1.1507 +    # We're on a posix platform. Hooray! :)
  1.1508 +    path="$POTENTIAL_FREETYPE_LIB_PATH"
  1.1509 +    has_space=`$ECHO "$path" | $GREP " "`
  1.1510 +    if test "x$has_space" != x; then
  1.1511 +      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5
  1.1512 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;}
  1.1513 +      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
  1.1514 +    fi
  1.1515 +
  1.1516 +    # Use eval to expand a potential ~
  1.1517 +    eval path="$path"
  1.1518 +    if test ! -f "$path" && test ! -d "$path"; then
  1.1519 +      as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5
  1.1520 +    fi
  1.1521 +
  1.1522 +    POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`"
  1.1523 +  fi
  1.1524 +
  1.1525 +
  1.1526 +    FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH"
  1.1527 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5
  1.1528 +$as_echo_n "checking for freetype includes... " >&6; }
  1.1529 +    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5
  1.1530 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; }
  1.1531 +    FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH"
  1.1532 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5
  1.1533 +$as_echo_n "checking for freetype libraries... " >&6; }
  1.1534 +    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5
  1.1535 +$as_echo "$FREETYPE_LIB_PATH" >&6; }
  1.1536 +  fi
  1.1537 +
  1.1538 +          fi
  1.1539 +
  1.1540 +          if test "x$FOUND_FREETYPE" != xyes; then
  1.1541 +            FREETYPE_BASE_DIR="$SYSROOT/usr"
  1.1542              if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
  1.1543  
  1.1544    POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include"
  1.1545 @@ -45577,7 +45870,9 @@
  1.1546    fi
  1.1547  
  1.1548      fi
  1.1549 -    if test "x$ALSA_FOUND" = xno; then
  1.1550 +    # Do not try pkg-config if we have a sysroot set.
  1.1551 +    if test "x$SYSROOT" = x; then
  1.1552 +      if test "x$ALSA_FOUND" = xno; then
  1.1553  
  1.1554  pkg_failed=no
  1.1555  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA" >&5
  1.1556 @@ -45645,6 +45940,7 @@
  1.1557  $as_echo "yes" >&6; }
  1.1558  	ALSA_FOUND=yes
  1.1559  fi
  1.1560 +      fi
  1.1561      fi
  1.1562      if test "x$ALSA_FOUND" = xno; then
  1.1563        for ac_header in alsa/asoundlib.h
  1.1564 @@ -46412,7 +46708,7 @@
  1.1565  
  1.1566    # libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
  1.1567    if test "x$TOOLCHAIN_TYPE" = xsolstudio && test "x$LIBCXX" = x; then
  1.1568 -    LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
  1.1569 +    LIBCXX="${SYSROOT}/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
  1.1570    fi
  1.1571  
  1.1572    # TODO better (platform agnostic) test
  1.1573 @@ -47337,8 +47633,8 @@
  1.1574      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  1.1575  $as_echo "yes" >&6; }
  1.1576      OLD_PATH="$PATH"
  1.1577 -    if test "x$TOOLS_DIR" != x; then
  1.1578 -      PATH=$TOOLS_DIR:$PATH
  1.1579 +    if test "x$TOOLCHAIN_PATH" != x; then
  1.1580 +      PATH=$TOOLCHAIN_PATH:$PATH
  1.1581      fi
  1.1582  
  1.1583  

mercurial