Merge
authorlana
Wed, 14 Nov 2012 16:41:12 -0800
changeset 14508 eabcd457c4db
parent 14507 066419d1e732 (current diff)
parent 14455 a2cf4d4a4843 (diff)
child 14509 4358b75583be
Merge
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java
langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourcePath.java
langtools/src/share/classes/com/sun/tools/javac/code/TypeTags.java
--- a/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -184,3 +184,5 @@
 5e3adc681779037a2d33b7be6f75680619085492 jdk8-b60
 cdaa6122185f9bf512dcd6600f56bfccc4824e8c jdk8-b61
 8d9d430b4244b95f5cf1ebe719f834a1ac5d6cd5 jdk8-b62
+21ee1dd7b809639284900a128b9b656a592ebc7a jdk8-b63
+70fa4b11f26522e69b51fd652215f60ce350bac3 jdk8-b64
--- a/.hgtags-top-repo	Tue Nov 13 20:02:39 2012 -0800
+++ b/.hgtags-top-repo	Wed Nov 14 16:41:12 2012 -0800
@@ -184,3 +184,5 @@
 e07f499b9dccb529ecf74172cf6ac11a195ec57a jdk8-b60
 20ff117b509075c3aec4ee3a57990ecd5db5df9c jdk8-b61
 8a3fe0ae06a8cc21347da5a18384b0aa6c2349f5 jdk8-b62
+3229597524cab4239325bc3602df6c486397a511 jdk8-b63
+1c8370a55b305d35353346202bde042ba9e8a9fd jdk8-b64
--- a/common/autoconf/basics.m4	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/basics.m4	Wed Nov 14 16:41:12 2012 -0800
@@ -373,7 +373,11 @@
       # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
       # other files
       files_present=`$LS $OUTPUT_ROOT`
-      if test "x$files_present" != x; then
+      # Configure has already touched config.log and confdefs.h in the current dir when this check 
+      # is performed.
+      filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \
+                                             | $TR -d '\n'`
+      if test "x$filtered_files" != x; then
         AC_MSG_NOTICE([Current directory is $CURDIR.])
         AC_MSG_NOTICE([Since this is not the source root, configure will output the configuration here])
         AC_MSG_NOTICE([(as opposed to creating a configuration in <src_root>/build/<conf-name>).])
--- a/common/autoconf/basics_windows.m4	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/basics_windows.m4	Wed Nov 14 16:41:12 2012 -0800
@@ -172,6 +172,13 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
   if test "x$new_path" = x; then
     # Oops. Which didn't find the executable.
     # The splitting of arguments from the executable at a space might have been incorrect,
@@ -181,6 +188,13 @@
     arguments="EOL"
     new_path=`$CYGPATH -u "$path"`
     new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
       AC_MSG_NOTICE([The path of $1, which resolves as "$complete", is not found.])
--- a/common/autoconf/compare.sh.in	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/compare.sh.in	Wed Nov 14 16:41:12 2012 -0800
@@ -60,6 +60,7 @@
 STRIP="@POST_STRIP_CMD@"
 TEE="@TEE@"
 UNIQ="@UNIQ@"
+UNPACK200="@FIXPATH@ @BOOT_JDK@/bin/unpack200"
 UNZIP="@UNZIP@"
 
 SRC_ROOT="@SRC_ROOT@"
--- a/common/autoconf/generated-configure.sh	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/generated-configure.sh	Wed Nov 14 16:41:12 2012 -0800
@@ -1,24 +1,20 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for OpenJDK jdk8.
+# Generated by GNU Autoconf 2.63 for OpenJDK jdk8.
 #
 # Report bugs to <build-dev@openjdk.java.net>.
 #
-#
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
-#
-#
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -26,14 +22,22 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 as_nl='
 '
@@ -42,13 +46,7 @@
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -59,7 +57,7 @@
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in #(
+      case $arg in
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -82,6 +80,13 @@
   }
 fi
 
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
 
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
@@ -91,15 +96,15 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in #((
+case $0 in
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
 IFS=$as_save_IFS
 
      ;;
@@ -111,16 +116,12 @@
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
 done
 PS1='$ '
 PS2='> '
@@ -132,249 +133,7 @@
 LANGUAGE=C
 export LANGUAGE
 
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-"
-  as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
-  exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1"
-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  as_found=:
-  case $as_dir in #(
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     # Try only shells that exist, to save several forks.
-	     as_shell=$as_dir/$as_base
-	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  CONFIG_SHELL=$as_shell as_have_required=yes
-		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  break 2
-fi
-fi
-	   done;;
-       esac
-  as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
-      if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
-  else
-    $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: build-dev@openjdk.java.net about your system, including
-$0: any error possibly output before this message. Then
-$0: install a modern shell, or manually run the script
-$0: under such a shell if you do have one."
-  fi
-  exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
+# Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -388,12 +147,8 @@
   as_basename=false
 fi
 
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
+
+# Name of the executable.
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -413,19 +168,295 @@
 	  }
 	  s/.*/./; q'`
 
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
-  as_lineno_1=$LINENO as_lineno_1a=$LINENO
-  as_lineno_2=$LINENO as_lineno_2a=$LINENO
-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes &&	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+	do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+	done
+	export CONFIG_SHELL
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell bug-autoconf@gnu.org about your system,
+  echo including any error possibly output before this message.
+  echo This can help us improve future autoconf versions.
+  echo Configuration will now proceed without shell functions.
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
   sed -n '
     p
     /[$]LINENO/=
@@ -442,7 +473,8 @@
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
@@ -452,18 +484,29 @@
   exit
 }
 
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
+case `echo -n x` in
 -n*)
-  case `echo 'xy\c'` in
+  case `echo 'x\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
+  *)   ECHO_C='\c';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -493,7 +536,7 @@
 rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
+  as_mkdir_p=:
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -512,10 +555,10 @@
       if test -d "$1"; then
 	test -d "$1/.";
       else
-	case $1 in #(
+	case $1 in
 	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -529,11 +572,11 @@
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
+
+exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
@@ -548,6 +591,7 @@
 subdirs=
 MFLAGS=
 MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
 
 # Identity of this package.
 PACKAGE_NAME='OpenJDK'
@@ -555,7 +599,6 @@
 PACKAGE_VERSION='jdk8'
 PACKAGE_STRING='OpenJDK jdk8'
 PACKAGE_BUGREPORT='build-dev@openjdk.java.net'
-PACKAGE_URL='http://openjdk.java.net'
 
 # Factoring default headers for most tests.
 ac_includes_default="\
@@ -730,6 +773,8 @@
 LD_OUT_OPTION
 EXE_OUT_OPTION
 CC_OUT_OPTION
+BUILD_HOTSPOT
+HOTSPOT_DIST
 BUILD_OUTPUT
 OVERRIDE_SRC_ROOT
 ADD_SRC_ROOT
@@ -934,7 +979,6 @@
 program_transform_name
 prefix
 exec_prefix
-PACKAGE_URL
 PACKAGE_BUGREPORT
 PACKAGE_STRING
 PACKAGE_VERSION
@@ -975,6 +1019,7 @@
 with_override_jaxws
 with_override_hotspot
 with_override_jdk
+with_import_hotspot
 with_msvcr_dll
 with_extra_cflags
 with_extra_cxxflags
@@ -990,7 +1035,7 @@
 with_alsa_include
 with_alsa_lib
 with_zlib
-enable_static_link_stdc__
+enable_static_link_stdc++
 with_num_cores
 with_memory_size
 with_sjavac_server_java
@@ -1083,9 +1128,8 @@
   fi
 
   case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
   esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
@@ -1130,7 +1174,8 @@
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1156,7 +1201,8 @@
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
+      { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1360,7 +1406,8 @@
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1376,7 +1423,8 @@
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
+      { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2
+   { (exit 1); exit 1; }; }
     ac_useropt_orig=$ac_useropt
     ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
@@ -1406,17 +1454,17 @@
   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
     x_libraries=$ac_optarg ;;
 
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
+  -*) { $as_echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
     ;;
 
   *=*)
     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
     # Reject names that are not valid shell variable names.
-    case $ac_envvar in #(
-      '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
-    esac
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
     eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
@@ -1433,13 +1481,15 @@
 
 if test -n "$ac_prev"; then
   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
+  { $as_echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
 fi
 
 if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2
+   { (exit 1); exit 1; }; } ;;
     *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
@@ -1462,7 +1512,8 @@
     [\\/$]* | ?:[\\/]* )  continue;;
     NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+  { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -1476,8 +1527,8 @@
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
+    $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1492,9 +1543,11 @@
 ac_pwd=`pwd` && test -n "$ac_pwd" &&
 ac_ls_di=`ls -di .` &&
 ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
+  { $as_echo "$as_me: error: working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
 test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
+  { $as_echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
 
 
 # Find the source files, if location was not specified.
@@ -1533,11 +1586,13 @@
 fi
 if test ! -r "$srcdir/$ac_unique_file"; then
   test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+  { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
 fi
 ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
 ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
 	pwd)`
 # When building in place, set srcdir=.
 if test "$ac_abs_confdir" = "$ac_pwd"; then
@@ -1577,7 +1632,7 @@
       --help=short        display options specific to this package
       --help=recursive    display the short help of all the included packages
   -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
+  -q, --quiet, --silent   do not print \`checking...' messages
       --cache-file=FILE   cache test results in FILE [disabled]
   -C, --config-cache      alias for \`--cache-file=config.cache'
   -n, --no-create         do not create output files
@@ -1719,6 +1774,9 @@
   --with-override-jaxws   use this jaxws dir for the build
   --with-override-hotspot use this hotspot dir for the build
   --with-override-jdk     use this jdk dir for the build
+  --with-import-hotspot   import hotspot binaries from this jdk image or
+                          hotspot build dist dir instead of building from
+                          source
   --with-msvcr-dll        copy this msvcr100.dll into the built JDK (Windows
                           only) [probed]
   --with-extra-cflags     extra flags to be used when compiling jdk c-files
@@ -1757,7 +1815,7 @@
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
   LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
@@ -1777,7 +1835,6 @@
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <build-dev@openjdk.java.net>.
-OpenJDK home page: <http://openjdk.java.net>.
 _ACEOF
 ac_status=$?
 fi
@@ -1841,698 +1898,21 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 OpenJDK configure jdk8
-generated by GNU Autoconf 2.67
-
-Copyright (C) 2010 Free Software Foundation, Inc.
+generated by GNU Autoconf 2.63
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
   exit
 fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_objc_try_compile LINENO
-# -----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_objc_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_objc_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_objc_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_cxx_try_cpp LINENO
-# ------------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_cpp
-
-# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
-# ---------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_cxx_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ----------------------------------------- ##
-## Report this to build-dev@openjdk.java.net ##
-## ----------------------------------------- ##"
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_cxx_check_header_mongrel
-
-# ac_fn_cxx_try_run LINENO
-# ------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_cxx_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_run
-
-# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
-# ---------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_cxx_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_cxx_check_header_compile
-
-# ac_fn_cxx_compute_int LINENO EXPR VAR INCLUDES
-# ----------------------------------------------
-# Tries to find the compile-time value of EXPR in a program that includes
-# INCLUDES, setting VAR accordingly. Returns whether the value could be
-# computed
-ac_fn_cxx_compute_int ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if test "$cross_compiling" = yes; then
-    # Depending upon the size, compute the lo and hi bounds.
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid; break
-else
-  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
-			if test $ac_lo -le $ac_mid; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_lo=$ac_mid; break
-else
-  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
-			if test $ac_mid -le $ac_hi; then
-			  ac_lo= ac_hi=
-			  break
-			fi
-			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  ac_lo= ac_hi=
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-# Binary search between lo and hi bounds.
-while test "x$ac_lo" != "x$ac_hi"; do
-  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_hi=$ac_mid
-else
-  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-case $ac_lo in #((
-?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
-'') ac_retval=1 ;;
-esac
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (($2) < 0)
-    {
-      long int i = longval ();
-      if (i != ($2))
-	return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ($2))
-	return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_run "$LINENO"; then :
-  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
-  ac_retval=1
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-rm -f conftest.val
-
-  fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_compute_int
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_cxx_check_func LINENO FUNC VAR
-# ------------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_cxx_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_cxx_check_func
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_header_compile
 cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by OpenJDK $as_me jdk8, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   $ $0 $@
 
@@ -2568,8 +1948,8 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
-  done
+  $as_echo "PATH: $as_dir"
+done
 IFS=$as_save_IFS
 
 } >&5
@@ -2606,9 +1986,9 @@
       ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
     2)
-      as_fn_append ac_configure_args1 " '$ac_arg'"
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
       if test $ac_must_keep_next = true; then
 	ac_must_keep_next=false # Got value, back to normal.
       else
@@ -2624,13 +2004,13 @@
 	  -* ) ac_must_keep_next=true ;;
 	esac
       fi
-      as_fn_append ac_configure_args " '$ac_arg'"
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
 done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
 
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
@@ -2642,9 +2022,11 @@
   {
     echo
 
-    $as_echo "## ---------------- ##
+    cat <<\_ASBOX
+## ---------------- ##
 ## Cache variables. ##
-## ---------------- ##"
+## ---------------- ##
+_ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
 (
@@ -2653,13 +2035,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
+      *) $as_unset $ac_var ;;
       esac ;;
     esac
   done
@@ -2678,9 +2060,11 @@
 )
     echo
 
-    $as_echo "## ----------------- ##
+    cat <<\_ASBOX
+## ----------------- ##
 ## Output variables. ##
-## ----------------- ##"
+## ----------------- ##
+_ASBOX
     echo
     for ac_var in $ac_subst_vars
     do
@@ -2693,9 +2077,11 @@
     echo
 
     if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
+      cat <<\_ASBOX
+## ------------------- ##
 ## File substitutions. ##
-## ------------------- ##"
+## ------------------- ##
+_ASBOX
       echo
       for ac_var in $ac_subst_files
       do
@@ -2709,9 +2095,11 @@
     fi
 
     if test -s confdefs.h; then
-      $as_echo "## ----------- ##
+      cat <<\_ASBOX
+## ----------- ##
 ## confdefs.h. ##
-## ----------- ##"
+## ----------- ##
+_ASBOX
       echo
       cat confdefs.h
       echo
@@ -2725,53 +2113,46 @@
     exit $exit_status
 ' 0
 for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
-$as_echo "/* confdefs.h */" > confdefs.h
-
 # Predefined preprocessor variables.
 
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_NAME "$PACKAGE_NAME"
 _ACEOF
 
+
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_TARNAME "$PACKAGE_TARNAME"
 _ACEOF
 
+
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_VERSION "$PACKAGE_VERSION"
 _ACEOF
 
+
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_STRING "$PACKAGE_STRING"
 _ACEOF
 
+
 cat >>confdefs.h <<_ACEOF
 #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
 _ACEOF
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer an explicitly selected file to automatically selected ones.
 ac_site_file1=NONE
 ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
+  ac_site_file1=$CONFIG_SITE
 elif test "x$prefix" != xNONE; then
   ac_site_file1=$prefix/share/config.site
   ac_site_file2=$prefix/etc/config.site
@@ -2782,23 +2163,19 @@
 for ac_site_file in "$ac_site_file1" "$ac_site_file2"
 do
   test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+  if test -r "$ac_site_file"; then
+    { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 $as_echo "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+    . "$ac_site_file"
   fi
 done
 
 if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special files
-  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
-  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+  # Some versions of bash will fail to source /dev/null (special
+  # files actually), so we avoid doing that.
+  if test -f "$cache_file"; then
+    { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5
 $as_echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
@@ -2806,7 +2183,7 @@
     esac
   fi
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+  { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5
 $as_echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
@@ -2821,11 +2198,11 @@
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+      { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
@@ -2835,17 +2212,17 @@
 	ac_old_val_w=`echo x $ac_old_val`
 	ac_new_val_w=`echo x $ac_new_val`
 	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+	  { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
 	  ac_cache_corrupted=:
 	else
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+	  { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
 	  eval $ac_var=\$ac_old_val
 	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+	{ $as_echo "$as_me:$LINENO:   former value:  \`$ac_old_val'" >&5
 $as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+	{ $as_echo "$as_me:$LINENO:   current value: \`$ac_new_val'" >&5
 $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
@@ -2857,20 +2234,43 @@
     esac
     case " $ac_configure_args " in
       *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
     esac
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+  { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+  { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
+  { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -2897,7 +2297,9 @@
   fi
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&5
+$as_echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 # These three variables are undocumented and unsupported,
@@ -3428,7 +2830,7 @@
 # to create them
 
 # Check whether --with-custom-make-dir was given.
-if test "${with_custom_make_dir+set}" = set; then :
+if test "${with_custom_make_dir+set}" = set; then
   withval=$with_custom_make_dir; CUSTOM_MAKE_DIR=$with_custom_make_dir
 fi
 
@@ -3665,7 +3067,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1351539315
+DATE_WHEN_GENERATED=1352751880
 
 ###############################################################################
 #
@@ -3682,9 +3084,9 @@
 
 DATE_WHEN_CONFIGURED=`LANG=C date`
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration created at $DATE_WHEN_CONFIGURED." >&5
+{ $as_echo "$as_me:$LINENO: Configuration created at $DATE_WHEN_CONFIGURED." >&5
 $as_echo "$as_me: Configuration created at $DATE_WHEN_CONFIGURED." >&6;}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: configure script generated at timestamp $DATE_WHEN_GENERATED." >&5
+{ $as_echo "$as_me:$LINENO: configure script generated at timestamp $DATE_WHEN_GENERATED." >&5
 $as_echo "$as_me: configure script generated at timestamp $DATE_WHEN_GENERATED." >&6;}
 
 
@@ -3701,9 +3103,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASENAME+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BASENAME+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $BASENAME in
@@ -3716,14 +3118,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_BASENAME="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -3731,10 +3133,10 @@
 fi
 BASENAME=$ac_cv_path_BASENAME
 if test -n "$BASENAME"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASENAME" >&5
+  { $as_echo "$as_me:$LINENO: result: $BASENAME" >&5
 $as_echo "$BASENAME" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3749,9 +3151,11 @@
         else
           PROG_NAME=basename
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -3760,9 +3164,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASH+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BASH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -3775,14 +3179,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -3790,10 +3194,10 @@
 fi
 BASH=$ac_cv_path_BASH
 if test -n "$BASH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5
+  { $as_echo "$as_me:$LINENO: result: $BASH" >&5
 $as_echo "$BASH" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3808,9 +3212,11 @@
         else
           PROG_NAME=bash
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -3819,9 +3225,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CAT+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CAT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CAT in
@@ -3834,14 +3240,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CAT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -3849,10 +3255,10 @@
 fi
 CAT=$ac_cv_path_CAT
 if test -n "$CAT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAT" >&5
+  { $as_echo "$as_me:$LINENO: result: $CAT" >&5
 $as_echo "$CAT" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3867,9 +3273,11 @@
         else
           PROG_NAME=cat
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -3878,9 +3286,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHMOD+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CHMOD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CHMOD in
@@ -3893,14 +3301,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -3908,10 +3316,10 @@
 fi
 CHMOD=$ac_cv_path_CHMOD
 if test -n "$CHMOD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHMOD" >&5
+  { $as_echo "$as_me:$LINENO: result: $CHMOD" >&5
 $as_echo "$CHMOD" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3926,9 +3334,11 @@
         else
           PROG_NAME=chmod
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -3937,9 +3347,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CMP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CMP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CMP in
@@ -3952,14 +3362,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CMP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -3967,10 +3377,10 @@
 fi
 CMP=$ac_cv_path_CMP
 if test -n "$CMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CMP" >&5
+  { $as_echo "$as_me:$LINENO: result: $CMP" >&5
 $as_echo "$CMP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -3985,9 +3395,11 @@
         else
           PROG_NAME=cmp
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -3996,9 +3408,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CP in
@@ -4011,14 +3423,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4026,10 +3438,10 @@
 fi
 CP=$ac_cv_path_CP
 if test -n "$CP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CP" >&5
+  { $as_echo "$as_me:$LINENO: result: $CP" >&5
 $as_echo "$CP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4044,9 +3456,11 @@
         else
           PROG_NAME=cp
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4055,9 +3469,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CUT+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CUT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CUT in
@@ -4070,14 +3484,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CUT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4085,10 +3499,10 @@
 fi
 CUT=$ac_cv_path_CUT
 if test -n "$CUT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUT" >&5
+  { $as_echo "$as_me:$LINENO: result: $CUT" >&5
 $as_echo "$CUT" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4103,9 +3517,11 @@
         else
           PROG_NAME=cut
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4114,9 +3530,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DATE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DATE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $DATE in
@@ -4129,14 +3545,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_DATE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4144,10 +3560,10 @@
 fi
 DATE=$ac_cv_path_DATE
 if test -n "$DATE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5
+  { $as_echo "$as_me:$LINENO: result: $DATE" >&5
 $as_echo "$DATE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4162,9 +3578,11 @@
         else
           PROG_NAME=date
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4173,9 +3591,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DIFF+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DIFF+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $DIFF in
@@ -4188,14 +3606,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4203,10 +3621,10 @@
 fi
 DIFF=$ac_cv_path_DIFF
 if test -n "$DIFF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5
+  { $as_echo "$as_me:$LINENO: result: $DIFF" >&5
 $as_echo "$DIFF" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4221,9 +3639,11 @@
         else
           PROG_NAME=gdiff diff
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4232,9 +3652,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DIRNAME+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DIRNAME+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $DIRNAME in
@@ -4247,14 +3667,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4262,10 +3682,10 @@
 fi
 DIRNAME=$ac_cv_path_DIRNAME
 if test -n "$DIRNAME"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIRNAME" >&5
+  { $as_echo "$as_me:$LINENO: result: $DIRNAME" >&5
 $as_echo "$DIRNAME" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4280,9 +3700,11 @@
         else
           PROG_NAME=dirname
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4291,9 +3713,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ECHO+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ECHO+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $ECHO in
@@ -4306,14 +3728,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ECHO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4321,10 +3743,10 @@
 fi
 ECHO=$ac_cv_path_ECHO
 if test -n "$ECHO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ECHO" >&5
+  { $as_echo "$as_me:$LINENO: result: $ECHO" >&5
 $as_echo "$ECHO" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4339,9 +3761,11 @@
         else
           PROG_NAME=echo
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4350,9 +3774,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_EXPR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_EXPR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $EXPR in
@@ -4365,14 +3789,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_EXPR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4380,10 +3804,10 @@
 fi
 EXPR=$ac_cv_path_EXPR
 if test -n "$EXPR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXPR" >&5
+  { $as_echo "$as_me:$LINENO: result: $EXPR" >&5
 $as_echo "$EXPR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4398,9 +3822,11 @@
         else
           PROG_NAME=expr
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4409,9 +3835,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FILE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FILE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $FILE in
@@ -4424,14 +3850,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_FILE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4439,10 +3865,10 @@
 fi
 FILE=$ac_cv_path_FILE
 if test -n "$FILE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FILE" >&5
+  { $as_echo "$as_me:$LINENO: result: $FILE" >&5
 $as_echo "$FILE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4457,9 +3883,11 @@
         else
           PROG_NAME=file
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4468,9 +3896,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_FIND+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_FIND+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $FIND in
@@ -4483,14 +3911,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4498,10 +3926,10 @@
 fi
 FIND=$ac_cv_path_FIND
 if test -n "$FIND"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIND" >&5
+  { $as_echo "$as_me:$LINENO: result: $FIND" >&5
 $as_echo "$FIND" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4516,9 +3944,11 @@
         else
           PROG_NAME=find
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4527,9 +3957,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_HEAD+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_HEAD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $HEAD in
@@ -4542,14 +3972,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_HEAD="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4557,10 +3987,10 @@
 fi
 HEAD=$ac_cv_path_HEAD
 if test -n "$HEAD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HEAD" >&5
+  { $as_echo "$as_me:$LINENO: result: $HEAD" >&5
 $as_echo "$HEAD" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4575,9 +4005,11 @@
         else
           PROG_NAME=head
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4586,9 +4018,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LN+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LN+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $LN in
@@ -4601,14 +4033,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LN="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4616,10 +4048,10 @@
 fi
 LN=$ac_cv_path_LN
 if test -n "$LN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LN" >&5
+  { $as_echo "$as_me:$LINENO: result: $LN" >&5
 $as_echo "$LN" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4634,9 +4066,11 @@
         else
           PROG_NAME=ln
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4645,9 +4079,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LS+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LS+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $LS in
@@ -4660,14 +4094,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4675,10 +4109,10 @@
 fi
 LS=$ac_cv_path_LS
 if test -n "$LS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LS" >&5
+  { $as_echo "$as_me:$LINENO: result: $LS" >&5
 $as_echo "$LS" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4693,9 +4127,11 @@
         else
           PROG_NAME=ls
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4704,9 +4140,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MKDIR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MKDIR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $MKDIR in
@@ -4719,14 +4155,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4734,10 +4170,10 @@
 fi
 MKDIR=$ac_cv_path_MKDIR
 if test -n "$MKDIR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5
+  { $as_echo "$as_me:$LINENO: result: $MKDIR" >&5
 $as_echo "$MKDIR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4752,9 +4188,11 @@
         else
           PROG_NAME=mkdir
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4763,9 +4201,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MKTEMP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MKTEMP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $MKTEMP in
@@ -4778,14 +4216,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MKTEMP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4793,10 +4231,10 @@
 fi
 MKTEMP=$ac_cv_path_MKTEMP
 if test -n "$MKTEMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKTEMP" >&5
+  { $as_echo "$as_me:$LINENO: result: $MKTEMP" >&5
 $as_echo "$MKTEMP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4811,9 +4249,11 @@
         else
           PROG_NAME=mktemp
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4822,9 +4262,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MV+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MV+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $MV in
@@ -4837,14 +4277,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4852,10 +4292,10 @@
 fi
 MV=$ac_cv_path_MV
 if test -n "$MV"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5
+  { $as_echo "$as_me:$LINENO: result: $MV" >&5
 $as_echo "$MV" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4870,9 +4310,11 @@
         else
           PROG_NAME=mv
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4881,9 +4323,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PRINTF+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PRINTF+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $PRINTF in
@@ -4896,14 +4338,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PRINTF="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4911,10 +4353,10 @@
 fi
 PRINTF=$ac_cv_path_PRINTF
 if test -n "$PRINTF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5
+  { $as_echo "$as_me:$LINENO: result: $PRINTF" >&5
 $as_echo "$PRINTF" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4929,9 +4371,11 @@
         else
           PROG_NAME=printf
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4940,9 +4384,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_THEPWDCMD+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_THEPWDCMD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $THEPWDCMD in
@@ -4955,14 +4399,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_THEPWDCMD="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -4970,10 +4414,10 @@
 fi
 THEPWDCMD=$ac_cv_path_THEPWDCMD
 if test -n "$THEPWDCMD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THEPWDCMD" >&5
+  { $as_echo "$as_me:$LINENO: result: $THEPWDCMD" >&5
 $as_echo "$THEPWDCMD" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -4988,9 +4432,11 @@
         else
           PROG_NAME=pwd
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -4999,9 +4445,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_RM+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_RM+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $RM in
@@ -5014,14 +4460,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5029,10 +4475,10 @@
 fi
 RM=$ac_cv_path_RM
 if test -n "$RM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5
+  { $as_echo "$as_me:$LINENO: result: $RM" >&5
 $as_echo "$RM" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5047,9 +4493,11 @@
         else
           PROG_NAME=rm
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5058,9 +4506,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SH+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $SH in
@@ -5073,14 +4521,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5088,10 +4536,10 @@
 fi
 SH=$ac_cv_path_SH
 if test -n "$SH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SH" >&5
+  { $as_echo "$as_me:$LINENO: result: $SH" >&5
 $as_echo "$SH" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5106,9 +4554,11 @@
         else
           PROG_NAME=sh
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5117,9 +4567,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SORT+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SORT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $SORT in
@@ -5132,14 +4582,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5147,10 +4597,10 @@
 fi
 SORT=$ac_cv_path_SORT
 if test -n "$SORT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT" >&5
+  { $as_echo "$as_me:$LINENO: result: $SORT" >&5
 $as_echo "$SORT" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5165,9 +4615,11 @@
         else
           PROG_NAME=sort
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5176,9 +4628,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_TAIL+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_TAIL+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $TAIL in
@@ -5191,14 +4643,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TAIL="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5206,10 +4658,10 @@
 fi
 TAIL=$ac_cv_path_TAIL
 if test -n "$TAIL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAIL" >&5
+  { $as_echo "$as_me:$LINENO: result: $TAIL" >&5
 $as_echo "$TAIL" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5224,9 +4676,11 @@
         else
           PROG_NAME=tail
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5235,9 +4689,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_TAR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_TAR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $TAR in
@@ -5250,14 +4704,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5265,10 +4719,10 @@
 fi
 TAR=$ac_cv_path_TAR
 if test -n "$TAR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5
+  { $as_echo "$as_me:$LINENO: result: $TAR" >&5
 $as_echo "$TAR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5283,9 +4737,11 @@
         else
           PROG_NAME=tar
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5294,9 +4750,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_TEE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_TEE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $TEE in
@@ -5309,14 +4765,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TEE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5324,10 +4780,10 @@
 fi
 TEE=$ac_cv_path_TEE
 if test -n "$TEE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEE" >&5
+  { $as_echo "$as_me:$LINENO: result: $TEE" >&5
 $as_echo "$TEE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5342,9 +4798,11 @@
         else
           PROG_NAME=tee
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5353,9 +4811,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_TOUCH+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_TOUCH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $TOUCH in
@@ -5368,14 +4826,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5383,10 +4841,10 @@
 fi
 TOUCH=$ac_cv_path_TOUCH
 if test -n "$TOUCH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TOUCH" >&5
+  { $as_echo "$as_me:$LINENO: result: $TOUCH" >&5
 $as_echo "$TOUCH" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5401,9 +4859,11 @@
         else
           PROG_NAME=touch
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5412,9 +4872,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_TR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_TR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $TR in
@@ -5427,14 +4887,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5442,10 +4902,10 @@
 fi
 TR=$ac_cv_path_TR
 if test -n "$TR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TR" >&5
+  { $as_echo "$as_me:$LINENO: result: $TR" >&5
 $as_echo "$TR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5460,9 +4920,11 @@
         else
           PROG_NAME=tr
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5471,9 +4933,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_UNAME+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_UNAME+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $UNAME in
@@ -5486,14 +4948,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_UNAME="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5501,10 +4963,10 @@
 fi
 UNAME=$ac_cv_path_UNAME
 if test -n "$UNAME"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNAME" >&5
+  { $as_echo "$as_me:$LINENO: result: $UNAME" >&5
 $as_echo "$UNAME" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5519,9 +4981,11 @@
         else
           PROG_NAME=uname
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5530,9 +4994,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_UNIQ+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_UNIQ+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $UNIQ in
@@ -5545,14 +5009,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_UNIQ="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5560,10 +5024,10 @@
 fi
 UNIQ=$ac_cv_path_UNIQ
 if test -n "$UNIQ"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIQ" >&5
+  { $as_echo "$as_me:$LINENO: result: $UNIQ" >&5
 $as_echo "$UNIQ" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5578,9 +5042,11 @@
         else
           PROG_NAME=uniq
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5589,9 +5055,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $WC in
@@ -5604,14 +5070,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_WC="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5619,10 +5085,10 @@
 fi
 WC=$ac_cv_path_WC
 if test -n "$WC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WC" >&5
+  { $as_echo "$as_me:$LINENO: result: $WC" >&5
 $as_echo "$WC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5637,9 +5103,11 @@
         else
           PROG_NAME=wc
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5648,9 +5116,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_WHICH+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_WHICH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $WHICH in
@@ -5663,14 +5131,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_WHICH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5678,10 +5146,10 @@
 fi
 WHICH=$ac_cv_path_WHICH
 if test -n "$WHICH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WHICH" >&5
+  { $as_echo "$as_me:$LINENO: result: $WHICH" >&5
 $as_echo "$WHICH" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5696,9 +5164,11 @@
         else
           PROG_NAME=which
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5707,9 +5177,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XARGS+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_XARGS+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $XARGS in
@@ -5722,14 +5192,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_XARGS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -5737,10 +5207,10 @@
 fi
 XARGS=$ac_cv_path_XARGS
 if test -n "$XARGS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XARGS" >&5
+  { $as_echo "$as_me:$LINENO: result: $XARGS" >&5
 $as_echo "$XARGS" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5755,9 +5225,11 @@
         else
           PROG_NAME=xargs
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -5767,9 +5239,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AWK"; then
@@ -5780,24 +5252,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
 $as_echo "$AWK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -5812,14 +5284,16 @@
         else
           PROG_NAME=
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
-    fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if test "${ac_cv_path_GREP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -5830,7 +5304,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
+  for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
       { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
@@ -5850,7 +5324,7 @@
     $as_echo 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    ac_count=`expr $ac_count + 1`
     if test $ac_count -gt ${ac_path_GREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_GREP="$ac_path_GREP"
@@ -5865,17 +5339,19 @@
       $ac_path_GREP_found && break 3
     done
   done
-  done
+done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 else
   ac_cv_path_GREP=$GREP
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
 $as_echo "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
@@ -5887,14 +5363,16 @@
         else
           PROG_NAME=
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
-    fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if test "${ac_cv_path_EGREP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -5908,7 +5386,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
+  for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
       { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
@@ -5928,7 +5406,7 @@
     $as_echo 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    ac_count=`expr $ac_count + 1`
     if test $ac_count -gt ${ac_path_EGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_EGREP="$ac_path_EGREP"
@@ -5943,10 +5421,12 @@
       $ac_path_EGREP_found && break 3
     done
   done
-  done
+done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 else
   ac_cv_path_EGREP=$EGREP
@@ -5954,7 +5434,7 @@
 
    fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
 $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
@@ -5966,14 +5446,16 @@
         else
           PROG_NAME=
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
-    fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
 $as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then :
+if test "${ac_cv_path_FGREP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
@@ -5987,7 +5469,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_prog in fgrep; do
+  for ac_prog in fgrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
       { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
@@ -6007,7 +5489,7 @@
     $as_echo 'FGREP' >> "conftest.nl"
     "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    ac_count=`expr $ac_count + 1`
     if test $ac_count -gt ${ac_path_FGREP_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_FGREP="$ac_path_FGREP"
@@ -6022,10 +5504,12 @@
       $ac_path_FGREP_found && break 3
     done
   done
-  done
+done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_FGREP"; then
-    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 else
   ac_cv_path_FGREP=$FGREP
@@ -6033,7 +5517,7 @@
 
    fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
 $as_echo "$ac_cv_path_FGREP" >&6; }
  FGREP="$ac_cv_path_FGREP"
 
@@ -6045,14 +5529,16 @@
         else
           PROG_NAME=
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
-    fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then :
+if test "${ac_cv_path_SED+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -6060,7 +5546,7 @@
        ac_script="$ac_script$as_nl$ac_script"
      done
      echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
+     $as_unset ac_script || ac_script=
      if test -z "$SED"; then
   ac_path_SED_found=false
   # Loop through the user's path and test for each of PROGNAME-LIST
@@ -6069,7 +5555,7 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
+  for ac_prog in sed gsed; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
       { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
@@ -6089,7 +5575,7 @@
     $as_echo '' >> "conftest.nl"
     "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    ac_count=`expr $ac_count + 1`
     if test $ac_count -gt ${ac_path_SED_max-0}; then
       # Best one so far, save it but keep looking for a better one
       ac_cv_path_SED="$ac_path_SED"
@@ -6104,17 +5590,19 @@
       $ac_path_SED_found && break 3
     done
   done
-  done
+done
 IFS=$as_save_IFS
   if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 else
   ac_cv_path_SED=$SED
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
 $as_echo "$ac_cv_path_SED" >&6; }
  SED="$ac_cv_path_SED"
   rm -f conftest.sed
@@ -6126,9 +5614,11 @@
         else
           PROG_NAME=
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -6136,9 +5626,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_NAWK+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_NAWK+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $NAWK in
@@ -6151,14 +5641,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_NAWK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -6166,10 +5656,10 @@
 fi
 NAWK=$ac_cv_path_NAWK
 if test -n "$NAWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NAWK" >&5
+  { $as_echo "$as_me:$LINENO: result: $NAWK" >&5
 $as_echo "$NAWK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6184,9 +5674,11 @@
         else
           PROG_NAME=
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -6196,9 +5688,9 @@
 # These are not required on all platforms
 # Extract the first word of "cygpath", so it can be a program name with args.
 set dummy cygpath; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CYGPATH+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CYGPATH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CYGPATH in
@@ -6211,14 +5703,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CYGPATH="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -6226,19 +5718,19 @@
 fi
 CYGPATH=$ac_cv_path_CYGPATH
 if test -n "$CYGPATH"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5
+  { $as_echo "$as_me:$LINENO: result: $CYGPATH" >&5
 $as_echo "$CYGPATH" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "readlink", so it can be a program name with args.
 set dummy readlink; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_READLINK+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_READLINK+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $READLINK in
@@ -6251,14 +5743,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_READLINK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -6266,19 +5758,19 @@
 fi
 READLINK=$ac_cv_path_READLINK
 if test -n "$READLINK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINK" >&5
+  { $as_echo "$as_me:$LINENO: result: $READLINK" >&5
 $as_echo "$READLINK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "df", so it can be a program name with args.
 set dummy df; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DF+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DF+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $DF in
@@ -6291,14 +5783,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_DF="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -6306,19 +5798,19 @@
 fi
 DF=$ac_cv_path_DF
 if test -n "$DF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DF" >&5
+  { $as_echo "$as_me:$LINENO: result: $DF" >&5
 $as_echo "$DF" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "SetFile", so it can be a program name with args.
 set dummy SetFile; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SETFILE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SETFILE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $SETFILE in
@@ -6331,14 +5823,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_SETFILE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -6346,10 +5838,10 @@
 fi
 SETFILE=$ac_cv_path_SETFILE
 if test -n "$SETFILE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SETFILE" >&5
+  { $as_echo "$as_me:$LINENO: result: $SETFILE" >&5
 $as_echo "$SETFILE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -6358,29 +5850,43 @@
 
 # Now we can determine OpenJDK build and target platforms. This is required to
 # have early on.
+
+# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
+# is confusing; it assumes you are cross-compiling a cross-compiler (!)  and "target" is thus the target of the
+# product you're building. The target of this build is called "host". Since this is confusing to most people, we
+# have not adopted that system, but use "target" as the platform we are building for. In some places though we need
+# to use the configure naming style.
 # Make sure we can run config.sub.
 $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+  { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if test "${ac_cv_build+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
 test "x$ac_build_alias" = x &&
   ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
 test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+   { (exit 1); exit 1; }; }
 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+  { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -6396,24 +5902,28 @@
 case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if test "${ac_cv_host+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
   ac_cv_host=$ac_cv_build
 else
   ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -6429,24 +5939,28 @@
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+{ $as_echo "$as_me:$LINENO: checking target system type" >&5
 $as_echo_n "checking target system type... " >&6; }
-if test "${ac_cv_target+set}" = set; then :
+if test "${ac_cv_target+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test "x$target_alias" = x; then
   ac_cv_target=$ac_cv_host
 else
   ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+    { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5
 $as_echo "$ac_cv_target" >&6; }
 case $ac_cv_target in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+$as_echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
 esac
 target=$ac_cv_target
 ac_save_IFS=$IFS; IFS='-'
@@ -6469,15 +5983,6 @@
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
-# is confusing; it assumes you are cross-compiling a cross-compiler (!)  and "target" is thus the target of the
-# product you're building. The target of this build is called "host". Since this is confusing to most people, we
-# have not adopted that system, but use "target" as the platform we are building for. In some places though we need
-# to use the configure naming style.
-
-
-
-
 
     # Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME
     # (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME
@@ -6522,7 +6027,9 @@
       VAR_OS_ENV=windows.msys
       ;;
     *)
-      as_fn_error $? "unsupported operating system $build_os" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: unsupported operating system $build_os" >&5
+$as_echo "$as_me: error: unsupported operating system $build_os" >&2;}
+   { (exit 1); exit 1; }; }
       ;;
   esac
 
@@ -6572,7 +6079,9 @@
       VAR_CPU_ENDIAN=big
        ;;
     *)
-      as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: unsupported cpu $build_cpu" >&5
+$as_echo "$as_me: error: unsupported cpu $build_cpu" >&2;}
+   { (exit 1); exit 1; }; }
       ;;
   esac
 
@@ -6591,9 +6100,9 @@
 
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-build os-cpu" >&5
+    { $as_echo "$as_me:$LINENO: checking openjdk-build os-cpu" >&5
 $as_echo_n "checking openjdk-build os-cpu... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&5
+    { $as_echo "$as_me:$LINENO: result: $OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&5
 $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
 
     # Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables.
@@ -6630,7 +6139,9 @@
       VAR_OS_ENV=windows.msys
       ;;
     *)
-      as_fn_error $? "unsupported operating system $host_os" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: unsupported operating system $host_os" >&5
+$as_echo "$as_me: error: unsupported operating system $host_os" >&2;}
+   { (exit 1); exit 1; }; }
       ;;
   esac
 
@@ -6680,7 +6191,9 @@
       VAR_CPU_ENDIAN=big
        ;;
     *)
-      as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: unsupported cpu $host_cpu" >&5
+$as_echo "$as_me: error: unsupported cpu $host_cpu" >&2;}
+   { (exit 1); exit 1; }; }
       ;;
   esac
 
@@ -6699,15 +6212,15 @@
 
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking openjdk-target os-cpu" >&5
+    { $as_echo "$as_me:$LINENO: checking openjdk-target os-cpu" >&5
 $as_echo_n "checking openjdk-target os-cpu... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&5
+    { $as_echo "$as_me:$LINENO: result: $OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&5
 $as_echo "$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" >&6; }
 
 
 
 # Check whether --with-target-bits was given.
-if test "${with_target_bits+set}" = set; then :
+if test "${with_target_bits+set}" = set; then
   withval=$with_target_bits;
 fi
 
@@ -6726,7 +6239,9 @@
 
   if test "x$with_target_bits" != x; then
     if test "x$COMPILE_TYPE" = "xcross"; then
-      as_fn_error $? "It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either." >&5
+$as_echo "$as_me: error: It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
@@ -6738,22 +6253,28 @@
       elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
         OPENJDK_TARGET_CPU=sparc
       else
-        as_fn_error $? "Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9" >&5
+$as_echo "$as_me: error: Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
-      as_fn_error $? "It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead." >&5
+$as_echo "$as_me: error: It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead." >&2;}
+   { (exit 1); exit 1; }; }
     elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: --with-target-bits are set to build platform address size; argument has no meaning" >&5
+      { $as_echo "$as_me:$LINENO: --with-target-bits are set to build platform address size; argument has no meaning" >&5
 $as_echo "$as_me: --with-target-bits are set to build platform address size; argument has no meaning" >&6;}
     else
-      as_fn_error $? "--with-target-bits can only be 32 or 64, you specified $with_target_bits!" "$LINENO" 5
-    fi
-  fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compilation type" >&5
+      { { $as_echo "$as_me:$LINENO: error: --with-target-bits can only be 32 or 64, you specified $with_target_bits!" >&5
+$as_echo "$as_me: error: --with-target-bits can only be 32 or 64, you specified $with_target_bits!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+
+{ $as_echo "$as_me:$LINENO: checking compilation type" >&5
 $as_echo_n "checking compilation type... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPILE_TYPE" >&5
+{ $as_echo "$as_me:$LINENO: result: $COMPILE_TYPE" >&5
 $as_echo "$COMPILE_TYPE" >&6; }
 
 
@@ -6944,51 +6465,59 @@
 
   SRC_ROOT_LENGTH=`$THEPWDCMD|$WC -m`
   if test $SRC_ROOT_LENGTH -gt 100; then
-      as_fn_error $? "Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" "$LINENO" 5
-  fi
-
-  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin release" >&5
+      { { $as_echo "$as_me:$LINENO: error: Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" >&5
+$as_echo "$as_me: error: Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+  if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
+    { $as_echo "$as_me:$LINENO: checking cygwin release" >&5
 $as_echo_n "checking cygwin release... " >&6; }
     CYGWIN_VERSION=`$UNAME -r`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_VERSION" >&5
+    { $as_echo "$as_me:$LINENO: result: $CYGWIN_VERSION" >&5
 $as_echo "$CYGWIN_VERSION" >&6; }
     WINDOWS_ENV_VENDOR='cygwin'
     WINDOWS_ENV_VERSION="$CYGWIN_VERSION"
 
     CYGWIN_VERSION_OK=`$ECHO $CYGWIN_VERSION | $GREP ^1.7.`
     if test "x$CYGWIN_VERSION_OK" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5
+      { $as_echo "$as_me:$LINENO: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&5
 $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but at least cygwin 1.7 is required. Please upgrade." >&6;}
-      as_fn_error $? "Cannot continue" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test "x$CYGPATH" = x; then
-        as_fn_error $? "Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5
+        { { $as_echo "$as_me:$LINENO: error: Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" >&5
+$as_echo "$as_me: error: Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking cygwin root directory as unix-style path" >&5
 $as_echo_n "checking cygwin root directory as unix-style path... " >&6; }
     # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
     cygwin_winpath_root=`cd / ; cmd /c cd | grep ".*"`
     # Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
     CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5
+    { $as_echo "$as_me:$LINENO: result: $CYGWIN_ROOT_PATH" >&5
 $as_echo "$CYGWIN_ROOT_PATH" >&6; }
     WINDOWS_ENV_ROOT_PATH="$CYGWIN_ROOT_PATH"
     test_cygdrive_prefix=`$ECHO $CYGWIN_ROOT_PATH | $GREP ^/cygdrive/`
     if test "x$test_cygdrive_prefix" = x; then
-        as_fn_error $? "Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." "$LINENO" 5
-    fi
-  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys release" >&5
+        { { $as_echo "$as_me:$LINENO: error: Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." >&5
+$as_echo "$as_me: error: Your cygdrive prefix is not /cygdrive. This is currently not supported. Change with mount -c." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
+    { $as_echo "$as_me:$LINENO: checking msys release" >&5
 $as_echo_n "checking msys release... " >&6; }
     MSYS_VERSION=`$UNAME -r`
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSYS_VERSION" >&5
+    { $as_echo "$as_me:$LINENO: result: $MSYS_VERSION" >&5
 $as_echo "$MSYS_VERSION" >&6; }
 
     WINDOWS_ENV_VENDOR='msys'
     WINDOWS_ENV_VERSION="$MSYS_VERSION"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking msys root directory as unix-style path" >&5
+    { $as_echo "$as_me:$LINENO: checking msys root directory as unix-style path" >&5
 $as_echo_n "checking msys root directory as unix-style path... " >&6; }
     # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
     MSYS_ROOT_PATH=`cd / ; cmd /c cd | grep ".*"`
@@ -7002,32 +6531,36 @@
     MSYS_ROOT_PATH="$unix_path"
   fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSYS_ROOT_PATH" >&5
+    { $as_echo "$as_me:$LINENO: result: $MSYS_ROOT_PATH" >&5
 $as_echo "$MSYS_ROOT_PATH" >&6; }
     WINDOWS_ENV_ROOT_PATH="$MSYS_ROOT_PATH"
   else
-    as_fn_error $? "Unknown Windows environment. Neither cygwin nor msys was detected." "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Unknown Windows environment. Neither cygwin nor msys was detected." >&5
+$as_echo "$as_me: error: Unknown Windows environment. Neither cygwin nor msys was detected." >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Test if windows or unix (cygwin/msys) find is first in path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking what kind of 'find' is first on the PATH" >&5
+  { $as_echo "$as_me:$LINENO: checking what kind of 'find' is first on the PATH" >&5
 $as_echo_n "checking what kind of 'find' is first on the PATH... " >&6; }
   FIND_BINARY_OUTPUT=`find --version 2>&1`
   if test "x`echo $FIND_BINARY_OUTPUT | $GREP GNU`" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unix style" >&5
+    { $as_echo "$as_me:$LINENO: result: unix style" >&5
 $as_echo "unix style" >&6; }
   elif test "x`echo $FIND_BINARY_OUTPUT | $GREP FIND`" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Windows" >&5
+    { $as_echo "$as_me:$LINENO: result: Windows" >&5
 $as_echo "Windows" >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&5
+    { $as_echo "$as_me:$LINENO: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&5
 $as_echo "$as_me: Your path contains Windows tools (C:\Windows\system32) before your unix (cygwin or msys) tools." >&6;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&5
+    { $as_echo "$as_me:$LINENO: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&5
 $as_echo "$as_me: This will not work. Please correct and make sure /usr/bin (or similar) is first in path." >&6;}
-    as_fn_error $? "Cannot continue" "$LINENO" 5
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+    { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    { $as_echo "$as_me:$LINENO: result: unknown" >&5
 $as_echo "unknown" >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: It seems that your find utility is non-standard." >&5
+    { $as_echo "$as_me:$LINENO: WARNING: It seems that your find utility is non-standard." >&5
 $as_echo "$as_me: WARNING: It seems that your find utility is non-standard." >&2;}
   fi
 
@@ -7056,9 +6589,11 @@
   # 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 SRC_ROOT, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of SRC_ROOT" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of SRC_ROOT" >&5
+$as_echo "$as_me: error: Cannot locate the the path of SRC_ROOT" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -7097,7 +6632,7 @@
 
   if test "x$path" != "x$new_path"; then
     SRC_ROOT="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting SRC_ROOT to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting SRC_ROOT to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting SRC_ROOT to \"$new_path\"" >&6;}
   fi
 
@@ -7135,7 +6670,7 @@
 
   if test "x$path" != "x$new_path"; then
     SRC_ROOT="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting SRC_ROOT to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting SRC_ROOT to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting SRC_ROOT to \"$new_path\"" >&6;}
   fi
 
@@ -7147,14 +6682,18 @@
     path="$SRC_ROOT"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of SRC_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of SRC_ROOT, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of SRC_ROOT, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of SRC_ROOT, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -7175,9 +6714,11 @@
   # 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 CURDIR, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of CURDIR" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CURDIR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CURDIR" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -7216,7 +6757,7 @@
 
   if test "x$path" != "x$new_path"; then
     CURDIR="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting CURDIR to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   fi
 
@@ -7254,7 +6795,7 @@
 
   if test "x$path" != "x$new_path"; then
     CURDIR="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CURDIR to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting CURDIR to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting CURDIR to \"$new_path\"" >&6;}
   fi
 
@@ -7266,14 +6807,18 @@
     path="$CURDIR"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of CURDIR, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of CURDIR, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of CURDIR, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of CURDIR, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of CURDIR, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -7287,7 +6832,7 @@
 # is not correct.
 
 # Check whether --with-sys-root was given.
-if test "${with_sys_root+set}" = set; then :
+if test "${with_sys_root+set}" = set; then
   withval=$with_sys_root;
 fi
 
@@ -7301,20 +6846,24 @@
 
 
 # Check whether --with-tools-dir was given.
-if test "${with_tools_dir+set}" = set; then :
+if test "${with_tools_dir+set}" = set; then
   withval=$with_tools_dir; TOOLS_DIR=$with_tools_dir
 fi
 
 
 
 # Check whether --with-devkit was given.
-if test "${with_devkit+set}" = set; then :
+if test "${with_devkit+set}" = set; then
   withval=$with_devkit;
     if test "x$with_sys_root" != x; then
-      as_fn_error $? "Cannot specify both --with-devkit and --with-sys-root at the same time" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot specify both --with-devkit and --with-sys-root at the same time" >&5
+$as_echo "$as_me: error: Cannot specify both --with-devkit and --with-sys-root at the same time" >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test "x$with_tools_dir" != x; then
-      as_fn_error $? "Cannot specify both --with-devkit and --with-tools-dir at the same time" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot specify both --with-devkit and --with-tools-dir at the same time" >&5
+$as_echo "$as_me: error: Cannot specify both --with-devkit and --with-tools-dir at the same time" >&2;}
+   { (exit 1); exit 1; }; }
     fi
     TOOLS_DIR=$with_devkit/bin
     SYS_ROOT=$with_devkit/$host_alias/libc
@@ -7346,11 +6895,11 @@
 # modules to compile into the JDK. In the future, these modules
 # might even be Jigsaw modules.
 #
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of the JDK to build" >&5
+{ $as_echo "$as_me:$LINENO: checking which variant of the JDK to build" >&5
 $as_echo_n "checking which variant of the JDK to build... " >&6; }
 
 # Check whether --with-jdk-variant was given.
-if test "${with_jdk_variant+set}" = set; then :
+if test "${with_jdk_variant+set}" = set; then
   withval=$with_jdk_variant;
 fi
 
@@ -7358,12 +6907,14 @@
 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
     JDK_VARIANT="normal"
 else
-    as_fn_error $? "The available JDK variants are: normal" "$LINENO" 5
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $JDK_VARIANT" >&5
+    { { $as_echo "$as_me:$LINENO: error: The available JDK variants are: normal" >&5
+$as_echo "$as_me: error: The available JDK variants are: normal" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+{ $as_echo "$as_me:$LINENO: result: $JDK_VARIANT" >&5
 $as_echo "$JDK_VARIANT" >&6; }
 
 
@@ -7378,11 +6929,11 @@
 #             ie normal interpreter and C1, only the serial GC, kernel jvmti etc
 #    zero: no machine code interpreter, no compiler
 #    zeroshark: zero interpreter and shark/llvm compiler backend
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which variants of the JVM to build" >&5
+{ $as_echo "$as_me:$LINENO: checking which variants of the JVM to build" >&5
 $as_echo_n "checking which variants of the JVM to build... " >&6; }
 
 # Check whether --with-jvm-variants was given.
-if test "${with_jvm_variants+set}" = set; then :
+if test "${with_jvm_variants+set}" = set; then
   withval=$with_jvm_variants;
 fi
 
@@ -7395,9 +6946,11 @@
 TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
 
 if test "x$TEST_VARIANTS" != "x,"; then
-   as_fn_error $? "The available JVM variants are: server, client, kernel, zero, zeroshark" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_jvm_variants" >&5
+   { { $as_echo "$as_me:$LINENO: error: The available JVM variants are: server, client, kernel, zero, zeroshark" >&5
+$as_echo "$as_me: error: The available JVM variants are: server, client, kernel, zero, zeroshark" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+{ $as_echo "$as_me:$LINENO: result: $with_jvm_variants" >&5
 $as_echo "$with_jvm_variants" >&6; }
 
 JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
@@ -7408,12 +6961,16 @@
 
 if test "x$JVM_VARIANT_CLIENT" = xtrue; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        as_fn_error $? "You cannot build a client JVM for a 64-bit machine." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: You cannot build a client JVM for a 64-bit machine." >&5
+$as_echo "$as_me: error: You cannot build a client JVM for a 64-bit machine." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 fi
 if test "x$JVM_VARIANT_KERNEL" = xtrue; then
     if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
-        as_fn_error $? "You cannot build a kernel JVM for a 64-bit machine." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: You cannot build a kernel JVM for a 64-bit machine." >&5
+$as_echo "$as_me: error: You cannot build a kernel JVM for a 64-bit machine." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 fi
 
@@ -7449,10 +7006,10 @@
 #    slowdebug: debug information (-g), no optimizations, all asserts
 #
 DEBUG_LEVEL="release"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which debug level to use" >&5
+{ $as_echo "$as_me:$LINENO: checking which debug level to use" >&5
 $as_echo_n "checking which debug level to use... " >&6; }
 # Check whether --enable-debug was given.
-if test "${enable_debug+set}" = set; then :
+if test "${enable_debug+set}" = set; then
   enableval=$enable_debug;
         ENABLE_DEBUG="${enableval}"
         DEBUG_LEVEL="fastdebug"
@@ -7464,22 +7021,26 @@
 
 
 # Check whether --with-debug-level was given.
-if test "${with_debug_level+set}" = set; then :
+if test "${with_debug_level+set}" = set; then
   withval=$with_debug_level;
         DEBUG_LEVEL="${withval}"
         if test "x$ENABLE_DEBUG" = xyes; then
-			as_fn_error $? "You cannot use both --enable-debug and --with-debug-level at the same time." "$LINENO" 5
-        fi
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEBUG_LEVEL" >&5
+			{ { $as_echo "$as_me:$LINENO: error: You cannot use both --enable-debug and --with-debug-level at the same time." >&5
+$as_echo "$as_me: error: You cannot use both --enable-debug and --with-debug-level at the same time." >&2;}
+   { (exit 1); exit 1; }; }
+        fi
+
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $DEBUG_LEVEL" >&5
 $as_echo "$DEBUG_LEVEL" >&6; }
 
 if test "x$DEBUG_LEVEL" != xrelease && \
    test "x$DEBUG_LEVEL" != xfastdebug && \
    test "x$DEBUG_LEVEL" != xslowdebug; then
-   as_fn_error $? "Allowed debug levels are: release, fastdebug and slowdebug" "$LINENO" 5
+   { { $as_echo "$as_me:$LINENO: error: Allowed debug levels are: release, fastdebug and slowdebug" >&5
+$as_echo "$as_me: error: Allowed debug levels are: release, fastdebug and slowdebug" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 
@@ -7569,7 +7130,7 @@
 
 
 # Check whether --with-conf-name was given.
-if test "${with_conf_name+set}" = set; then :
+if test "${with_conf_name+set}" = set; then
   withval=$with_conf_name;  CONF_NAME=${with_conf_name}
 fi
 
@@ -7584,7 +7145,9 @@
     OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
     $MKDIR -p "$OUTPUT_ROOT"
     if test ! -d "$OUTPUT_ROOT"; then
-        as_fn_error $? "Could not create build directory $OUTPUT_ROOT" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Could not create build directory $OUTPUT_ROOT" >&5
+$as_echo "$as_me: error: Could not create build directory $OUTPUT_ROOT" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 else
     # We are running configure from outside of the src dir.
@@ -7603,28 +7166,34 @@
       # If we have a spec.gmk, we have run here before and we are OK. Otherwise, check for
       # other files
       files_present=`$LS $OUTPUT_ROOT`
-      if test "x$files_present" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Current directory is $CURDIR." >&5
+      # Configure has already touched config.log and confdefs.h in the current dir when this check
+      # is performed.
+      filtered_files=`$ECHO "$files_present" | $SED -e 's/config.log//g' -e 's/confdefs.h//g' -e 's/ //g' \
+                                             | $TR -d '\n'`
+      if test "x$filtered_files" != x; then
+        { $as_echo "$as_me:$LINENO: Current directory is $CURDIR." >&5
 $as_echo "$as_me: Current directory is $CURDIR." >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Since this is not the source root, configure will output the configuration here" >&5
+        { $as_echo "$as_me:$LINENO: Since this is not the source root, configure will output the configuration here" >&5
 $as_echo "$as_me: Since this is not the source root, configure will output the configuration here" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: (as opposed to creating a configuration in <src_root>/build/<conf-name>)." >&5
+        { $as_echo "$as_me:$LINENO: (as opposed to creating a configuration in <src_root>/build/<conf-name>)." >&5
 $as_echo "$as_me: (as opposed to creating a configuration in <src_root>/build/<conf-name>)." >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: However, this directory is not empty. This is not allowed, since it could" >&5
+        { $as_echo "$as_me:$LINENO: However, this directory is not empty. This is not allowed, since it could" >&5
 $as_echo "$as_me: However, this directory is not empty. This is not allowed, since it could" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: seriously mess up just about everything." >&5
+        { $as_echo "$as_me:$LINENO: seriously mess up just about everything." >&5
 $as_echo "$as_me: seriously mess up just about everything." >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Try 'cd $SRC_ROOT' and restart configure" >&5
+        { $as_echo "$as_me:$LINENO: Try 'cd $SRC_ROOT' and restart configure" >&5
 $as_echo "$as_me: Try 'cd $SRC_ROOT' and restart configure" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: (or create a new empty directory and cd to it)." >&5
+        { $as_echo "$as_me:$LINENO: (or create a new empty directory and cd to it)." >&5
 $as_echo "$as_me: (or create a new empty directory and cd to it)." >&6;}
-        as_fn_error $? "Will not continue creating configuration in $CURDIR" "$LINENO" 5
-      fi
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what configuration name to use" >&5
+        { { $as_echo "$as_me:$LINENO: error: Will not continue creating configuration in $CURDIR" >&5
+$as_echo "$as_me: error: Will not continue creating configuration in $CURDIR" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: checking what configuration name to use" >&5
 $as_echo_n "checking what configuration name to use... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONF_NAME" >&5
+{ $as_echo "$as_me:$LINENO: result: $CONF_NAME" >&5
 $as_echo "$CONF_NAME" >&6; }
 
 
@@ -7644,9 +7213,11 @@
   # 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 OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of OUTPUT_ROOT" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OUTPUT_ROOT" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OUTPUT_ROOT" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -7685,7 +7256,7 @@
 
   if test "x$path" != "x$new_path"; then
     OUTPUT_ROOT="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OUTPUT_ROOT to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting OUTPUT_ROOT to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;}
   fi
 
@@ -7723,7 +7294,7 @@
 
   if test "x$path" != "x$new_path"; then
     OUTPUT_ROOT="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OUTPUT_ROOT to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting OUTPUT_ROOT to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting OUTPUT_ROOT to \"$new_path\"" >&6;}
   fi
 
@@ -7735,14 +7306,18 @@
     path="$OUTPUT_ROOT"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of OUTPUT_ROOT, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -7788,9 +7363,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_PKGHANDLER+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PKGHANDLER+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$PKGHANDLER"; then
@@ -7801,24 +7376,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_PKGHANDLER="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 PKGHANDLER=$ac_cv_prog_PKGHANDLER
 if test -n "$PKGHANDLER"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGHANDLER" >&5
+  { $as_echo "$as_me:$LINENO: result: $PKGHANDLER" >&5
 $as_echo "$PKGHANDLER" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -7835,23 +7410,25 @@
   if test "x$MAKE" != x; then
     # User has supplied a make, test it.
     if test ! -f "$MAKE"; then
-      as_fn_error $? "The specified make (by MAKE=$MAKE) is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The specified make (by MAKE=$MAKE) is not found." >&5
+$as_echo "$as_me: error: The specified make (by MAKE=$MAKE) is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
   MAKE_CANDIDATE=""$MAKE""
   DESCRIPTION="user supplied MAKE=$MAKE"
   if test "x$MAKE_CANDIDATE" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
+    { $as_echo "$as_me:$LINENO: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
 $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;}
     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
     if test "x$IS_GNU_MAKE" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
+      { $as_echo "$as_me:$LINENO: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
     else
       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'`
       if test "x$IS_MODERN_MAKE" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
+        { $as_echo "$as_me:$LINENO: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
       else
         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
@@ -7860,7 +7437,9 @@
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
             MAKE_EXPECTED_ENV='msys'
           else
-            as_fn_error $? "Unknown Windows environment" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Unknown Windows environment" >&5
+$as_echo "$as_me: error: Unknown Windows environment" >&2;}
+   { (exit 1); exit 1; }; }
           fi
           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
@@ -7869,7 +7448,7 @@
           IS_MAKE_CORRECT_ENV=true
         fi
         if test "x$IS_MAKE_CORRECT_ENV" = x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
+          { $as_echo "$as_me:$LINENO: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
 $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;}
         else
           FOUND_MAKE=$MAKE_CANDIDATE
@@ -7889,25 +7468,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -7927,11 +7522,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -8023,14 +7620,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -8085,18 +7684,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -8110,7 +7711,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
   fi
 
@@ -8120,7 +7721,9 @@
   fi
 
     if test "x$FOUND_MAKE" = x; then
-      as_fn_error $? "The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer." >&5
+$as_echo "$as_me: error: The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     # Try our hardest to locate a correct version of GNU make
@@ -8128,9 +7731,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHECK_GMAKE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CHECK_GMAKE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CHECK_GMAKE in
@@ -8143,14 +7746,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CHECK_GMAKE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -8158,10 +7761,10 @@
 fi
 CHECK_GMAKE=$ac_cv_path_CHECK_GMAKE
 if test -n "$CHECK_GMAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_GMAKE" >&5
+  { $as_echo "$as_me:$LINENO: result: $CHECK_GMAKE" >&5
 $as_echo "$CHECK_GMAKE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -8173,17 +7776,17 @@
   MAKE_CANDIDATE=""$CHECK_GMAKE""
   DESCRIPTION="gmake in PATH"
   if test "x$MAKE_CANDIDATE" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
+    { $as_echo "$as_me:$LINENO: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
 $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;}
     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
     if test "x$IS_GNU_MAKE" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
+      { $as_echo "$as_me:$LINENO: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
     else
       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'`
       if test "x$IS_MODERN_MAKE" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
+        { $as_echo "$as_me:$LINENO: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
       else
         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
@@ -8192,7 +7795,9 @@
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
             MAKE_EXPECTED_ENV='msys'
           else
-            as_fn_error $? "Unknown Windows environment" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Unknown Windows environment" >&5
+$as_echo "$as_me: error: Unknown Windows environment" >&2;}
+   { (exit 1); exit 1; }; }
           fi
           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
@@ -8201,7 +7806,7 @@
           IS_MAKE_CORRECT_ENV=true
         fi
         if test "x$IS_MAKE_CORRECT_ENV" = x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
+          { $as_echo "$as_me:$LINENO: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
 $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;}
         else
           FOUND_MAKE=$MAKE_CANDIDATE
@@ -8221,25 +7826,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -8259,11 +7880,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -8355,14 +7978,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -8417,18 +8042,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -8442,7 +8069,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
   fi
 
@@ -8457,9 +8084,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHECK_MAKE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CHECK_MAKE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CHECK_MAKE in
@@ -8472,14 +8099,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CHECK_MAKE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -8487,10 +8114,10 @@
 fi
 CHECK_MAKE=$ac_cv_path_CHECK_MAKE
 if test -n "$CHECK_MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_MAKE" >&5
+  { $as_echo "$as_me:$LINENO: result: $CHECK_MAKE" >&5
 $as_echo "$CHECK_MAKE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -8502,17 +8129,17 @@
   MAKE_CANDIDATE=""$CHECK_MAKE""
   DESCRIPTION="make in PATH"
   if test "x$MAKE_CANDIDATE" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
+    { $as_echo "$as_me:$LINENO: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
 $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;}
     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
     if test "x$IS_GNU_MAKE" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
+      { $as_echo "$as_me:$LINENO: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
     else
       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'`
       if test "x$IS_MODERN_MAKE" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
+        { $as_echo "$as_me:$LINENO: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
       else
         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
@@ -8521,7 +8148,9 @@
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
             MAKE_EXPECTED_ENV='msys'
           else
-            as_fn_error $? "Unknown Windows environment" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Unknown Windows environment" >&5
+$as_echo "$as_me: error: Unknown Windows environment" >&2;}
+   { (exit 1); exit 1; }; }
           fi
           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
@@ -8530,7 +8159,7 @@
           IS_MAKE_CORRECT_ENV=true
         fi
         if test "x$IS_MAKE_CORRECT_ENV" = x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
+          { $as_echo "$as_me:$LINENO: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
 $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;}
         else
           FOUND_MAKE=$MAKE_CANDIDATE
@@ -8550,25 +8179,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -8588,11 +8233,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -8684,14 +8331,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -8746,18 +8395,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -8771,7 +8422,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
   fi
 
@@ -8791,9 +8442,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CHECK_TOOLSDIR_GMAKE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CHECK_TOOLSDIR_GMAKE in
@@ -8806,14 +8457,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CHECK_TOOLSDIR_GMAKE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -8821,10 +8472,10 @@
 fi
 CHECK_TOOLSDIR_GMAKE=$ac_cv_path_CHECK_TOOLSDIR_GMAKE
 if test -n "$CHECK_TOOLSDIR_GMAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_GMAKE" >&5
+  { $as_echo "$as_me:$LINENO: result: $CHECK_TOOLSDIR_GMAKE" >&5
 $as_echo "$CHECK_TOOLSDIR_GMAKE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -8836,17 +8487,17 @@
   MAKE_CANDIDATE=""$CHECK_TOOLSDIR_GMAKE""
   DESCRIPTION="gmake in tools-dir"
   if test "x$MAKE_CANDIDATE" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
+    { $as_echo "$as_me:$LINENO: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
 $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;}
     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
     if test "x$IS_GNU_MAKE" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
+      { $as_echo "$as_me:$LINENO: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
     else
       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'`
       if test "x$IS_MODERN_MAKE" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
+        { $as_echo "$as_me:$LINENO: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
       else
         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
@@ -8855,7 +8506,9 @@
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
             MAKE_EXPECTED_ENV='msys'
           else
-            as_fn_error $? "Unknown Windows environment" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Unknown Windows environment" >&5
+$as_echo "$as_me: error: Unknown Windows environment" >&2;}
+   { (exit 1); exit 1; }; }
           fi
           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
@@ -8864,7 +8517,7 @@
           IS_MAKE_CORRECT_ENV=true
         fi
         if test "x$IS_MAKE_CORRECT_ENV" = x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
+          { $as_echo "$as_me:$LINENO: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
 $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;}
         else
           FOUND_MAKE=$MAKE_CANDIDATE
@@ -8884,25 +8537,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -8922,11 +8591,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -9018,14 +8689,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -9080,18 +8753,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -9105,7 +8780,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
   fi
 
@@ -9119,9 +8794,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CHECK_TOOLSDIR_MAKE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CHECK_TOOLSDIR_MAKE in
@@ -9134,14 +8809,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CHECK_TOOLSDIR_MAKE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9149,10 +8824,10 @@
 fi
 CHECK_TOOLSDIR_MAKE=$ac_cv_path_CHECK_TOOLSDIR_MAKE
 if test -n "$CHECK_TOOLSDIR_MAKE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHECK_TOOLSDIR_MAKE" >&5
+  { $as_echo "$as_me:$LINENO: result: $CHECK_TOOLSDIR_MAKE" >&5
 $as_echo "$CHECK_TOOLSDIR_MAKE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9164,17 +8839,17 @@
   MAKE_CANDIDATE=""$CHECK_TOOLSDIR_MAKE""
   DESCRIPTION="make in tools-dir"
   if test "x$MAKE_CANDIDATE" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
+    { $as_echo "$as_me:$LINENO: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&5
 $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION" >&6;}
     MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
     IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
     if test "x$IS_GNU_MAKE" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
+      { $as_echo "$as_me:$LINENO: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5
 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;}
     else
       IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'`
       if test "x$IS_MODERN_MAKE" = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
+        { $as_echo "$as_me:$LINENO: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5
 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;}
       else
         if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
@@ -9183,7 +8858,9 @@
           elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
             MAKE_EXPECTED_ENV='msys'
           else
-            as_fn_error $? "Unknown Windows environment" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Unknown Windows environment" >&5
+$as_echo "$as_me: error: Unknown Windows environment" >&2;}
+   { (exit 1); exit 1; }; }
           fi
           MAKE_BUILT_FOR=`$MAKE_CANDIDATE --version | $GREP -i 'built for'`
           IS_MAKE_CORRECT_ENV=`$ECHO $MAKE_BUILT_FOR | $GREP $MAKE_EXPECTED_ENV`
@@ -9192,7 +8869,7 @@
           IS_MAKE_CORRECT_ENV=true
         fi
         if test "x$IS_MAKE_CORRECT_ENV" = x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
+          { $as_echo "$as_me:$LINENO: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&5
 $as_echo "$as_me: Found GNU make version $MAKE_VERSION_STRING at $MAKE_CANDIDATE, but it is not for $MAKE_EXPECTED_ENV (it says: $MAKE_BUILT_FOR). Ignoring." >&6;}
         else
           FOUND_MAKE=$MAKE_CANDIDATE
@@ -9212,25 +8889,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -9250,11 +8943,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -9346,14 +9041,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -9408,18 +9105,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving FOUND_MAKE (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of FOUND_MAKE, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of FOUND_MAKE" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FOUND_MAKE" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FOUND_MAKE" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -9433,7 +9132,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     FOUND_MAKE="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FOUND_MAKE to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting FOUND_MAKE to \"$new_complete\"" >&6;}
   fi
 
@@ -9448,19 +9147,21 @@
     fi
 
     if test "x$FOUND_MAKE" = x; then
-      as_fn_error $? "Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." >&5
+$as_echo "$as_me: error: Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
   MAKE=$FOUND_MAKE
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&5
+  { $as_echo "$as_me:$LINENO: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&5
 $as_echo "$as_me: Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)" >&6;}
 
 
 
     # Test if find supports -delete
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if find supports -delete" >&5
+    { $as_echo "$as_me:$LINENO: checking if find supports -delete" >&5
 $as_echo_n "checking if find supports -delete... " >&6; }
     FIND_DELETE="-delete"
 
@@ -9473,10 +9174,10 @@
         # No, it does not.
         rm $DELETEDIR/TestIfFindSupportsDelete
         FIND_DELETE="-exec rm \{\} \+"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+        { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    else
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
     fi
     rmdir $DELETEDIR
@@ -9490,9 +9191,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_UNZIP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_UNZIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $UNZIP in
@@ -9505,14 +9206,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9520,10 +9221,10 @@
 fi
 UNZIP=$ac_cv_path_UNZIP
 if test -n "$UNZIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5
+  { $as_echo "$as_me:$LINENO: result: $UNZIP" >&5
 $as_echo "$UNZIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9538,9 +9239,11 @@
         else
           PROG_NAME=unzip
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -9549,9 +9252,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ZIP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ZIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $ZIP in
@@ -9564,14 +9267,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9579,10 +9282,10 @@
 fi
 ZIP=$ac_cv_path_ZIP
 if test -n "$ZIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5
+  { $as_echo "$as_me:$LINENO: result: $ZIP" >&5
 $as_echo "$ZIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9597,9 +9300,11 @@
         else
           PROG_NAME=zip
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -9608,9 +9313,9 @@
 
 # Extract the first word of "ldd", so it can be a program name with args.
 set dummy ldd; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LDD+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LDD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $LDD in
@@ -9623,14 +9328,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LDD="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9638,10 +9343,10 @@
 fi
 LDD=$ac_cv_path_LDD
 if test -n "$LDD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDD" >&5
+  { $as_echo "$as_me:$LINENO: result: $LDD" >&5
 $as_echo "$LDD" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9654,9 +9359,9 @@
 fi
 # Extract the first word of "otool", so it can be a program name with args.
 set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_OTOOL+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_OTOOL+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $OTOOL in
@@ -9669,14 +9374,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_OTOOL="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9684,10 +9389,10 @@
 fi
 OTOOL=$ac_cv_path_OTOOL
 if test -n "$OTOOL"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+  { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5
 $as_echo "$OTOOL" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9699,9 +9404,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_READELF+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_READELF+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $READELF in
@@ -9714,14 +9419,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_READELF="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9729,10 +9434,10 @@
 fi
 READELF=$ac_cv_path_READELF
 if test -n "$READELF"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
+  { $as_echo "$as_me:$LINENO: result: $READELF" >&5
 $as_echo "$READELF" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9742,9 +9447,9 @@
 
 # Extract the first word of "hg", so it can be a program name with args.
 set dummy hg; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_HG+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_HG+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $HG in
@@ -9757,14 +9462,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_HG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9772,19 +9477,19 @@
 fi
 HG=$ac_cv_path_HG
 if test -n "$HG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HG" >&5
+  { $as_echo "$as_me:$LINENO: result: $HG" >&5
 $as_echo "$HG" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "stat", so it can be a program name with args.
 set dummy stat; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_STAT+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_STAT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $STAT in
@@ -9797,14 +9502,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_STAT="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9812,19 +9517,19 @@
 fi
 STAT=$ac_cv_path_STAT
 if test -n "$STAT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STAT" >&5
+  { $as_echo "$as_me:$LINENO: result: $STAT" >&5
 $as_echo "$STAT" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
 # Extract the first word of "time", so it can be a program name with args.
 set dummy time; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_TIME+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_TIME+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $TIME in
@@ -9837,14 +9542,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_TIME="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9852,10 +9557,10 @@
 fi
 TIME=$ac_cv_path_TIME
 if test -n "$TIME"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TIME" >&5
+  { $as_echo "$as_me:$LINENO: result: $TIME" >&5
 $as_echo "$TIME" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9867,9 +9572,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_COMM+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_COMM+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $COMM in
@@ -9882,14 +9587,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9897,10 +9602,10 @@
 fi
 COMM=$ac_cv_path_COMM
 if test -n "$COMM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5
+  { $as_echo "$as_me:$LINENO: result: $COMM" >&5
 $as_echo "$COMM" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9915,9 +9620,11 @@
         else
           PROG_NAME=comm
         fi
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5
-$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
-        as_fn_error $? "Cannot continue" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: Could not find $PROG_NAME!" >&5
+$as_echo "$as_me: Could not find $PROG_NAME!" >&6;}
+        { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
 
@@ -9931,9 +9638,9 @@
 	if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -9946,14 +9653,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -9961,10 +9668,10 @@
 fi
 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 if test -n "$PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
 $as_echo "$PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -9974,9 +9681,9 @@
   ac_pt_PKG_CONFIG=$PKG_CONFIG
   # Extract the first word of "pkg-config", so it can be a program name with args.
 set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -9989,14 +9696,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -10004,10 +9711,10 @@
 fi
 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
 if test -n "$ac_pt_PKG_CONFIG"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
 $as_echo "$ac_pt_PKG_CONFIG" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -10016,7 +9723,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -10029,13 +9736,13 @@
 fi
 if test -n "$PKG_CONFIG"; then
 	_pkg_min_version=0.9.0
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+	{ $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
 	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+		{ $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 	else
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+		{ $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 		PKG_CONFIG=""
 	fi
@@ -10063,21 +9770,21 @@
 
 
 # Check whether --with-builddeps-conf was given.
-if test "${with_builddeps_conf+set}" = set; then :
+if test "${with_builddeps_conf+set}" = set; then
   withval=$with_builddeps_conf;
 fi
 
 
 
 # Check whether --with-builddeps-server was given.
-if test "${with_builddeps_server+set}" = set; then :
+if test "${with_builddeps_server+set}" = set; then
   withval=$with_builddeps_server;
 fi
 
 
 
 # Check whether --with-builddeps-dir was given.
-if test "${with_builddeps_dir+set}" = set; then :
+if test "${with_builddeps_dir+set}" = set; then
   withval=$with_builddeps_dir;
 else
   with_builddeps_dir=/localhome/builddeps
@@ -10086,7 +9793,7 @@
 
 
 # Check whether --with-builddeps-group was given.
-if test "${with_builddeps_group+set}" = set; then :
+if test "${with_builddeps_group+set}" = set; then
   withval=$with_builddeps_group;
 fi
 
@@ -10095,18 +9802,20 @@
 
     if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
         if test "x$with_builddeps_conf" != x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supplied builddeps configuration file" >&5
+            { $as_echo "$as_me:$LINENO: checking for supplied builddeps configuration file" >&5
 $as_echo_n "checking for supplied builddeps configuration file... " >&6; }
             builddepsfile=$with_builddeps_conf
             if test -s $builddepsfile; then
                 . $builddepsfile
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: loaded!" >&5
+                { $as_echo "$as_me:$LINENO: result: loaded!" >&5
 $as_echo "loaded!" >&6; }
             else
-               as_fn_error $? "The given builddeps conf file $with_builddeps_conf could not be loaded!" "$LINENO" 5
+               { { $as_echo "$as_me:$LINENO: error: The given builddeps conf file $with_builddeps_conf could not be loaded!" >&5
+$as_echo "$as_me: error: The given builddeps conf file $with_builddeps_conf could not be loaded!" >&2;}
+   { (exit 1); exit 1; }; }
            fi
         else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for builddeps.conf files in sources..." >&5
+            { $as_echo "$as_me:$LINENO: checking for builddeps.conf files in sources..." >&5
 $as_echo_n "checking for builddeps.conf files in sources...... " >&6; }
             builddepsfile=`mktemp`
             touch $builddepsfile
@@ -10115,10 +9824,12 @@
             # Source the file to acquire the variables
             if test -s $builddepsfile; then
                 . $builddepsfile
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: found at least one!" >&5
+                { $as_echo "$as_me:$LINENO: result: found at least one!" >&5
 $as_echo "found at least one!" >&6; }
             else
-               as_fn_error $? "Could not find any builddeps.conf at all!" "$LINENO" 5
+               { { $as_echo "$as_me:$LINENO: error: Could not find any builddeps.conf at all!" >&5
+$as_echo "$as_me: error: Could not find any builddeps.conf at all!" >&2;}
+   { (exit 1); exit 1; }; }
            fi
         fi
         # Create build and target names that use _ instead of "-" and ".".
@@ -10147,9 +9858,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_BDEPS_UNZIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$BDEPS_UNZIP"; then
@@ -10160,24 +9871,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_BDEPS_UNZIP="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 BDEPS_UNZIP=$ac_cv_prog_BDEPS_UNZIP
 if test -n "$BDEPS_UNZIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BDEPS_UNZIP" >&5
+  { $as_echo "$as_me:$LINENO: result: $BDEPS_UNZIP" >&5
 $as_echo "$BDEPS_UNZIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -10193,9 +9904,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_BDEPS_FTP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_BDEPS_FTP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$BDEPS_FTP"; then
@@ -10206,24 +9917,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_BDEPS_FTP="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 BDEPS_FTP=$ac_cv_prog_BDEPS_FTP
 if test -n "$BDEPS_FTP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BDEPS_FTP" >&5
+  { $as_echo "$as_me:$LINENO: result: $BDEPS_FTP" >&5
 $as_echo "$BDEPS_FTP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -10247,33 +9958,33 @@
 # Should we build only OpenJDK even if closed sources are present?
 #
 # Check whether --enable-openjdk-only was given.
-if test "${enable_openjdk_only+set}" = set; then :
+if test "${enable_openjdk_only+set}" = set; then
   enableval=$enable_openjdk_only;
 else
   enable_openjdk_only="no"
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for presence of closed sources" >&5
+{ $as_echo "$as_me:$LINENO: checking for presence of closed sources" >&5
 $as_echo_n "checking for presence of closed sources... " >&6; }
 if test -d "$SRC_ROOT/jdk/src/closed"; then
     CLOSED_SOURCE_PRESENT=yes
 else
     CLOSED_SOURCE_PRESENT=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLOSED_SOURCE_PRESENT" >&5
+{ $as_echo "$as_me:$LINENO: result: $CLOSED_SOURCE_PRESENT" >&5
 $as_echo "$CLOSED_SOURCE_PRESENT" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if closed source is supressed (openjdk-only)" >&5
+{ $as_echo "$as_me:$LINENO: checking if closed source is supressed (openjdk-only)" >&5
 $as_echo_n "checking if closed source is supressed (openjdk-only)... " >&6; }
 SUPRESS_CLOSED_SOURCE="$enable_openjdk_only"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SUPRESS_CLOSED_SOURCE" >&5
+{ $as_echo "$as_me:$LINENO: result: $SUPRESS_CLOSED_SOURCE" >&5
 $as_echo "$SUPRESS_CLOSED_SOURCE" >&6; }
 
 if test "x$CLOSED_SOURCE_PRESENT" = xno; then
   OPENJDK=true
   if test "x$SUPRESS_CLOSED_SOURCE" = "xyes"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&5
+    { $as_echo "$as_me:$LINENO: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&5
 $as_echo "$as_me: WARNING: No closed source present, --enable-openjdk-only makes no sense" >&2;}
   fi
 else
@@ -10295,10 +10006,10 @@
 # Should we build a JDK/JVM with headful support (ie a graphical ui)?
 # We always build headless support.
 #
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking headful support" >&5
+{ $as_echo "$as_me:$LINENO: checking headful support" >&5
 $as_echo_n "checking headful support... " >&6; }
 # Check whether --enable-headful was given.
-if test "${enable_headful+set}" = set; then :
+if test "${enable_headful+set}" = set; then
   enableval=$enable_headful; SUPPORT_HEADFUL=${enable_headful}
 else
   SUPPORT_HEADFUL=yes
@@ -10319,7 +10030,7 @@
     headful_msg="headless only"
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $headful_msg" >&5
+{ $as_echo "$as_me:$LINENO: result: $headful_msg" >&5
 $as_echo "$headful_msg" >&6; }
 
 
@@ -10328,7 +10039,7 @@
 
 # Control wether Hotspot runs Queens test after build.
 # Check whether --enable-hotspot-test-in-build was given.
-if test "${enable_hotspot_test_in_build+set}" = set; then :
+if test "${enable_hotspot_test_in_build+set}" = set; then
   enableval=$enable_hotspot_test_in_build;
 else
   enable_hotspot_test_in_build=no
@@ -10347,7 +10058,7 @@
 #
 
 # Check whether --with-cacerts-file was given.
-if test "${with_cacerts_file+set}" = set; then :
+if test "${with_cacerts_file+set}" = set; then
   withval=$with_cacerts_file;
 fi
 
@@ -10367,7 +10078,7 @@
 # Enable or disable unlimited crypto
 #
 # Check whether --enable-unlimited-crypto was given.
-if test "${enable_unlimited_crypto+set}" = set; then :
+if test "${enable_unlimited_crypto+set}" = set; then
   enableval=$enable_unlimited_crypto;
 else
   enable_unlimited_crypto=no
@@ -10454,7 +10165,7 @@
 BOOT_JDK_FOUND=no
 
 # Check whether --with-boot-jdk was given.
-if test "${with_boot_jdk+set}" = set; then :
+if test "${with_boot_jdk+set}" = set; then
   withval=$with_boot_jdk;
 fi
 
@@ -10472,7 +10183,7 @@
 if test "x$with_boot_jdk" != x; then
     BOOT_JDK=$with_boot_jdk
     BOOT_JDK_FOUND=maybe
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using configure arguments" >&5
+    { $as_echo "$as_me:$LINENO: Found potential Boot JDK using configure arguments" >&5
 $as_echo "$as_me: Found potential Boot JDK using configure arguments" >&6;}
 fi
 
@@ -10481,21 +10192,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -10505,9 +10216,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -10530,9 +10241,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -10571,7 +10284,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -10609,7 +10322,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -10621,25 +10334,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -10651,7 +10368,9 @@
 if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then
   # Having specified an argument which is incorrect will produce an instant failure;
   # we should not go on looking
-  as_fn_error $? "The path given by --with-boot-jdk does not contain a valid Boot JDK" "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: The path given by --with-boot-jdk does not contain a valid Boot JDK" >&5
+$as_echo "$as_me: error: The path given by --with-boot-jdk does not contain a valid Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 # Test: Is bootjdk available from builddeps?
@@ -10680,7 +10399,7 @@
             resource=${builddep_bootjdk}
         fi
         if test "x$resource" != x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for bootjdk" >&5
+            { $as_echo "$as_me:$LINENO: Using builddeps $resource for bootjdk" >&5
 $as_echo "$as_me: Using builddeps $resource for bootjdk" >&6;}
 	    # If the resource in the builddeps.conf file is an existing directory,
 	    # for example /java/linux/cups
@@ -10701,18 +10420,22 @@
     extension=${filename#*.}
     installdir=$with_builddeps_dir/$filebase
     if test ! -f $installdir/$filename.unpacked; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&5
+        { $as_echo "$as_me:$LINENO: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&5
 $as_echo "$as_me: Downloading build dependency bootjdk from $with_builddeps_server/$resource and installing into $installdir" >&6;}
         if test ! -d $installdir; then
             mkdir -p $installdir
         fi
         if test ! -d $installdir; then
-            as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create directory $installdir" >&5
+$as_echo "$as_me: error: Could not create directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         tmpfile=`mktemp $installdir/bootjdk.XXXXXXXXX`
         touch $tmpfile
         if test ! -f $tmpfile; then
-            as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create files in directory $installdir" >&5
+$as_echo "$as_me: error: Could not create files in directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
 
     # $with_builddeps_server/$resource  is the ftp://abuilddeps.server.com/libs/cups.zip
@@ -10750,12 +10473,16 @@
         ) | ftp -in $FTPSERVER
     fi
     if test "x$VALID_TOOL" != xyes; then
-       as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: I do not know how to use the tool: $BDEPS_FTP" >&5
+$as_echo "$as_me: error: I do not know how to use the tool: $BDEPS_FTP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
         mv $tmpfile $installdir/$filename
         if test ! -s $installdir/$filename; then
-            as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not download $with_builddeps_server/$resource" >&5
+$as_echo "$as_me: error: Could not download $with_builddeps_server/$resource" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         case "$extension" in
             zip)  echo "Unzipping $installdir/$filename..."
@@ -10767,7 +10494,9 @@
             tgz) echo "Untaring $installdir/$filename..."
                (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
             ;;
-            *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5
+            *) { { $as_echo "$as_me:$LINENO: error: Cannot handle build depency archive with extension $extension" >&5
+$as_echo "$as_me: error: Cannot handle build depency archive with extension $extension" >&2;}
+   { (exit 1); exit 1; }; }
             ;;
         esac
     fi
@@ -10784,7 +10513,9 @@
             thecflags=${builddep_bootjdk_CFLAGS}
             thelibs=${builddep_bootjdk_LIBS}
             if test "x$depdir" = x; then
-                as_fn_error $? "Could not download build dependency bootjdk" "$LINENO" 5
+                { { $as_echo "$as_me:$LINENO: error: Could not download build dependency bootjdk" >&5
+$as_echo "$as_me: error: Could not download build dependency bootjdk" >&2;}
+   { (exit 1); exit 1; }; }
             fi
             BOOT_JDK=$depdir
             if test "x$theroot" != x; then
@@ -10810,21 +10541,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -10834,9 +10565,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -10859,9 +10590,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -10900,7 +10633,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -10938,7 +10671,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -10950,25 +10683,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -11002,9 +10739,11 @@
   # 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 JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of JAVA_HOME_PROCESSED" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of JAVA_HOME_PROCESSED" >&5
+$as_echo "$as_me: error: Cannot locate the the path of JAVA_HOME_PROCESSED" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -11043,7 +10782,7 @@
 
   if test "x$path" != "x$new_path"; then
     JAVA_HOME_PROCESSED="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;}
   fi
 
@@ -11081,7 +10820,7 @@
 
   if test "x$path" != "x$new_path"; then
     JAVA_HOME_PROCESSED="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting JAVA_HOME_PROCESSED to \"$new_path\"" >&6;}
   fi
 
@@ -11093,26 +10832,30 @@
     path="$JAVA_HOME_PROCESSED"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of JAVA_HOME_PROCESSED, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
         if test ! -d "$JAVA_HOME_PROCESSED"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Your JAVA_HOME points to a non-existing directory!" >&5
+            { $as_echo "$as_me:$LINENO: Your JAVA_HOME points to a non-existing directory!" >&5
 $as_echo "$as_me: Your JAVA_HOME points to a non-existing directory!" >&6;}
         else
           # Aha, the user has set a JAVA_HOME
           # let us use that as the Boot JDK.
           BOOT_JDK="$JAVA_HOME_PROCESSED"
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using JAVA_HOME" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using JAVA_HOME" >&5
 $as_echo "$as_me: Found potential Boot JDK using JAVA_HOME" >&6;}
         fi
     fi
@@ -11122,21 +10865,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -11146,9 +10889,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -11171,9 +10914,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -11212,7 +10957,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11250,7 +10995,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11262,25 +11007,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -11298,7 +11047,7 @@
     if test -x /usr/libexec/java_home; then
         BOOT_JDK=`/usr/libexec/java_home`
         BOOT_JDK_FOUND=maybe
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using /usr/libexec/java_home" >&5
+        { $as_echo "$as_me:$LINENO: Found potential Boot JDK using /usr/libexec/java_home" >&5
 $as_echo "$as_me: Found potential Boot JDK using /usr/libexec/java_home" >&6;}
     fi
 
@@ -11307,21 +11056,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -11331,9 +11080,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -11356,9 +11105,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -11397,7 +11148,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11435,7 +11186,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11447,25 +11198,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -11482,9 +11237,9 @@
 
     # Extract the first word of "javac", so it can be a program name with args.
 set dummy javac; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_JAVAC_CHECK+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAVAC_CHECK+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $JAVAC_CHECK in
@@ -11497,14 +11252,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_JAVAC_CHECK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -11512,19 +11267,19 @@
 fi
 JAVAC_CHECK=$ac_cv_path_JAVAC_CHECK
 if test -n "$JAVAC_CHECK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC_CHECK" >&5
+  { $as_echo "$as_me:$LINENO: result: $JAVAC_CHECK" >&5
 $as_echo "$JAVAC_CHECK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
     # Extract the first word of "java", so it can be a program name with args.
 set dummy java; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_JAVA_CHECK+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_JAVA_CHECK+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $JAVA_CHECK in
@@ -11537,14 +11292,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_JAVA_CHECK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -11552,10 +11307,10 @@
 fi
 JAVA_CHECK=$ac_cv_path_JAVA_CHECK
 if test -n "$JAVA_CHECK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_CHECK" >&5
+  { $as_echo "$as_me:$LINENO: result: $JAVA_CHECK" >&5
 $as_echo "$JAVA_CHECK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -11618,7 +11373,7 @@
         if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
             # Looks like we found ourselves an JDK
             BOOT_JDK_FOUND=maybe
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using java(c) in PATH" >&5
+            { $as_echo "$as_me:$LINENO: Found potential Boot JDK using java(c) in PATH" >&5
 $as_echo "$as_me: Found potential Boot JDK using java(c) in PATH" >&6;}
         fi
     fi
@@ -11628,21 +11383,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -11652,9 +11407,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -11677,9 +11432,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -11718,7 +11475,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11756,7 +11513,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11768,25 +11525,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -11831,7 +11592,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -11840,21 +11601,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -11864,9 +11625,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -11889,9 +11650,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -11930,7 +11693,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11968,7 +11731,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -11980,25 +11743,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -12017,21 +11784,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -12041,9 +11808,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -12066,9 +11833,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -12107,7 +11876,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12145,7 +11914,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12157,25 +11926,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -12213,7 +11986,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -12222,21 +11995,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -12246,9 +12019,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -12271,9 +12044,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -12312,7 +12087,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12350,7 +12125,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12362,25 +12137,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -12399,21 +12178,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -12423,9 +12202,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -12448,9 +12227,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -12489,7 +12270,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12527,7 +12308,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12539,25 +12320,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -12595,7 +12380,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -12604,21 +12389,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -12628,9 +12413,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -12653,9 +12438,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -12694,7 +12481,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12732,7 +12519,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12744,25 +12531,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -12781,21 +12572,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -12805,9 +12596,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -12830,9 +12621,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -12871,7 +12664,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12909,7 +12702,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -12921,25 +12714,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -12977,7 +12774,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -12986,21 +12783,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -13010,9 +12807,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -13035,9 +12832,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -13076,7 +12875,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13114,7 +12913,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13126,25 +12925,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -13163,21 +12966,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -13187,9 +12990,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -13212,9 +13015,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -13253,7 +13058,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13291,7 +13096,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13303,25 +13108,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -13346,7 +13155,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -13355,21 +13164,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -13379,9 +13188,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -13404,9 +13213,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -13445,7 +13256,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13483,7 +13294,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13495,25 +13306,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -13530,21 +13345,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -13554,9 +13369,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -13579,9 +13394,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -13620,7 +13437,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13658,7 +13475,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13670,25 +13487,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -13714,7 +13535,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -13723,21 +13544,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -13747,9 +13568,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -13772,9 +13593,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -13813,7 +13636,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13851,7 +13674,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -13863,25 +13686,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -13898,21 +13725,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -13922,9 +13749,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -13947,9 +13774,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -13988,7 +13817,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14026,7 +13855,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14038,25 +13867,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -14081,7 +13914,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -14090,21 +13923,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -14114,9 +13947,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -14139,9 +13972,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -14180,7 +14015,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14218,7 +14053,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14230,25 +14065,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -14265,21 +14104,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -14289,9 +14128,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -14314,9 +14153,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -14355,7 +14196,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14393,7 +14234,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14405,25 +14246,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -14449,7 +14294,7 @@
         BOOT_JDK="${BOOT_JDK_PREFIX}/${JDK_TO_TRY}${BOOT_JDK_SUFFIX}"
         if test -d "$BOOT_JDK"; then
           BOOT_JDK_FOUND=maybe
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
+          { $as_echo "$as_me:$LINENO: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&5
 $as_echo "$as_me: Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX/$JDK_TO_TRY)" >&6;}
         fi
 
@@ -14458,21 +14303,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -14482,9 +14327,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -14507,9 +14352,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -14548,7 +14395,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14586,7 +14433,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14598,25 +14445,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -14633,21 +14484,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -14657,9 +14508,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -14682,9 +14533,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -14723,7 +14576,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14761,7 +14614,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14773,25 +14626,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -14807,21 +14664,21 @@
     if test "x$BOOT_JDK_FOUND" = xmaybe; then
       # Do we have a bin/java?
       if test ! -x "$BOOT_JDK/bin/java"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring" >&6;}
         BOOT_JDK_FOUND=no
       else
         # Do we have a bin/javac?
         if test ! -x "$BOOT_JDK/bin/javac"; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
+          { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring" >&6;}
-          { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be an JRE instead of an JDK)" >&5
+          { $as_echo "$as_me:$LINENO: (This might be an JRE instead of an JDK)" >&5
 $as_echo "$as_me: (This might be an JRE instead of an JDK)" >&6;}
           BOOT_JDK_FOUND=no
         else
           # Do we have an rt.jar? (On MacOSX it is called classes.jar)
           if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
+            { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring" >&6;}
             BOOT_JDK_FOUND=no
           else
@@ -14831,9 +14688,9 @@
             # Extra M4 quote needed to protect [] in grep expression.
             FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep  '\"1\.[78]\.'`
             if test "x$FOUND_VERSION_78" = x; then
-              { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
+              { $as_echo "$as_me:$LINENO: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&5
 $as_echo "$as_me: Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring" >&6;}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Boot JDK must be version 7 or 8)" >&5
+              { $as_echo "$as_me:$LINENO: (Your Boot JDK must be version 7 or 8)" >&5
 $as_echo "$as_me: (Your Boot JDK must be version 7 or 8)" >&6;}
               BOOT_JDK_FOUND=no
             else
@@ -14856,9 +14713,11 @@
   # 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 BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of BOOT_JDK" "$LINENO" 5
+    { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BOOT_JDK" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BOOT_JDK" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -14897,7 +14756,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14935,7 +14794,7 @@
 
   if test "x$path" != "x$new_path"; then
     BOOT_JDK="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BOOT_JDK to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BOOT_JDK to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting BOOT_JDK to \"$new_path\"" >&6;}
   fi
 
@@ -14947,25 +14806,29 @@
     path="$BOOT_JDK"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of BOOT_JDK, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of BOOT_JDK, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
-$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boot JDK" >&5
+      { $as_echo "$as_me:$LINENO: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&5
+$as_echo "$as_me: The path of BOOT_JDK, which resolves as \"$path\", is invalid." >&6;}
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+              { $as_echo "$as_me:$LINENO: checking for Boot JDK" >&5
 $as_echo_n "checking for Boot JDK... " >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK" >&5
 $as_echo "$BOOT_JDK" >&6; }
-              { $as_echo "$as_me:${as_lineno-$LINENO}: checking Boot JDK version" >&5
+              { $as_echo "$as_me:$LINENO: checking Boot JDK version" >&5
 $as_echo_n "checking Boot JDK version... " >&6; }
               BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' '  '`
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BOOT_JDK_VERSION" >&5
+              { $as_echo "$as_me:$LINENO: result: $BOOT_JDK_VERSION" >&5
 $as_echo "$BOOT_JDK_VERSION" >&6; }
             fi # end check jdk version
           fi # end check rt.jar
@@ -15002,11 +14865,13 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find a valid Boot JDK. $HELP_MSG" >&5
+  { $as_echo "$as_me:$LINENO: Could not find a valid Boot JDK. $HELP_MSG" >&5
 $as_echo "$as_me: Could not find a valid Boot JDK. $HELP_MSG" >&6;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: This might be fixed by explicitely setting --with-boot-jdk" >&5
+  { $as_echo "$as_me:$LINENO: This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-  as_fn_error $? "Cannot continue" "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 # Setup proper paths for what we found
@@ -15027,101 +14892,115 @@
 
 # Setup tools from the Boot JDK.
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for java in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for java in Boot JDK" >&5
 $as_echo_n "checking for java in Boot JDK... " >&6; }
   JAVA=$BOOT_JDK/bin/java
   if test ! -x $JAVA; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find java in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find java in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find java in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javac in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for javac in Boot JDK" >&5
 $as_echo_n "checking for javac in Boot JDK... " >&6; }
   JAVAC=$BOOT_JDK/bin/javac
   if test ! -x $JAVAC; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find javac in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find javac in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find javac in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javah in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for javah in Boot JDK" >&5
 $as_echo_n "checking for javah in Boot JDK... " >&6; }
   JAVAH=$BOOT_JDK/bin/javah
   if test ! -x $JAVAH; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find javah in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find javah in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find javah in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for javap in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for javap in Boot JDK" >&5
 $as_echo_n "checking for javap in Boot JDK... " >&6; }
   JAVAP=$BOOT_JDK/bin/javap
   if test ! -x $JAVAP; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find javap in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find javap in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find javap in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jar in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for jar in Boot JDK" >&5
 $as_echo_n "checking for jar in Boot JDK... " >&6; }
   JAR=$BOOT_JDK/bin/jar
   if test ! -x $JAR; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find jar in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find jar in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find jar in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rmic in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for rmic in Boot JDK" >&5
 $as_echo_n "checking for rmic in Boot JDK... " >&6; }
   RMIC=$BOOT_JDK/bin/rmic
   if test ! -x $RMIC; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find rmic in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find rmic in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find rmic in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for native2ascii in Boot JDK" >&5
+  { $as_echo "$as_me:$LINENO: checking for native2ascii in Boot JDK" >&5
 $as_echo_n "checking for native2ascii in Boot JDK... " >&6; }
   NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
   if test ! -x $NATIVE2ASCII; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+      { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
+      { $as_echo "$as_me:$LINENO: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&5
 $as_echo "$as_me: Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk" >&6;}
-      as_fn_error $? "Could not find native2ascii in the Boot JDK" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Could not find native2ascii in the Boot JDK" >&5
+$as_echo "$as_me: error: Could not find native2ascii in the Boot JDK" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
 
 
@@ -15139,7 +15018,7 @@
 #
 
 # Check whether --with-boot-jdk-jvmargs was given.
-if test "${with_boot_jdk_jvmargs+set}" = set; then :
+if test "${with_boot_jdk_jvmargs+set}" = set; then
   withval=$with_boot_jdk_jvmargs;
 fi
 
@@ -15266,21 +15145,21 @@
 #
 
 # Check whether --with-add-source-root was given.
-if test "${with_add_source_root+set}" = set; then :
+if test "${with_add_source_root+set}" = set; then
   withval=$with_add_source_root;
 fi
 
 
 
 # Check whether --with-override-source-root was given.
-if test "${with_override_source_root+set}" = set; then :
+if test "${with_override_source_root+set}" = set; then
   withval=$with_override_source_root;
 fi
 
 
 
 # Check whether --with-adds-and-overrides was given.
-if test "${with_adds_and_overrides+set}" = set; then :
+if test "${with_adds_and_overrides+set}" = set; then
   withval=$with_adds_and_overrides;
 fi
 
@@ -15292,7 +15171,9 @@
 
 if test "x$with_add_source_root" != x; then
     if ! test -d $with_add_source_root; then
-       as_fn_error $? "Trying to use a non-existant add-source-root $with_add_source_root" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: Trying to use a non-existant add-source-root $with_add_source_root" >&5
+$as_echo "$as_me: error: Trying to use a non-existant add-source-root $with_add_source_root" >&2;}
+   { (exit 1); exit 1; }; }
     fi
     CURDIR="$PWD"
     cd "$with_add_source_root"
@@ -15302,34 +15183,48 @@
     # If it does, then it is usually an error, prevent this.
     if test -f $with_add_source_root/langtools/makefiles/Makefile || \
        test -f $with_add_source_root/langtools/make/Makefile; then
-        as_fn_error $? "Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources." >&5
+$as_echo "$as_me: error: Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_add_source_root/corba/makefiles/Makefile || \
        test -f $with_add_source_root/corba/make/Makefile; then
-        as_fn_error $? "Your add source root seems to contain a full corba repo! An add source root should only contain additional sources." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your add source root seems to contain a full corba repo! An add source root should only contain additional sources." >&5
+$as_echo "$as_me: error: Your add source root seems to contain a full corba repo! An add source root should only contain additional sources." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_add_source_root/jaxp/makefiles/Makefile || \
        test -f $with_add_source_root/jaxp/make/Makefile; then
-        as_fn_error $? "Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources." >&5
+$as_echo "$as_me: error: Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_add_source_root/jaxws/makefiles/Makefile || \
        test -f $with_add_source_root/jaxws/make/Makefile; then
-        as_fn_error $? "Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources." >&5
+$as_echo "$as_me: error: Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_add_source_root/hotspot/makefiles/Makefile || \
        test -f $with_add_source_root/hotspot/make/Makefile; then
-        as_fn_error $? "Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources." >&5
+$as_echo "$as_me: error: Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_add_source_root/jdk/makefiles/Makefile || \
        test -f $with_add_source_root/jdk/make/Makefile; then
-        as_fn_error $? "Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources." >&5
+$as_echo "$as_me: error: Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 fi
 
 
 if test "x$with_override_source_root" != x; then
     if ! test -d $with_override_source_root; then
-       as_fn_error $? "Trying to use a non-existant override-source-root $with_override_source_root" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: Trying to use a non-existant override-source-root $with_override_source_root" >&5
+$as_echo "$as_me: error: Trying to use a non-existant override-source-root $with_override_source_root" >&2;}
+   { (exit 1); exit 1; }; }
     fi
     CURDIR="$PWD"
     cd "$with_override_source_root"
@@ -15337,27 +15232,39 @@
     cd "$CURDIR"
     if test -f $with_override_source_root/langtools/makefiles/Makefile || \
        test -f $with_override_source_root/langtools/make/Makefile; then
-        as_fn_error $? "Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override." >&5
+$as_echo "$as_me: error: Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_override_source_root/corba/makefiles/Makefile || \
        test -f $with_override_source_root/corba/make/Makefile; then
-        as_fn_error $? "Your override source root seems to contain a full corba repo! An override source root should only contain sources that override." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your override source root seems to contain a full corba repo! An override source root should only contain sources that override." >&5
+$as_echo "$as_me: error: Your override source root seems to contain a full corba repo! An override source root should only contain sources that override." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_override_source_root/jaxp/makefiles/Makefile || \
        test -f $with_override_source_root/jaxp/make/Makefile; then
-        as_fn_error $? "Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override." >&5
+$as_echo "$as_me: error: Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_override_source_root/jaxws/makefiles/Makefile || \
        test -f $with_override_source_root/jaxws/make/Makefile; then
-        as_fn_error $? "Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override." >&5
+$as_echo "$as_me: error: Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_override_source_root/hotspot/makefiles/Makefile || \
        test -f $with_override_source_root/hotspot/make/Makefile; then
-        as_fn_error $? "Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override." >&5
+$as_echo "$as_me: error: Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override." >&2;}
+   { (exit 1); exit 1; }; }
     fi
     if test -f $with_override_source_root/jdk/makefiles/Makefile || \
        test -f $with_override_source_root/jdk/make/Makefile; then
-        as_fn_error $? "Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override." >&5
+$as_echo "$as_me: error: Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 fi
 
@@ -15383,42 +15290,42 @@
 
 
 # Check whether --with-override-langtools was given.
-if test "${with_override_langtools+set}" = set; then :
+if test "${with_override_langtools+set}" = set; then
   withval=$with_override_langtools;
 fi
 
 
 
 # Check whether --with-override-corba was given.
-if test "${with_override_corba+set}" = set; then :
+if test "${with_override_corba+set}" = set; then
   withval=$with_override_corba;
 fi
 
 
 
 # Check whether --with-override-jaxp was given.
-if test "${with_override_jaxp+set}" = set; then :
+if test "${with_override_jaxp+set}" = set; then
   withval=$with_override_jaxp;
 fi
 
 
 
 # Check whether --with-override-jaxws was given.
-if test "${with_override_jaxws+set}" = set; then :
+if test "${with_override_jaxws+set}" = set; then
   withval=$with_override_jaxws;
 fi
 
 
 
 # Check whether --with-override-hotspot was given.
-if test "${with_override_hotspot+set}" = set; then :
+if test "${with_override_hotspot+set}" = set; then
   withval=$with_override_hotspot;
 fi
 
 
 
 # Check whether --with-override-jdk was given.
-if test "${with_override_jdk+set}" = set; then :
+if test "${with_override_jdk+set}" = set; then
   withval=$with_override_jdk;
 fi
 
@@ -15429,11 +15336,13 @@
     LANGTOOLS_TOPDIR="`pwd`"
     cd "$CURDIR"
     if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then
-        as_fn_error $? "You have to override langtools with a full langtools repo!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if langtools should be overridden" >&5
+        { { $as_echo "$as_me:$LINENO: error: You have to override langtools with a full langtools repo!" >&5
+$as_echo "$as_me: error: You have to override langtools with a full langtools repo!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if langtools should be overridden" >&5
 $as_echo_n "checking if langtools should be overridden... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $LANGTOOLS_TOPDIR" >&5
+    { $as_echo "$as_me:$LINENO: result: yes with $LANGTOOLS_TOPDIR" >&5
 $as_echo "yes with $LANGTOOLS_TOPDIR" >&6; }
 fi
 if test "x$with_override_corba" != x; then
@@ -15442,11 +15351,13 @@
     CORBA_TOPDIR="`pwd`"
     cd "$CURDIR"
     if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then
-        as_fn_error $? "You have to override corba with a full corba repo!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if corba should be overridden" >&5
+        { { $as_echo "$as_me:$LINENO: error: You have to override corba with a full corba repo!" >&5
+$as_echo "$as_me: error: You have to override corba with a full corba repo!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if corba should be overridden" >&5
 $as_echo_n "checking if corba should be overridden... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $CORBA_TOPDIR" >&5
+    { $as_echo "$as_me:$LINENO: result: yes with $CORBA_TOPDIR" >&5
 $as_echo "yes with $CORBA_TOPDIR" >&6; }
 fi
 if test "x$with_override_jaxp" != x; then
@@ -15455,11 +15366,13 @@
     JAXP_TOPDIR="`pwd`"
     cd "$CURDIR"
     if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then
-        as_fn_error $? "You have to override jaxp with a full jaxp repo!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jaxp should be overridden" >&5
+        { { $as_echo "$as_me:$LINENO: error: You have to override jaxp with a full jaxp repo!" >&5
+$as_echo "$as_me: error: You have to override jaxp with a full jaxp repo!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if jaxp should be overridden" >&5
 $as_echo_n "checking if jaxp should be overridden... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $JAXP_TOPDIR" >&5
+    { $as_echo "$as_me:$LINENO: result: yes with $JAXP_TOPDIR" >&5
 $as_echo "yes with $JAXP_TOPDIR" >&6; }
 fi
 if test "x$with_override_jaxws" != x; then
@@ -15468,11 +15381,13 @@
     JAXWS_TOPDIR="`pwd`"
     cd "$CURDIR"
     if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then
-        as_fn_error $? "You have to override jaxws with a full jaxws repo!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jaxws should be overridden" >&5
+        { { $as_echo "$as_me:$LINENO: error: You have to override jaxws with a full jaxws repo!" >&5
+$as_echo "$as_me: error: You have to override jaxws with a full jaxws repo!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if jaxws should be overridden" >&5
 $as_echo_n "checking if jaxws should be overridden... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $JAXWS_TOPDIR" >&5
+    { $as_echo "$as_me:$LINENO: result: yes with $JAXWS_TOPDIR" >&5
 $as_echo "yes with $JAXWS_TOPDIR" >&6; }
 fi
 if test "x$with_override_hotspot" != x; then
@@ -15482,11 +15397,13 @@
     cd "$CURDIR"
     if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \
        ! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then
-        as_fn_error $? "You have to override hotspot with a full hotspot repo!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if hotspot should be overridden" >&5
+        { { $as_echo "$as_me:$LINENO: error: You have to override hotspot with a full hotspot repo!" >&5
+$as_echo "$as_me: error: You have to override hotspot with a full hotspot repo!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if hotspot should be overridden" >&5
 $as_echo_n "checking if hotspot should be overridden... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $HOTSPOT_TOPDIR" >&5
+    { $as_echo "$as_me:$LINENO: result: yes with $HOTSPOT_TOPDIR" >&5
 $as_echo "yes with $HOTSPOT_TOPDIR" >&6; }
 fi
 if test "x$with_override_jdk" != x; then
@@ -15495,11 +15412,13 @@
     JDK_TOPDIR="`pwd`"
     cd "$CURDIR"
     if ! test -f $JDK_TOPDIR/makefiles/Makefile; then
-        as_fn_error $? "You have to override JDK with a full JDK repo!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if JDK should be overridden" >&5
+        { { $as_echo "$as_me:$LINENO: error: You have to override JDK with a full JDK repo!" >&5
+$as_echo "$as_me: error: You have to override JDK with a full JDK repo!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if JDK should be overridden" >&5
 $as_echo_n "checking if JDK should be overridden... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes with $JDK_TOPDIR" >&5
+    { $as_echo "$as_me:$LINENO: result: yes with $JDK_TOPDIR" >&5
 $as_echo "yes with $JDK_TOPDIR" >&6; }
 fi
 
@@ -15508,6 +15427,33 @@
 BUILD_OUTPUT="$OUTPUT_ROOT"
 
 
+HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
+BUILD_HOTSPOT=true
+
+
+
+# Check whether --with-import-hotspot was given.
+if test "${with_import_hotspot+set}" = set; then
+  withval=$with_import_hotspot;
+fi
+
+if test "x$with_import_hotspot" != x; then
+    CURDIR="$PWD"
+    cd "$with_import_hotspot"
+    HOTSPOT_DIST="`pwd`"
+    cd "$CURDIR"
+    if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then
+        { { $as_echo "$as_me:$LINENO: error: You have to import hotspot from a full jdk image or hotspot build dist dir!" >&5
+$as_echo "$as_me: error: You have to import hotspot from a full jdk image or hotspot build dist dir!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: checking if hotspot should be imported" >&5
+$as_echo_n "checking if hotspot should be imported... " >&6; }
+    { $as_echo "$as_me:$LINENO: result: yes from $HOTSPOT_DIST" >&5
+$as_echo "yes from $HOTSPOT_DIST" >&6; }
+    BUILD_HOTSPOT=false
+fi
+
 JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
 
 
@@ -15552,9 +15498,9 @@
   # VS linker. This must be done before changing the PATH when looking for VS.
   # Extract the first word of "link", so it can be a program name with args.
 set dummy link; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CYGWIN_LINK+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CYGWIN_LINK+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CYGWIN_LINK in
@@ -15567,14 +15513,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CYGWIN_LINK="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -15582,23 +15528,23 @@
 fi
 CYGWIN_LINK=$ac_cv_path_CYGWIN_LINK
 if test -n "$CYGWIN_LINK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_LINK" >&5
+  { $as_echo "$as_me:$LINENO: result: $CYGWIN_LINK" >&5
 $as_echo "$CYGWIN_LINK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
   if test "x$CYGWIN_LINK" != x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the first found link.exe is actually the Cygwin link tool" >&5
+    { $as_echo "$as_me:$LINENO: checking if the first found link.exe is actually the Cygwin link tool" >&5
 $as_echo_n "checking if the first found link.exe is actually the Cygwin link tool... " >&6; }
     "$CYGWIN_LINK" --version > /dev/null
     if test $? -eq 0 ; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+      { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
       # This might be the VS linker. Don't exclude it later on.
       CYGWIN_LINK=""
@@ -15632,13 +15578,13 @@
 
     if test -d "$VS100BASE"; then
       if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
         VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
@@ -15649,11 +15595,13 @@
   if test "x$with_toolsdir" != x && test "x$VS_ENV_CMD" = x; then
     # Having specified an argument which is incorrect will produce an instant failure;
     # we should not go on looking
-    { $as_echo "$as_me:${as_lineno-$LINENO}: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&5
+    { $as_echo "$as_me:$LINENO: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&5
 $as_echo "$as_me: The path given by --with-tools-dir does not contain a valid Visual Studio installation" >&6;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Please point to the VC/bin directory within the Visual Studio installation" >&5
+    { $as_echo "$as_me:$LINENO: Please point to the VC/bin directory within the Visual Studio installation" >&5
 $as_echo "$as_me: Please point to the VC/bin directory within the Visual Studio installation" >&6;}
-    as_fn_error $? "Cannot locate a valid Visual Studio installation" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate a valid Visual Studio installation" >&5
+$as_echo "$as_me: error: Cannot locate a valid Visual Studio installation" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   if test "x$ProgramW6432" != x; then
@@ -15673,7 +15621,7 @@
 
     if test -d "$WIN_SDK_BASE"; then
       if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
@@ -15682,9 +15630,9 @@
           VS_ENV_ARGS="/x64"
         fi
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;}
       fi
     fi
@@ -15708,7 +15656,7 @@
 
     if test -d "$WIN_SDK_BASE"; then
       if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
@@ -15717,9 +15665,9 @@
           VS_ENV_ARGS="/x64"
         fi
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;}
       fi
     fi
@@ -15743,7 +15691,7 @@
 
     if test -d "$WIN_SDK_BASE"; then
       if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
@@ -15752,9 +15700,9 @@
           VS_ENV_ARGS="/x64"
         fi
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;}
       fi
     fi
@@ -15777,7 +15725,7 @@
 
     if test -d "$WIN_SDK_BASE"; then
       if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
@@ -15786,9 +15734,9 @@
           VS_ENV_ARGS="/x64"
         fi
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;}
       fi
     fi
@@ -15810,7 +15758,7 @@
 
     if test -d "$WIN_SDK_BASE"; then
       if test -f "$WIN_SDK_BASE/SetEnv.Cmd"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
         VS_ENV_CMD="$WIN_SDK_BASE/SetEnv.Cmd"
         if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
@@ -15819,9 +15767,9 @@
           VS_ENV_ARGS="/x64"
         fi
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&5
 $as_echo "$as_me: Found Windows SDK installation at $WIN_SDK_BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&5
 $as_echo "$as_me: Warning: Installation is broken, SetEnv.Cmd is missing. Ignoring" >&6;}
       fi
     fi
@@ -15845,13 +15793,13 @@
 
     if test -d "$VS100BASE"; then
       if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
         VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
@@ -15875,13 +15823,13 @@
 
     if test -d "$VS100BASE"; then
       if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
         VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
@@ -15904,13 +15852,13 @@
 
     if test -d "$VS100BASE"; then
       if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
         VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
@@ -15932,13 +15880,13 @@
 
     if test -d "$VS100BASE"; then
       if test -f "$VS100BASE/$VCVARSFILE"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
         VS_ENV_CMD="$VS100BASE/$VCVARSFILE"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
+        { $as_echo "$as_me:$LINENO: Found Visual Studio installation at $VS100BASE using $METHOD" >&5
 $as_echo "$as_me: Found Visual Studio installation at $VS100BASE using $METHOD" >&6;}
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
+        { $as_echo "$as_me:$LINENO: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&5
 $as_echo "$as_me: Warning: $VCVARSFILE is missing, this is probably Visual Studio Express. Ignoring" >&6;}
       fi
     fi
@@ -15963,25 +15911,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of VS_ENV_CMD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of VS_ENV_CMD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -16001,11 +15965,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of VS_ENV_CMD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of VS_ENV_CMD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -16097,14 +16063,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of VS_ENV_CMD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of VS_ENV_CMD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -16159,18 +16127,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving VS_ENV_CMD (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of VS_ENV_CMD, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of VS_ENV_CMD" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of VS_ENV_CMD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of VS_ENV_CMD" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -16184,13 +16154,13 @@
 
   if test "x$complete" != "x$new_complete"; then
     VS_ENV_CMD="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting VS_ENV_CMD to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting VS_ENV_CMD to \"$new_complete\"" >&6;}
   fi
 
 
     # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Trying to extract Visual Studio environment variables" >&5
+    { $as_echo "$as_me:$LINENO: Trying to extract Visual Studio environment variables" >&5
 $as_echo "$as_me: Trying to extract Visual Studio environment variables" >&6;}
     cd $OUTPUT_ROOT
     # FIXME: The code betweeen ---- was inlined from a separate script and is not properly adapted
@@ -16231,39 +16201,43 @@
     #----
     cd $CURDIR
     if test ! -s $OUTPUT_ROOT/localdevenv.sh; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Could not succesfully extract the envionment variables needed for the VS setup." >&5
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+      { $as_echo "$as_me:$LINENO: Could not succesfully extract the envionment variables needed for the VS setup." >&5
 $as_echo "$as_me: Could not succesfully extract the envionment variables needed for the VS setup." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5
+      { $as_echo "$as_me:$LINENO: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5
 $as_echo "$as_me: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5
+      { $as_echo "$as_me:$LINENO: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5
 $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;}
-      as_fn_error $? "Cannot continue" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     # Now set all paths and other env variables. This will allow the rest of
     # the configure script to find and run the compiler in the proper way.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Setting extracted environment variables" >&5
+    { $as_echo "$as_me:$LINENO: Setting extracted environment variables" >&5
 $as_echo "$as_me: Setting extracted environment variables" >&6;}
     . $OUTPUT_ROOT/localdevenv.sh
   else
     # We did not find a vsvars bat file, let's hope we are run from a VS command prompt.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot locate a valid Visual Studio installation, checking current environment" >&5
+    { $as_echo "$as_me:$LINENO: Cannot locate a valid Visual Studio installation, checking current environment" >&5
 $as_echo "$as_me: Cannot locate a valid Visual Studio installation, checking current environment" >&6;}
   fi
 
   # At this point, we should have corrent variables in the environment, or we can't continue.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Visual Studio variables" >&5
+  { $as_echo "$as_me:$LINENO: checking for Visual Studio variables" >&5
 $as_echo_n "checking for Visual Studio variables... " >&6; }
 
   if test "x$VCINSTALLDIR" != x || test "x$WindowsSDKDir" != x || test "x$WINDOWSSDKDIR" != x; then
     if test "x$INCLUDE" = x || test "x$LIB" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: present but broken" >&5
+      { $as_echo "$as_me:$LINENO: result: present but broken" >&5
 $as_echo "present but broken" >&6; }
-      as_fn_error $? "Your VC command prompt seems broken, INCLUDE and/or LIB is missing." "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+      { { $as_echo "$as_me:$LINENO: error: Your VC command prompt seems broken, INCLUDE and/or LIB is missing." >&5
+$as_echo "$as_me: error: Your VC command prompt seems broken, INCLUDE and/or LIB is missing." >&2;}
+   { (exit 1); exit 1; }; }
+    else
+      { $as_echo "$as_me:$LINENO: result: ok" >&5
 $as_echo "ok" >&6; }
       VS_INCLUDE="$INCLUDE"
       VS_LIB="$LIB"
@@ -16273,30 +16247,32 @@
 
     fi
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+    { $as_echo "$as_me:$LINENO: result: not found" >&5
 $as_echo "not found" >&6; }
 
     if test "x$VS_ENV_CMD" = x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&5
+      { $as_echo "$as_me:$LINENO: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&5
 $as_echo "$as_me: Cannot locate a valid Visual Studio or Windows SDK installation on disk," >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: nor is this script run from a Visual Studio command prompt." >&5
+      { $as_echo "$as_me:$LINENO: nor is this script run from a Visual Studio command prompt." >&5
 $as_echo "$as_me: nor is this script run from a Visual Studio command prompt." >&6;}
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Running the extraction script failed." >&5
+      { $as_echo "$as_me:$LINENO: Running the extraction script failed." >&5
 $as_echo "$as_me: Running the extraction script failed." >&6;}
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5
+    { $as_echo "$as_me:$LINENO: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&5
 $as_echo "$as_me: Try setting --with-tools-dir to the VC/bin directory within the VS installation" >&6;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5
+    { $as_echo "$as_me:$LINENO: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&5
 $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run configure from there." >&6;}
-    as_fn_error $? "Cannot continue" "$LINENO" 5
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5
+    { { $as_echo "$as_me:$LINENO: error: Cannot continue" >&5
+$as_echo "$as_me: error: Cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+
+  { $as_echo "$as_me:$LINENO: checking for msvcr100.dll" >&5
 $as_echo_n "checking for msvcr100.dll... " >&6; }
 
 # Check whether --with-msvcr-dll was given.
-if test "${with_msvcr_dll+set}" = set; then :
+if test "${with_msvcr_dll+set}" = set; then
   withval=$with_msvcr_dll;
 fi
 
@@ -16313,27 +16289,29 @@
         fi
       fi
       if test "x$MSVCR_DLL" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&5
+        { $as_echo "$as_me:$LINENO: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&5
 $as_echo "$as_me: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&6;}
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&5
+        { $as_echo "$as_me:$LINENO: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&5
 $as_echo "$as_me: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&6;}
       fi
     fi
     if test "x$MSVCR_DLL" = x; then
       if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5
+        { $as_echo "$as_me:$LINENO: msvcr100.dll found in $SYSTEMROOT/system32" >&5
 $as_echo "$as_me: msvcr100.dll found in $SYSTEMROOT/system32" >&6;}
         MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll"
       fi
     fi
   fi
   if test "x$MSVCR_DLL" = x; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Could not find msvcr100.dll !" "$LINENO" 5
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    { { $as_echo "$as_me:$LINENO: error: Could not find msvcr100.dll !" >&5
+$as_echo "$as_me: error: Could not find msvcr100.dll !" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+  { $as_echo "$as_me:$LINENO: result: $MSVCR_DLL" >&5
 $as_echo "$MSVCR_DLL" >&6; }
 
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -16352,9 +16330,11 @@
   # 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 MSVCR_DLL, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of MSVCR_DLL" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MSVCR_DLL" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MSVCR_DLL" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -16393,7 +16373,7 @@
 
   if test "x$path" != "x$new_path"; then
     MSVCR_DLL="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting MSVCR_DLL to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;}
   fi
 
@@ -16431,7 +16411,7 @@
 
   if test "x$path" != "x$new_path"; then
     MSVCR_DLL="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MSVCR_DLL to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting MSVCR_DLL to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting MSVCR_DLL to \"$new_path\"" >&6;}
   fi
 
@@ -16443,14 +16423,18 @@
     path="$MSVCR_DLL"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of MSVCR_DLL, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of MSVCR_DLL, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of MSVCR_DLL, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of MSVCR_DLL, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -16480,9 +16464,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BUILD_CC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BUILD_CC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $BUILD_CC in
@@ -16495,14 +16479,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_BUILD_CC="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -16510,10 +16494,10 @@
 fi
 BUILD_CC=$ac_cv_path_BUILD_CC
 if test -n "$BUILD_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CC" >&5
+  { $as_echo "$as_me:$LINENO: result: $BUILD_CC" >&5
 $as_echo "$BUILD_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -16537,25 +16521,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -16575,11 +16575,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of BUILD_CC, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -16671,14 +16673,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -16733,18 +16737,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving BUILD_CC (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CC, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of BUILD_CC" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CC" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -16758,7 +16764,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     BUILD_CC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CC to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BUILD_CC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting BUILD_CC to \"$new_complete\"" >&6;}
   fi
 
@@ -16766,9 +16772,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BUILD_CXX+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BUILD_CXX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $BUILD_CXX in
@@ -16781,14 +16787,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_BUILD_CXX="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -16796,10 +16802,10 @@
 fi
 BUILD_CXX=$ac_cv_path_BUILD_CXX
 if test -n "$BUILD_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_CXX" >&5
+  { $as_echo "$as_me:$LINENO: result: $BUILD_CXX" >&5
 $as_echo "$BUILD_CXX" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -16823,25 +16829,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -16861,11 +16883,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -16957,14 +16981,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -17019,18 +17045,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving BUILD_CXX (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_CXX, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of BUILD_CXX" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_CXX" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -17044,15 +17072,15 @@
 
   if test "x$complete" != "x$new_complete"; then
     BUILD_CXX="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_CXX to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BUILD_CXX to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting BUILD_CXX to \"$new_complete\"" >&6;}
   fi
 
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BUILD_LD+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_BUILD_LD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $BUILD_LD in
@@ -17065,14 +17093,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_BUILD_LD="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -17080,10 +17108,10 @@
 fi
 BUILD_LD=$ac_cv_path_BUILD_LD
 if test -n "$BUILD_LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_LD" >&5
+  { $as_echo "$as_me:$LINENO: result: $BUILD_LD" >&5
 $as_echo "$BUILD_LD" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -17104,25 +17132,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_LD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_LD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -17142,11 +17186,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of BUILD_LD, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_LD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_LD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -17238,14 +17284,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_LD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_LD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -17300,18 +17348,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving BUILD_LD (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of BUILD_LD, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of BUILD_LD" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of BUILD_LD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of BUILD_LD" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -17325,7 +17375,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     BUILD_LD="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_LD to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting BUILD_LD to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting BUILD_LD to \"$new_complete\"" >&6;}
   fi
 
@@ -17359,7 +17409,7 @@
             resource=${builddep_devkit}
         fi
         if test "x$resource" != x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for devkit" >&5
+            { $as_echo "$as_me:$LINENO: Using builddeps $resource for devkit" >&5
 $as_echo "$as_me: Using builddeps $resource for devkit" >&6;}
 	    # If the resource in the builddeps.conf file is an existing directory,
 	    # for example /java/linux/cups
@@ -17380,18 +17430,22 @@
     extension=${filename#*.}
     installdir=$with_builddeps_dir/$filebase
     if test ! -f $installdir/$filename.unpacked; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5
+        { $as_echo "$as_me:$LINENO: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&5
 $as_echo "$as_me: Downloading build dependency devkit from $with_builddeps_server/$resource and installing into $installdir" >&6;}
         if test ! -d $installdir; then
             mkdir -p $installdir
         fi
         if test ! -d $installdir; then
-            as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create directory $installdir" >&5
+$as_echo "$as_me: error: Could not create directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         tmpfile=`mktemp $installdir/devkit.XXXXXXXXX`
         touch $tmpfile
         if test ! -f $tmpfile; then
-            as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create files in directory $installdir" >&5
+$as_echo "$as_me: error: Could not create files in directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
 
     # $with_builddeps_server/$resource  is the ftp://abuilddeps.server.com/libs/cups.zip
@@ -17429,12 +17483,16 @@
         ) | ftp -in $FTPSERVER
     fi
     if test "x$VALID_TOOL" != xyes; then
-       as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: I do not know how to use the tool: $BDEPS_FTP" >&5
+$as_echo "$as_me: error: I do not know how to use the tool: $BDEPS_FTP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
         mv $tmpfile $installdir/$filename
         if test ! -s $installdir/$filename; then
-            as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not download $with_builddeps_server/$resource" >&5
+$as_echo "$as_me: error: Could not download $with_builddeps_server/$resource" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         case "$extension" in
             zip)  echo "Unzipping $installdir/$filename..."
@@ -17446,7 +17504,9 @@
             tgz) echo "Untaring $installdir/$filename..."
                (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
             ;;
-            *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5
+            *) { { $as_echo "$as_me:$LINENO: error: Cannot handle build depency archive with extension $extension" >&5
+$as_echo "$as_me: error: Cannot handle build depency archive with extension $extension" >&2;}
+   { (exit 1); exit 1; }; }
             ;;
         esac
     fi
@@ -17463,7 +17523,9 @@
             thecflags=${builddep_devkit_CFLAGS}
             thelibs=${builddep_devkit_LIBS}
             if test "x$depdir" = x; then
-                as_fn_error $? "Could not download build dependency devkit" "$LINENO" 5
+                { { $as_echo "$as_me:$LINENO: error: Could not download build dependency devkit" >&5
+$as_echo "$as_me: error: Could not download build dependency devkit" >&2;}
+   { (exit 1); exit 1; }; }
             fi
             DEVKIT=$depdir
             if test "x$theroot" != x; then
@@ -17534,9 +17596,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_POTENTIAL_CC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_POTENTIAL_CC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $POTENTIAL_CC in
@@ -17549,14 +17611,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -17564,10 +17626,10 @@
 fi
 POTENTIAL_CC=$ac_cv_path_POTENTIAL_CC
 if test -n "$POTENTIAL_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CC" >&5
+  { $as_echo "$as_me:$LINENO: result: $POTENTIAL_CC" >&5
 $as_echo "$POTENTIAL_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -17603,7 +17665,9 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-      as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Could not find a $COMPILER_NAME compiler. $HELP_MSG" >&5
+$as_echo "$as_me: error: Could not find a $COMPILER_NAME compiler. $HELP_MSG" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -17621,25 +17685,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -17659,11 +17739,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of CC, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of CC, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -17755,14 +17837,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -17817,18 +17901,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CC (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving CC (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving CC (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CC, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CC, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of CC" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CC" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -17842,11 +17928,11 @@
 
   if test "x$complete" != "x$new_complete"; then
     CC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CC to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting CC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CC to \"$new_complete\"" >&6;}
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CC" >&5
+  { $as_echo "$as_me:$LINENO: checking resolved symbolic links for CC" >&5
 $as_echo_n "checking resolved symbolic links for CC... " >&6; }
   TEST_COMPILER="$CC"
 
@@ -17893,14 +17979,14 @@
         fi
     fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5
+  { $as_echo "$as_me:$LINENO: result: $TEST_COMPILER" >&5
 $as_echo "$TEST_COMPILER" >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CC is disguised ccache" >&5
+  { $as_echo "$as_me:$LINENO: checking if CC is disguised ccache" >&5
 $as_echo_n "checking if CC is disguised ccache... " >&6; }
 
   COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
   if test "x$COMPILER_BASENAME" = "xccache"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5
+    { $as_echo "$as_me:$LINENO: result: yes, trying to find proper $COMPILER_NAME compiler" >&5
 $as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; }
     # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
     # We want to control ccache invocation ourselves, so ignore this cc and try
@@ -17917,9 +18003,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_PROPER_COMPILER_CC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PROPER_COMPILER_CC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$PROPER_COMPILER_CC"; then
@@ -17930,24 +18016,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_PROPER_COMPILER_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 PROPER_COMPILER_CC=$ac_cv_prog_PROPER_COMPILER_CC
 if test -n "$PROPER_COMPILER_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5
+  { $as_echo "$as_me:$LINENO: result: $PROPER_COMPILER_CC" >&5
 $as_echo "$PROPER_COMPILER_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -17961,9 +18047,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_PROPER_COMPILER_CC"; then
@@ -17974,24 +18060,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_PROPER_COMPILER_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_PROPER_COMPILER_CC=$ac_cv_prog_ac_ct_PROPER_COMPILER_CC
 if test -n "$ac_ct_PROPER_COMPILER_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CC" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_PROPER_COMPILER_CC" >&5
 $as_echo "$ac_ct_PROPER_COMPILER_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -18004,7 +18090,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -18028,25 +18114,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -18066,11 +18168,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -18162,14 +18266,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -18224,18 +18330,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving PROPER_COMPILER_CC (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CC, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CC" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CC" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -18249,13 +18357,13 @@
 
   if test "x$complete" != "x$new_complete"; then
     PROPER_COMPILER_CC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting PROPER_COMPILER_CC to \"$new_complete\"" >&6;}
   fi
 
     PATH="$RETRY_COMPILER_SAVED_PATH"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CC" >&5
+    { $as_echo "$as_me:$LINENO: checking for resolved symbolic links for CC" >&5
 $as_echo_n "checking for resolved symbolic links for CC... " >&6; }
 
     if test "x$OPENJDK_BUILD_OS" != xwindows; then
@@ -18301,11 +18409,11 @@
         fi
     fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CC" >&5
+    { $as_echo "$as_me:$LINENO: result: $PROPER_COMPILER_CC" >&5
 $as_echo "$PROPER_COMPILER_CC" >&6; }
     CC="$PROPER_COMPILER_CC"
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CC" >&5
+    { $as_echo "$as_me:$LINENO: result: no, keeping CC" >&5
 $as_echo "no, keeping CC" >&6; }
     CC="$TEST_COMPILER"
   fi
@@ -18320,11 +18428,13 @@
     if test $? -ne 0; then
       GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5
+      { $as_echo "$as_me:$LINENO: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5
 $as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5
+      { $as_echo "$as_me:$LINENO: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5
 $as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&6;}
-      as_fn_error $? "Sun Studio compiler is required. Try setting --with-tools-dir." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Sun Studio compiler is required. Try setting --with-tools-dir." >&5
+$as_echo "$as_me: error: Sun Studio compiler is required. Try setting --with-tools-dir." >&2;}
+   { (exit 1); exit 1; }; }
     else
       COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p"`
       COMPILER_VENDOR="Sun Studio"
@@ -18338,11 +18448,15 @@
     COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"`
     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
       if test "x$COMPILER_CPU_TEST" != "x80x86"; then
-        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." >&5
+$as_echo "$as_me: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." >&2;}
+   { (exit 1); exit 1; }; }
       fi
     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
       if test "x$COMPILER_CPU_TEST" != "xx64"; then
-        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." >&5
+$as_echo "$as_me: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   else
@@ -18350,11 +18464,13 @@
     # Check that this is likely to be GCC.
     $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null
     if test $? -ne 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5
+      { $as_echo "$as_me:$LINENO: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5
 $as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5
+      { $as_echo "$as_me:$LINENO: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5
 $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;}
-      as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: GCC compiler is required. Try setting --with-tools-dir." >&5
+$as_echo "$as_me: error: GCC compiler is required. Try setting --with-tools-dir." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     # First line typically looks something like:
@@ -18367,7 +18483,7 @@
   # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker)
   CC_VENDOR="$COMPILER_VENDOR"
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5
+  { $as_echo "$as_me:$LINENO: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5
 $as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
 
 
@@ -18382,9 +18498,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -18395,24 +18511,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+  { $as_echo "$as_me:$LINENO: result: $CC" >&5
 $as_echo "$CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -18426,9 +18542,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -18439,24 +18555,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
 $as_echo "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -18469,7 +18585,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -18478,37 +18594,57 @@
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
 
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+$as_echo "$as_me:$LINENO: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -18524,8 +18660,8 @@
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
 ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
@@ -18541,17 +18677,17 @@
 done
 rm -f $ac_rmfiles
 
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
@@ -18568,7 +18704,7 @@
 	# certainly right.
 	break;;
     *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
 	then :; else
 	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
 	fi
@@ -18587,41 +18723,84 @@
 else
   ac_file=''
 fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+
+{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+if test -z "$ac_file"; then
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+  if { ac_try='./$ac_file'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
 
 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5
 $as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -18636,83 +18815,32 @@
   esac
 done
 else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
 $as_echo "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "${ac_cv_objext+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -18724,17 +18852,17 @@
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
@@ -18747,23 +18875,31 @@
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
-fi
+{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
+fi
+
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
 $as_echo "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -18777,16 +18913,37 @@
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  ac_compiler_gnu=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
 $as_echo "$ac_cv_c_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GCC=yes
@@ -18795,68 +18952,145 @@
 fi
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
    CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
 	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
 $as_echo "$ac_cv_prog_cc_g" >&6; }
 if test "$ac_test_CFLAGS" = set; then
   CFLAGS=$ac_save_CFLAGS
@@ -18873,14 +19107,18 @@
     CFLAGS=
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
 ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
@@ -18937,9 +19175,32 @@
 	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_c89=$ac_arg
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
@@ -18950,19 +19211,17 @@
 # AC_CACHE_VAL
 case "x$ac_cv_prog_cc_c89" in
   x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+    { $as_echo "$as_me:$LINENO: result: none needed" >&5
 $as_echo "none needed" >&6; } ;;
   xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+    { $as_echo "$as_me:$LINENO: result: unsupported" >&5
 $as_echo "unsupported" >&6; } ;;
   *)
     CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+    { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
 esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
+
 
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -18989,9 +19248,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_POTENTIAL_CXX+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_POTENTIAL_CXX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $POTENTIAL_CXX in
@@ -19004,14 +19263,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -19019,10 +19278,10 @@
 fi
 POTENTIAL_CXX=$ac_cv_path_POTENTIAL_CXX
 if test -n "$POTENTIAL_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POTENTIAL_CXX" >&5
+  { $as_echo "$as_me:$LINENO: result: $POTENTIAL_CXX" >&5
 $as_echo "$POTENTIAL_CXX" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19058,7 +19317,9 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-      as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Could not find a $COMPILER_NAME compiler. $HELP_MSG" >&5
+$as_echo "$as_me: error: Could not find a $COMPILER_NAME compiler. $HELP_MSG" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
@@ -19076,25 +19337,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -19114,11 +19391,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of CXX, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of CXX, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -19210,14 +19489,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -19272,18 +19553,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXX (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving CXX (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving CXX (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXX, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXX, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of CXX" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXX" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -19297,11 +19580,11 @@
 
   if test "x$complete" != "x$new_complete"; then
     CXX="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXX to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting CXX to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CXX to \"$new_complete\"" >&6;}
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking resolved symbolic links for CXX" >&5
+  { $as_echo "$as_me:$LINENO: checking resolved symbolic links for CXX" >&5
 $as_echo_n "checking resolved symbolic links for CXX... " >&6; }
   TEST_COMPILER="$CXX"
 
@@ -19348,14 +19631,14 @@
         fi
     fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEST_COMPILER" >&5
+  { $as_echo "$as_me:$LINENO: result: $TEST_COMPILER" >&5
 $as_echo "$TEST_COMPILER" >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if CXX is disguised ccache" >&5
+  { $as_echo "$as_me:$LINENO: checking if CXX is disguised ccache" >&5
 $as_echo_n "checking if CXX is disguised ccache... " >&6; }
 
   COMPILER_BASENAME=`$BASENAME "$TEST_COMPILER"`
   if test "x$COMPILER_BASENAME" = "xccache"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, trying to find proper $COMPILER_NAME compiler" >&5
+    { $as_echo "$as_me:$LINENO: result: yes, trying to find proper $COMPILER_NAME compiler" >&5
 $as_echo "yes, trying to find proper $COMPILER_NAME compiler" >&6; }
     # We /usr/lib/ccache in the path, so cc is a symlink to /usr/bin/ccache.
     # We want to control ccache invocation ourselves, so ignore this cc and try
@@ -19372,9 +19655,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_PROPER_COMPILER_CXX+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PROPER_COMPILER_CXX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$PROPER_COMPILER_CXX"; then
@@ -19385,24 +19668,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_PROPER_COMPILER_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 PROPER_COMPILER_CXX=$ac_cv_prog_PROPER_COMPILER_CXX
 if test -n "$PROPER_COMPILER_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5
+  { $as_echo "$as_me:$LINENO: result: $PROPER_COMPILER_CXX" >&5
 $as_echo "$PROPER_COMPILER_CXX" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19416,9 +19699,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_PROPER_COMPILER_CXX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_PROPER_COMPILER_CXX"; then
@@ -19429,24 +19712,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_PROPER_COMPILER_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_PROPER_COMPILER_CXX=$ac_cv_prog_ac_ct_PROPER_COMPILER_CXX
 if test -n "$ac_ct_PROPER_COMPILER_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PROPER_COMPILER_CXX" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_PROPER_COMPILER_CXX" >&5
 $as_echo "$ac_ct_PROPER_COMPILER_CXX" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19459,7 +19742,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -19483,25 +19766,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -19521,11 +19820,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -19617,14 +19918,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -19679,18 +19982,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving PROPER_COMPILER_CXX (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of PROPER_COMPILER_CXX, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of PROPER_COMPILER_CXX" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&5
+$as_echo "$as_me: error: Cannot locate the the path of PROPER_COMPILER_CXX" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -19704,13 +20009,13 @@
 
   if test "x$complete" != "x$new_complete"; then
     PROPER_COMPILER_CXX="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting PROPER_COMPILER_CXX to \"$new_complete\"" >&6;}
   fi
 
     PATH="$RETRY_COMPILER_SAVED_PATH"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for resolved symbolic links for CXX" >&5
+    { $as_echo "$as_me:$LINENO: checking for resolved symbolic links for CXX" >&5
 $as_echo_n "checking for resolved symbolic links for CXX... " >&6; }
 
     if test "x$OPENJDK_BUILD_OS" != xwindows; then
@@ -19756,11 +20061,11 @@
         fi
     fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PROPER_COMPILER_CXX" >&5
+    { $as_echo "$as_me:$LINENO: result: $PROPER_COMPILER_CXX" >&5
 $as_echo "$PROPER_COMPILER_CXX" >&6; }
     CXX="$PROPER_COMPILER_CXX"
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, keeping CXX" >&5
+    { $as_echo "$as_me:$LINENO: result: no, keeping CXX" >&5
 $as_echo "no, keeping CXX" >&6; }
     CXX="$TEST_COMPILER"
   fi
@@ -19775,11 +20080,13 @@
     if test $? -ne 0; then
       GCC_VERSION_TEST=`$COMPILER --version 2>&1 | $HEAD -n 1`
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5
+      { $as_echo "$as_me:$LINENO: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&5
 $as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required Sun Studio compiler." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5
+      { $as_echo "$as_me:$LINENO: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&5
 $as_echo "$as_me: The result from running with -V was: \"$COMPILER_VERSION_TEST\" and with --version: \"$GCC_VERSION_TEST\"" >&6;}
-      as_fn_error $? "Sun Studio compiler is required. Try setting --with-tools-dir." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Sun Studio compiler is required. Try setting --with-tools-dir." >&5
+$as_echo "$as_me: error: Sun Studio compiler is required. Try setting --with-tools-dir." >&2;}
+   { (exit 1); exit 1; }; }
     else
       COMPILER_VERSION=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.*[ ,\t]$COMPILER_NAME[ ,\t]\([1-9]\.[0-9][0-9]*\).*/\1/p"`
       COMPILER_VENDOR="Sun Studio"
@@ -19793,11 +20100,15 @@
     COMPILER_CPU_TEST=`$ECHO $COMPILER_VERSION_TEST | $SED -n "s/^.* for \(.*\)$/\1/p"`
     if test "x$OPENJDK_TARGET_CPU" = "xx86"; then
       if test "x$COMPILER_CPU_TEST" != "x80x86"; then
-        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." >&5
+$as_echo "$as_me: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"80x86\"." >&2;}
+   { (exit 1); exit 1; }; }
       fi
     elif test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
       if test "x$COMPILER_CPU_TEST" != "xx64"; then
-        as_fn_error $? "Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." >&5
+$as_echo "$as_me: error: Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for \"$COMPILER_CPU_TEST\"; expected \"x64\"." >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   else
@@ -19805,11 +20116,13 @@
     # Check that this is likely to be GCC.
     $COMPILER --version 2>&1 | $GREP "Free Software Foundation" > /dev/null
     if test $? -ne 0; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5
+      { $as_echo "$as_me:$LINENO: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&5
 $as_echo "$as_me: The $COMPILER_NAME compiler (located as $COMPILER) does not seem to be the required GCC compiler." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5
+      { $as_echo "$as_me:$LINENO: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&5
 $as_echo "$as_me: The result from running with --version was: \"$COMPILER_VERSION_TEST\"" >&6;}
-      as_fn_error $? "GCC compiler is required. Try setting --with-tools-dir." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: GCC compiler is required. Try setting --with-tools-dir." >&5
+$as_echo "$as_me: error: GCC compiler is required. Try setting --with-tools-dir." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     # First line typically looks something like:
@@ -19822,7 +20135,7 @@
   # This sets CC_VENDOR or CXX_VENDOR. (This comment is a grep marker)
   CXX_VENDOR="$COMPILER_VENDOR"
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5
+  { $as_echo "$as_me:$LINENO: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&5
 $as_echo "$as_me: Using $COMPILER_VENDOR $COMPILER_NAME compiler version $COMPILER_VERSION (located at $COMPILER)" >&6;}
 
 
@@ -19841,9 +20154,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_CXX+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_CXX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CXX"; then
@@ -19854,24 +20167,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 CXX=$ac_cv_prog_CXX
 if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+  { $as_echo "$as_me:$LINENO: result: $CXX" >&5
 $as_echo "$CXX" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19885,9 +20198,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CXX"; then
@@ -19898,24 +20211,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
 if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
 $as_echo "$ac_ct_CXX" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -19928,7 +20241,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -19939,36 +20252,53 @@
   fi
 fi
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -19982,16 +20312,37 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  ac_compiler_gnu=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GXX=yes
@@ -20000,68 +20351,145 @@
 fi
 ac_test_CXXFLAGS=${CXXFLAGS+set}
 ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if test "${ac_cv_prog_cxx_g+set}" = set; then :
+if test "${ac_cv_prog_cxx_g+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_save_cxx_werror_flag=$ac_cxx_werror_flag
    ac_cxx_werror_flag=yes
    ac_cv_prog_cxx_g=no
    CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cxx_g=yes
 else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CXXFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 	 CXXFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cxx_g=yes
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_cxx_werror_flag=$ac_save_cxx_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
 $as_echo "$ac_cv_prog_cxx_g" >&6; }
 if test "$ac_test_CXXFLAGS" = set; then
   CXXFLAGS=$ac_save_CXXFLAGS
@@ -20098,9 +20526,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OBJC"; then
@@ -20111,24 +20539,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_OBJC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 OBJC=$ac_cv_prog_OBJC
 if test -n "$OBJC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJC" >&5
+  { $as_echo "$as_me:$LINENO: result: $OBJC" >&5
 $as_echo "$OBJC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -20142,9 +20570,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OBJC"; then
@@ -20155,24 +20583,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_OBJC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OBJC=$ac_cv_prog_ac_ct_OBJC
 if test -n "$ac_ct_OBJC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJC" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJC" >&5
 $as_echo "$ac_ct_OBJC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -20185,7 +20613,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -20194,36 +20622,53 @@
 fi
 
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for Objective C compiler version" >&5
+$as_echo "$as_me:$LINENO: checking for Objective C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Objective C compiler" >&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU Objective C compiler" >&5
 $as_echo_n "checking whether we are using the GNU Objective C compiler... " >&6; }
-if test "${ac_cv_objc_compiler_gnu+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "${ac_cv_objc_compiler_gnu+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -20237,16 +20682,37 @@
   return 0;
 }
 _ACEOF
-if ac_fn_objc_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
-  ac_compiler_gnu=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_objc_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objc_compiler_gnu" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_objc_compiler_gnu" >&5
 $as_echo "$ac_cv_objc_compiler_gnu" >&6; }
 if test $ac_compiler_gnu = yes; then
   GOBJC=yes
@@ -20255,68 +20721,145 @@
 fi
 ac_test_OBJCFLAGS=${OBJCFLAGS+set}
 ac_save_OBJCFLAGS=$OBJCFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $OBJC accepts -g" >&5
+{ $as_echo "$as_me:$LINENO: checking whether $OBJC accepts -g" >&5
 $as_echo_n "checking whether $OBJC accepts -g... " >&6; }
-if test "${ac_cv_prog_objc_g+set}" = set; then :
+if test "${ac_cv_prog_objc_g+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_save_objc_werror_flag=$ac_objc_werror_flag
    ac_objc_werror_flag=yes
    ac_cv_prog_objc_g=no
    OBJCFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_objc_try_compile "$LINENO"; then :
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_objc_g=yes
 else
-  OBJCFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_objc_try_compile "$LINENO"; then :
-
-else
-  ac_objc_werror_flag=$ac_save_objc_werror_flag
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	OBJCFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_objc_werror_flag=$ac_save_objc_werror_flag
 	 OBJCFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_objc_try_compile "$LINENO"; then :
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_objc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_objc_g=yes
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    ac_objc_werror_flag=$ac_save_objc_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_objc_g" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_objc_g" >&5
 $as_echo "$ac_cv_prog_objc_g" >&6; }
 if test "$ac_test_OBJCFLAGS" = set; then
   OBJCFLAGS=$ac_save_OBJCFLAGS
@@ -20355,25 +20898,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of OBJC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -20393,11 +20952,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of OBJC, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of OBJC, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -20489,14 +21050,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of OBJC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -20551,18 +21114,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving OBJC (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJC, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of OBJC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJC, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of OBJC" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJC" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -20576,7 +21141,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     OBJC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJC to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting OBJC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting OBJC to \"$new_complete\"" >&6;}
   fi
 
@@ -20606,9 +21171,9 @@
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$AR"; then
@@ -20619,24 +21184,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
 $as_echo "$AR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -20646,9 +21211,9 @@
   ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_AR"; then
@@ -20659,24 +21224,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_AR="ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
 $as_echo "$ac_ct_AR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -20685,7 +21250,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -20711,25 +21276,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of AR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AR" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -20749,11 +21330,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of AR, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of AR, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AR" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -20845,14 +21428,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of AR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AR" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -20907,18 +21492,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AR (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving AR (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving AR (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AR, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of AR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AR, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of AR" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AR" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -20932,7 +21519,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     AR="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AR to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting AR to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting AR to \"$new_complete\"" >&6;}
   fi
 
@@ -20952,7 +21539,7 @@
 
 COMPILER_NAME=gcc
 COMPILER_TYPE=CC
-if test "x$OPENJDK_TARGET_OS" = xwindows; then :
+if test "x$OPENJDK_TARGET_OS" = xwindows; then
 
     # For now, assume that we are always compiling using cl.exe.
     CC_OUT_OPTION=-Fo
@@ -20963,9 +21550,9 @@
     # program for something completely different.
     # Extract the first word of "link", so it can be a program name with args.
 set dummy link; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_WINLD+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_WINLD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$WINLD"; then
@@ -20977,18 +21564,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "$CYGWIN_LINK"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_WINLD="link"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -21007,10 +21594,10 @@
 fi
 WINLD=$ac_cv_prog_WINLD
 if test -n "$WINLD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINLD" >&5
+  { $as_echo "$as_me:$LINENO: result: $WINLD" >&5
 $as_echo "$WINLD" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -21033,25 +21620,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of WINLD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINLD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINLD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -21071,11 +21674,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of WINLD, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of WINLD, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINLD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINLD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -21167,14 +21772,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of WINLD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINLD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINLD" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -21229,18 +21836,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving WINLD (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINLD, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of WINLD, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of WINLD, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of WINLD" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINLD" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINLD" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -21254,20 +21863,22 @@
 
   if test "x$complete" != "x$new_complete"; then
     WINLD="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINLD to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting WINLD to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting WINLD to \"$new_complete\"" >&6;}
   fi
 
     printf "Windows linker was found at $WINLD\n"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the found link.exe is actually the Visual Studio linker" >&5
+    { $as_echo "$as_me:$LINENO: checking if the found link.exe is actually the Visual Studio linker" >&5
 $as_echo_n "checking if the found link.exe is actually the Visual Studio linker... " >&6; }
     "$WINLD" --version > /dev/null
     if test $? -eq 0 ; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-      as_fn_error $? "This is the Cygwin link tool. Please check your PATH and rerun configure." "$LINENO" 5
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+      { { $as_echo "$as_me:$LINENO: error: This is the Cygwin link tool. Please check your PATH and rerun configure." >&5
+$as_echo "$as_me: error: This is the Cygwin link tool. Please check your PATH and rerun configure." >&2;}
+   { (exit 1); exit 1; }; }
+    else
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
     fi
     LD="$WINLD"
@@ -21277,9 +21888,9 @@
 
     # Extract the first word of "mt", so it can be a program name with args.
 set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_MT+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_MT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$MT"; then
@@ -21291,18 +21902,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/bin/mt"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_MT="mt"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -21321,10 +21932,10 @@
 fi
 MT=$ac_cv_prog_MT
 if test -n "$MT"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MT" >&5
+  { $as_echo "$as_me:$LINENO: result: $MT" >&5
 $as_echo "$MT" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -21345,25 +21956,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of MT, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MT" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MT" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -21383,11 +22010,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of MT, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of MT, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MT" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MT" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -21479,14 +22108,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of MT, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MT" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MT" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -21541,18 +22172,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MT (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving MT (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving MT (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MT, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of MT, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MT, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of MT" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MT" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MT" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -21566,16 +22199,16 @@
 
   if test "x$complete" != "x$new_complete"; then
     MT="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MT to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting MT to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting MT to \"$new_complete\"" >&6;}
   fi
 
     # The resource compiler
     # Extract the first word of "rc", so it can be a program name with args.
 set dummy rc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RC+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_RC+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$RC"; then
@@ -21587,18 +22220,18 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/bin/rc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_RC="rc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
@@ -21617,10 +22250,10 @@
 fi
 RC=$ac_cv_prog_RC
 if test -n "$RC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RC" >&5
+  { $as_echo "$as_me:$LINENO: result: $RC" >&5
 $as_echo "$RC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -21641,25 +22274,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of RC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of RC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of RC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -21679,11 +22328,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of RC, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of RC, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of RC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of RC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -21775,14 +22426,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of RC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of RC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of RC" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -21837,18 +22490,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving RC (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving RC (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving RC (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of RC, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of RC, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of RC, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of RC" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of RC" >&5
+$as_echo "$as_me: error: Cannot locate the the path of RC" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -21862,7 +22517,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     RC="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting RC to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting RC to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting RC to \"$new_complete\"" >&6;}
   fi
 
@@ -21917,17 +22572,19 @@
 
 
     RC_FLAGS="-nologo -l 0x409 -r"
-    if test "x$VARIANT" = xOPT; then :
+    if test "x$VARIANT" = xOPT; then
 
         RC_FLAGS="$RC_FLAGS -d NDEBUG"
 
 fi
+
     JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION
-    if test "x$JDK_UPDATE_VERSION" = x; then :
+    if test "x$JDK_UPDATE_VERSION" = x; then
 
         JDK_UPDATE_VERSION_NOTNULL=0
 
 fi
+
     RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\""
     RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\""
     RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\""
@@ -21939,9 +22596,9 @@
     # lib.exe is used to create static libraries.
     # Extract the first word of "lib", so it can be a program name with args.
 set dummy lib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_WINAR+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_WINAR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$WINAR"; then
@@ -21952,24 +22609,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_WINAR="lib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 WINAR=$ac_cv_prog_WINAR
 if test -n "$WINAR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINAR" >&5
+  { $as_echo "$as_me:$LINENO: result: $WINAR" >&5
 $as_echo "$WINAR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -21990,25 +22647,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of WINAR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINAR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINAR" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -22028,11 +22701,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of WINAR, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of WINAR, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINAR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINAR" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -22124,14 +22799,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of WINAR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINAR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINAR" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -22186,18 +22863,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving WINAR (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of WINAR, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of WINAR, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of WINAR, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of WINAR" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of WINAR" >&5
+$as_echo "$as_me: error: Cannot locate the the path of WINAR" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -22211,7 +22890,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     WINAR="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting WINAR to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting WINAR to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting WINAR to \"$new_complete\"" >&6;}
   fi
 
@@ -22220,9 +22899,9 @@
 
     # Extract the first word of "dumpbin", so it can be a program name with args.
 set dummy dumpbin; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DUMPBIN+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$DUMPBIN"; then
@@ -22233,24 +22912,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_DUMPBIN="dumpbin"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 DUMPBIN=$ac_cv_prog_DUMPBIN
 if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+  { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
 $as_echo "$DUMPBIN" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -22271,25 +22950,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of DUMPBIN" >&5
+$as_echo "$as_me: error: Cannot locate the the path of DUMPBIN" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -22309,11 +23004,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of DUMPBIN, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of DUMPBIN" >&5
+$as_echo "$as_me: error: Cannot locate the the path of DUMPBIN" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -22405,14 +23102,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of DUMPBIN" >&5
+$as_echo "$as_me: error: Cannot locate the the path of DUMPBIN" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -22467,18 +23166,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving DUMPBIN (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of DUMPBIN, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of DUMPBIN" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of DUMPBIN" >&5
+$as_echo "$as_me: error: Cannot locate the the path of DUMPBIN" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -22492,7 +23193,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     DUMPBIN="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting DUMPBIN to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting DUMPBIN to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting DUMPBIN to \"$new_complete\"" >&6;}
   fi
 
@@ -22504,19 +23205,20 @@
 
 
 
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
 $as_echo_n "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if test "${ac_cv_prog_CPP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -22531,7 +23233,11 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -22540,34 +23246,78 @@
 #endif
 		     Syntax error
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
   break
 fi
 
@@ -22579,7 +23329,7 @@
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
 $as_echo "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
@@ -22590,7 +23340,11 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -22599,40 +23353,87 @@
 #endif
 		     Syntax error
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=cpp
@@ -22657,25 +23458,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of CPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CPP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -22695,11 +23512,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of CPP, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of CPP, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CPP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -22791,14 +23610,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of CPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CPP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -22853,18 +23674,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CPP (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving CPP (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving CPP (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CPP, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of CPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CPP, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of CPP" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CPP" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -22878,7 +23701,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     CPP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CPP to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting CPP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CPP to \"$new_complete\"" >&6;}
   fi
 
@@ -22888,10 +23711,10 @@
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
 $as_echo_n "checking how to run the C++ preprocessor... " >&6; }
 if test -z "$CXXCPP"; then
-  if test "${ac_cv_prog_CXXCPP+set}" = set; then :
+  if test "${ac_cv_prog_CXXCPP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CXXCPP needs to be expanded
@@ -22906,7 +23729,11 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -22915,34 +23742,78 @@
 #endif
 		     Syntax error
 _ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
   break
 fi
 
@@ -22954,7 +23825,7 @@
 else
   ac_cv_prog_CXXCPP=$CXXCPP
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5
 $as_echo "$CXXCPP" >&6; }
 ac_preproc_ok=false
 for ac_cxx_preproc_warn_flag in '' yes
@@ -22965,7 +23836,11 @@
   # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #ifdef __STDC__
 # include <limits.h>
@@ -22974,40 +23849,87 @@
 #endif
 		     Syntax error
 _ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
-
-else
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Broken: fails on valid input.
 continue
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
   # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   # Passes both tests.
 ac_preproc_ok=:
 break
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }; }
 fi
 
 ac_ext=cpp
@@ -23032,25 +23954,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXXCPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXXCPP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23070,11 +24008,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of CXXCPP, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXXCPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXXCPP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -23166,14 +24106,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXXCPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXXCPP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23228,18 +24170,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving CXXCPP (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of CXXCPP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of CXXCPP, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of CXXCPP" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of CXXCPP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of CXXCPP" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -23253,7 +24197,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     CXXCPP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting CXXCPP to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting CXXCPP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting CXXCPP to \"$new_complete\"" >&6;}
   fi
 
@@ -23282,9 +24226,9 @@
 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AS+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_AS+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $AS in
@@ -23297,14 +24241,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_AS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -23312,10 +24256,10 @@
 fi
 AS=$ac_cv_path_AS
 if test -n "$AS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+  { $as_echo "$as_me:$LINENO: result: $AS" >&5
 $as_echo "$AS" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -23336,25 +24280,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of AS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AS" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23374,11 +24334,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of AS, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of AS, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AS" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -23470,14 +24432,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of AS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AS" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23532,18 +24496,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving AS (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving AS (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving AS (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of AS, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of AS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of AS, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of AS" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of AS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of AS" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -23557,7 +24523,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     AS="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting AS to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting AS to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting AS to \"$new_complete\"" >&6;}
   fi
 
@@ -23571,9 +24537,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_NM+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_NM+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $NM in
@@ -23586,14 +24552,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_NM="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -23601,10 +24567,10 @@
 fi
 NM=$ac_cv_path_NM
 if test -n "$NM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+  { $as_echo "$as_me:$LINENO: result: $NM" >&5
 $as_echo "$NM" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -23628,25 +24594,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23666,11 +24648,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -23762,14 +24746,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23824,18 +24810,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -23849,15 +24837,15 @@
 
   if test "x$complete" != "x$new_complete"; then
     NM="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting NM to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
   fi
 
     # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_STRIP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_STRIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $STRIP in
@@ -23870,14 +24858,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -23885,10 +24873,10 @@
 fi
 STRIP=$ac_cv_path_STRIP
 if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
 $as_echo "$STRIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -23909,25 +24897,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -23947,11 +24951,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -24043,14 +25049,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -24105,18 +25113,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -24130,15 +25140,15 @@
 
   if test "x$complete" != "x$new_complete"; then
     STRIP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting STRIP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
   fi
 
     # Extract the first word of "mcs", so it can be a program name with args.
 set dummy mcs; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MCS+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MCS+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $MCS in
@@ -24151,14 +25161,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_MCS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -24166,10 +25176,10 @@
 fi
 MCS=$ac_cv_path_MCS
 if test -n "$MCS"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCS" >&5
+  { $as_echo "$as_me:$LINENO: result: $MCS" >&5
 $as_echo "$MCS" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -24190,25 +25200,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of MCS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MCS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MCS" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -24228,11 +25254,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of MCS, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of MCS, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MCS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MCS" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -24324,14 +25352,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of MCS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MCS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MCS" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -24386,18 +25416,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving MCS (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving MCS (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving MCS (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of MCS, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of MCS, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of MCS, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of MCS" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of MCS" >&5
+$as_echo "$as_me: error: Cannot locate the the path of MCS" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -24411,7 +25443,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     MCS="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting MCS to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting MCS to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting MCS to \"$new_complete\"" >&6;}
   fi
 
@@ -24419,9 +25451,9 @@
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ac_tool_prefix}nm; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_NM+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_NM+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$NM"; then
@@ -24432,24 +25464,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_NM="${ac_tool_prefix}nm"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 NM=$ac_cv_prog_NM
 if test -n "$NM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+  { $as_echo "$as_me:$LINENO: result: $NM" >&5
 $as_echo "$NM" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -24459,9 +25491,9 @@
   ac_ct_NM=$NM
   # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_NM+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_NM+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_NM"; then
@@ -24472,24 +25504,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_NM="nm"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_NM=$ac_cv_prog_ac_ct_NM
 if test -n "$ac_ct_NM"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5
 $as_echo "$ac_ct_NM" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -24498,7 +25530,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -24524,25 +25556,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -24562,11 +25610,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -24658,14 +25708,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -24720,18 +25772,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving NM (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving NM (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of NM, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of NM, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of NM, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of NM" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of NM" >&5
+$as_echo "$as_me: error: Cannot locate the the path of NM" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -24745,16 +25799,16 @@
 
   if test "x$complete" != "x$new_complete"; then
     NM="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting NM to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting NM to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting NM to \"$new_complete\"" >&6;}
   fi
 
     if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$STRIP"; then
@@ -24765,24 +25819,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
 $as_echo "$STRIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -24792,9 +25846,9 @@
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_STRIP"; then
@@ -24805,24 +25859,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
 $as_echo "$ac_ct_STRIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -24831,7 +25885,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -24857,25 +25911,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -24895,11 +25965,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -24991,14 +26063,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -25053,18 +26127,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving STRIP (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of STRIP, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of STRIP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of STRIP, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of STRIP" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of STRIP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of STRIP" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -25078,7 +26154,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     STRIP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting STRIP to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting STRIP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting STRIP to \"$new_complete\"" >&6;}
   fi
 
@@ -25092,9 +26168,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJCOPY+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJCOPY+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OBJCOPY"; then
@@ -25105,24 +26181,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_OBJCOPY="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 OBJCOPY=$ac_cv_prog_OBJCOPY
 if test -n "$OBJCOPY"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
+  { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5
 $as_echo "$OBJCOPY" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -25136,9 +26212,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OBJCOPY"; then
@@ -25149,24 +26225,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_OBJCOPY="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY
 if test -n "$ac_ct_OBJCOPY"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJCOPY" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5
 $as_echo "$ac_ct_OBJCOPY" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -25179,7 +26255,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -25203,25 +26279,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJCOPY" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJCOPY" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -25241,11 +26333,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJCOPY" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJCOPY" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -25337,14 +26431,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJCOPY" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJCOPY" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -25399,18 +26495,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving OBJCOPY (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJCOPY, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of OBJCOPY" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJCOPY" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJCOPY" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -25424,7 +26522,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     OBJCOPY="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJCOPY to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting OBJCOPY to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting OBJCOPY to \"$new_complete\"" >&6;}
   fi
 
@@ -25435,9 +26533,9 @@
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_OBJDUMP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OBJDUMP"; then
@@ -25448,24 +26546,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_OBJDUMP="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 OBJDUMP=$ac_cv_prog_OBJDUMP
 if test -n "$OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+  { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5
 $as_echo "$OBJDUMP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -25479,9 +26577,9 @@
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OBJDUMP"; then
@@ -25492,24 +26590,24 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_OBJDUMP="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
 if test -n "$ac_ct_OBJDUMP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
 $as_echo "$ac_ct_OBJDUMP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -25522,7 +26620,7 @@
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
@@ -25548,25 +26646,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJDUMP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJDUMP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -25586,11 +26700,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of OBJDUMP, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJDUMP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJDUMP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -25682,14 +26798,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJDUMP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJDUMP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -25744,18 +26862,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving OBJDUMP (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of OBJDUMP, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of OBJDUMP" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of OBJDUMP" >&5
+$as_echo "$as_me: error: Cannot locate the the path of OBJDUMP" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -25769,7 +26889,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     OBJDUMP="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting OBJDUMP to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting OBJDUMP to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting OBJDUMP to \"$new_complete\"" >&6;}
   fi
 
@@ -25778,9 +26898,9 @@
 if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
    # Extract the first word of "lipo", so it can be a program name with args.
 set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LIPO+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_LIPO+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $LIPO in
@@ -25793,14 +26913,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_LIPO="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -25808,10 +26928,10 @@
 fi
 LIPO=$ac_cv_path_LIPO
 if test -n "$LIPO"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+  { $as_echo "$as_me:$LINENO: result: $LIPO" >&5
 $as_echo "$LIPO" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
@@ -25832,25 +26952,41 @@
 
   # Now try to locate executable using which
   new_path=`$WHICH "$new_path" 2> /dev/null`
-  if test "x$new_path" = x; then
-    # Oops. Which didn't find the executable.
-    # The splitting of arguments from the executable at a space might have been incorrect,
-    # since paths with space are more likely in Windows. Give it another try with the whole
-    # argument.
-    path="$complete"
-    arguments="EOL"
-    new_path=`$CYGPATH -u "$path"`
-    new_path=`$WHICH "$new_path" 2> /dev/null`
-    if test "x$new_path" = x; then
-      # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+  # bat and cmd files are not always considered executable in cygwin causing which
+  # to not find them
+  if test "x$new_path" = x \
+           && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+           && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+    new_path=`$CYGPATH -u "$path"`
+  fi
+  if test "x$new_path" = x; then
+    # Oops. Which didn't find the executable.
+    # The splitting of arguments from the executable at a space might have been incorrect,
+    # since paths with space are more likely in Windows. Give it another try with the whole
+    # argument.
+    path="$complete"
+    arguments="EOL"
+    new_path=`$CYGPATH -u "$path"`
+    new_path=`$WHICH "$new_path" 2> /dev/null`
+    # bat and cmd files are not always considered executable in cygwin causing which
+    # to not find them
+    if test "x$new_path" = x \
+             && test "x`$ECHO \"$path\" | $GREP -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \
+             && test "x`$LS \"$path\" 2>/dev/null`" != x; then
+      new_path=`$CYGPATH -u "$path"`
+    fi
+    if test "x$new_path" = x; then
+      # It's still not found. Now this is an unrecoverable error.
+      { $as_echo "$as_me:$LINENO: The path of LIPO, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of LIPO" >&5
+$as_echo "$as_me: error: Cannot locate the the path of LIPO" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -25870,11 +27006,13 @@
     elif test -f "${new_path}.cmd"; then
        input_to_shortpath="${new_path}.cmd"
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of LIPO, which resolves as \"$new_path\", is invalid." >&5
 $as_echo "$as_me: The path of LIPO, which resolves as \"$new_path\", is invalid." >&6;}
-      { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
+      { $as_echo "$as_me:$LINENO: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5
 $as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;}
-      as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of LIPO" >&5
+$as_echo "$as_me: error: Cannot locate the the path of LIPO" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     input_to_shortpath="$new_path"
@@ -25966,14 +27104,16 @@
 
     if test "x$new_path" = x; then
       # It's still not found. Now this is an unrecoverable error.
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+      { $as_echo "$as_me:$LINENO: The path of LIPO, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
       has_space=`$ECHO "$complete" | $GREP " "`
       if test "x$has_space" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
-$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
-      fi
-      as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+        { $as_echo "$as_me:$LINENO: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5
+$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;}
+      fi
+      { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of LIPO" >&5
+$as_echo "$as_me: error: Cannot locate the the path of LIPO" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -26028,18 +27168,20 @@
     if test "x$new_path" = x; then
       is_absolute_path=`$ECHO "$path" | $GREP ^/`
       if test "x$is_absolute_path" != x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&5
+        { $as_echo "$as_me:$LINENO: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&5
 $as_echo "$as_me: Resolving LIPO (as $path) with 'which' failed, using $path directly." >&6;}
         new_path="$path"
       else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: The path of LIPO, which resolves as \"$complete\", is not found." >&5
+        { $as_echo "$as_me:$LINENO: The path of LIPO, which resolves as \"$complete\", is not found." >&5
 $as_echo "$as_me: The path of LIPO, which resolves as \"$complete\", is not found." >&6;}
         has_space=`$ECHO "$complete" | $GREP " "`
         if test "x$has_space" != x; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5
+          { $as_echo "$as_me:$LINENO: This might be caused by spaces in the path, which is not allowed." >&5
 $as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;}
         fi
-        as_fn_error $? "Cannot locate the the path of LIPO" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of LIPO" >&5
+$as_echo "$as_me: error: Cannot locate the the path of LIPO" >&2;}
+   { (exit 1); exit 1; }; }
       fi
     fi
   fi
@@ -26053,7 +27195,7 @@
 
   if test "x$complete" != "x$new_complete"; then
     LIPO="$new_complete"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting LIPO to \"$new_complete\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting LIPO to \"$new_complete\"" >&5
 $as_echo "$as_me: Rewriting LIPO to \"$new_complete\"" >&6;}
   fi
 
@@ -26068,12 +27210,16 @@
 # And we can test some aspects on the target using configure macros.
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <stdlib.h>
 #include <stdarg.h>
@@ -26088,23 +27234,48 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
-  ac_cv_header_stdc=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <string.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
 else
   ac_cv_header_stdc=no
 fi
@@ -26114,14 +27285,18 @@
 
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <stdlib.h>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
+  $EGREP "free" >/dev/null 2>&1; then
+  :
 else
   ac_cv_header_stdc=no
 fi
@@ -26131,10 +27306,14 @@
 
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
+  if test "$cross_compiling" = yes; then
   :
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
 #include <stdlib.h>
@@ -26161,33 +27340,118 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
 $as_echo "$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
 
 fi
 
 # On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
 for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
 		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -26243,26 +27507,167 @@
 fi
 
 # Make compilation sanity check
+
 for ac_header in stdio.h
-do :
-  ac_fn_cxx_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdio_h" = x""yes; then :
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to build-dev@openjdk.java.net ##
+## ----------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_STDIO_H 1
-_ACEOF
-
-else
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+  { $as_echo "$as_me:$LINENO: Failed to compile stdio.h. This likely implies missing compile dependencies." >&5
 $as_echo "$as_me: Failed to compile stdio.h. This likely implies missing compile dependencies." >&6;}
   if test "x$COMPILE_TYPE" = xreduced; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5
+    { $as_echo "$as_me:$LINENO: You are doing a reduced build. Check that you have 32-bit libraries installed." >&5
 $as_echo "$as_me: You are doing a reduced build. Check that you have 32-bit libraries installed." >&6;}
   elif test "x$COMPILE_TYPE" = xcross; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
+    { $as_echo "$as_me:$LINENO: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&5
 $as_echo "$as_me: You are doing a cross-compilation. Check that you have all target platform libraries installed." >&6;}
   fi
-  as_fn_error $? "Cannot continue." "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: Cannot continue." >&5
+$as_echo "$as_me: error: Cannot continue." >&2;}
+   { (exit 1); exit 1; }; }
 
 fi
 
@@ -26273,26 +27678,352 @@
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
 # This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5
+{ $as_echo "$as_me:$LINENO: checking size of int *" >&5
 $as_echo_n "checking size of int *... " >&6; }
-if test "${ac_cv_sizeof_int_p+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_cxx_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p"        "$ac_includes_default"; then :
-
-else
-  if test "$ac_cv_type_int_p" = yes; then
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+if test "${ac_cv_sizeof_int_p+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int *))) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int *))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr $ac_mid + 1`
+			if test $ac_lo -le $ac_mid; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int *))) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int *))) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_hi=`expr '(' $ac_mid ')' - 1`
+			if test $ac_mid -le $ac_hi; then
+			  ac_lo= ac_hi=
+			  break
+			fi
+			ac_mid=`expr 2 '*' $ac_mid`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo= ac_hi=
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int *))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_sizeof_int_p=$ac_lo;;
+'') if test "$ac_cv_type_int_p" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (int *)
-See \`config.log' for more details" "$LINENO" 5 ; }
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int *)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (int *)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
+   else
+     ac_cv_sizeof_int_p=0
+   fi ;;
+esac
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (int *)); }
+static unsigned long int ulongval () { return (long int) (sizeof (int *)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (int *))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (int *))))
+	return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (int *))))
+	return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_int_p=`cat conftest.val`
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_int_p" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int *)
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: cannot compute sizeof (int *)
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }; }
    else
      ac_cv_sizeof_int_p=0
    fi
 fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int_p" >&5
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int_p" >&5
 $as_echo "$ac_cv_sizeof_int_p" >&6; }
 
 
@@ -26310,19 +28041,21 @@
 
 if test "x$SIZEOF_INT_P" = x; then
     # The test failed, lets stick to the assumed value.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&5
+    { $as_echo "$as_me:$LINENO: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&5
 $as_echo "$as_me: WARNING: The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS." >&2;}
 else
     TESTED_TARGET_CPU_BITS=`expr 8 \* $SIZEOF_INT_P`
 
     if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
-        as_fn_error $? "The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" "$LINENO" 5
-    fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target address size" >&5
+        { { $as_echo "$as_me:$LINENO: error: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&5
+$as_echo "$as_me: error: The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for target address size" >&5
 $as_echo_n "checking for target address size... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENJDK_TARGET_CPU_BITS bits" >&5
+{ $as_echo "$as_me:$LINENO: result: $OPENJDK_TARGET_CPU_BITS bits" >&5
 $as_echo "$OPENJDK_TARGET_CPU_BITS bits" >&6; }
 
 
@@ -26330,14 +28063,19 @@
 #
 # Is the target little of big endian?
 #
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+
+ { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
 $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then :
+if test "${ac_cv_c_bigendian+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_bigendian=unknown
     # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #ifndef __APPLE_CC__
 	       not a universal capable compiler
@@ -26345,34 +28083,46 @@
 	     typedef int dummy;
 
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
 	# Check for potential -arch flags.  It is not universal unless
-	# there are at least two -arch flags with different values.
-	ac_arch=
-	ac_prev=
-	for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-	 if test -n "$ac_prev"; then
-	   case $ac_word in
-	     i?86 | x86_64 | ppc | ppc64)
-	       if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-		 ac_arch=$ac_word
-	       else
-		 ac_cv_c_bigendian=universal
-		 break
-	       fi
-	       ;;
-	   esac
-	   ac_prev=
-	 elif test "x$ac_word" = "x-arch"; then
-	   ac_prev=arch
-	 fi
-       done
-fi
+	# there are some -arch flags.  Note that *ppc* also matches
+	# ppc64.  This check is also rather less than ideal.
+	case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
+	  *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
+	esac
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     if test $ac_cv_c_bigendian = unknown; then
       # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
 	     #include <sys/param.h>
@@ -26390,9 +28140,30 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   # It does; now see whether it defined to BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
 		#include <sys/param.h>
@@ -26408,18 +28179,49 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_c_bigendian=yes
 else
-  ac_cv_c_bigendian=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_bigendian=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
     if test $ac_cv_c_bigendian = unknown; then
       # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <limits.h>
 
@@ -26434,9 +28236,30 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   # It does; now see whether it defined to _BIG_ENDIAN or not.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <limits.h>
 
@@ -26451,20 +28274,51 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_c_bigendian=yes
 else
-  ac_cv_c_bigendian=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_c_bigendian=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
     if test $ac_cv_c_bigendian = unknown; then
       # Compile a test program.
-      if test "$cross_compiling" = yes; then :
+      if test "$cross_compiling" = yes; then
   # Try to guess by grepping values from an object file.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 short int ascii_mm[] =
 		  { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -26490,7 +28344,24 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
 	      ac_cv_c_bigendian=yes
 	    fi
@@ -26502,10 +28373,20 @@
 		ac_cv_c_bigendian=unknown
 	      fi
 	    fi
-fi
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
 int
@@ -26525,18 +28406,45 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_run "$LINENO"; then :
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
   ac_cv_c_bigendian=no
 else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
 $as_echo "$ac_cv_c_bigendian" >&6; }
  case $ac_cv_c_bigendian in #(
    yes)
@@ -26552,10 +28460,14 @@
 
 
 if test "x$ENDIAN" = xuniversal_endianness; then
-    as_fn_error $? "Building with both big and little endianness is not supported" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Building with both big and little endianness is not supported" >&5
+$as_echo "$as_me: error: Building with both big and little endianness is not supported" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then
-    as_fn_error $? "The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)" >&5
+$as_echo "$as_me: error: The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 
@@ -26683,26 +28595,57 @@
     # On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
     # While waiting for a better solution, the current workaround is to use -mstackrealign.
     CFLAGS="$CFLAGS -mstackrealign"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if 32-bit compiler supports -mstackrealign" >&5
+    { $as_echo "$as_me:$LINENO: checking if 32-bit compiler supports -mstackrealign" >&5
 $as_echo_n "checking if 32-bit compiler supports -mstackrealign... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 int main() { return 0; }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-		        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+
+		        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 
 else
-
-		        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-	                as_fn_error $? "The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path." "$LINENO" 5
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+		        { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+	                { { $as_echo "$as_me:$LINENO: error: The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path." >&5
+$as_echo "$as_me: error: The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
 
 C_FLAG_DEPS="-MMD -MF"
@@ -26850,37 +28793,37 @@
 
 
 if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5
+   { $as_echo "$as_me:$LINENO: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&5
 $as_echo "$as_me: WARNING: Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags" >&2;}
 fi
 
 if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5
+   { $as_echo "$as_me:$LINENO: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&5
 $as_echo "$as_me: WARNING: Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags" >&2;}
 fi
 
 if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
-   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5
+   { $as_echo "$as_me:$LINENO: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&5
 $as_echo "$as_me: WARNING: Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags" >&2;}
 fi
 
 
 # Check whether --with-extra-cflags was given.
-if test "${with_extra_cflags+set}" = set; then :
+if test "${with_extra_cflags+set}" = set; then
   withval=$with_extra_cflags;
 fi
 
 
 
 # Check whether --with-extra-cxxflags was given.
-if test "${with_extra_cxxflags+set}" = set; then :
+if test "${with_extra_cxxflags+set}" = set; then
   withval=$with_extra_cxxflags;
 fi
 
 
 
 # Check whether --with-extra-ldflags was given.
-if test "${with_extra_ldflags+set}" = set; then :
+if test "${with_extra_ldflags+set}" = set; then
   withval=$with_extra_ldflags;
 fi
 
@@ -27119,18 +29062,20 @@
 fi
 
 # Check whether --enable-debug-symbols was given.
-if test "${enable_debug_symbols+set}" = set; then :
+if test "${enable_debug_symbols+set}" = set; then
   enableval=$enable_debug_symbols; ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should generate debug symbols" >&5
+{ $as_echo "$as_me:$LINENO: checking if we should generate debug symbols" >&5
 $as_echo_n "checking if we should generate debug symbols... " >&6; }
 
 if test "x$ENABLE_DEBUG_SYMBOLS" = "xyes" && test "x$OBJCOPY" = x; then
    # explicit enabling of enable-debug-symbols and can't find objcopy
    #   this is an error
-   as_fn_error $? "Unable to find objcopy, cannot enable debug-symbols" "$LINENO" 5
+   { { $as_echo "$as_me:$LINENO: error: Unable to find objcopy, cannot enable debug-symbols" >&5
+$as_echo "$as_me: error: Unable to find objcopy, cannot enable debug-symbols" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 if test "x$ENABLE_DEBUG_SYMBOLS" = "xdefault"; then
@@ -27142,7 +29087,7 @@
   fi
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_DEBUG_SYMBOLS" >&5
+{ $as_echo "$as_me:$LINENO: result: $ENABLE_DEBUG_SYMBOLS" >&5
 $as_echo "$ENABLE_DEBUG_SYMBOLS" >&6; }
 
 #
@@ -27151,14 +29096,14 @@
 ZIP_DEBUGINFO_FILES=yes
 
 # Check whether --enable-zip-debug-info was given.
-if test "${enable_zip_debug_info+set}" = set; then :
+if test "${enable_zip_debug_info+set}" = set; then
   enableval=$enable_zip_debug_info; ZIP_DEBUGINFO_FILES=${enable_zip_debug_info}
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should zip debug-info files" >&5
+{ $as_echo "$as_me:$LINENO: checking if we should zip debug-info files" >&5
 $as_echo_n "checking if we should zip debug-info files... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP_DEBUGINFO_FILES" >&5
+{ $as_echo "$as_me:$LINENO: result: $ZIP_DEBUGINFO_FILES" >&5
 $as_echo "$ZIP_DEBUGINFO_FILES" >&6; }
 
 # Hotspot wants ZIP_DEBUGINFO_FILES to be 1 for yes
@@ -27188,35 +29133,35 @@
 # OS specific settings that we never will need to probe.
 #
 if test "x$OPENJDK_TARGET_OS" = xlinux; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on Linux?" >&5
+    { $as_echo "$as_me:$LINENO: checking what is not needed on Linux?" >&5
 $as_echo_n "checking what is not needed on Linux?... " >&6; }
     PULSE_NOT_NEEDED=yes
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: pulse" >&5
+    { $as_echo "$as_me:$LINENO: result: pulse" >&5
 $as_echo "pulse" >&6; }
 fi
 
 if test "x$OPENJDK_TARGET_OS" = xsolaris; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on Solaris?" >&5
+    { $as_echo "$as_me:$LINENO: checking what is not needed on Solaris?" >&5
 $as_echo_n "checking what is not needed on Solaris?... " >&6; }
     ALSA_NOT_NEEDED=yes
     PULSE_NOT_NEEDED=yes
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse" >&5
+    { $as_echo "$as_me:$LINENO: result: alsa pulse" >&5
 $as_echo "alsa pulse" >&6; }
 fi
 
 if test "x$OPENJDK_TARGET_OS" = xwindows; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on Windows?" >&5
+    { $as_echo "$as_me:$LINENO: checking what is not needed on Windows?" >&5
 $as_echo_n "checking what is not needed on Windows?... " >&6; }
     CUPS_NOT_NEEDED=yes
     ALSA_NOT_NEEDED=yes
     PULSE_NOT_NEEDED=yes
     X11_NOT_NEEDED=yes
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa cups pulse x11" >&5
+    { $as_echo "$as_me:$LINENO: result: alsa cups pulse x11" >&5
 $as_echo "alsa cups pulse x11" >&6; }
 fi
 
 if test "x$OPENJDK_TARGET_OS" = xmacosx; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on MacOSX?" >&5
+    { $as_echo "$as_me:$LINENO: checking what is not needed on MacOSX?" >&5
 $as_echo_n "checking what is not needed on MacOSX?... " >&6; }
     ALSA_NOT_NEEDED=yes
     PULSE_NOT_NEEDED=yes
@@ -27224,15 +29169,15 @@
     FREETYPE2_NOT_NEEDED=yes
     # If the java runtime framework is disabled, then we need X11.
     # This will be adjusted below.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5
+    { $as_echo "$as_me:$LINENO: result: alsa pulse x11" >&5
 $as_echo "alsa pulse x11" >&6; }
 fi
 
 if test "x$OPENJDK_TARGET_OS" = xbsd; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on bsd?" >&5
+    { $as_echo "$as_me:$LINENO: checking what is not needed on bsd?" >&5
 $as_echo_n "checking what is not needed on bsd?... " >&6; }
     ALSA_NOT_NEEDED=yes
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa" >&5
+    { $as_echo "$as_me:$LINENO: result: alsa" >&5
 $as_echo "alsa" >&6; }
 fi
 
@@ -27250,7 +29195,7 @@
 # that uses this API.
 #
 # Check whether --enable-macosx-runtime-support was given.
-if test "${enable_macosx_runtime_support+set}" = set; then :
+if test "${enable_macosx_runtime_support+set}" = set; then
   enableval=$enable_macosx_runtime_support; MACOSX_RUNTIME_SUPPORT="${enableval}"
 else
   MACOSX_RUNTIME_SUPPORT="no"
@@ -27258,29 +29203,29 @@
 
 
 USE_MACOSX_RUNTIME_SUPPORT=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit Java runtime support in the OS" >&5
+{ $as_echo "$as_me:$LINENO: checking for explicit Java runtime support in the OS" >&5
 $as_echo_n "checking for explicit Java runtime support in the OS... " >&6; }
 if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
     if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then
         MACOSX_RUNTIME_SUPPORT=yes
         USE_MACOSX_RUNTIME_SUPPORT=yes
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, does not need alsa freetype2 pulse and X11" >&5
+        { $as_echo "$as_me:$LINENO: result: yes, does not need alsa freetype2 pulse and X11" >&5
 $as_echo "yes, does not need alsa freetype2 pulse and X11" >&6; }
     else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, but explicitly disabled." >&5
+        { $as_echo "$as_me:$LINENO: result: yes, but explicitly disabled." >&5
 $as_echo "yes, but explicitly disabled." >&6; }
     fi
 else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+    { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on an X11 build on MacOSX?" >&5
+    { $as_echo "$as_me:$LINENO: checking what is not needed on an X11 build on MacOSX?" >&5
 $as_echo_n "checking what is not needed on an X11 build on MacOSX?... " >&6; }
     X11_NOT_NEEDED=
     FREETYPE2_NOT_NEEDED=
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse" >&5
+    { $as_echo "$as_me:$LINENO: result: alsa pulse" >&5
 $as_echo "alsa pulse" >&6; }
 fi
 
@@ -27309,12 +29254,12 @@
 fi
 
 # Now let autoconf do it's magic
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
+{ $as_echo "$as_me:$LINENO: checking for X" >&5
 $as_echo_n "checking for X... " >&6; }
 
 
 # Check whether --with-x was given.
-if test "${with_x+set}" = set; then :
+if test "${with_x+set}" = set; then
   withval=$with_x;
 fi
 
@@ -27324,8 +29269,10 @@
   have_x=disabled
 else
   case $x_includes,$x_libraries in #(
-    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5 ;; #(
-    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then :
+    *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5
+$as_echo "$as_me: error: cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   # One or both of the vars are not set, and there is no cached value.
@@ -27342,7 +29289,7 @@
 	@echo libdir='${LIBDIR}'
 _ACEOF
   if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
     for ac_var in incroot usrlibdir libdir; do
       eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
     done
@@ -27373,25 +29320,21 @@
 # Check X11 before X11Rn because it is often a symlink to the current release.
 ac_x_header_dirs='
 /usr/X11/include
-/usr/X11R7/include
 /usr/X11R6/include
 /usr/X11R5/include
 /usr/X11R4/include
 
 /usr/include/X11
-/usr/include/X11R7
 /usr/include/X11R6
 /usr/include/X11R5
 /usr/include/X11R4
 
 /usr/local/X11/include
-/usr/local/X11R7/include
 /usr/local/X11R6/include
 /usr/local/X11R5/include
 /usr/local/X11R4/include
 
 /usr/local/include/X11
-/usr/local/include/X11R7
 /usr/local/include/X11R6
 /usr/local/include/X11R5
 /usr/local/include/X11R4
@@ -27413,14 +29356,37 @@
 if test "$ac_x_includes" = no; then
   # Guess where to find include files, by looking for Xlib.h.
   # First, try using that file with no special directory specified.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 _ACEOF
-if ac_fn_cxx_try_cpp "$LINENO"; then :
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
   # We can compile using X headers with no special include directory.
 ac_x_includes=
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
   for ac_dir in $ac_x_header_dirs; do
   if test -r "$ac_dir/X11/Xlib.h"; then
     ac_x_includes=$ac_dir
@@ -27428,7 +29394,8 @@
   fi
 done
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
+
+rm -f conftest.err conftest.$ac_ext
 fi # $ac_x_includes = no
 
 if test "$ac_x_libraries" = no; then
@@ -27437,7 +29404,11 @@
   # Don't add to $LIBS permanently.
   ac_save_LIBS=$LIBS
   LIBS="-lX11 $LIBS"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Xlib.h>
 int
@@ -27448,12 +29419,35 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
 ac_x_libraries=
 else
-  LIBS=$ac_save_LIBS
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
 for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
 do
   # Don't even attempt the hair of trying to link an X program!
@@ -27465,8 +29459,10 @@
   done
 done
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi # $ac_x_libraries = no
 
 case $ac_x_includes,$ac_x_libraries in #(
@@ -27487,7 +29483,7 @@
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
+  { $as_echo "$as_me:$LINENO: result: $have_x" >&5
 $as_echo "$have_x" >&6; }
   no_x=yes
 else
@@ -27498,14 +29494,16 @@
   ac_cv_have_x="have_x=yes\
 	ac_x_includes='$x_includes'\
 	ac_x_libraries='$x_libraries'"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
+  { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
 $as_echo "libraries $x_libraries, headers $x_includes" >&6; }
 fi
 
 if test "$no_x" = yes; then
   # Not all programs may use this symbol, but it does not hurt to define it.
 
-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define X_DISPLAY_MISSING 1
+_ACEOF
 
   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
 else
@@ -27518,52 +29516,110 @@
     X_LIBS="$X_LIBS -L$x_libraries"
     # For Solaris; some versions of Sun CC require a space after -R and
     # others require no space.  Words are not sufficient . . . .
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
+    { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
 $as_echo_n "checking whether -R must be followed by a space... " >&6; }
     ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
     ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag
     ac_cxx_werror_flag=yes
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
        X_LIBS="$X_LIBS -R$x_libraries"
 else
-  LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS="$ac_xsave_LIBS -R $x_libraries"
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 	  X_LIBS="$X_LIBS -R $x_libraries"
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: result: neither works" >&5
 $as_echo "neither works" >&6; }
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
     ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag
     LIBS=$ac_xsave_LIBS
   fi
@@ -27579,7 +29635,11 @@
     # libraries were built with DECnet support.  And Karl Berry says
     # the Alpha needs dnet_stub (dnet does not exist).
     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27597,17 +29657,114 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  :
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	{ $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then :
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldnet  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dnet_ntoa ();
+int
+main ()
+{
+return dnet_ntoa ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
+if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27625,66 +29782,52 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then :
+if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
 fi
 
     fi
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
     LIBS="$ac_xsave_LIBS"
 
     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
@@ -27695,20 +29838,175 @@
     # on Irix 5.2, according to T.E. Dickey.
     # The functions gethostbyname, getservbyname, and inet_addr are
     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    ac_fn_cxx_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = x""yes; then :
-
-fi
+    { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5
+$as_echo_n "checking for gethostbyname... " >&6; }
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char gethostbyname (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_gethostbyname || defined __stub___gethostbyname
+choke me
+#endif
+
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+$as_echo "$ac_cv_func_gethostbyname" >&6; }
 
     if test $ac_cv_func_gethostbyname = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+      { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then :
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_nsl_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+      if test $ac_cv_lib_nsl_gethostbyname = no; then
+	{ $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27726,59 +30024,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_gethostbyname=yes
-else
-  ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_bsd_gethostbyname=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_bsd_gethostbyname=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
-      if test $ac_cv_lib_nsl_gethostbyname = no; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_bsd_gethostbyname=yes
-else
-  ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then :
+if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
 fi
 
@@ -27792,20 +30074,105 @@
     # variants that don't use the name server (or something).  -lsocket
     # must be given before -lnsl if both are needed.  We assume that
     # if connect needs -lnsl, so does gethostbyname.
-    ac_fn_cxx_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = x""yes; then :
-
-fi
+    { $as_echo "$as_me:$LINENO: checking for connect" >&5
+$as_echo_n "checking for connect... " >&6; }
+if test "${ac_cv_func_connect+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char connect ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_connect || defined __stub___connect
+choke me
+#endif
+
+int
+main ()
+{
+return connect ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_connect=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+$as_echo "$ac_cv_func_connect" >&6; }
 
     if test $ac_cv_func_connect = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
+      { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
 $as_echo_n "checking for connect in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_connect+set}" = set; then :
+if test "${ac_cv_lib_socket_connect+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27823,38 +30190,148 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_socket_connect=yes
 else
-  ac_cv_lib_socket_connect=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_socket_connect=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
 $as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = x""yes; then :
+if test "x$ac_cv_lib_socket_connect" = x""yes; then
   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
 fi
 
     fi
 
     # Guillermo Gomez says -lposix is necessary on A/UX.
-    ac_fn_cxx_check_func "$LINENO" "remove" "ac_cv_func_remove"
-if test "x$ac_cv_func_remove" = x""yes; then :
-
-fi
+    { $as_echo "$as_me:$LINENO: checking for remove" >&5
+$as_echo_n "checking for remove... " >&6; }
+if test "${ac_cv_func_remove+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char remove ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_remove || defined __stub___remove
+choke me
+#endif
+
+int
+main ()
+{
+return remove ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_remove=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+$as_echo "$ac_cv_func_remove" >&6; }
 
     if test $ac_cv_func_remove = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
+      { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5
 $as_echo_n "checking for remove in -lposix... " >&6; }
-if test "${ac_cv_lib_posix_remove+set}" = set; then :
+if test "${ac_cv_lib_posix_remove+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lposix  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27872,38 +30349,148 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_posix_remove=yes
 else
-  ac_cv_lib_posix_remove=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_posix_remove=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
 $as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = x""yes; then :
+if test "x$ac_cv_lib_posix_remove" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
 fi
 
     fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    ac_fn_cxx_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
-if test "x$ac_cv_func_shmat" = x""yes; then :
-
-fi
+    { $as_echo "$as_me:$LINENO: checking for shmat" >&5
+$as_echo_n "checking for shmat... " >&6; }
+if test "${ac_cv_func_shmat+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shmat ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_shmat || defined __stub___shmat
+choke me
+#endif
+
+int
+main ()
+{
+return shmat ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shmat=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_func_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+$as_echo "$ac_cv_func_shmat" >&6; }
 
     if test $ac_cv_func_shmat = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
+      { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
 $as_echo_n "checking for shmat in -lipc... " >&6; }
-if test "${ac_cv_lib_ipc_shmat+set}" = set; then :
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lipc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27921,18 +30508,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_ipc_shmat=yes
 else
-  ac_cv_lib_ipc_shmat=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ipc_shmat=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
 $as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = x""yes; then :
+if test "x$ac_cv_lib_ipc_shmat" = x""yes; then
   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
 fi
 
@@ -27948,14 +30560,18 @@
   # These have to be linked with before -lX11, unlike the other
   # libraries we check for below, so use a different variable.
   # John Interrante, Karl Berry
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
+  { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then :
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -27973,18 +30589,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_ICE_IceConnectionNumber=yes
 else
-  ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then :
+if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then
   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
 fi
 
@@ -28019,7 +30660,9 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-    as_fn_error $? "Could not find X11 libraries. $HELP_MSG" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Could not find X11 libraries. $HELP_MSG" >&5
+$as_echo "$as_me: error: Could not find X11 libraries. $HELP_MSG" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 # Some of the old makefiles require a setting of OPENWIN_HOME
@@ -28060,14 +30703,64 @@
 CFLAGS="$CFLAGS $X_CFLAGS"
 
 # Need to include Xlib.h and Xutil.h to avoid "present but cannot be compiled" warnings on Solaris 10
+
+
+
 for ac_header in X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " # include <X11/Xlib.h>
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+ # include <X11/Xlib.h>
                    # include <X11/Xutil.h>
 
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -28113,7 +30806,9 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-    as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG" >&5
+$as_echo "$as_me: error: Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 
@@ -28127,20 +30822,20 @@
 #
 
 # Check whether --with-cups was given.
-if test "${with_cups+set}" = set; then :
+if test "${with_cups+set}" = set; then
   withval=$with_cups;
 fi
 
 
 # Check whether --with-cups-include was given.
-if test "${with_cups_include+set}" = set; then :
+if test "${with_cups_include+set}" = set; then
   withval=$with_cups_include;
 fi
 
 
 if test "x$CUPS_NOT_NEEDED" = xyes; then
 	if test "x${with_cups}" != x || test "x${with_cups_include}" != x; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cups not used, so --with-cups is ignored" >&5
+		{ $as_echo "$as_me:$LINENO: WARNING: cups not used, so --with-cups is ignored" >&5
 $as_echo "$as_me: WARNING: cups not used, so --with-cups is ignored" >&2;}
 	fi
 	CUPS_CFLAGS=
@@ -28148,7 +30843,9 @@
 	CUPS_FOUND=no
 
 	if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno; then
-	    as_fn_error $? "It is not possible to disable the use of cups. Remove the --without-cups option." "$LINENO" 5
+	    { { $as_echo "$as_me:$LINENO: error: It is not possible to disable the use of cups. Remove the --without-cups option." >&5
+$as_echo "$as_me: error: It is not possible to disable the use of cups. Remove the --without-cups option." >&2;}
+   { (exit 1); exit 1; }; }
 	fi
 
 	if test "x${with_cups}" != x; then
@@ -28181,7 +30878,7 @@
             resource=${builddep_cups}
         fi
         if test "x$resource" != x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for cups" >&5
+            { $as_echo "$as_me:$LINENO: Using builddeps $resource for cups" >&5
 $as_echo "$as_me: Using builddeps $resource for cups" >&6;}
 	    # If the resource in the builddeps.conf file is an existing directory,
 	    # for example /java/linux/cups
@@ -28202,18 +30899,22 @@
     extension=${filename#*.}
     installdir=$with_builddeps_dir/$filebase
     if test ! -f $installdir/$filename.unpacked; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency cups from $with_builddeps_server/$resource and installing into $installdir" >&5
+        { $as_echo "$as_me:$LINENO: Downloading build dependency cups from $with_builddeps_server/$resource and installing into $installdir" >&5
 $as_echo "$as_me: Downloading build dependency cups from $with_builddeps_server/$resource and installing into $installdir" >&6;}
         if test ! -d $installdir; then
             mkdir -p $installdir
         fi
         if test ! -d $installdir; then
-            as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create directory $installdir" >&5
+$as_echo "$as_me: error: Could not create directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         tmpfile=`mktemp $installdir/cups.XXXXXXXXX`
         touch $tmpfile
         if test ! -f $tmpfile; then
-            as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create files in directory $installdir" >&5
+$as_echo "$as_me: error: Could not create files in directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
 
     # $with_builddeps_server/$resource  is the ftp://abuilddeps.server.com/libs/cups.zip
@@ -28251,12 +30952,16 @@
         ) | ftp -in $FTPSERVER
     fi
     if test "x$VALID_TOOL" != xyes; then
-       as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: I do not know how to use the tool: $BDEPS_FTP" >&5
+$as_echo "$as_me: error: I do not know how to use the tool: $BDEPS_FTP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
         mv $tmpfile $installdir/$filename
         if test ! -s $installdir/$filename; then
-            as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not download $with_builddeps_server/$resource" >&5
+$as_echo "$as_me: error: Could not download $with_builddeps_server/$resource" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         case "$extension" in
             zip)  echo "Unzipping $installdir/$filename..."
@@ -28268,7 +30973,9 @@
             tgz) echo "Untaring $installdir/$filename..."
                (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
             ;;
-            *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5
+            *) { { $as_echo "$as_me:$LINENO: error: Cannot handle build depency archive with extension $extension" >&5
+$as_echo "$as_me: error: Cannot handle build depency archive with extension $extension" >&2;}
+   { (exit 1); exit 1; }; }
             ;;
         esac
     fi
@@ -28285,7 +30992,9 @@
             thecflags=${builddep_cups_CFLAGS}
             thelibs=${builddep_cups_LIBS}
             if test "x$depdir" = x; then
-                as_fn_error $? "Could not download build dependency cups" "$LINENO" 5
+                { { $as_echo "$as_me:$LINENO: error: Could not download build dependency cups" >&5
+$as_echo "$as_me: error: Could not download build dependency cups" >&2;}
+   { (exit 1); exit 1; }; }
             fi
             CUPS=$depdir
             if test "x$theroot" != x; then
@@ -28306,11 +31015,150 @@
 	fi
 	if test "x$CUPS_FOUND" = xno; then
 	    # Are the cups headers installed in the default /usr/include location?
-	    for ac_header in cups/cups.h cups/ppd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+
+
+for ac_header in cups/cups.h cups/ppd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to build-dev@openjdk.java.net ##
+## ----------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
@@ -28325,7 +31173,7 @@
 	if test "x$CUPS_FOUND" = xno; then
 	    # Getting nervous now? Lets poke around for standard Solaris third-party
 	    # package installation locations.
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cups headers" >&5
+	    { $as_echo "$as_me:$LINENO: checking for cups headers" >&5
 $as_echo_n "checking for cups headers... " >&6; }
 	    if test -s /opt/sfw/cups/include/cups/cups.h; then
 	       # An SFW package seems to be installed!
@@ -28336,7 +31184,7 @@
 	       CUPS_FOUND=yes
 	       CUPS_CFLAGS="-I/opt/csw/include"
 	    fi
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CUPS_FOUND" >&5
+	    { $as_echo "$as_me:$LINENO: result: $CUPS_FOUND" >&5
 $as_echo "$CUPS_FOUND" >&6; }
 	fi
 	if test "x$CUPS_FOUND" = xno; then
@@ -28365,7 +31213,9 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-	    as_fn_error $? "Could not find cups! $HELP_MSG " "$LINENO" 5
+	    { { $as_echo "$as_me:$LINENO: error: Could not find cups! $HELP_MSG " >&5
+$as_echo "$as_me: error: Could not find cups! $HELP_MSG " >&2;}
+   { (exit 1); exit 1; }; }
 	fi
 fi
 
@@ -28380,7 +31230,7 @@
 #
 
 # Check whether --with-freetype was given.
-if test "${with_freetype+set}" = set; then :
+if test "${with_freetype+set}" = set; then
   withval=$with_freetype;
 fi
 
@@ -28390,7 +31240,7 @@
 
 if test "x$FREETYPE2_NOT_NEEDED" = xyes; then
 	if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5
+		{ $as_echo "$as_me:$LINENO: WARNING: freetype not used, so --with-freetype is ignored" >&5
 $as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2;}
 	fi
 	FREETYPE2_CFLAGS=
@@ -28417,9 +31267,11 @@
   # 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 with_freetype, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of with_freetype, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of with_freetype" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of with_freetype" >&5
+$as_echo "$as_me: error: Cannot locate the the path of with_freetype" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -28458,7 +31310,7 @@
 
   if test "x$path" != "x$new_path"; then
     with_freetype="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting with_freetype to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;}
   fi
 
@@ -28496,7 +31348,7 @@
 
   if test "x$path" != "x$new_path"; then
     with_freetype="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting with_freetype to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;}
   fi
 
@@ -28508,14 +31360,18 @@
     path="$with_freetype"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of with_freetype, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of with_freetype, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of with_freetype, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
     fi
   fi
 
@@ -28536,16 +31392,22 @@
    	    if test "x$FREETYPE2_FOUND" = xyes; then
 	        # Verify that the directories exist
                 if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
-		   as_fn_error $? "Could not find the expected directories $with_freetype/lib and $with_freetype/include" "$LINENO" 5
+		   { { $as_echo "$as_me:$LINENO: error: Could not find the expected directories $with_freetype/lib and $with_freetype/include" >&5
+$as_echo "$as_me: error: Could not find the expected directories $with_freetype/lib and $with_freetype/include" >&2;}
+   { (exit 1); exit 1; }; }
 		fi
 	        # List the contents of the lib.
 		FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null`
                 if test "x$FREETYPELIB" = x; then
-		   as_fn_error $? "Could not find libfreetype.so nor freetype.dll in $with_freetype/lib" "$LINENO" 5
+		   { { $as_echo "$as_me:$LINENO: error: Could not find libfreetype.so nor freetype.dll in $with_freetype/lib" >&5
+$as_echo "$as_me: error: Could not find libfreetype.so nor freetype.dll in $with_freetype/lib" >&2;}
+   { (exit 1); exit 1; }; }
 		fi
 	        # Check one h-file
                 if ! test -s "$with_freetype/include/ft2build.h"; then
-		   as_fn_error $? "Could not find $with_freetype/include/ft2build.h" "$LINENO" 5
+		   { { $as_echo "$as_me:$LINENO: error: Could not find $with_freetype/include/ft2build.h" >&5
+$as_echo "$as_me: error: Could not find $with_freetype/include/ft2build.h" >&2;}
+   { (exit 1); exit 1; }; }
 		fi
             fi
         fi
@@ -28571,7 +31433,7 @@
             resource=${builddep_freetype2}
         fi
         if test "x$resource" != x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for freetype2" >&5
+            { $as_echo "$as_me:$LINENO: Using builddeps $resource for freetype2" >&5
 $as_echo "$as_me: Using builddeps $resource for freetype2" >&6;}
 	    # If the resource in the builddeps.conf file is an existing directory,
 	    # for example /java/linux/cups
@@ -28592,18 +31454,22 @@
     extension=${filename#*.}
     installdir=$with_builddeps_dir/$filebase
     if test ! -f $installdir/$filename.unpacked; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&5
+        { $as_echo "$as_me:$LINENO: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&5
 $as_echo "$as_me: Downloading build dependency freetype2 from $with_builddeps_server/$resource and installing into $installdir" >&6;}
         if test ! -d $installdir; then
             mkdir -p $installdir
         fi
         if test ! -d $installdir; then
-            as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create directory $installdir" >&5
+$as_echo "$as_me: error: Could not create directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         tmpfile=`mktemp $installdir/freetype2.XXXXXXXXX`
         touch $tmpfile
         if test ! -f $tmpfile; then
-            as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create files in directory $installdir" >&5
+$as_echo "$as_me: error: Could not create files in directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
 
     # $with_builddeps_server/$resource  is the ftp://abuilddeps.server.com/libs/cups.zip
@@ -28641,12 +31507,16 @@
         ) | ftp -in $FTPSERVER
     fi
     if test "x$VALID_TOOL" != xyes; then
-       as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: I do not know how to use the tool: $BDEPS_FTP" >&5
+$as_echo "$as_me: error: I do not know how to use the tool: $BDEPS_FTP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
         mv $tmpfile $installdir/$filename
         if test ! -s $installdir/$filename; then
-            as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not download $with_builddeps_server/$resource" >&5
+$as_echo "$as_me: error: Could not download $with_builddeps_server/$resource" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         case "$extension" in
             zip)  echo "Unzipping $installdir/$filename..."
@@ -28658,7 +31528,9 @@
             tgz) echo "Untaring $installdir/$filename..."
                (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
             ;;
-            *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5
+            *) { { $as_echo "$as_me:$LINENO: error: Cannot handle build depency archive with extension $extension" >&5
+$as_echo "$as_me: error: Cannot handle build depency archive with extension $extension" >&2;}
+   { (exit 1); exit 1; }; }
             ;;
         esac
     fi
@@ -28675,7 +31547,9 @@
             thecflags=${builddep_freetype2_CFLAGS}
             thelibs=${builddep_freetype2_LIBS}
             if test "x$depdir" = x; then
-                as_fn_error $? "Could not download build dependency freetype2" "$LINENO" 5
+                { { $as_echo "$as_me:$LINENO: error: Could not download build dependency freetype2" >&5
+$as_echo "$as_me: error: Could not download build dependency freetype2" >&2;}
+   { (exit 1); exit 1; }; }
             fi
             FREETYPE2=$depdir
             if test "x$theroot" != x; then
@@ -28716,9 +31590,11 @@
   # 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 FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5
+    { $as_echo "$as_me:$LINENO: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;}
-    as_fn_error $? "Cannot locate the the path of FREETYPELOCATION" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: Cannot locate the the path of FREETYPELOCATION" >&5
+$as_echo "$as_me: error: Cannot locate the the path of FREETYPELOCATION" >&2;}
+   { (exit 1); exit 1; }; }
   fi
 
   # Call helper function which possibly converts this using DOS-style short mode.
@@ -28757,7 +31633,7 @@
 
   if test "x$path" != "x$new_path"; then
     FREETYPELOCATION="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FREETYPELOCATION to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;}
   fi
 
@@ -28795,7 +31671,7 @@
 
   if test "x$path" != "x$new_path"; then
     FREETYPELOCATION="$new_path"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5
+    { $as_echo "$as_me:$LINENO: Rewriting FREETYPELOCATION to \"$new_path\"" >&5
 $as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;}
   fi
 
@@ -28807,50 +31683,58 @@
     path="$FREETYPELOCATION"
 
     if test ! -f "$path" && test ! -d "$path"; then
-      as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5
+      { { $as_echo "$as_me:$LINENO: error: The path of FREETYPELOCATION, which resolves as \"$path\", is not found." >&5
+$as_echo "$as_me: error: The path of FREETYPELOCATION, which resolves as \"$path\", is not found." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     has_space=`$ECHO "$path" | $GREP " "`
     if test "x$has_space" != x; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5
+      { $as_echo "$as_me:$LINENO: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5
 $as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;}
-      as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5
-    fi
-  fi
-
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5
+      { { $as_echo "$as_me:$LINENO: error: Spaces are not allowed in this path." >&5
+$as_echo "$as_me: error: Spaces are not allowed in this path." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+
+	    { $as_echo "$as_me:$LINENO: checking for freetype in some standard windows locations" >&5
 $as_echo_n "checking for freetype in some standard windows locations... " >&6; }
 	    if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then
 	        FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include"
 	        FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib"
  	        FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib"
                 if ! test -s "$FREETYPE2_LIBS"; then
-		   as_fn_error $? "Could not find $FREETYPE2_LIBS" "$LINENO" 5
+		   { { $as_echo "$as_me:$LINENO: error: Could not find $FREETYPE2_LIBS" >&5
+$as_echo "$as_me: error: Could not find $FREETYPE2_LIBS" >&2;}
+   { (exit 1); exit 1; }; }
 		fi
                 if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then
-		   as_fn_error $? "Could not find $FREETYPE2_LIB_PATH/freetype.dll" "$LINENO" 5
+		   { { $as_echo "$as_me:$LINENO: error: Could not find $FREETYPE2_LIB_PATH/freetype.dll" >&5
+$as_echo "$as_me: error: Could not find $FREETYPE2_LIB_PATH/freetype.dll" >&2;}
+   { (exit 1); exit 1; }; }
 		fi
                 USING_SYSTEM_FT_LIB=true
                 FREETYPE2_FOUND=yes
 	    fi
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5
+	    { $as_echo "$as_me:$LINENO: result: $FREETYPE2_FOUND" >&5
 $as_echo "$FREETYPE2_FOUND" >&6; }
         fi
 	if test "x$FREETYPE2_FOUND" = xno; then
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE2" >&5
+{ $as_echo "$as_me:$LINENO: checking for FREETYPE2" >&5
 $as_echo_n "checking for FREETYPE2... " >&6; }
 
 if test -n "$FREETYPE2_CFLAGS"; then
     pkg_cv_FREETYPE2_CFLAGS="$FREETYPE2_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"freetype2\"") >&5
   ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   pkg_cv_FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null`
 else
   pkg_failed=yes
@@ -28862,11 +31746,11 @@
     pkg_cv_FREETYPE2_LIBS="$FREETYPE2_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"freetype2\"") >&5
   ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   pkg_cv_FREETYPE2_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null`
 else
   pkg_failed=yes
@@ -28892,7 +31776,7 @@
 	# Put the nasty error message in config.log where it belongs
 	echo "$FREETYPE2_PKG_ERRORS" >&5
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
                 FREETYPE2_FOUND=no
 elif test $pkg_failed = untried; then
@@ -28900,7 +31784,7 @@
 else
 	FREETYPE2_CFLAGS=$pkg_cv_FREETYPE2_CFLAGS
 	FREETYPE2_LIBS=$pkg_cv_FREETYPE2_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 	FREETYPE2_FOUND=yes
 fi
@@ -28913,7 +31797,7 @@
             fi
 	fi
 	if test "x$FREETYPE2_FOUND" = xno; then
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard locations" >&5
+	    { $as_echo "$as_me:$LINENO: checking for freetype in some standard locations" >&5
 $as_echo_n "checking for freetype in some standard locations... " >&6; }
 
 	    if test -s /usr/X11/include/ft2build.h && test -d /usr/X11/include/freetype2/freetype; then
@@ -28929,14 +31813,38 @@
 	    PREV_LDFLAGS="$LDFLAGS"
 	    CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS"
 	    LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS"
-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+	    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include<ft2build.h>
 	                    #include FT_FREETYPE_H
 	                   int main() { return 0; }
 
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
 
 	                      # Yes, the default cflags and libs did the trick.
 	                      FREETYPE2_FOUND=yes
@@ -28944,15 +31852,20 @@
 	                      FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS"
 
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
 
 	                      FREETYPE2_FOUND=no
 
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
             CXXCFLAGS="$PREV_CXXFLAGS"
 	    LDFLAGS="$PREV_LDFLAGS"
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5
+	    { $as_echo "$as_me:$LINENO: result: $FREETYPE2_FOUND" >&5
 $as_echo "$FREETYPE2_FOUND" >&6; }
             USING_SYSTEM_FT_LIB=true
 	fi
@@ -28982,21 +31895,27 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-		as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5
+		{ { $as_echo "$as_me:$LINENO: error: Could not find freetype2! $HELP_MSG " >&5
+$as_echo "$as_me: error: Could not find freetype2! $HELP_MSG " >&2;}
+   { (exit 1); exit 1; }; }
 	fi
 
         if test "x$OPENJDK_TARGET_OS" != xwindows; then
             # AC_CHECK_LIB does not support use of cl.exe
             PREV_LDFLAGS="$LDFLAGS"
             LDFLAGS="$FREETYPE2_LIBS"
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5
+            { $as_echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5
 $as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; }
-if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then :
+if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lfreetype  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -29014,26 +31933,48 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_freetype_FT_Init_FreeType=yes
 else
-  ac_cv_lib_freetype_FT_Init_FreeType=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_freetype_FT_Init_FreeType=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5
 $as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; }
-if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBFREETYPE 1
-_ACEOF
-
-  LIBS="-lfreetype $LIBS"
-
-else
-  as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5
+if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = x""yes; then
+  FREETYPE2_FOUND=true
+else
+  { { $as_echo "$as_me:$LINENO: error: Could not find freetype2! $HELP_MSG " >&5
+$as_echo "$as_me: error: Could not find freetype2! $HELP_MSG " >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
             LDFLAGS="$PREV_LDFLAGS"
@@ -29054,26 +31995,26 @@
 #
 
 # Check whether --with-alsa was given.
-if test "${with_alsa+set}" = set; then :
+if test "${with_alsa+set}" = set; then
   withval=$with_alsa;
 fi
 
 
 # Check whether --with-alsa-include was given.
-if test "${with_alsa_include+set}" = set; then :
+if test "${with_alsa_include+set}" = set; then
   withval=$with_alsa_include;
 fi
 
 
 # Check whether --with-alsa-lib was given.
-if test "${with_alsa_lib+set}" = set; then :
+if test "${with_alsa_lib+set}" = set; then
   withval=$with_alsa_lib;
 fi
 
 
 if test "x$ALSA_NOT_NEEDED" = xyes; then
 	if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: alsa not used, so --with-alsa is ignored" >&5
+		{ $as_echo "$as_me:$LINENO: WARNING: alsa not used, so --with-alsa is ignored" >&5
 $as_echo "$as_me: WARNING: alsa not used, so --with-alsa is ignored" >&2;}
 	fi
 	ALSA_CFLAGS=
@@ -29082,7 +32023,9 @@
 	ALSA_FOUND=no
 
 	if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
-	    as_fn_error $? "It is not possible to disable the use of alsa. Remove the --without-alsa option." "$LINENO" 5
+	    { { $as_echo "$as_me:$LINENO: error: It is not possible to disable the use of alsa. Remove the --without-alsa option." >&5
+$as_echo "$as_me: error: It is not possible to disable the use of alsa. Remove the --without-alsa option." >&2;}
+   { (exit 1); exit 1; }; }
 	fi
 
 	if test "x${with_alsa}" != x; then
@@ -29120,7 +32063,7 @@
             resource=${builddep_alsa}
         fi
         if test "x$resource" != x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: Using builddeps $resource for alsa" >&5
+            { $as_echo "$as_me:$LINENO: Using builddeps $resource for alsa" >&5
 $as_echo "$as_me: Using builddeps $resource for alsa" >&6;}
 	    # If the resource in the builddeps.conf file is an existing directory,
 	    # for example /java/linux/cups
@@ -29141,18 +32084,22 @@
     extension=${filename#*.}
     installdir=$with_builddeps_dir/$filebase
     if test ! -f $installdir/$filename.unpacked; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Downloading build dependency alsa from $with_builddeps_server/$resource and installing into $installdir" >&5
+        { $as_echo "$as_me:$LINENO: Downloading build dependency alsa from $with_builddeps_server/$resource and installing into $installdir" >&5
 $as_echo "$as_me: Downloading build dependency alsa from $with_builddeps_server/$resource and installing into $installdir" >&6;}
         if test ! -d $installdir; then
             mkdir -p $installdir
         fi
         if test ! -d $installdir; then
-            as_fn_error $? "Could not create directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create directory $installdir" >&5
+$as_echo "$as_me: error: Could not create directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         tmpfile=`mktemp $installdir/alsa.XXXXXXXXX`
         touch $tmpfile
         if test ! -f $tmpfile; then
-            as_fn_error $? "Could not create files in directory $installdir" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not create files in directory $installdir" >&5
+$as_echo "$as_me: error: Could not create files in directory $installdir" >&2;}
+   { (exit 1); exit 1; }; }
         fi
 
     # $with_builddeps_server/$resource  is the ftp://abuilddeps.server.com/libs/cups.zip
@@ -29190,12 +32137,16 @@
         ) | ftp -in $FTPSERVER
     fi
     if test "x$VALID_TOOL" != xyes; then
-       as_fn_error $? "I do not know how to use the tool: $BDEPS_FTP" "$LINENO" 5
+       { { $as_echo "$as_me:$LINENO: error: I do not know how to use the tool: $BDEPS_FTP" >&5
+$as_echo "$as_me: error: I do not know how to use the tool: $BDEPS_FTP" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
         mv $tmpfile $installdir/$filename
         if test ! -s $installdir/$filename; then
-            as_fn_error $? "Could not download $with_builddeps_server/$resource" "$LINENO" 5
+            { { $as_echo "$as_me:$LINENO: error: Could not download $with_builddeps_server/$resource" >&5
+$as_echo "$as_me: error: Could not download $with_builddeps_server/$resource" >&2;}
+   { (exit 1); exit 1; }; }
         fi
         case "$extension" in
             zip)  echo "Unzipping $installdir/$filename..."
@@ -29207,7 +32158,9 @@
             tgz) echo "Untaring $installdir/$filename..."
                (cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
             ;;
-            *) as_fn_error $? "Cannot handle build depency archive with extension $extension" "$LINENO" 5
+            *) { { $as_echo "$as_me:$LINENO: error: Cannot handle build depency archive with extension $extension" >&5
+$as_echo "$as_me: error: Cannot handle build depency archive with extension $extension" >&2;}
+   { (exit 1); exit 1; }; }
             ;;
         esac
     fi
@@ -29224,7 +32177,9 @@
             thecflags=${builddep_alsa_CFLAGS}
             thelibs=${builddep_alsa_LIBS}
             if test "x$depdir" = x; then
-                as_fn_error $? "Could not download build dependency alsa" "$LINENO" 5
+                { { $as_echo "$as_me:$LINENO: error: Could not download build dependency alsa" >&5
+$as_echo "$as_me: error: Could not download build dependency alsa" >&2;}
+   { (exit 1); exit 1; }; }
             fi
             ALSA=$depdir
             if test "x$theroot" != x; then
@@ -29248,18 +32203,18 @@
 	if test "x$ALSA_FOUND" = xno; then
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ALSA" >&5
+{ $as_echo "$as_me:$LINENO: checking for ALSA" >&5
 $as_echo_n "checking for ALSA... " >&6; }
 
 if test -n "$ALSA_CFLAGS"; then
     pkg_cv_ALSA_CFLAGS="$ALSA_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"alsa\""; } >&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"alsa\"") >&5
   ($PKG_CONFIG --exists --print-errors "alsa") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   pkg_cv_ALSA_CFLAGS=`$PKG_CONFIG --cflags "alsa" 2>/dev/null`
 else
   pkg_failed=yes
@@ -29271,11 +32226,11 @@
     pkg_cv_ALSA_LIBS="$ALSA_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"alsa\""; } >&5
+    { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"alsa\"") >&5
   ($PKG_CONFIG --exists --print-errors "alsa") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
   pkg_cv_ALSA_LIBS=`$PKG_CONFIG --libs "alsa" 2>/dev/null`
 else
   pkg_failed=yes
@@ -29301,7 +32256,7 @@
 	# Put the nasty error message in config.log where it belongs
 	echo "$ALSA_PKG_ERRORS" >&5
 
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+	{ $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
                 ALSA_FOUND=no
 elif test $pkg_failed = untried; then
@@ -29309,18 +32264,157 @@
 else
 	ALSA_CFLAGS=$pkg_cv_ALSA_CFLAGS
 	ALSA_LIBS=$pkg_cv_ALSA_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+        { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
 	ALSA_FOUND=yes
 fi
 	fi
 	if test "x$ALSA_FOUND" = xno; then
-	    for ac_header in alsa/asoundlib.h
-do :
-  ac_fn_cxx_check_header_mongrel "$LINENO" "alsa/asoundlib.h" "ac_cv_header_alsa_asoundlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_alsa_asoundlib_h" = x""yes; then :
+
+for ac_header in alsa/asoundlib.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ----------------------------------------- ##
+## Report this to build-dev@openjdk.java.net ##
+## ----------------------------------------- ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+	       { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+		 $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_ALSA_ASOUNDLIB_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
  ALSA_FOUND=yes
 	                      ALSA_CFLAGS=-Iignoreme
@@ -29359,7 +32453,9 @@
         HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
     fi
 
-	    as_fn_error $? "Could not find alsa! $HELP_MSG " "$LINENO" 5
+	    { { $as_echo "$as_me:$LINENO: error: Could not find alsa! $HELP_MSG " >&5
+$as_echo "$as_me: error: Could not find alsa! $HELP_MSG " >&2;}
+   { (exit 1); exit 1; }; }
 	fi
 fi
 
@@ -29375,14 +32471,19 @@
 #
 
 USE_EXTERNAL_LIBJPEG=true
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ljpeg" >&5
+
+{ $as_echo "$as_me:$LINENO: checking for main in -ljpeg" >&5
 $as_echo_n "checking for main in -ljpeg... " >&6; }
-if test "${ac_cv_lib_jpeg_main+set}" = set; then :
+if test "${ac_cv_lib_jpeg_main+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ljpeg  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
@@ -29394,18 +32495,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_jpeg_main=yes
 else
-  ac_cv_lib_jpeg_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_jpeg_main=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_main" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_main" >&5
 $as_echo "$ac_cv_lib_jpeg_main" >&6; }
-if test "x$ac_cv_lib_jpeg_main" = x""yes; then :
+if test "x$ac_cv_lib_jpeg_main" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBJPEG 1
 _ACEOF
@@ -29414,7 +32540,7 @@
 
 else
    USE_EXTERNAL_LIBJPEG=false
-               { $as_echo "$as_me:${as_lineno-$LINENO}: Will use jpeg decoder bundled with the OpenJDK source" >&5
+               { $as_echo "$as_me:$LINENO: Will use jpeg decoder bundled with the OpenJDK source" >&5
 $as_echo "$as_me: Will use jpeg decoder bundled with the OpenJDK source" >&6;}
 
 fi
@@ -29427,14 +32553,19 @@
 #
 
 USE_EXTERNAL_LIBJPEG=true
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgif" >&5
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lgif" >&5
 $as_echo_n "checking for main in -lgif... " >&6; }
-if test "${ac_cv_lib_gif_main+set}" = set; then :
+if test "${ac_cv_lib_gif_main+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lgif  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 
@@ -29446,18 +32577,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_gif_main=yes
 else
-  ac_cv_lib_gif_main=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_gif_main=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gif_main" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gif_main" >&5
 $as_echo "$ac_cv_lib_gif_main" >&6; }
-if test "x$ac_cv_lib_gif_main" = x""yes; then :
+if test "x$ac_cv_lib_gif_main" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBGIF 1
 _ACEOF
@@ -29466,7 +32622,7 @@
 
 else
    USE_EXTERNAL_LIBGIF=false
-               { $as_echo "$as_me:${as_lineno-$LINENO}: Will use gif decoder bundled with the OpenJDK source" >&5
+               { $as_echo "$as_me:$LINENO: Will use gif decoder bundled with the OpenJDK source" >&5
 $as_echo "$as_me: Will use gif decoder bundled with the OpenJDK source" >&6;}
 
 fi
@@ -29480,19 +32636,23 @@
 
 
 # Check whether --with-zlib was given.
-if test "${with_zlib+set}" = set; then :
+if test "${with_zlib+set}" = set; then
   withval=$with_zlib;
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress in -lz" >&5
+{ $as_echo "$as_me:$LINENO: checking for compress in -lz" >&5
 $as_echo_n "checking for compress in -lz... " >&6; }
-if test "${ac_cv_lib_z_compress+set}" = set; then :
+if test "${ac_cv_lib_z_compress+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lz  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -29510,25 +32670,50 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_z_compress=yes
 else
-  ac_cv_lib_z_compress=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_z_compress=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5
 $as_echo "$ac_cv_lib_z_compress" >&6; }
-if test "x$ac_cv_lib_z_compress" = x""yes; then :
+if test "x$ac_cv_lib_z_compress" = x""yes; then
    ZLIB_FOUND=yes
 else
    ZLIB_FOUND=no
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for which zlib to use" >&5
+{ $as_echo "$as_me:$LINENO: checking for which zlib to use" >&5
 $as_echo_n "checking for which zlib to use... " >&6; }
 
 DEFAULT_ZLIB=bundled
@@ -29555,20 +32740,24 @@
 
 if test "x${with_zlib}" = "xbundled"; then
     USE_EXTERNAL_LIBZ=false
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: bundled" >&5
+    { $as_echo "$as_me:$LINENO: result: bundled" >&5
 $as_echo "bundled" >&6; }
 elif test "x${with_zlib}" = "xsystem"; then
     if test "x${ZLIB_FOUND}" = "xyes"; then
         USE_EXTERNAL_LIBZ=true
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5
+        { $as_echo "$as_me:$LINENO: result: system" >&5
 $as_echo "system" >&6; }
     else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: system not found" >&5
+        { $as_echo "$as_me:$LINENO: result: system not found" >&5
 $as_echo "system not found" >&6; }
-        as_fn_error $? "--with-zlib=system specified, but no zlib found!" "$LINENO" 5
-    fi
-else
-    as_fn_error $? "Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: --with-zlib=system specified, but no zlib found!" >&5
+$as_echo "$as_me: error: --with-zlib=system specified, but no zlib found!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+else
+    { { $as_echo "$as_me:$LINENO: error: Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'" >&5
+$as_echo "$as_me: error: Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'" >&2;}
+   { (exit 1); exit 1; }; }
 fi
 
 
@@ -29583,7 +32772,11 @@
 # Check if altzone exists in time.h
 #
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <time.h>
 int
@@ -29594,16 +32787,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   has_altzone=yes
 else
-  has_altzone=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	has_altzone=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 if test "x$has_altzone" = xyes; then
 
-$as_echo "#define HAVE_ALTZONE 1" >>confdefs.h
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALTZONE 1
+_ACEOF
 
 fi
 
@@ -29612,14 +32832,19 @@
 # Check the maths library
 #
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5
+
+{ $as_echo "$as_me:$LINENO: checking for cos in -lm" >&5
 $as_echo_n "checking for cos in -lm... " >&6; }
-if test "${ac_cv_lib_m_cos+set}" = set; then :
+if test "${ac_cv_lib_m_cos+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lm  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -29637,18 +32862,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_m_cos=yes
 else
-  ac_cv_lib_m_cos=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_m_cos=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_cos" >&5
 $as_echo "$ac_cv_lib_m_cos" >&6; }
-if test "x$ac_cv_lib_m_cos" = x""yes; then :
+if test "x$ac_cv_lib_m_cos" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
 _ACEOF
@@ -29657,7 +32907,7 @@
 
 else
 
-                  { $as_echo "$as_me:${as_lineno-$LINENO}: Maths library was not found" >&5
+                  { $as_echo "$as_me:$LINENO: Maths library was not found" >&5
 $as_echo "$as_me: Maths library was not found" >&6;}
 
 fi
@@ -29670,14 +32920,19 @@
 
 save_LIBS="$LIBS"
 LIBS=""
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+
+{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-ldl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -29695,18 +32950,43 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   ac_cv_lib_dl_dlopen=yes
 else
-  ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDL 1
 _ACEOF
@@ -29727,8 +33007,8 @@
 # dynamic build is configured on command line.
 #
 # Check whether --enable-static-link-stdc++ was given.
-if test "${enable_static_link_stdc__+set}" = set; then :
-  enableval=$enable_static_link_stdc__;
+if test "${enable_static_link_stdc+++set}" = set; then
+  enableval=$enable_static_link_stdc++;
 else
 
 		enable_static_link_stdc__=yes
@@ -29738,7 +33018,7 @@
 
 if test "x$OPENJDK_TARGET_OS" = xlinux; then
     # Test if -lstdc++ works.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if dynamic link of stdc++ is possible" >&5
+    { $as_echo "$as_me:$LINENO: checking if dynamic link of stdc++ is possible" >&5
 $as_echo_n "checking if dynamic link of stdc++ is possible... " >&6; }
     ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -29748,7 +33028,11 @@
 
     OLD_CXXFLAGS="$CXXFLAGS"
     CXXFLAGS="$CXXFLAGS -lstdc++"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -29759,13 +33043,38 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   has_dynamic_libstdcxx=yes
 else
-  has_dynamic_libstdcxx=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	has_dynamic_libstdcxx=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
     CXXFLAGS="$OLD_CXXFLAGS"
     ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -29773,11 +33082,11 @@
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_dynamic_libstdcxx" >&5
+    { $as_echo "$as_me:$LINENO: result: $has_dynamic_libstdcxx" >&5
 $as_echo "$has_dynamic_libstdcxx" >&6; }
 
     # Test if stdc++ can be linked statically.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if static link of stdc++ is possible" >&5
+    { $as_echo "$as_me:$LINENO: checking if static link of stdc++ is possible" >&5
 $as_echo_n "checking if static link of stdc++ is possible... " >&6; }
     STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
     ac_ext=cpp
@@ -29790,7 +33099,11 @@
     OLD_CXX="$CXX"
     LIBS="$STATIC_STDCXX_FLAGS"
     CXX="$CC"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
 int
@@ -29801,13 +33114,38 @@
   return 0;
 }
 _ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
   has_static_libstdcxx=yes
 else
-  has_static_libstdcxx=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	has_static_libstdcxx=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
     LIBS="$OLD_LIBS"
     CXX="$OLD_CXX"
     ac_ext=cpp
@@ -29816,38 +33154,40 @@
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_static_libstdcxx" >&5
+    { $as_echo "$as_me:$LINENO: result: $has_static_libstdcxx" >&5
 $as_echo "$has_static_libstdcxx" >&6; }
 
     if test "x$has_static_libcxx" = xno && test "x$has_dynamic_libcxx" = xno; then
-        as_fn_error $? "I cannot link to stdc++! Neither dynamically nor statically." "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: I cannot link to stdc++! Neither dynamically nor statically." >&5
+$as_echo "$as_me: error: I cannot link to stdc++! Neither dynamically nor statically." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
     if test "x$enable_static_link_stdc__" = xyes && test "x$has_static_libstdcxx" = xno; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Static linking of libstdc++ was not possible reverting to dynamic linking." >&5
+        { $as_echo "$as_me:$LINENO: Static linking of libstdc++ was not possible reverting to dynamic linking." >&5
 $as_echo "$as_me: Static linking of libstdc++ was not possible reverting to dynamic linking." >&6;}
         enable_static_link_stdc__=no
     fi
 
     if test "x$enable_static_link_stdc__" = xno && test "x$has_dynamic_libstdcxx" = xno; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: Dynamic linking of libstdc++ was not possible reverting to static linking." >&5
+        { $as_echo "$as_me:$LINENO: Dynamic linking of libstdc++ was not possible reverting to static linking." >&5
 $as_echo "$as_me: Dynamic linking of libstdc++ was not possible reverting to static linking." >&6;}
         enable_static_link_stdc__=yes
     fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libstdc++" >&5
+    { $as_echo "$as_me:$LINENO: checking how to link with libstdc++" >&5
 $as_echo_n "checking how to link with libstdc++... " >&6; }
     if test "x$enable_static_link_stdc__" = xyes; then
         LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
         LDCXX="$CC"
         STATIC_CXX_SETTING="STATIC_CXX=true"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+        { $as_echo "$as_me:$LINENO: result: static" >&5
 $as_echo "static" >&6; }
     else
         LIBCXX="$LIBCXX -lstdc++"
         LDCXX="$CXX"
         STATIC_CXX_SETTING="STATIC_CXX=false"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: dynamic" >&5
+        { $as_echo "$as_me:$LINENO: result: dynamic" >&5
 $as_echo "dynamic" >&6; }
     fi
 fi
@@ -29875,7 +33215,7 @@
 # called fixpath.
 FIXPATH=
 if test "x$OPENJDK_BUILD_OS" = xwindows; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5
+    { $as_echo "$as_me:$LINENO: checking if fixpath can be created" >&5
 $as_echo_n "checking if fixpath can be created... " >&6; }
     FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c"
     FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe"
@@ -29901,25 +33241,29 @@
     cd $CURDIR
 
     if test ! -x $OUTPUT_ROOT/fixpath.exe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
         cat $OUTPUT_ROOT/fixpath1.log
-        as_fn_error $? "Could not create $OUTPUT_ROOT/fixpath.exe" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+        { { $as_echo "$as_me:$LINENO: error: Could not create $OUTPUT_ROOT/fixpath.exe" >&5
+$as_echo "$as_me: error: Could not create $OUTPUT_ROOT/fixpath.exe" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5
+    { $as_echo "$as_me:$LINENO: checking if fixpath.exe works" >&5
 $as_echo_n "checking if fixpath.exe works... " >&6; }
     cd $OUTPUT_ROOT
     $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1
     cd $CURDIR
     if test ! -x $OUTPUT_ROOT/fixpath2.exe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+        { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
         cat $OUTPUT_ROOT/fixpath2.log
-        as_fn_error $? "fixpath did not work!" "$LINENO" 5
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+        { { $as_echo "$as_me:$LINENO: error: fixpath did not work!" >&5
+$as_echo "$as_me: error: fixpath did not work!" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+    { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
     rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj
 fi
@@ -29957,14 +33301,14 @@
 # How many cores do we have on this build system?
 
 # Check whether --with-num-cores was given.
-if test "${with_num_cores+set}" = set; then :
+if test "${with_num_cores+set}" = set; then
   withval=$with_num_cores;
 fi
 
 if test "x$with_num_cores" = x; then
     # The number of cores were not specified, try to probe them.
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of cores" >&5
+    { $as_echo "$as_me:$LINENO: checking for number of cores" >&5
 $as_echo_n "checking for number of cores... " >&6; }
     NUM_CORES=1
     FOUND_CORES=no
@@ -29992,12 +33336,12 @@
     CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
 
     if test "x$FOUND_CORES" = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUM_CORES" >&5
+        { $as_echo "$as_me:$LINENO: result: $NUM_CORES" >&5
 $as_echo "$NUM_CORES" >&6; }
     else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect number of cores, defaulting to 1" >&5
+        { $as_echo "$as_me:$LINENO: result: could not detect number of cores, defaulting to 1" >&5
 $as_echo "could not detect number of cores, defaulting to 1" >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This will disable all parallelism from build!" >&5
+        { $as_echo "$as_me:$LINENO: WARNING: This will disable all parallelism from build!" >&5
 $as_echo "$as_me: WARNING: This will disable all parallelism from build!" >&2;}
     fi
 
@@ -30013,14 +33357,14 @@
 # How much memory do we have on this build system?
 
 # Check whether --with-memory-size was given.
-if test "${with_memory_size+set}" = set; then :
+if test "${with_memory_size+set}" = set; then
   withval=$with_memory_size;
 fi
 
 if test "x$with_memory_size" = x; then
     # The memory size was not specified, try to probe it.
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for memory size" >&5
+    { $as_echo "$as_me:$LINENO: checking for memory size" >&5
 $as_echo_n "checking for memory size... " >&6; }
     # Default to 1024 MB
     MEMORY_SIZE=1024
@@ -30048,12 +33392,12 @@
     fi
 
     if test "x$FOUND_MEM" = xyes; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEMORY_SIZE MB" >&5
+        { $as_echo "$as_me:$LINENO: result: $MEMORY_SIZE MB" >&5
 $as_echo "$MEMORY_SIZE MB" >&6; }
     else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not detect memory size, defaulting to 1024 MB" >&5
+        { $as_echo "$as_me:$LINENO: result: could not detect memory size, defaulting to 1024 MB" >&5
 $as_echo "could not detect memory size, defaulting to 1024 MB" >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This might seriously impact build performance!" >&5
+        { $as_echo "$as_me:$LINENO: WARNING: This might seriously impact build performance!" >&5
 $as_echo "$as_me: WARNING: This might seriously impact build performance!" >&2;}
     fi
 
@@ -30067,7 +33411,7 @@
 
 
 # Check whether --with-sjavac-server-java was given.
-if test "${with_sjavac_server_java+set}" = set; then :
+if test "${with_sjavac_server_java+set}" = set; then
   withval=$with_sjavac_server_java;
 fi
 
@@ -30076,7 +33420,9 @@
     SJAVAC_SERVER_JAVA="$with_sjavac_server_java"
     FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
     if test "x$FOUND_VERSION" = x; then
-        as_fn_error $? "Could not execute server java: $SJAVAC_SERVER_JAVA" "$LINENO" 5
+        { { $as_echo "$as_me:$LINENO: error: Could not execute server java: $SJAVAC_SERVER_JAVA" >&5
+$as_echo "$as_me: error: Could not execute server java: $SJAVAC_SERVER_JAVA" >&2;}
+   { (exit 1); exit 1; }; }
     fi
 else
     SJAVAC_SERVER_JAVA=""
@@ -30106,7 +33452,7 @@
 
 
 # Check whether --with-sjavac-server-cores was given.
-if test "${with_sjavac_server_cores+set}" = set; then :
+if test "${with_sjavac_server_cores+set}" = set; then
   withval=$with_sjavac_server_cores;
 fi
 
@@ -30260,25 +33606,25 @@
 
     MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501`
     if test "$SJAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if number of server cores must be reduced" >&5
+        { $as_echo "$as_me:$LINENO: checking if number of server cores must be reduced" >&5
 $as_echo_n "checking if number of server cores must be reduced... " >&6; }
         SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP"
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&5
+        { $as_echo "$as_me:$LINENO: result: yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&5
 $as_echo "yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB" >&6; }
     fi
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5
+{ $as_echo "$as_me:$LINENO: checking whether to use sjavac" >&5
 $as_echo_n "checking whether to use sjavac... " >&6; }
 # Check whether --enable-sjavac was given.
-if test "${enable_sjavac+set}" = set; then :
+if test "${enable_sjavac+set}" = set; then
   enableval=$enable_sjavac; ENABLE_SJAVAC="${enableval}"
 else
   ENABLE_SJAVAC='no'
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_SJAVAC" >&5
+{ $as_echo "$as_me:$LINENO: result: $ENABLE_SJAVAC" >&5
 $as_echo "$ENABLE_SJAVAC" >&6; }
 
 
@@ -30299,7 +33645,7 @@
 # Can the C/C++ compiler use precompiled headers?
 #
 # Check whether --enable-precompiled-headers was given.
-if test "${enable_precompiled_headers+set}" = set; then :
+if test "${enable_precompiled_headers+set}" = set; then
   enableval=$enable_precompiled_headers; ENABLE_PRECOMPH=${enable_precompiled-headers}
 else
   ENABLE_PRECOMPH=yes
@@ -30314,17 +33660,17 @@
 if test "x$ENABLE_PRECOMPH" = xyes; then
     # Check that the compiler actually supports precomp headers.
     if test "x$GCC" = xyes; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: checking that precompiled headers work" >&5
+         { $as_echo "$as_me:$LINENO: checking that precompiled headers work" >&5
 $as_echo_n "checking that precompiled headers work... " >&6; }
          echo "int alfa();" > conftest.h
          $CXX -x c++-header conftest.h -o conftest.hpp.gch
          if test ! -f conftest.hpp.gch; then
              echo Precompiled header is not working!
              USE_PRECOMPILED_HEADER=0
-             { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+             { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
          else
-             { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+             { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
          fi
          rm -f conftest.h
@@ -30337,7 +33683,7 @@
 # Setup use of ccache, if available
 
     # Check whether --enable-ccache was given.
-if test "${enable_ccache+set}" = set; then :
+if test "${enable_ccache+set}" = set; then
   enableval=$enable_ccache; ENABLE_CCACHE=${enable_ccache}
 else
   ENABLE_CCACHE=yes
@@ -30346,9 +33692,9 @@
     if test "x$ENABLE_CCACHE" = xyes; then
         # Extract the first word of "ccache", so it can be a program name with args.
 set dummy ccache; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_CCACHE+set}" = set; then :
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_CCACHE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   case $CCACHE in
@@ -30361,14 +33707,14 @@
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_CCACHE="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 IFS=$as_save_IFS
 
   ;;
@@ -30376,18 +33722,18 @@
 fi
 CCACHE=$ac_cv_path_CCACHE
 if test -n "$CCACHE"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCACHE" >&5
+  { $as_echo "$as_me:$LINENO: result: $CCACHE" >&5
 $as_echo "$CCACHE" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ccache" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    else
+        { $as_echo "$as_me:$LINENO: checking for ccache" >&5
 $as_echo_n "checking for ccache... " >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: explicitly disabled" >&5
+        { $as_echo "$as_me:$LINENO: result: explicitly disabled" >&5
 $as_echo "explicitly disabled" >&6; }
         CCACHE=
     fi
@@ -30395,7 +33741,7 @@
 
 
 # Check whether --with-ccache-dir was given.
-if test "${with_ccache_dir+set}" = set; then :
+if test "${with_ccache_dir+set}" = set; then
   withval=$with_ccache_dir;
 fi
 
@@ -30412,43 +33758,68 @@
         CCACHE_FOUND="true"
         # Only use ccache if it is 3.1.4 or later, which supports
         # precompiled headers.
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ccache supports precompiled headers" >&5
+        { $as_echo "$as_me:$LINENO: checking if ccache supports precompiled headers" >&5
 $as_echo_n "checking if ccache supports precompiled headers... " >&6; }
         HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.[456789]) 2> /dev/null`
         if test "x$HAS_GOOD_CCACHE" = x; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccache" >&5
+            { $as_echo "$as_me:$LINENO: result: no, disabling ccache" >&5
 $as_echo "no, disabling ccache" >&6; }
             CCACHE=
         else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+            { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking if C-compiler supports ccache precompiled headers" >&5
+            { $as_echo "$as_me:$LINENO: checking if C-compiler supports ccache precompiled headers" >&5
 $as_echo_n "checking if C-compiler supports ccache precompiled headers... " >&6; }
             PUSHED_FLAGS="$CXXFLAGS"
             CXXFLAGS="-fpch-preprocess $CXXFLAGS"
-            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   CC_KNOWS_CCACHE_TRICK=yes
 else
-  CC_KNOWS_CCACHE_TRICK=no
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CC_KNOWS_CCACHE_TRICK=no
+fi
+
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
             CXXFLAGS="$PUSHED_FLAGS"
             if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+                { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
             else
-                { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabling ccaching of precompiled headers" >&5
+                { $as_echo "$as_me:$LINENO: result: no, disabling ccaching of precompiled headers" >&5
 $as_echo "no, disabling ccaching of precompiled headers" >&6; }
                 CCACHE=
             fi
@@ -30478,7 +33849,7 @@
 # Check for some common pitfalls
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if build directory is on local disk" >&5
+{ $as_echo "$as_me:$LINENO: checking if build directory is on local disk" >&5
 $as_echo_n "checking if build directory is on local disk... " >&6; }
 
 	# df -l lists only local disks; if the given directory is not found then
@@ -30504,7 +33875,7 @@
     fi
   fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OUTPUT_DIR_IS_LOCAL" >&5
+{ $as_echo "$as_me:$LINENO: result: $OUTPUT_DIR_IS_LOCAL" >&5
 $as_echo "$OUTPUT_DIR_IS_LOCAL" >&6; }
 
 # Check if the user has any old-style ALT_ variables set.
@@ -30562,13 +33933,13 @@
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+      *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5
 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
       BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
+      *) $as_unset $ac_var ;;
       esac ;;
     esac
   done
@@ -30576,8 +33947,8 @@
   (set) 2>&1 |
     case $as_nl`(ac_space=' '; set) 2>&1` in #(
     *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes: double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
 	"s/'/'\\\\''/g;
 	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
@@ -30600,11 +33971,11 @@
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     test "x$cache_file" != "x/dev/null" &&
-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+      { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+    { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
@@ -30618,15 +33989,14 @@
 
 ac_libobjs=
 ac_ltlibobjs=
-U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
   ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -30638,10 +34008,9 @@
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #! $SHELL
 # Generated by $as_me.
 # Run this file to recreate the current configuration.
@@ -30651,18 +34020,17 @@
 debug=false
 ac_cs_recheck=false
 ac_cs_silent=false
-
 SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
@@ -30670,14 +34038,22 @@
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
 
 as_nl='
 '
@@ -30686,13 +34062,7 @@
 as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
 as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
   as_echo='printf %s\n'
   as_echo_n='printf %s'
 else
@@ -30703,7 +34073,7 @@
     as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
     as_echo_n_body='eval
       arg=$1;
-      case $arg in #(
+      case $arg in
       *"$as_nl"*)
 	expr "X$arg" : "X\\(.*\\)$as_nl";
 	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
@@ -30726,6 +34096,13 @@
   }
 fi
 
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
 
 # IFS
 # We need space, tab and new line, in precisely that order.  Quoting is
@@ -30735,15 +34112,15 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-case $0 in #((
+case $0 in
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
 IFS=$as_save_IFS
 
      ;;
@@ -30755,16 +34132,12 @@
 fi
 if test ! -f "$as_myself"; then
   $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
 done
 PS1='$ '
 PS2='> '
@@ -30776,89 +34149,7 @@
 LANGUAGE=C
 export LANGUAGE
 
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
+# Required to use basename.
 if expr a : '\(a\)' >/dev/null 2>&1 &&
    test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
@@ -30872,12 +34163,8 @@
   as_basename=false
 fi
 
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
+
+# Name of the executable.
 as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
 	 X"$0" : 'X\(//\)$' \| \
@@ -30897,25 +34184,76 @@
 	  }
 	  s/.*/./; q'`
 
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
 
 ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
+case `echo -n x` in
 -n*)
-  case `echo 'xy\c'` in
+  case `echo 'x\c'` in
   *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
+  *)   ECHO_C='\c';;
   esac;;
 *)
   ECHO_N='-n';;
 esac
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
 
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
@@ -30944,56 +34282,8 @@
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
 
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
 if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
+  as_mkdir_p=:
 else
   test -d ./-p && rmdir ./-p
   as_mkdir_p=false
@@ -31012,10 +34302,10 @@
       if test -d "$1"; then
 	test -d "$1/.";
       else
-	case $1 in #(
+	case $1 in
 	-*)set "./$1";;
 	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
 	???[sx]*):;;*)false;;esac;fi
     '\'' sh
   '
@@ -31030,19 +34320,13 @@
 
 
 exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
+
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
 This file was extended by OpenJDK $as_me jdk8, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.63.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -31073,15 +34357,13 @@
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration.  Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTION]... [FILE]...
 
   -h, --help       print this help, then exit
   -V, --version    print version number and configuration settings, then exit
-      --config     print configuration, then exit
   -q, --quiet, --silent
                    do not print progress messages
   -d, --debug      don't remove temporary files
@@ -31097,18 +34379,16 @@
 Configuration headers:
 $config_headers
 
-Report bugs to <build-dev@openjdk.java.net>.
-OpenJDK home page: <http://openjdk.java.net>."
+Report bugs to <bug-autoconf@gnu.org>."
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 OpenJDK config.status jdk8
-configured by $0, generated by GNU Autoconf 2.67,
-  with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2010 Free Software Foundation, Inc.
+configured by $0, generated by GNU Autoconf 2.63,
+  with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2008 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -31124,16 +34404,11 @@
 while test $# != 0
 do
   case $1 in
-  --*=?*)
+  --*=*)
     ac_option=`expr "X$1" : 'X\([^=]*\)='`
     ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
   *)
     ac_option=$1
     ac_optarg=$2
@@ -31147,29 +34422,27 @@
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     $as_echo "$ac_cs_version"; exit ;;
-  --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
     esac
-    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    CONFIG_FILES="$CONFIG_FILES '$ac_optarg'"
     ac_need_defaults=false;;
   --header | --heade | --head | --hea )
     $ac_shift
     case $ac_optarg in
     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'"
     ac_need_defaults=false;;
   --he | --h)
     # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
+    { $as_echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
   --help | --hel | -h )
     $as_echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
@@ -31177,10 +34450,11 @@
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
-  *) as_fn_append ac_config_targets " $1"
+  -*) { $as_echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
      ac_need_defaults=false ;;
 
   esac
@@ -31234,7 +34508,9 @@
     "$OUTPUT_ROOT/spec.sh") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in" ;;
     "$OUTPUT_ROOT/Makefile") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
   esac
 done
 
@@ -31260,7 +34536,7 @@
   trap 'exit_status=$?
   { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
-  trap 'as_fn_exit 1' 1 2 13 15
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
 # Create a (secure) tmp directory for tmp files.
 
@@ -31271,7 +34547,11 @@
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+} ||
+{
+   $as_echo "$as_me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -31279,13 +34559,7 @@
 if test -n "$CONFIG_FILES"; then
 
 
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
-  eval ac_cr=\$\'\\r\'
-fi
+ac_cr='
'
 ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
 if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
   ac_cs_awk_cr='\\r'
@@ -31302,18 +34576,24 @@
   echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
   echo "_ACEOF"
 } >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+  { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'`
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
 
   ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
   if test $ac_delim_n = $ac_delim_num; then
     break
   elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -31335,7 +34615,7 @@
 t delim
 :nl
 h
-s/\(.\{148\}\)..*/\1/
+s/\(.\{148\}\).*/\1/
 t more1
 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
 p
@@ -31349,7 +34629,7 @@
 t nl
 :delim
 h
-s/\(.\{148\}\)..*/\1/
+s/\(.\{148\}\).*/\1/
 t more2
 s/["\\]/\\&/g; s/^/"/; s/$/"/
 p
@@ -31402,28 +34682,22 @@
 else
   cat
 fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+  || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5
+$as_echo "$as_me: error: could not setup config files machinery" >&2;}
+   { (exit 1); exit 1; }; }
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
 # trailing colons and then remove the whole line if VPATH becomes empty
 # (actually we leave an empty line to preserve line numbers).
 if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
-h
-s///
-s/^/:/
-s/[	 ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
 s/:*$//
-x
-s/\(=[	 ]*\).*/\1/
-G
-s/\n//
 s/^[^=]*=[	 ]*$//
 }'
 fi
@@ -31451,7 +34725,9 @@
   if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+    { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5
+$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;}
+   { (exit 1); exit 1; }; }
   else
     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
@@ -31536,7 +34812,9 @@
 _ACAWK
 _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5
+$as_echo "$as_me: error: could not setup config headers machinery" >&2;}
+   { (exit 1); exit 1; }; }
 fi # test -n "$CONFIG_HEADERS"
 
 
@@ -31549,7 +34827,9 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5
+$as_echo "$as_me: error: invalid tag $ac_tag" >&2;}
+   { (exit 1); exit 1; }; };;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -31577,10 +34857,12 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      as_fn_append ac_file_inputs " '$ac_f'"
+      ac_file_inputs="$ac_file_inputs '$ac_f'"
     done
 
     # Let's still pretend it is `configure' which instantiates (i.e., don't
@@ -31591,7 +34873,7 @@
 	`' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+      { $as_echo "$as_me:$LINENO: creating $ac_file" >&5
 $as_echo "$as_me: creating $ac_file" >&6;}
     fi
     # Neutralize special characters interpreted by sed in replacement strings.
@@ -31604,7 +34886,9 @@
 
     case $ac_tag in
     *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; } ;;
     esac
     ;;
   esac
@@ -31632,7 +34916,47 @@
 	    q
 	  }
 	  s/.*/./; q'`
-  as_dir="$ac_dir"; as_fn_mkdir_p
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+$as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
   ac_builddir=.
 
 case "$ac_dir" in
@@ -31680,6 +35004,7 @@
 # If the template does not know about datarootdir, expand it.
 # FIXME: This hack should be removed a few years after 2.60.
 ac_datarootdir_hack=; ac_datarootdir_seen=
+
 ac_sed_dataroot='
 /datarootdir/ {
   p
@@ -31689,11 +35014,12 @@
 /@docdir@/p
 /@infodir@/p
 /@localedir@/p
-/@mandir@/p'
+/@mandir@/p
+'
 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
@@ -31703,7 +35029,7 @@
   s&@infodir@&$infodir&g
   s&@localedir@&$localedir&g
   s&@mandir@&$mandir&g
-  s&\\\${datarootdir}&$datarootdir&g' ;;
+    s&\\\${datarootdir}&$datarootdir&g' ;;
 esac
 _ACEOF
 
@@ -31730,22 +35056,26 @@
 $ac_datarootdir_hack
 "
 eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
+  { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
+which seems to be undefined.  Please make sure it is defined." >&2;}
 
   rm -f "$tmp/stdin"
   case $ac_file in
   -) cat "$tmp/out" && rm -f "$tmp/out";;
   *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+  || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
  ;;
   :H)
   #
@@ -31756,19 +35086,25 @@
       $as_echo "/* $configure_input  */" \
       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
     } >"$tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+      || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
     if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+      { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
       mv "$tmp/config.h" "$ac_file" \
-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+	|| { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5
+$as_echo "$as_me: error: could not create $ac_file" >&2;}
+   { (exit 1); exit 1; }; }
     fi
   else
     $as_echo "/* $configure_input  */" \
       && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
+      || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5
+$as_echo "$as_me: error: could not create -" >&2;}
+   { (exit 1); exit 1; }; }
   fi
  ;;
 
@@ -31778,12 +35114,15 @@
 done # for ac_tag
 
 
-as_fn_exit 0
-_ACEOF
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
 ac_clean_files=$ac_clean_files_save
 
 test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+  { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
 
 
 # configure is writing to config.log, and then calls config.status.
@@ -31804,10 +35143,10 @@
   exec 5>>config.log
   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
   # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
+  $ac_cs_success || { (exit 1); exit 1; }
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+  { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
--- a/common/autoconf/libraries.m4	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/libraries.m4	Wed Nov 14 16:41:12 2012 -0800
@@ -393,7 +393,9 @@
             # AC_CHECK_LIB does not support use of cl.exe
             PREV_LDFLAGS="$LDFLAGS"
             LDFLAGS="$FREETYPE2_LIBS"
-            AC_CHECK_LIB(freetype, FT_Init_FreeType, [], AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]))
+            AC_CHECK_LIB(freetype, FT_Init_FreeType, 
+                         FREETYPE2_FOUND=true, 
+                         AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]))
             LDFLAGS="$PREV_LDFLAGS"
         fi
 fi
--- a/common/autoconf/source-dirs.m4	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/source-dirs.m4	Wed Nov 14 16:41:12 2012 -0800
@@ -253,5 +253,24 @@
 BUILD_OUTPUT="$OUTPUT_ROOT"
 AC_SUBST(BUILD_OUTPUT)
 
+HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
+BUILD_HOTSPOT=true
+AC_SUBST(HOTSPOT_DIST)
+AC_SUBST(BUILD_HOTSPOT)
+AC_ARG_WITH(import-hotspot, [AS_HELP_STRING([--with-import-hotspot],
+	[import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source])])
+if test "x$with_import_hotspot" != x; then
+    CURDIR="$PWD"
+    cd "$with_import_hotspot"
+    HOTSPOT_DIST="`pwd`"
+    cd "$CURDIR"
+    if ! (test -d $HOTSPOT_DIST/lib && test -d $HOTSPOT_DIST/jre/lib); then
+        AC_MSG_ERROR([You have to import hotspot from a full jdk image or hotspot build dist dir!])
+    fi
+    AC_MSG_CHECKING([if hotspot should be imported])
+    AC_MSG_RESULT([yes from $HOTSPOT_DIST])
+    BUILD_HOTSPOT=false
+fi
+
 JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
 ])
--- a/common/autoconf/spec.gmk.in	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/autoconf/spec.gmk.in	Wed Nov 14 16:41:12 2012 -0800
@@ -224,7 +224,9 @@
 CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
 JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
 JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
-HOTSPOT_DIST=$(HOTSPOT_OUTPUTDIR)/dist
+HOTSPOT_DIST=@HOTSPOT_DIST@
+
+BUILD_HOTSPOT=@BUILD_HOTSPOT@
 
 # The boot jdk to use
 BOOT_JDK:=@BOOT_JDK@
@@ -244,12 +246,6 @@
 # Store sjavac server synchronization files here, and
 # the sjavac server log files.
 SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
-# We can block the Javac server to never use more cores than this.
-# This is not for performance reasons, but for memory usage, since each
-# core requires its own JavaCompiler. We might have 64 cores and 4GB
-# of memory, 64 JavaCompilers will currently not fit in a 3GB heap.
-# Since there is no sharing of data between the JavaCompilers.
-SJAVAC_SERVER_CORES:=@SJAVAC_SERVER_CORES@
 
 # The OpenJDK makefiles should be changed to using the standard
 # configure output ..._CFLAGS and ..._LIBS. In the meantime we
@@ -494,7 +490,14 @@
 # Where the build output is stored for your convenience.
 BUILD_LOG:=@BUILD_LOG@
 BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
-BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
+# Disable the build log wrapper on sjavac+winapi until
+# we have solved how to prevent the log wrapper to wait
+# for the background sjavac server process.
+ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS_API@,yesXwinapi)
+    BUILD_LOG_WRAPPER:=
+else
+    BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
+endif
 
 # Build setup
 ENABLE_JFR=@ENABLE_JFR@
--- a/common/bin/compare.sh	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/bin/compare.sh	Wed Nov 14 16:41:12 2012 -0800
@@ -352,6 +352,29 @@
     (cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
     (cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
 
+    # Find all archives inside and unzip them as well to compare the contents rather than
+    # the archives.
+    EXCEPTIONS=""
+    for pack in $($FIND $THIS_UNZIPDIR -name "*.pack" -o -name "*.pack.gz"); do
+        ($UNPACK200 $pack $pack.jar)
+        # Filter out the unzipped archives from the diff below.
+        EXCEPTIONS="$EXCEPTIONS $pack $pack.jar"
+    done
+    for pack in $($FIND $OTHER_UNZIPDIR -name "*.pack" -o -name "*.pack.gz"); do
+        ($UNPACK200 $pack $pack.jar)
+        EXCEPTIONS="$EXCEPTIONS $pack $pack.jar"
+    done
+    for zip in $($FIND $THIS_UNZIPDIR -name "*.jar" -o -name "*.zip"); do
+        $MKDIR $zip.unzip
+        (cd $zip.unzip && $UNARCHIVE $zip)
+        EXCEPTIONS="$EXCEPTIONS $zip"
+    done
+    for zip in $($FIND $OTHER_UNZIPDIR -name "*.jar" -o -name "*.zip"); do
+        $MKDIR $zip.unzip
+        (cd $zip.unzip && $UNARCHIVE $zip)
+        EXCEPTIONS="$EXCEPTIONS $zip"
+    done
+
     CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
     # On solaris, there is no -q option.
     if [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
@@ -389,7 +412,7 @@
 
     $RM -f $WORK_DIR/$ZIP_FILE.diffs
     for file in $DIFFING_FILES; do
-	if [[ "$ACCEPTED_JARZIP_CONTENTS" != *"$file"* ]]; then
+	if [[ "$ACCEPTED_JARZIP_CONTENTS $EXCEPTIONS" != *"$file"* ]]; then
             diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
 	fi
     done
@@ -664,8 +687,8 @@
 
     # Check dependencies
     if [ -n "$LDD_CMD" ]; then
-	(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
-	(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
+	(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME 2>/dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
+	(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME 2</dev/null | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
 	(cd $FILE_WORK_DIR && $RM -f $NAME)
 	
 	LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
@@ -846,7 +869,12 @@
     if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
         EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER)
     else
-        EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' -o -name '*.jar' -o -name '*.diz' \) | $SORT | $FILTER)
+        EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \
+            \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \
+            -o -name '*.jar' -o -name '*.diz' -o -name 'jcontrol' -o -name '*.properties' \
+            -o -name '*.data' -o -name '*.bfc' -o -name '*.src' -o -name '*.txt' \
+            -o -name '*.cfg' -o -name 'meta-index' -o -name '*.properties.ja' \
+            -o -name 'classlist' \) | $SORT | $FILTER)
     fi
 
     if [ -n "$EXECS" ]; then
@@ -1022,6 +1050,7 @@
 if [ -d "$THIS/deploy/j2sdk-image" ]; then
     THIS_J2SDK="$THIS/deploy/j2sdk-image"
     THIS_J2RE="$THIS/deploy/j2re-image"
+    echo "Comparing deploy images"
 elif [ -d "$THIS/images/j2sdk-image" ]; then
     THIS_J2SDK="$THIS/images/j2sdk-image"
     THIS_J2RE="$THIS/images/j2re-image"
--- a/common/bin/compare_exceptions.sh.incl	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/bin/compare_exceptions.sh.incl	Wed Nov 14 16:41:12 2012 -0800
@@ -282,6 +282,14 @@
 ./jre/lib/i386/libunpack.so
 ./jre/lib/i386/libverify.so
 ./jre/lib/i386/libzip.so
+./jre/lib/i386/libdeploy.so
+./jre/lib/i386/libjavaplugin.so
+./jre/lib/i386/libjavaplugin_jni.so
+./jre/lib/i386/libjavaplugin_nscp.so
+./jre/lib/i386/libjavaplugin_oji.so
+./jre/lib/i386/libnpjp2.so
+./jre/plugin/i386/ns4/libjavaplugin.so
+./jre/plugin/i386/ns7/libjavaplugin_oji.so
 ./jre/lib/i386/server/libjvm.so
 ./bin/appletviewer
 ./bin/extcheck
@@ -293,6 +301,7 @@
 ./bin/javadoc
 ./bin/javah
 ./bin/javap
+./bin/javaws
 ./bin/jcmd
 ./bin/jconsole
 ./bin/jdb
@@ -322,6 +331,8 @@
 ./bin/wsimport
 ./bin/xjc
 ./jre/bin/java
+./jre/bin/java_vm
+./jre/bin/javaws
 ./jre/bin/keytool
 ./jre/bin/orbd
 ./jre/bin/pack200
@@ -561,6 +572,14 @@
 ./jre/lib/sparc/libunpack.so
 ./jre/lib/sparc/libverify.so
 ./jre/lib/sparc/libzip.so
+./jre/lib/sparc/libdeploy.so
+./jre/lib/sparc/libjavaplugin.so
+./jre/lib/sparc/libjavaplugin_jni.so
+./jre/lib/sparc/libjavaplugin_nscp.so
+./jre/lib/sparc/libjavaplugin_oji.so
+./jre/lib/sparc/libnpjp2.so
+./jre/plugin/sparc/ns4/libjavaplugin.so
+./jre/plugin/sparc/ns7/libjavaplugin_oji.so
 ./jre/lib/sparc/server/libjvm.so
 ./bin/appletviewer
 ./bin/extcheck
@@ -572,6 +591,7 @@
 ./bin/javadoc
 ./bin/javah
 ./bin/javap
+./bin/javaws
 ./bin/jcmd
 ./bin/jconsole
 ./bin/jdb
@@ -601,6 +621,8 @@
 ./bin/wsimport
 ./bin/xjc
 ./jre/bin/java
+./jre/bin/java_vm
+./jre/bin/javaws
 ./jre/bin/keytool
 ./jre/bin/orbd
 ./jre/bin/pack200
--- a/common/makefiles/JavaCompilation.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/makefiles/JavaCompilation.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -111,7 +111,7 @@
         ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),)
             $1_GREP_INCLUDES:=| $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS))
         else
-            $$(shell $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include)
+            $$(shell $(MKDIR) -p $$($1_BIN) && $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_include)
             $$(eval $$(call ListPathsSafelyNow,$1_GREP_INCLUDE_PATTERNS,\n, \
 			>> $$($1_BIN)/_the.$$($1_JARNAME)_include))
             $1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include
@@ -124,7 +124,7 @@
         ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),)
             $1_GREP_EXCLUDES:=| $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS))
         else
-            $$(shell $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude)
+            $$(shell $(MKDIR) -p $$($1_BIN) && $(RM) $$($1_BIN)/_the.$$($1_JARNAME)_exclude)
             $$(eval $$(call ListPathsSafelyNow,$1_GREP_EXCLUDE_PATTERNS,\n, \
 			>> $$($1_BIN)/_the.$$($1_JARNAME)_exclude))
             $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude
@@ -170,9 +170,10 @@
     # tells us what to remove from the jar-file.
     $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE))
     # The update contents macro updates the jar file with the previously capture contents.
+    # xargs is used to trim the whitespace from the contents file, to see if it is empty.
     $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
                     (cd $$(src) && \
-                     if [ -s _the.$$($1_JARNAME)_contents ]; then \
+                     if [ -n "`$(CAT) _the.$$($1_JARNAME)_contents | $(XARGS)`" ]; then \
                          $(ECHO) "  updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
                          $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \
                      fi) $$(NEWLINE))
@@ -480,19 +481,24 @@
         $1_SJAVAC:=$$(word 1,$$($1_JAVAC)) -cp $$(word 3,$$($1_JAVAC)) com.sun.tools.sjavac.Main
 
         # Set the $1_REMOTE to spawn a background javac server.
-        $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),poolsize=$(SJAVAC_SERVER_CORES),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
+        $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
 
         $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS)
 		$(MKDIR) -p $$(@D)
 		$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
 		$(ECHO) Compiling $1
-		$$($1_JVM) $$($1_SJAVAC) \
-			$$($1_REMOTE) $$($1_SJAVAC_ARGS) \
+		($$($1_JVM) $$($1_SJAVAC) \
+			$$($1_REMOTE) \
+			-j $(NUM_CORES) \
 			--permit-unidentified-artifacts \
 			--permit-sources-without-package \
 			--compare-found-sources $$($1_BIN)/_the.batch.tmp \
+			--log=$(LOG) \
+			$$($1_SJAVAC_ARGS) \
 			$$($1_FLAGS) \
-			-implicit:none -d $$($1_BIN) $$($1_HEADERS_ARG)
+			$$($1_HEADERS_ARG) \
+			-d $$($1_BIN) && \
+			$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
     else
         # Using plain javac to batch compile everything.
         $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch
--- a/common/makefiles/Main.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/makefiles/Main.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -94,11 +94,13 @@
 	@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk)
 	@$(call TargetExit)
 
+ifeq ($(BUILD_HOTSPOT),true)
 hotspot: hotspot-only
 hotspot-only: start-make
 	@$(call TargetEnter)
 	@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
 	@$(call TargetExit)
+endif
 
 jdk: langtools hotspot corba jaxp jaxws jdk-only
 jdk-only: start-make
--- a/common/makefiles/MakeBase.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/makefiles/MakeBase.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -65,7 +65,7 @@
 #    The \n argument means translate spaces into \n
 #    if instead , , (a space) is supplied, then spaces remain spaces.
 define ListPathsSafely
-    $(if $(word 10001,$($1)),$(error Cannot list safely more than 10000 paths. $1 has $(words $($1)) paths!))
+    $(if $(word 16001,$($1)),$(error Cannot list safely more than 16000 paths. $1 has $(words $($1)) paths!))
     $(call ListPathsSafely_If,$1,$2,1,250)
     $(call ListPathsSafely_If,$1,$2,251,500)
     $(call ListPathsSafely_If,$1,$2,501,750)
@@ -116,6 +116,36 @@
     $(call ListPathsSafely_If,$1,$2,9501,9750)
     $(call ListPathsSafely_If,$1,$2,9751,10000)
 
+    $(call ListPathsSafely_If,$1,$2,10001,10250)
+    $(call ListPathsSafely_If,$1,$2,10251,10500)
+    $(call ListPathsSafely_If,$1,$2,10501,10750)
+    $(call ListPathsSafely_If,$1,$2,10751,11000)
+
+    $(call ListPathsSafely_If,$1,$2,11001,11250)
+    $(call ListPathsSafely_If,$1,$2,11251,11500)
+    $(call ListPathsSafely_If,$1,$2,11501,11750)
+    $(call ListPathsSafely_If,$1,$2,11751,12000)
+
+    $(call ListPathsSafely_If,$1,$2,12001,12250)
+    $(call ListPathsSafely_If,$1,$2,12251,12500)
+    $(call ListPathsSafely_If,$1,$2,12501,12750)
+    $(call ListPathsSafely_If,$1,$2,12751,13000)
+
+    $(call ListPathsSafely_If,$1,$2,13001,13250)
+    $(call ListPathsSafely_If,$1,$2,13251,13500)
+    $(call ListPathsSafely_If,$1,$2,13501,13750)
+    $(call ListPathsSafely_If,$1,$2,13751,14000)
+
+    $(call ListPathsSafely_If,$1,$2,14001,14250)
+    $(call ListPathsSafely_If,$1,$2,14251,14500)
+    $(call ListPathsSafely_If,$1,$2,14501,14750)
+    $(call ListPathsSafely_If,$1,$2,14751,15000)
+
+    $(call ListPathsSafely_If,$1,$2,15001,15250)
+    $(call ListPathsSafely_If,$1,$2,15251,15500)
+    $(call ListPathsSafely_If,$1,$2,15501,15750)
+    $(call ListPathsSafely_If,$1,$2,15751,16000)
+
     $(call ListPathsSafely_Printf,$1,$2,$3,1)
     $(call ListPathsSafely_Printf,$1,$2,$3,251)
     $(call ListPathsSafely_Printf,$1,$2,$3,501)
@@ -165,6 +195,36 @@
     $(call ListPathsSafely_Printf,$1,$2,$3,9251)
     $(call ListPathsSafely_Printf,$1,$2,$3,9501)
     $(call ListPathsSafely_Printf,$1,$2,$3,9751)
+
+    $(call ListPathsSafely_Printf,$1,$2,$3,10001)
+    $(call ListPathsSafely_Printf,$1,$2,$3,10251)
+    $(call ListPathsSafely_Printf,$1,$2,$3,10501)
+    $(call ListPathsSafely_Printf,$1,$2,$3,10751)
+
+    $(call ListPathsSafely_Printf,$1,$2,$3,11001)
+    $(call ListPathsSafely_Printf,$1,$2,$3,11251)
+    $(call ListPathsSafely_Printf,$1,$2,$3,11501)
+    $(call ListPathsSafely_Printf,$1,$2,$3,11751)
+
+    $(call ListPathsSafely_Printf,$1,$2,$3,12001)
+    $(call ListPathsSafely_Printf,$1,$2,$3,12251)
+    $(call ListPathsSafely_Printf,$1,$2,$3,12501)
+    $(call ListPathsSafely_Printf,$1,$2,$3,12751)
+
+    $(call ListPathsSafely_Printf,$1,$2,$3,13001)
+    $(call ListPathsSafely_Printf,$1,$2,$3,13251)
+    $(call ListPathsSafely_Printf,$1,$2,$3,13501)
+    $(call ListPathsSafely_Printf,$1,$2,$3,13751)
+
+    $(call ListPathsSafely_Printf,$1,$2,$3,14001)
+    $(call ListPathsSafely_Printf,$1,$2,$3,14251)
+    $(call ListPathsSafely_Printf,$1,$2,$3,14501)
+    $(call ListPathsSafely_Printf,$1,$2,$3,14751)
+
+    $(call ListPathsSafely_Printf,$1,$2,$3,15001)
+    $(call ListPathsSafely_Printf,$1,$2,$3,15251)
+    $(call ListPathsSafely_Printf,$1,$2,$3,15501)
+    $(call ListPathsSafely_Printf,$1,$2,$3,15751)
 endef
 
 define ListPathsSafelyNow_IfPrintf
--- a/common/makefiles/MakeHelpers.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/common/makefiles/MakeHelpers.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -157,7 +157,7 @@
 
 # Hook to be called as the very last thing for targets that are "top level" targets
 define AtMakeEnd
-    $(if $(SJAVAC_SERVER_DIR),@$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
+    [ -f $(SJAVAC_SERVER_DIR)/server.port ] && echo Stopping sjavac server && $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
     $(call StopGlobalTimer)
     $(call ReportBuildTimes)
     @$(PRINTF) "Finished building $(PRODUCT_NAME) for target '$(call GetRealTarget)'\n"
@@ -174,8 +174,8 @@
 define ParseLogLevel
     ifeq ($$(origin VERBOSE),undefined)
         # Setup logging according to LOG (but only if VERBOSE is not given)
-        
-       # If the "nofile" argument is given, act on it and strip it away
+
+        # If the "nofile" argument is given, act on it and strip it away
         ifneq ($$(findstring nofile,$$(LOG)),)
           # Reset the build log wrapper, regardless of other values
           override BUILD_LOG_WRAPPER=
--- a/corba/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/corba/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -184,3 +184,5 @@
 207ef43ba69ead6cbbab415d81834545e4d46747 jdk8-b60
 0e08ba7648fb3faa0986cb217887d7c4990977f3 jdk8-b61
 08afb9c6f44f11c3595b01fd0985db64b29834dd jdk8-b62
+6ccbf67b68bfed1ab9c44ab8748a5bdc7df33506 jdk8-b63
+54d599a5b4aad83c235d590652fc81f41c2824fb jdk8-b64
--- a/corba/src/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/corba/src/share/classes/com/sun/corba/se/impl/util/IdentityHashtable.java	Wed Nov 14 16:41:12 2012 -0800
@@ -42,16 +42,6 @@
  * instead, it uses the System.identityHashcode() method and pointer comparison.
  * In addition, all synchronization has been removed.
  */
-/**
- * IdentityHashtable collision list.
- */
-class IdentityHashtableEntry {
-        int hash;
-        Object key;
-        Object value;
-        IdentityHashtableEntry next;
-}
-
 public final class IdentityHashtable extends Dictionary {
     /**
      * The hash table data.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/corba/src/share/classes/com/sun/corba/se/impl/util/IdentityHashtableEntry.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 1999, 2004, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Licensed Materials - Property of IBM
+ * RMI-IIOP v1.0
+ * Copyright IBM Corp. 1998 1999  All Rights Reserved
+ *
+ */
+
+package com.sun.corba.se.impl.util;
+
+/**
+ * IdentityHashtable collision list.
+ */
+class IdentityHashtableEntry {
+    int hash;
+    Object key;
+    Object value;
+    IdentityHashtableEntry next;
+}
--- a/hotspot/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -289,3 +289,7 @@
 d0337c31c8be7716369b4e7c3bd5f352983c6a06 hs25-b06
 dccd40de8db1fa96f186e6179907818d75320440 jdk8-b62
 dc16fe422c535ecd4e9f80fb814a1bb9704da6f5 hs25-b07
+acabb5c282f59be7e3238920b2ea06b684ab68f7 jdk8-b63
+8cb93eadfb6dcab88d91b8e2cd3e0e07d0ac4048 hs25-b08
+5920f72e799c8133d1066c4a62fa1fafcb729966 jdk8-b64
+b4ee7b773144a88af8b6b92e4384dea82cb948d8 hs25-b09
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java	Wed Nov 14 16:41:12 2012 -0800
@@ -121,7 +121,7 @@
     Address addr = cache.getValue(getAddress());
     return (ConstantPoolCache) VMObjectFactory.newObject(ConstantPoolCache.class, addr);
   }
-  public Klass             getPoolHolder() { return (Klass)             poolHolder.getValue(this); }
+  public InstanceKlass     getPoolHolder() { return (InstanceKlass)poolHolder.getValue(this); }
   public int               getLength()     { return (int)length.getValue(getAddress()); }
   public Oop               getResolvedReferences() {
     Address handle = resolvedReferences.getValue(getAddress());
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java	Wed Nov 14 16:41:12 2012 -0800
@@ -177,7 +177,7 @@
       bci. It is required that there is currently a bytecode at this
       bci. */
   public int getOrigBytecodeAt(int bci) {
-    BreakpointInfo bp = ((InstanceKlass) getMethodHolder()).getBreakpoints();
+    BreakpointInfo bp = getMethodHolder().getBreakpoints();
     for (; bp != null; bp = bp.getNext()) {
       if (bp.match(this, bci)) {
         return bp.getOrigBytecode();
@@ -238,7 +238,7 @@
   }
 
   // Method holder (the Klass holding this method)
-  public Klass   getMethodHolder()  { return getConstants().getPoolHolder();                           }
+  public InstanceKlass   getMethodHolder()  { return getConstants().getPoolHolder();                   }
 
   // Access flags
   public boolean isPublic()         { return getAccessFlagsObj().isPublic();                           }
--- a/hotspot/make/Makefile	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/make/Makefile	Wed Nov 14 16:41:12 2012 -0800
@@ -453,14 +453,30 @@
     ifeq ($(JVM_VARIANT_ZEROSHARK), true)
         $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
 		$(install-file)
+        $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo):	$(SHARK_DIR)/%.debuginfo
+		$(install-file)
+        $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz:		$(SHARK_DIR)/%.diz
+		$(install-file)
         $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(SHARK_DIR)/%.$(LIBRARY_SUFFIX)
 		$(install-file)
+        $(EXPORT_SERVER_DIR)/%.debuginfo:		$(SHARK_DIR)/%.debuginfo
+		$(install-file)
+        $(EXPORT_SERVER_DIR)/%.diz:			$(SHARK_DIR)/%.diz
+		$(install-file)
     endif
     ifeq ($(JVM_VARIANT_ZERO), true)
         $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
 		$(install-file)
+        $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo:		$(ZERO_DIR)/%.debuginfo
+		$(install-file)
+        $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz:		$(ZERO_DIR)/%.diz
+		$(install-file)
         $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX):       $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
 		$(install-file)
+        $(EXPORT_SERVER_DIR)/%.debuginfo:		$(ZERO_DIR)/%.debuginfo
+		$(install-file)
+        $(EXPORT_SERVER_DIR)/%.diz:			$(ZERO_DIR)/%.diz
+		$(install-file)
     endif
     ifeq ($(JVM_VARIANT_MINIMAL1), true)
         $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX):	$(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
--- a/hotspot/make/hotspot_version	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/make/hotspot_version	Wed Nov 14 16:41:12 2012 -0800
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=25
 HS_MINOR_VER=0
-HS_BUILD_NUMBER=07
+HS_BUILD_NUMBER=09
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=8
--- a/hotspot/make/linux/makefiles/defs.make	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/make/linux/makefiles/defs.make	Wed Nov 14 16:41:12 2012 -0800
@@ -170,68 +170,70 @@
   # overridden in some situations, e.g., a BUILD_FLAVOR != product
   # build.
 
-  ifeq ($(BUILD_FLAVOR), product)
-    FULL_DEBUG_SYMBOLS ?= 1
-    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
-  else
-    # debug variants always get Full Debug Symbols (if available)
-    ENABLE_FULL_DEBUG_SYMBOLS = 1
-  endif
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
-  # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
+  # Due to the multiple sub-make processes that occur this logic gets
+  # executed multiple times. We reduce the noise by at least checking that
+  # BUILD_FLAVOR has been set.
+  ifneq ($(BUILD_FLAVOR),)
+    ifeq ($(BUILD_FLAVOR), product)
+      FULL_DEBUG_SYMBOLS ?= 1
+      ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
+    else
+      # debug variants always get Full Debug Symbols (if available)
+      ENABLE_FULL_DEBUG_SYMBOLS = 1
+    endif
+    _JUNK_ := $(shell \
+      echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+    # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 
-  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-    # Default OBJCOPY comes from GNU Binutils on Linux:
-    DEF_OBJCOPY=/usr/bin/objcopy
-    ifdef CROSS_COMPILE_ARCH
-      # don't try to generate .debuginfo files when cross compiling
-      _JUNK_ := $(shell \
-        echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
-          "skipping .debuginfo generation.")
-      OBJCOPY=
-    else
+    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+      # Default OBJCOPY comes from GNU Binutils on Linux
+      ifeq ($(CROSS_COMPILE_ARCH),)
+        DEF_OBJCOPY=/usr/bin/objcopy
+      else
+        # Assume objcopy is part of the cross-compilation toolset
+        ifneq ($(ALT_COMPILER_PATH),)
+          DEF_OBJCOPY=$(ALT_COMPILER_PATH)/objcopy
+        endif
+      endif
       OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
       ifneq ($(ALT_OBJCOPY),)
         _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
         OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
       endif
-    endif
-  else
-    OBJCOPY=
-  endif
 
-  ifeq ($(OBJCOPY),)
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
-    ENABLE_FULL_DEBUG_SYMBOLS=0
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
-  else
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
+      ifeq ($(OBJCOPY),)
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
+        ENABLE_FULL_DEBUG_SYMBOLS=0
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+      else
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 
-    # Library stripping policies for .debuginfo configs:
-    #   all_strip - strips everything from the library
-    #   min_strip - strips most stuff from the library; leaves minimum symbols
-    #   no_strip  - does not strip the library at all
-    #
-    # Oracle security policy requires "all_strip". A waiver was granted on
-    # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
-    #
-    # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
-    #
-    STRIP_POLICY ?= min_strip
+        # Library stripping policies for .debuginfo configs:
+        #   all_strip - strips everything from the library
+        #   min_strip - strips most stuff from the library; leaves minimum symbols
+        #   no_strip  - does not strip the library at all
+        #
+        # Oracle security policy requires "all_strip". A waiver was granted on
+        # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
+        #
+        # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
+        #
+        STRIP_POLICY ?= min_strip
 
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
 
-    ZIP_DEBUGINFO_FILES ?= 1
+        ZIP_DEBUGINFO_FILES ?= 1
 
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
-  endif
-endif
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
+      endif
+    endif # ENABLE_FULL_DEBUG_SYMBOLS=1
+  endif # BUILD_FLAVOR
+endif # JDK_6_OR_EARLIER
 
 JDK_INCLUDE_SUBDIR=linux
 
--- a/hotspot/make/linux/makefiles/vm.make	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/make/linux/makefiles/vm.make	Wed Nov 14 16:41:12 2012 -0800
@@ -336,24 +336,23 @@
 	      fi                                                        \
             fi 								\
 	}
-ifeq ($(CROSS_COMPILE_ARCH),)
-  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+
+ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 	$(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DEBUGINFO)
 	$(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DEBUGINFO) $@
-    ifeq ($(STRIP_POLICY),all_strip)
+  ifeq ($(STRIP_POLICY),all_strip)
 	$(QUIETLY) $(STRIP) $@
-    else
-      ifeq ($(STRIP_POLICY),min_strip)
+  else
+    ifeq ($(STRIP_POLICY),min_strip)
 	$(QUIETLY) $(STRIP) -g $@
-      # implied else here is no stripping at all
-      endif
+    # implied else here is no stripping at all
     endif
+  endif
 	$(QUIETLY) [ -f $(LIBJVM_G_DEBUGINFO) ] || ln -s $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
-    ifeq ($(ZIP_DEBUGINFO_FILES),1)
+  ifeq ($(ZIP_DEBUGINFO_FILES),1)
 	$(ZIPEXE) -q -y $(LIBJVM_DIZ) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
 	$(RM) $(LIBJVM_DEBUGINFO) $(LIBJVM_G_DEBUGINFO)
 	[ -f $(LIBJVM_G_DIZ) ] || { ln -s $(LIBJVM_DIZ) $(LIBJVM_G_DIZ); }
-    endif
   endif
 endif
 
--- a/hotspot/make/solaris/makefiles/defs.make	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/make/solaris/makefiles/defs.make	Wed Nov 14 16:41:12 2012 -0800
@@ -109,60 +109,63 @@
   # overridden in some situations, e.g., a BUILD_FLAVOR != product
   # build.
 
-  ifeq ($(BUILD_FLAVOR), product)
-    FULL_DEBUG_SYMBOLS ?= 1
-    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
-  else
-    # debug variants always get Full Debug Symbols (if available)
-    ENABLE_FULL_DEBUG_SYMBOLS = 1
-  endif
-  _JUNK_ := $(shell \
-    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
-  # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
-
-  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-    # Default OBJCOPY comes from the SUNWbinutils package:
-    DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
-    OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-    ifneq ($(ALT_OBJCOPY),)
-      _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-      OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
+  # Due to the multiple sub-make processes that occur this logic gets
+  # executed multiple times. We reduce the noise by at least checking that
+  # BUILD_FLAVOR has been set.
+  ifneq ($(BUILD_FLAVOR),)
+    ifeq ($(BUILD_FLAVOR), product)
+      FULL_DEBUG_SYMBOLS ?= 1
+      ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
+    else
+      # debug variants always get Full Debug Symbols (if available)
+      ENABLE_FULL_DEBUG_SYMBOLS = 1
     endif
-  else
-    OBJCOPY=
-  endif
-
-  ifeq ($(OBJCOPY),)
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
-    ENABLE_FULL_DEBUG_SYMBOLS=0
     _JUNK_ := $(shell \
       echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
-  else
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
+    # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
+
+    ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+      # Default OBJCOPY comes from the SUNWbinutils package:
+      DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
+      OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
+      ifneq ($(ALT_OBJCOPY),)
+        _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
+        OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
+      endif
+
+      ifeq ($(OBJCOPY),)
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+        ENABLE_FULL_DEBUG_SYMBOLS=0
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+      else
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
 
-    # Library stripping policies for .debuginfo configs:
-    #   all_strip - strips everything from the library
-    #   min_strip - strips most stuff from the library; leaves minimum symbols
-    #   no_strip  - does not strip the library at all
-    #
-    # Oracle security policy requires "all_strip". A waiver was granted on
-    # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
-    #
-    # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
-    #
-    STRIP_POLICY ?= min_strip
+        # Library stripping policies for .debuginfo configs:
+        #   all_strip - strips everything from the library
+        #   min_strip - strips most stuff from the library; leaves minimum symbols
+        #   no_strip  - does not strip the library at all
+        #
+        # Oracle security policy requires "all_strip". A waiver was granted on
+        # 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
+        #
+        # Currently, STRIP_POLICY is only used when Full Debug Symbols is enabled.
+        #
+        STRIP_POLICY ?= min_strip
 
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
 
-    ZIP_DEBUGINFO_FILES ?= 1
+        ZIP_DEBUGINFO_FILES ?= 1
 
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
-  endif
-endif
+        _JUNK_ := $(shell \
+          echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)")
+      endif
+    endif # ENABLE_FULL_DEBUG_SYMBOLS=1
+  endif # BUILD_FLAVOR
+endif # JDK_6_OR_EARLIER
 
 JDK_INCLUDE_SUBDIR=solaris
 
--- a/hotspot/make/windows/makefiles/defs.make	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/make/windows/makefiles/defs.make	Wed Nov 14 16:41:12 2012 -0800
@@ -131,23 +131,29 @@
 # overridden in some situations, e.g., a BUILD_FLAVOR != product
 # build.
 
-ifeq ($(BUILD_FLAVOR), product)
-  FULL_DEBUG_SYMBOLS ?= 1
-  ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
-else
-  # debug variants always get Full Debug Symbols (if available)
-  ENABLE_FULL_DEBUG_SYMBOLS = 1
+# Due to the multiple sub-make processes that occur this logic gets
+# executed multiple times. We reduce the noise by at least checking that
+# BUILD_FLAVOR has been set.
+ifneq ($(BUILD_FLAVOR),)
+  ifeq ($(BUILD_FLAVOR), product)
+    FULL_DEBUG_SYMBOLS ?= 1
+    ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS)
+  else
+    # debug variants always get Full Debug Symbols (if available)
+    ENABLE_FULL_DEBUG_SYMBOLS = 1
+  endif
+  _JUNK_ := $(shell \
+    echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
+  MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
+
+  ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+    ZIP_DEBUGINFO_FILES ?= 1
+  else
+    ZIP_DEBUGINFO_FILES=0
+  endif
+  MAKE_ARGS += ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)
 endif
-_JUNK_ := $(shell \
-  echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)")
-MAKE_ARGS += ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)
 
-ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-  ZIP_DEBUGINFO_FILES ?= 1
-else
-  ZIP_DEBUGINFO_FILES=0
-endif
-MAKE_ARGS += ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)
 MAKE_ARGS += RM="$(RM)"
 MAKE_ARGS += ZIPEXE=$(ZIPEXE)
 
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -2322,7 +2322,7 @@
   // Pre-load a static method's oop into O1.  Used both by locking code and
   // the normal JNI call code.
   if (method->is_static() && !is_critical_native) {
-    __ set_oop_constant(JNIHandles::make_local(Klass::cast(method->method_holder())->java_mirror()), O1);
+    __ set_oop_constant(JNIHandles::make_local(method->method_holder()->java_mirror()), O1);
 
     // Now handlize the static class mirror in O1.  It's known not-null.
     __ st_ptr(O1, SP, klass_offset + STACK_BIAS);
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1936,7 +1936,7 @@
   if (method->is_static() && !is_critical_native) {
 
     //  load opp into a register
-    __ movoop(oop_handle_reg, JNIHandles::make_local(Klass::cast(method->method_holder())->java_mirror()));
+    __ movoop(oop_handle_reg, JNIHandles::make_local(method->method_holder()->java_mirror()));
 
     // Now handlize the static class mirror it's known not-null.
     __ movptr(Address(rsp, klass_offset), oop_handle_reg);
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -2179,7 +2179,7 @@
   if (method->is_static() && !is_critical_native) {
 
     //  load oop into a register
-    __ movoop(oop_handle_reg, JNIHandles::make_local(Klass::cast(method->method_holder())->java_mirror()));
+    __ movoop(oop_handle_reg, JNIHandles::make_local(method->method_holder()->java_mirror()));
 
     // Now handlize the static class mirror it's known not-null.
     __ movptr(Address(rsp, klass_offset), oop_handle_reg);
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -488,8 +488,8 @@
   }
 
   // The AES intrinsic stubs require AES instruction support (of course)
-  // but also require AVX mode for misaligned SSE access
-  if (UseAES && (UseAVX > 0)) {
+  // but also require AVX and sse3 modes for instructions it use.
+  if (UseAES && (UseAVX > 0) && (UseSSE > 2)) {
     if (FLAG_IS_DEFAULT(UseAESIntrinsics)) {
       UseAESIntrinsics = true;
     }
--- a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -31,12 +31,17 @@
     return _masm;
   }
 
- protected:
-  address generate_entry(address entry_point) {
-    ZeroEntry *entry = (ZeroEntry *) assembler()->pc();
-    assembler()->advance(sizeof(ZeroEntry));
+ public:
+  static address generate_entry_impl(MacroAssembler* masm, address entry_point) {
+    ZeroEntry *entry = (ZeroEntry *) masm->pc();
+    masm->advance(sizeof(ZeroEntry));
     entry->set_entry_point(entry_point);
     return (address) entry;
   }
 
+ protected:
+  address generate_entry(address entry_point) {
+        return generate_entry_impl(assembler(), entry_point);
+  }
+
 #endif // CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -180,25 +180,6 @@
         method, istate->osr_entry(), istate->osr_buf(), THREAD);
       return;
     }
-    else if (istate->msg() == BytecodeInterpreter::call_method_handle) {
-      oop method_handle = istate->callee();
-
-      // Trim back the stack to put the parameters at the top
-      stack->set_sp(istate->stack() + 1);
-
-      // Make the call
-      process_method_handle(method_handle, THREAD);
-      fixup_after_potential_safepoint();
-
-      // Convert the result
-      istate->set_stack(stack->sp() - 1);
-
-      // Restore the stack
-      stack->set_sp(istate->stack_limit() + 1);
-
-      // Resume the interpreter
-      istate->set_msg(BytecodeInterpreter::method_resume);
-    }
     else {
       ShouldNotReachHere();
     }
@@ -535,35 +516,35 @@
   if (entry->is_volatile()) {
     switch (entry->flag_state()) {
     case ctos:
-      SET_LOCALS_INT(object->char_field_acquire(entry->f2()), 0);
+      SET_LOCALS_INT(object->char_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case btos:
-      SET_LOCALS_INT(object->byte_field_acquire(entry->f2()), 0);
+      SET_LOCALS_INT(object->byte_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case stos:
-      SET_LOCALS_INT(object->short_field_acquire(entry->f2()), 0);
+      SET_LOCALS_INT(object->short_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case itos:
-      SET_LOCALS_INT(object->int_field_acquire(entry->f2()), 0);
+      SET_LOCALS_INT(object->int_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case ltos:
-      SET_LOCALS_LONG(object->long_field_acquire(entry->f2()), 0);
+      SET_LOCALS_LONG(object->long_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case ftos:
-      SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2()), 0);
+      SET_LOCALS_FLOAT(object->float_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case dtos:
-      SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2()), 0);
+      SET_LOCALS_DOUBLE(object->double_field_acquire(entry->f2_as_index()), 0);
       break;
 
     case atos:
-      SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2()), 0);
+      SET_LOCALS_OBJECT(object->obj_field_acquire(entry->f2_as_index()), 0);
       break;
 
     default:
@@ -573,35 +554,35 @@
   else {
     switch (entry->flag_state()) {
     case ctos:
-      SET_LOCALS_INT(object->char_field(entry->f2()), 0);
+      SET_LOCALS_INT(object->char_field(entry->f2_as_index()), 0);
       break;
 
     case btos:
-      SET_LOCALS_INT(object->byte_field(entry->f2()), 0);
+      SET_LOCALS_INT(object->byte_field(entry->f2_as_index()), 0);
       break;
 
     case stos:
-      SET_LOCALS_INT(object->short_field(entry->f2()), 0);
+      SET_LOCALS_INT(object->short_field(entry->f2_as_index()), 0);
       break;
 
     case itos:
-      SET_LOCALS_INT(object->int_field(entry->f2()), 0);
+      SET_LOCALS_INT(object->int_field(entry->f2_as_index()), 0);
       break;
 
     case ltos:
-      SET_LOCALS_LONG(object->long_field(entry->f2()), 0);
+      SET_LOCALS_LONG(object->long_field(entry->f2_as_index()), 0);
       break;
 
     case ftos:
-      SET_LOCALS_FLOAT(object->float_field(entry->f2()), 0);
+      SET_LOCALS_FLOAT(object->float_field(entry->f2_as_index()), 0);
       break;
 
     case dtos:
-      SET_LOCALS_DOUBLE(object->double_field(entry->f2()), 0);
+      SET_LOCALS_DOUBLE(object->double_field(entry->f2_as_index()), 0);
       break;
 
     case atos:
-      SET_LOCALS_OBJECT(object->obj_field(entry->f2()), 0);
+      SET_LOCALS_OBJECT(object->obj_field(entry->f2_as_index()), 0);
       break;
 
     default:
@@ -629,516 +610,6 @@
   return 0;
 }
 
-int CppInterpreter::method_handle_entry(Method* method,
-                                        intptr_t UNUSED, TRAPS) {
-  JavaThread *thread = (JavaThread *) THREAD;
-  ZeroStack *stack = thread->zero_stack();
-  int argument_slots = method->size_of_parameters();
-  int result_slots = type2size[result_type_of(method)];
-  intptr_t *vmslots = stack->sp();
-  intptr_t *unwind_sp = vmslots + argument_slots;
-
-  // Find the MethodType
-  address p = (address) method;
-  for (jint* pc = method->method_type_offsets_chain(); (*pc) != -1; pc++) {
-    p = *(address*)(p + (*pc));
-  }
-  oop method_type = (oop) p;
-
-  // The MethodHandle is in the slot after the arguments
-  int num_vmslots = argument_slots - 1;
-  oop method_handle = VMSLOTS_OBJECT(num_vmslots);
-
-  // InvokeGeneric requires some extra shuffling
-  oop mhtype = java_lang_invoke_MethodHandle::type(method_handle);
-  bool is_exact = mhtype == method_type;
-  if (!is_exact) {
-    if (true || // FIXME
-        method->intrinsic_id() == vmIntrinsics::_invokeExact) {
-      CALL_VM_NOCHECK_NOFIX(
-        SharedRuntime::throw_WrongMethodTypeException(
-          thread, method_type, mhtype));
-      // NB all oops trashed!
-      assert(HAS_PENDING_EXCEPTION, "should do");
-      stack->set_sp(unwind_sp);
-      return 0;
-    }
-    assert(method->intrinsic_id() == vmIntrinsics::_invokeGeneric, "should be");
-
-    // Load up an adapter from the calling type
-    // NB the x86 code for this (in methodHandles_x86.cpp, search for
-    // "genericInvoker") is really really odd.  I'm hoping it's trying
-    // to accomodate odd VM/class library combinations I can ignore.
-    oop adapter = NULL; //FIXME: load the adapter from the CP cache
-    IF (adapter == NULL) {
-      CALL_VM_NOCHECK_NOFIX(
-        SharedRuntime::throw_WrongMethodTypeException(
-          thread, method_type, mhtype));
-      // NB all oops trashed!
-      assert(HAS_PENDING_EXCEPTION, "should do");
-      stack->set_sp(unwind_sp);
-      return 0;
-    }
-
-    // Adapters are shared among form-families of method-type.  The
-    // type being called is passed as a trusted first argument so that
-    // the adapter knows the actual types of its arguments and return
-    // values.
-    insert_vmslots(num_vmslots + 1, 1, THREAD);
-    if (HAS_PENDING_EXCEPTION) {
-      // NB all oops trashed!
-      stack->set_sp(unwind_sp);
-      return 0;
-    }
-
-    vmslots = stack->sp();
-    num_vmslots++;
-    SET_VMSLOTS_OBJECT(method_type, num_vmslots);
-
-    method_handle = adapter;
-  }
-
-  // Start processing
-  process_method_handle(method_handle, THREAD);
-  if (HAS_PENDING_EXCEPTION)
-    result_slots = 0;
-
-  // If this is an invokeExact then the eventual callee will not
-  // have unwound the method handle argument so we have to do it.
-  // If a result is being returned the it will be above the method
-  // handle argument we're unwinding.
-  if (is_exact) {
-    intptr_t result[2];
-    for (int i = 0; i < result_slots; i++)
-      result[i] = stack->pop();
-    stack->pop();
-    for (int i = result_slots - 1; i >= 0; i--)
-      stack->push(result[i]);
-  }
-
-  // Check
-  assert(stack->sp() == unwind_sp - result_slots, "should be");
-
-  // No deoptimized frames on the stack
-  return 0;
-}
-
-void CppInterpreter::process_method_handle(oop method_handle, TRAPS) {
-  JavaThread *thread = (JavaThread *) THREAD;
-  ZeroStack *stack = thread->zero_stack();
-  intptr_t *vmslots = stack->sp();
-
-  bool direct_to_method = false;
-  BasicType src_rtype = T_ILLEGAL;
-  BasicType dst_rtype = T_ILLEGAL;
-
-  MethodHandleEntry *entry =
-    java_lang_invoke_MethodHandle::vmentry(method_handle);
-  MethodHandles::EntryKind entry_kind =
-    (MethodHandles::EntryKind) (((intptr_t) entry) & 0xffffffff);
-
-  Method* method = NULL;
-  switch (entry_kind) {
-  case MethodHandles::_invokestatic_mh:
-    direct_to_method = true;
-    break;
-
-  case MethodHandles::_invokespecial_mh:
-  case MethodHandles::_invokevirtual_mh:
-  case MethodHandles::_invokeinterface_mh:
-    {
-      oop receiver =
-        VMSLOTS_OBJECT(
-          java_lang_invoke_MethodHandle::vmslots(method_handle) - 1);
-      if (receiver == NULL) {
-          stack->set_sp(calculate_unwind_sp(stack, method_handle));
-          CALL_VM_NOCHECK_NOFIX(
-            throw_exception(
-              thread, vmSymbols::java_lang_NullPointerException()));
-          // NB all oops trashed!
-          assert(HAS_PENDING_EXCEPTION, "should do");
-          return;
-      }
-      if (entry_kind != MethodHandles::_invokespecial_mh) {
-        intptr_t index = java_lang_invoke_DirectMethodHandle::vmindex(method_handle);
-        InstanceKlass* rcvrKlass =
-          (InstanceKlass *) receiver->klass();
-        if (entry_kind == MethodHandles::_invokevirtual_mh) {
-          method = (Method*) rcvrKlass->start_of_vtable()[index];
-        }
-        else {
-          oop iclass = java_lang_invoke_MethodHandle::next_target(method_handle);
-          itableOffsetEntry* ki =
-            (itableOffsetEntry *) rcvrKlass->start_of_itable();
-          int i, length = rcvrKlass->itable_length();
-          for (i = 0; i < length; i++, ki++ ) {
-            if (ki->interface_klass() == iclass)
-              break;
-          }
-          if (i == length) {
-            stack->set_sp(calculate_unwind_sp(stack, method_handle));
-            CALL_VM_NOCHECK_NOFIX(
-              throw_exception(
-                thread, vmSymbols::java_lang_IncompatibleClassChangeError()));
-            // NB all oops trashed!
-            assert(HAS_PENDING_EXCEPTION, "should do");
-            return;
-          }
-          itableMethodEntry* im = ki->first_method_entry(receiver->klass());
-          method = im[index].method();
-          if (method == NULL) {
-            stack->set_sp(calculate_unwind_sp(stack, method_handle));
-            CALL_VM_NOCHECK_NOFIX(
-              throw_exception(
-                thread, vmSymbols::java_lang_AbstractMethodError()));
-            // NB all oops trashed!
-            assert(HAS_PENDING_EXCEPTION, "should do");
-            return;
-          }
-        }
-      }
-    }
-    direct_to_method = true;
-    break;
-
-  case MethodHandles::_bound_ref_direct_mh:
-  case MethodHandles::_bound_int_direct_mh:
-  case MethodHandles::_bound_long_direct_mh:
-    direct_to_method = true;
-    // fall through
-  case MethodHandles::_bound_ref_mh:
-  case MethodHandles::_bound_int_mh:
-  case MethodHandles::_bound_long_mh:
-    {
-      BasicType arg_type  = T_ILLEGAL;
-      int       arg_mask  = -1;
-      int       arg_slots = -1;
-      MethodHandles::get_ek_bound_mh_info(
-        entry_kind, arg_type, arg_mask, arg_slots);
-      int arg_slot =
-        java_lang_invoke_BoundMethodHandle::vmargslot(method_handle);
-
-      // Create the new slot(s)
-      intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle);
-      insert_vmslots(arg_slot, arg_slots, THREAD);
-      if (HAS_PENDING_EXCEPTION) {
-        // all oops trashed
-        stack->set_sp(unwind_sp);
-        return;
-      }
-      vmslots = stack->sp();
-
-      // Store bound argument into new stack slot
-      oop arg = java_lang_invoke_BoundMethodHandle::argument(method_handle);
-      if (arg_type == T_OBJECT) {
-        assert(arg_slots == 1, "should be");
-        SET_VMSLOTS_OBJECT(arg, arg_slot);
-      }
-      else {
-        jvalue arg_value;
-        arg_type = java_lang_boxing_object::get_value(arg, &arg_value);
-        switch (arg_type) {
-        case T_BOOLEAN:
-          SET_VMSLOTS_INT(arg_value.z, arg_slot);
-          break;
-        case T_CHAR:
-          SET_VMSLOTS_INT(arg_value.c, arg_slot);
-          break;
-        case T_BYTE:
-          SET_VMSLOTS_INT(arg_value.b, arg_slot);
-          break;
-        case T_SHORT:
-          SET_VMSLOTS_INT(arg_value.s, arg_slot);
-          break;
-        case T_INT:
-          SET_VMSLOTS_INT(arg_value.i, arg_slot);
-          break;
-        case T_FLOAT:
-          SET_VMSLOTS_FLOAT(arg_value.f, arg_slot);
-          break;
-        case T_LONG:
-          SET_VMSLOTS_LONG(arg_value.j, arg_slot + 1);
-          break;
-        case T_DOUBLE:
-          SET_VMSLOTS_DOUBLE(arg_value.d, arg_slot + 1);
-          break;
-        default:
-          tty->print_cr("unhandled type %s", type2name(arg_type));
-          ShouldNotReachHere();
-        }
-      }
-    }
-    break;
-
-  case MethodHandles::_adapter_retype_only:
-  case MethodHandles::_adapter_retype_raw:
-    src_rtype = result_type_of_handle(
-      java_lang_invoke_MethodHandle::next_target(method_handle));
-    dst_rtype = result_type_of_handle(method_handle);
-    break;
-
-  case MethodHandles::_adapter_check_cast:
-    {
-      int arg_slot =
-        java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
-      oop arg = VMSLOTS_OBJECT(arg_slot);
-      if (arg != NULL) {
-        Klass* objKlassOop = arg->klass();
-        Klass* klassOf = java_lang_Class::as_Klass(
-          java_lang_invoke_AdapterMethodHandle::argument(method_handle));
-
-        if (objKlassOop != klassOf &&
-            !objKlassOop->is_subtype_of(klassOf)) {
-          ResourceMark rm(THREAD);
-          const char* objName = Klass::cast(objKlassOop)->external_name();
-          const char* klassName = Klass::cast(klassOf)->external_name();
-          char* message = SharedRuntime::generate_class_cast_message(
-            objName, klassName);
-
-          stack->set_sp(calculate_unwind_sp(stack, method_handle));
-          CALL_VM_NOCHECK_NOFIX(
-            throw_exception(
-              thread, vmSymbols::java_lang_ClassCastException(), message));
-          // NB all oops trashed!
-          assert(HAS_PENDING_EXCEPTION, "should do");
-          return;
-        }
-      }
-    }
-    break;
-
-  case MethodHandles::_adapter_dup_args:
-    {
-      int arg_slot =
-        java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
-      int conv =
-        java_lang_invoke_AdapterMethodHandle::conversion(method_handle);
-      int num_slots = -MethodHandles::adapter_conversion_stack_move(conv);
-      assert(num_slots > 0, "should be");
-
-      // Create the new slot(s)
-      intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle);
-      stack->overflow_check(num_slots, THREAD);
-      if (HAS_PENDING_EXCEPTION) {
-        // all oops trashed
-        stack->set_sp(unwind_sp);
-        return;
-      }
-
-      // Duplicate the arguments
-      for (int i = num_slots - 1; i >= 0; i--)
-        stack->push(*VMSLOTS_SLOT(arg_slot + i));
-
-      vmslots = stack->sp(); // unused, but let the compiler figure that out
-    }
-    break;
-
-  case MethodHandles::_adapter_drop_args:
-    {
-      int arg_slot =
-        java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
-      int conv =
-        java_lang_invoke_AdapterMethodHandle::conversion(method_handle);
-      int num_slots = MethodHandles::adapter_conversion_stack_move(conv);
-      assert(num_slots > 0, "should be");
-
-      remove_vmslots(arg_slot, num_slots, THREAD); // doesn't trap
-      vmslots = stack->sp(); // unused, but let the compiler figure that out
-    }
-    break;
-
-  case MethodHandles::_adapter_opt_swap_1:
-  case MethodHandles::_adapter_opt_swap_2:
-  case MethodHandles::_adapter_opt_rot_1_up:
-  case MethodHandles::_adapter_opt_rot_1_down:
-  case MethodHandles::_adapter_opt_rot_2_up:
-  case MethodHandles::_adapter_opt_rot_2_down:
-    {
-      int arg1 =
-        java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
-      int conv =
-        java_lang_invoke_AdapterMethodHandle::conversion(method_handle);
-      int arg2 = MethodHandles::adapter_conversion_vminfo(conv);
-
-      int swap_bytes = 0, rotate = 0;
-      MethodHandles::get_ek_adapter_opt_swap_rot_info(
-        entry_kind, swap_bytes, rotate);
-      int swap_slots = swap_bytes >> LogBytesPerWord;
-
-      intptr_t tmp;
-      switch (rotate) {
-      case 0: // swap
-        for (int i = 0; i < swap_slots; i++) {
-          tmp = *VMSLOTS_SLOT(arg1 + i);
-          SET_VMSLOTS_SLOT(VMSLOTS_SLOT(arg2 + i), arg1 + i);
-          SET_VMSLOTS_SLOT(&tmp, arg2 + i);
-        }
-        break;
-
-      case 1: // up
-        assert(arg1 - swap_slots > arg2, "should be");
-
-        tmp = *VMSLOTS_SLOT(arg1);
-        for (int i = arg1 - swap_slots; i >= arg2; i--)
-          SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i), i + swap_slots);
-        SET_VMSLOTS_SLOT(&tmp, arg2);
-
-        break;
-
-      case -1: // down
-        assert(arg2 - swap_slots > arg1, "should be");
-
-        tmp = *VMSLOTS_SLOT(arg1);
-        for (int i = arg1 + swap_slots; i <= arg2; i++)
-          SET_VMSLOTS_SLOT(VMSLOTS_SLOT(i), i - swap_slots);
-        SET_VMSLOTS_SLOT(&tmp, arg2);
-        break;
-
-      default:
-        ShouldNotReachHere();
-      }
-    }
-    break;
-
-  case MethodHandles::_adapter_opt_i2l:
-    {
-      int arg_slot =
-        java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
-      int arg = VMSLOTS_INT(arg_slot);
-      intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle);
-      insert_vmslots(arg_slot, 1, THREAD);
-      if (HAS_PENDING_EXCEPTION) {
-        // all oops trashed
-        stack->set_sp(unwind_sp);
-        return;
-      }
-      vmslots = stack->sp();
-      arg_slot++;
-      SET_VMSLOTS_LONG(arg, arg_slot);
-    }
-    break;
-
-  case MethodHandles::_adapter_opt_unboxi:
-  case MethodHandles::_adapter_opt_unboxl:
-    {
-      int arg_slot =
-        java_lang_invoke_AdapterMethodHandle::vmargslot(method_handle);
-      oop arg = VMSLOTS_OBJECT(arg_slot);
-      jvalue arg_value;
-      if (arg == NULL) {
-        // queue a nullpointer exception for the caller
-        stack->set_sp(calculate_unwind_sp(stack, method_handle));
-        CALL_VM_NOCHECK_NOFIX(
-          throw_exception(
-            thread, vmSymbols::java_lang_NullPointerException()));
-        // NB all oops trashed!
-        assert(HAS_PENDING_EXCEPTION, "should do");
-        return;
-      }
-      BasicType arg_type = java_lang_boxing_object::get_value(arg, &arg_value);
-      if (arg_type == T_LONG || arg_type == T_DOUBLE) {
-        intptr_t *unwind_sp = calculate_unwind_sp(stack, method_handle);
-        insert_vmslots(arg_slot, 1, THREAD);
-        if (HAS_PENDING_EXCEPTION) {
-          // all oops trashed
-          stack->set_sp(unwind_sp);
-          return;
-        }
-        vmslots = stack->sp();
-        arg_slot++;
-      }
-      switch (arg_type) {
-      case T_BOOLEAN:
-        SET_VMSLOTS_INT(arg_value.z, arg_slot);
-        break;
-      case T_CHAR:
-        SET_VMSLOTS_INT(arg_value.c, arg_slot);
-        break;
-      case T_BYTE:
-        SET_VMSLOTS_INT(arg_value.b, arg_slot);
-        break;
-      case T_SHORT:
-        SET_VMSLOTS_INT(arg_value.s, arg_slot);
-        break;
-      case T_INT:
-        SET_VMSLOTS_INT(arg_value.i, arg_slot);
-        break;
-      case T_FLOAT:
-        SET_VMSLOTS_FLOAT(arg_value.f, arg_slot);
-        break;
-      case T_LONG:
-        SET_VMSLOTS_LONG(arg_value.j, arg_slot);
-        break;
-      case T_DOUBLE:
-        SET_VMSLOTS_DOUBLE(arg_value.d, arg_slot);
-        break;
-      default:
-        tty->print_cr("unhandled type %s", type2name(arg_type));
-        ShouldNotReachHere();
-      }
-    }
-    break;
-
-  default:
-    tty->print_cr("unhandled entry_kind %s",
-                  MethodHandles::entry_name(entry_kind));
-    ShouldNotReachHere();
-  }
-
-  // Continue along the chain
-  if (direct_to_method) {
-    if (method == NULL) {
-      method =
-        (Method*) java_lang_invoke_MethodHandle::vmtarget(method_handle);
-    }
-    address entry_point = method->from_interpreted_entry();
-    Interpreter::invoke_method(method, entry_point, THREAD);
-  }
-  else {
-    process_method_handle(
-      java_lang_invoke_MethodHandle::next_target(method_handle), THREAD);
-  }
-  // NB all oops now trashed
-
-  // Adapt the result type, if necessary
-  if (src_rtype != dst_rtype && !HAS_PENDING_EXCEPTION) {
-    switch (dst_rtype) {
-    case T_VOID:
-      for (int i = 0; i < type2size[src_rtype]; i++)
-        stack->pop();
-      return;
-
-    case T_INT:
-      switch (src_rtype) {
-      case T_VOID:
-        stack->overflow_check(1, CHECK);
-        stack->push(0);
-        return;
-
-      case T_BOOLEAN:
-      case T_CHAR:
-      case T_BYTE:
-      case T_SHORT:
-        return;
-      }
-      // INT results sometimes need narrowing
-    case T_BOOLEAN:
-    case T_CHAR:
-    case T_BYTE:
-    case T_SHORT:
-      switch (src_rtype) {
-      case T_INT:
-        return;
-      }
-    }
-
-    tty->print_cr("unhandled conversion:");
-    tty->print_cr("src_rtype = %s", type2name(src_rtype));
-    tty->print_cr("dst_rtype = %s", type2name(dst_rtype));
-    ShouldNotReachHere();
-  }
-}
-
 // The new slots will be inserted before slot insert_before.
 // Slots < insert_before will have the same slot number after the insert.
 // Slots >= insert_before will become old_slot + num_slots.
@@ -1380,10 +851,6 @@
     entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry();
     break;
 
-  case Interpreter::method_handle:
-    entry_point = ((InterpreterGenerator*) this)->generate_method_handle_entry();
-    break;
-
   case Interpreter::java_lang_math_sin:
   case Interpreter::java_lang_math_cos:
   case Interpreter::java_lang_math_tan:
@@ -1391,6 +858,8 @@
   case Interpreter::java_lang_math_log:
   case Interpreter::java_lang_math_log10:
   case Interpreter::java_lang_math_sqrt:
+  case Interpreter::java_lang_math_pow:
+  case Interpreter::java_lang_math_exp:
     entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind);
     break;
 
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -36,7 +36,6 @@
   static int native_entry(Method* method, intptr_t UNUSED, TRAPS);
   static int accessor_entry(Method* method, intptr_t UNUSED, TRAPS);
   static int empty_entry(Method* method, intptr_t UNUSED, TRAPS);
-  static int method_handle_entry(Method* method, intptr_t UNUSED, TRAPS);
 
  public:
   // Main loop of normal_entry
@@ -44,7 +43,6 @@
 
  private:
   // Helpers for method_handle_entry
-  static void process_method_handle(oop method_handle, TRAPS);
   static void insert_vmslots(int insert_before, int num_slots, TRAPS);
   static void remove_vmslots(int first_slot, int num_slots, TRAPS);
   static BasicType result_type_of_handle(oop method_handle);
--- a/hotspot/src/cpu/zero/vm/frame_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -351,7 +351,7 @@
   switch (offset) {
   case pc_off:
     strncpy(fieldbuf, "pc", buflen);
-    if (method()->is_oop()) {
+    if (method()->is_method()) {
       nmethod *code = method()->code();
       if (code && code->pc_desc_at(pc())) {
         SimpleScopeDesc ssd(code, pc());
@@ -367,7 +367,7 @@
 
   case method_off:
     strncpy(fieldbuf, "method", buflen);
-    if (method()->is_oop()) {
+    if (method()->is_method()) {
       method()->name_and_sig_as_C_string(valuebuf, buflen);
     }
     return;
@@ -378,7 +378,7 @@
   }
 
   // Variable part
-  if (method()->is_oop()) {
+  if (method()->is_method()) {
     identify_vp_word(frame_index, addr_of_word(offset),
                      addr_of_word(header_words + 1),
                      unextended_sp() + method()->max_stack(),
@@ -430,4 +430,3 @@
   // unused... but returns fp() to minimize changes introduced by 7087445
   return fp();
 }
-
--- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -36,6 +36,8 @@
   _deopt_state = unknown;
 }
 
+inline address  frame::sender_pc()           const { ShouldNotCallThis();  }
+
 inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
   _zeroframe = zf;
   _sp = sp;
--- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -40,7 +40,7 @@
 }
 
 void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin,
-                                                Metadata* cached_oop,
+                                                void* cached_oop,
                                                 address entry_point) {
   // NB ic_stub_code_size() must return the size of the code we generate
   ShouldNotCallThis();
@@ -51,7 +51,6 @@
   ShouldNotCallThis();
 }
 
-Metadata* InlineCacheBuffer::ic_buffer_cached_oop(address code_begin) {
-  // NB ic_stub_code_size() must return the size of the code we generate
+void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
   ShouldNotCallThis();
 }
--- a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -24,26 +24,159 @@
  */
 
 #include "precompiled.hpp"
+#include "interpreter/interpreterGenerator.hpp"
 #include "interpreter/interpreter.hpp"
 #include "memory/allocation.inline.hpp"
 #include "prims/methodHandles.hpp"
 
-int MethodHandles::adapter_conversion_ops_supported_mask() {
-  return ((1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_ONLY)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_RETYPE_RAW)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_CHECK_CAST)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_PRIM_TO_PRIM)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_REF_TO_PRIM)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_SWAP_ARGS)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_ROT_ARGS)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_DUP_ARGS)
-         |(1<<java_lang_invoke_AdapterMethodHandle::OP_DROP_ARGS)
-         //|(1<<java_lang_invoke_AdapterMethodHandle::OP_SPREAD_ARGS) //BUG!
-         );
-  // FIXME: MethodHandlesTest gets a crash if we enable OP_SPREAD_ARGS.
+void MethodHandles::invoke_target(Method* method, TRAPS) {
+
+  JavaThread *thread = (JavaThread *) THREAD;
+  ZeroStack *stack = thread->zero_stack();
+  InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
+  interpreterState istate = frame->interpreter_state();
+
+  // Trim back the stack to put the parameters at the top
+  stack->set_sp(istate->stack() + 1);
+
+  Interpreter::invoke_method(method, method->from_interpreted_entry(), THREAD);
+
+  // Convert the result
+  istate->set_stack(stack->sp() - 1);
+
+}
+
+oop MethodHandles::popFromStack(TRAPS) {
+
+  JavaThread *thread = (JavaThread *) THREAD;
+  InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
+  interpreterState istate = frame->interpreter_state();
+  intptr_t* topOfStack = istate->stack();
+
+  oop top = STACK_OBJECT(-1);
+  MORE_STACK(-1);
+  istate->set_stack(topOfStack);
+
+  return top;
+
+}
+
+int MethodHandles::method_handle_entry_invokeBasic(Method* method, intptr_t UNUSED, TRAPS) {
+
+  JavaThread *thread = (JavaThread *) THREAD;
+  InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
+  interpreterState istate = frame->interpreter_state();
+  intptr_t* topOfStack = istate->stack();
+
+  // 'this' is a MethodHandle. We resolve the target method by accessing this.form.vmentry.vmtarget.
+  int numArgs = method->size_of_parameters();
+  oop lform1 = java_lang_invoke_MethodHandle::form(STACK_OBJECT(-numArgs)); // this.form
+  oop vmEntry1 = java_lang_invoke_LambdaForm::vmentry(lform1);
+  Method* vmtarget = (Method*) java_lang_invoke_MemberName::vmtarget(vmEntry1);
+
+  invoke_target(vmtarget, THREAD);
+
+  // No deoptimized frames on the stack
+  return 0;
+}
+
+int MethodHandles::method_handle_entry_linkToStaticOrSpecial(Method* method, intptr_t UNUSED, TRAPS) {
+
+  // Pop appendix argument from stack. This is a MemberName which we resolve to the
+  // target method.
+  oop vmentry = popFromStack(THREAD);
+
+  Method* vmtarget = (Method*) java_lang_invoke_MemberName::vmtarget(vmentry);
+
+  invoke_target(vmtarget, THREAD);
+
+  return 0;
 }
 
-void MethodHandles::generate_method_handle_stub(MacroAssembler*          masm,
-                                                MethodHandles::EntryKind ek) {
-  init_entry(ek, (MethodHandleEntry *) ek);
+int MethodHandles::method_handle_entry_linkToInterface(Method* method, intptr_t UNUSED, TRAPS) {
+  JavaThread *thread = (JavaThread *) THREAD;
+  InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
+  interpreterState istate = frame->interpreter_state();
+
+  // Pop appendix argument from stack. This is a MemberName which we resolve to the
+  // target method.
+  oop vmentry = popFromStack(THREAD);
+  intptr_t* topOfStack = istate->stack();
+
+  // Resolve target method by looking up in the receiver object's itable.
+  Klass* clazz = java_lang_Class::as_Klass(java_lang_invoke_MemberName::clazz(vmentry));
+  intptr_t vmindex = java_lang_invoke_MemberName::vmindex(vmentry);
+  Method* target = (Method*) java_lang_invoke_MemberName::vmtarget(vmentry);
+
+  int numArgs = target->size_of_parameters();
+  oop recv = STACK_OBJECT(-numArgs);
+
+  InstanceKlass* klass_part = InstanceKlass::cast(recv->klass());
+  itableOffsetEntry* ki = (itableOffsetEntry*) klass_part->start_of_itable();
+  int i;
+  for ( i = 0 ; i < klass_part->itable_length() ; i++, ki++ ) {
+    if (ki->interface_klass() == clazz) break;
+  }
+
+  itableMethodEntry* im = ki->first_method_entry(recv->klass());
+  Method* vmtarget = im[vmindex].method();
+
+  invoke_target(vmtarget, THREAD);
+
+  return 0;
 }
+
+int MethodHandles::method_handle_entry_linkToVirtual(Method* method, intptr_t UNUSED, TRAPS) {
+  JavaThread *thread = (JavaThread *) THREAD;
+
+  InterpreterFrame *frame = thread->top_zero_frame()->as_interpreter_frame();
+  interpreterState istate = frame->interpreter_state();
+
+  // Pop appendix argument from stack. This is a MemberName which we resolve to the
+  // target method.
+  oop vmentry = popFromStack(THREAD);
+  intptr_t* topOfStack = istate->stack();
+
+  // Resolve target method by looking up in the receiver object's vtable.
+  intptr_t vmindex = java_lang_invoke_MemberName::vmindex(vmentry);
+  Method* target = (Method*) java_lang_invoke_MemberName::vmtarget(vmentry);
+  int numArgs = target->size_of_parameters();
+  oop recv = STACK_OBJECT(-numArgs);
+  Klass* clazz = recv->klass();
+  Klass* klass_part = InstanceKlass::cast(clazz);
+  klassVtable* vtable = klass_part->vtable();
+  Method* vmtarget = vtable->method_at(vmindex);
+
+  invoke_target(vmtarget, THREAD);
+
+  return 0;
+}
+
+int MethodHandles::method_handle_entry_invalid(Method* method, intptr_t UNUSED, TRAPS) {
+  ShouldNotReachHere();
+  return 0;
+}
+
+address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* masm,
+                                                                vmIntrinsics::ID iid) {
+  switch (iid) {
+  case vmIntrinsics::_invokeGeneric:
+  case vmIntrinsics::_compiledLambdaForm:
+    // Perhaps surprisingly, the symbolic references visible to Java are not directly used.
+    // They are linked to Java-generated adapters via MethodHandleNatives.linkMethod.
+    // They all allow an appendix argument.
+    return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid);
+  case vmIntrinsics::_invokeBasic:
+    return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic);
+  case vmIntrinsics::_linkToStatic:
+  case vmIntrinsics::_linkToSpecial:
+    return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial);
+  case vmIntrinsics::_linkToInterface:
+    return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface);
+  case vmIntrinsics::_linkToVirtual:
+    return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual);
+  default:
+    ShouldNotReachHere();
+    return NULL;
+  }
+}
--- a/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -26,6 +26,14 @@
 
 // Adapters
 enum /* platform_dependent_constants */ {
-  adapter_code_size = 0
+  adapter_code_size = sizeof(ZeroEntry) * (Interpreter::method_handle_invoke_LAST - Interpreter::method_handle_invoke_FIRST + 1)
 };
 
+private:
+  static oop popFromStack(TRAPS);
+  static void invoke_target(Method* method, TRAPS);
+  static int method_handle_entry_invokeBasic(Method* method, intptr_t UNUSED, TRAPS);
+  static int method_handle_entry_linkToStaticOrSpecial(Method* method, intptr_t UNUSED, TRAPS);
+  static int method_handle_entry_linkToVirtual(Method* method, intptr_t UNUSED, TRAPS);
+  static int method_handle_entry_linkToInterface(Method* method, intptr_t UNUSED, TRAPS);
+  static int method_handle_entry_invalid(Method* method, intptr_t UNUSED, TRAPS);
--- a/hotspot/src/cpu/zero/vm/register_zero.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/register_zero.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -114,5 +114,8 @@
 };
 
 CONSTANT_REGISTER_DECLARATION(Register, noreg, (-1));
+#ifndef DONT_USE_REGISTER_DEFINES
+#define noreg ((Register)(noreg_RegisterEnumValue))
+#endif
 
 #endif // CPU_ZERO_VM_REGISTER_ZERO_HPP
--- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -77,3 +77,7 @@
                                                        CodeBuffer*       dst) {
   ShouldNotCallThis();
 }
+
+void metadata_Relocation::pd_fix_value(address x) {
+  ShouldNotCallThis();
+}
--- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -35,6 +35,7 @@
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/vframeArray.hpp"
 #include "vmreg_zero.inline.hpp"
+
 #ifdef COMPILER1
 #include "c1/c1_Runtime1.hpp"
 #endif
@@ -47,6 +48,12 @@
 #endif
 
 
+
+static address zero_null_code_stub() {
+  address start = ShouldNotCallThisStub();
+  return start;
+}
+
 int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
                                            VMRegPair *regs,
                                            int total_args_passed,
@@ -63,16 +70,14 @@
                         AdapterFingerPrint *fingerprint) {
   return AdapterHandlerLibrary::new_entry(
     fingerprint,
-    ShouldNotCallThisStub(),
-    ShouldNotCallThisStub(),
-    ShouldNotCallThisStub());
+    CAST_FROM_FN_PTR(address,zero_null_code_stub),
+    CAST_FROM_FN_PTR(address,zero_null_code_stub),
+    CAST_FROM_FN_PTR(address,zero_null_code_stub));
 }
 
 nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
                                                 methodHandle method,
                                                 int compile_id,
-                                                int total_args_passed,
-                                                int max_arg,
                                                 BasicType *sig_bt,
                                                 VMRegPair *regs,
                                                 BasicType ret_type) {
@@ -96,19 +101,20 @@
   ShouldNotCallThis();
 }
 
+JRT_LEAF(void, zero_stub())
+  ShouldNotCallThis();
+JRT_END
+
 static RuntimeStub* generate_empty_runtime_stub(const char* name) {
-  CodeBuffer buffer(name, 0, 0);
-  return RuntimeStub::new_runtime_stub(name, &buffer, 0, 0, NULL, false);
+  return CAST_FROM_FN_PTR(RuntimeStub*,zero_stub);
 }
 
 static SafepointBlob* generate_empty_safepoint_blob() {
-  CodeBuffer buffer("handler_blob", 0, 0);
-  return SafepointBlob::create(&buffer, NULL, 0);
+  return CAST_FROM_FN_PTR(SafepointBlob*,zero_stub);
 }
 
 static DeoptimizationBlob* generate_empty_deopt_blob() {
-  CodeBuffer buffer("handler_blob", 0, 0);
-  return DeoptimizationBlob::create(&buffer, NULL, 0, 0, 0, 0);
+  return CAST_FROM_FN_PTR(DeoptimizationBlob*,zero_stub);
 }
 
 
@@ -116,7 +122,7 @@
   _deopt_blob = generate_empty_deopt_blob();
 }
 
-SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause_return) {
+SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
   return generate_empty_safepoint_blob();
 }
 
@@ -124,6 +130,7 @@
   return generate_empty_runtime_stub("resolve_blob");
 }
 
+
 int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
                                          VMRegPair *regs,
                                          int total_args_passed) {
--- a/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os/bsd/vm/attachListener_bsd.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -342,7 +342,6 @@
 
     // get the credentials of the peer and check the effective uid/guid
     // - check with jeff on this.
-#ifdef _ALLBSD_SOURCE
     uid_t puid;
     gid_t pgid;
     if (::getpeereid(s, &puid, &pgid) != 0) {
@@ -350,17 +349,6 @@
       RESTARTABLE(::close(s), res);
       continue;
     }
-#else
-    struct ucred cred_info;
-    socklen_t optlen = sizeof(cred_info);
-    if (::getsockopt(s, SOL_SOCKET, SO_PEERCRED, (void*)&cred_info, &optlen) == -1) {
-      int res;
-      RESTARTABLE(::close(s), res);
-      continue;
-    }
-    uid_t puid = cred_info.uid;
-    gid_t pgid = cred_info.gid;
-#endif
     uid_t euid = geteuid();
     gid_t egid = getegid();
 
--- a/hotspot/src/os/bsd/vm/osThread_bsd.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os/bsd/vm/osThread_bsd.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -39,18 +39,12 @@
 
  private:
 
-#ifdef _ALLBSD_SOURCE
-
 #ifdef __APPLE__
   typedef thread_t thread_id_t;
 #else
   typedef pthread_t thread_id_t;
 #endif
 
-#else
-  typedef pid_t thread_id_t;
-#endif
-
   // _pthread_id is the pthread id, which is used by library calls
   // (e.g. pthread_kill).
   pthread_t _pthread_id;
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -108,14 +108,8 @@
 # include <semaphore.h>
 # include <fcntl.h>
 # include <string.h>
-#ifdef _ALLBSD_SOURCE
 # include <sys/param.h>
 # include <sys/sysctl.h>
-#else
-# include <syscall.h>
-# include <sys/sysinfo.h>
-# include <gnu/libc-version.h>
-#endif
 # include <sys/ipc.h>
 # include <sys/shm.h>
 #ifndef __APPLE__
@@ -150,25 +144,10 @@
 // global variables
 julong os::Bsd::_physical_memory = 0;
 
-#ifndef _ALLBSD_SOURCE
-address   os::Bsd::_initial_thread_stack_bottom = NULL;
-uintptr_t os::Bsd::_initial_thread_stack_size   = 0;
-#endif
 
 int (*os::Bsd::_clock_gettime)(clockid_t, struct timespec *) = NULL;
-#ifndef _ALLBSD_SOURCE
-int (*os::Bsd::_pthread_getcpuclockid)(pthread_t, clockid_t *) = NULL;
-Mutex* os::Bsd::_createThread_lock = NULL;
-#endif
 pthread_t os::Bsd::_main_thread;
 int os::Bsd::_page_size = -1;
-#ifndef _ALLBSD_SOURCE
-bool os::Bsd::_is_floating_stack = false;
-bool os::Bsd::_is_NPTL = false;
-bool os::Bsd::_supports_fast_thread_cpu_time = false;
-const char * os::Bsd::_glibc_version = NULL;
-const char * os::Bsd::_libpthread_version = NULL;
-#endif
 
 static jlong initial_time_count=0;
 
@@ -176,7 +155,7 @@
 
 // For diagnostics to print a message once. see run_periodic_checks
 static sigset_t check_signal_done;
-static bool check_signals = true;;
+static bool check_signals = true;
 
 static pid_t _initial_pid = 0;
 
@@ -198,16 +177,8 @@
 }
 
 julong os::Bsd::available_memory() {
-#ifdef _ALLBSD_SOURCE
   // XXXBSD: this is just a stopgap implementation
   return physical_memory() >> 2;
-#else
-  // values in struct sysinfo are "unsigned long"
-  struct sysinfo si;
-  sysinfo(&si);
-
-  return (julong)si.freeram * si.mem_unit;
-#endif
 }
 
 julong os::physical_memory() {
@@ -255,22 +226,6 @@
 }
 
 
-#ifndef _ALLBSD_SOURCE
-#ifndef SYS_gettid
-// i386: 224, ia64: 1105, amd64: 186, sparc 143
-#ifdef __ia64__
-#define SYS_gettid 1105
-#elif __i386__
-#define SYS_gettid 224
-#elif __amd64__
-#define SYS_gettid 186
-#elif __sparc__
-#define SYS_gettid 143
-#else
-#error define gettid for the arch
-#endif
-#endif
-#endif
 
 // Cpu architecture string
 #if   defined(ZERO)
@@ -302,36 +257,7 @@
 #define COMPILER_VARIANT "client"
 #endif
 
-#ifndef _ALLBSD_SOURCE
-// pid_t gettid()
-//
-// Returns the kernel thread id of the currently running thread. Kernel
-// thread id is used to access /proc.
-//
-// (Note that getpid() on BsdThreads returns kernel thread id too; but
-// on NPTL, it returns the same pid for all threads, as required by POSIX.)
-//
-pid_t os::Bsd::gettid() {
-  int rslt = syscall(SYS_gettid);
-  if (rslt == -1) {
-     // old kernel, no NPTL support
-     return getpid();
-  } else {
-     return (pid_t)rslt;
-  }
-}
-
-// Most versions of bsd have a bug where the number of processors are
-// determined by looking at the /proc file system.  In a chroot environment,
-// the system call returns 1.  This causes the VM to act as if it is
-// a single processor and elide locking (see is_MP() call).
-static bool unsafe_chroot_detected = false;
-static const char *unstable_chroot_error = "/proc file system not found.\n"
-                     "Java may be unstable running multithreaded in a chroot "
-                     "environment on Bsd when /proc filesystem is not mounted.";
-#endif
-
-#ifdef _ALLBSD_SOURCE
+
 void os::Bsd::initialize_system_info() {
   int mib[2];
   size_t len;
@@ -370,24 +296,6 @@
   }
 #endif
 }
-#else
-void os::Bsd::initialize_system_info() {
-  set_processor_count(sysconf(_SC_NPROCESSORS_CONF));
-  if (processor_count() == 1) {
-    pid_t pid = os::Bsd::gettid();
-    char fname[32];
-    jio_snprintf(fname, sizeof(fname), "/proc/%d", pid);
-    FILE *fp = fopen(fname, "r");
-    if (fp == NULL) {
-      unsafe_chroot_detected = true;
-    } else {
-      fclose(fp);
-    }
-  }
-  _physical_memory = (julong)sysconf(_SC_PHYS_PAGES) * (julong)sysconf(_SC_PAGESIZE);
-  assert(processor_count() > 0, "bsd error");
-}
-#endif
 
 #ifdef __APPLE__
 static const char *get_home() {
@@ -744,171 +652,6 @@
   }
 }
 
-#ifndef _ALLBSD_SOURCE
-//////////////////////////////////////////////////////////////////////////////
-// detecting pthread library
-
-void os::Bsd::libpthread_init() {
-  // Save glibc and pthread version strings. Note that _CS_GNU_LIBC_VERSION
-  // and _CS_GNU_LIBPTHREAD_VERSION are supported in glibc >= 2.3.2. Use a
-  // generic name for earlier versions.
-  // Define macros here so we can build HotSpot on old systems.
-# ifndef _CS_GNU_LIBC_VERSION
-# define _CS_GNU_LIBC_VERSION 2
-# endif
-# ifndef _CS_GNU_LIBPTHREAD_VERSION
-# define _CS_GNU_LIBPTHREAD_VERSION 3
-# endif
-
-  size_t n = confstr(_CS_GNU_LIBC_VERSION, NULL, 0);
-  if (n > 0) {
-     char *str = (char *)malloc(n);
-     confstr(_CS_GNU_LIBC_VERSION, str, n);
-     os::Bsd::set_glibc_version(str);
-  } else {
-     // _CS_GNU_LIBC_VERSION is not supported, try gnu_get_libc_version()
-     static char _gnu_libc_version[32];
-     jio_snprintf(_gnu_libc_version, sizeof(_gnu_libc_version),
-              "glibc %s %s", gnu_get_libc_version(), gnu_get_libc_release());
-     os::Bsd::set_glibc_version(_gnu_libc_version);
-  }
-
-  n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, 0);
-  if (n > 0) {
-     char *str = (char *)malloc(n);
-     confstr(_CS_GNU_LIBPTHREAD_VERSION, str, n);
-     // Vanilla RH-9 (glibc 2.3.2) has a bug that confstr() always tells
-     // us "NPTL-0.29" even we are running with BsdThreads. Check if this
-     // is the case. BsdThreads has a hard limit on max number of threads.
-     // So sysconf(_SC_THREAD_THREADS_MAX) will return a positive value.
-     // On the other hand, NPTL does not have such a limit, sysconf()
-     // will return -1 and errno is not changed. Check if it is really NPTL.
-     if (strcmp(os::Bsd::glibc_version(), "glibc 2.3.2") == 0 &&
-         strstr(str, "NPTL") &&
-         sysconf(_SC_THREAD_THREADS_MAX) > 0) {
-       free(str);
-       os::Bsd::set_libpthread_version("bsdthreads");
-     } else {
-       os::Bsd::set_libpthread_version(str);
-     }
-  } else {
-    // glibc before 2.3.2 only has BsdThreads.
-    os::Bsd::set_libpthread_version("bsdthreads");
-  }
-
-  if (strstr(libpthread_version(), "NPTL")) {
-     os::Bsd::set_is_NPTL();
-  } else {
-     os::Bsd::set_is_BsdThreads();
-  }
-
-  // BsdThreads have two flavors: floating-stack mode, which allows variable
-  // stack size; and fixed-stack mode. NPTL is always floating-stack.
-  if (os::Bsd::is_NPTL() || os::Bsd::supports_variable_stack_size()) {
-     os::Bsd::set_is_floating_stack();
-  }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// thread stack
-
-// Force Bsd kernel to expand current thread stack. If "bottom" is close
-// to the stack guard, caller should block all signals.
-//
-// MAP_GROWSDOWN:
-//   A special mmap() flag that is used to implement thread stacks. It tells
-//   kernel that the memory region should extend downwards when needed. This
-//   allows early versions of BsdThreads to only mmap the first few pages
-//   when creating a new thread. Bsd kernel will automatically expand thread
-//   stack as needed (on page faults).
-//
-//   However, because the memory region of a MAP_GROWSDOWN stack can grow on
-//   demand, if a page fault happens outside an already mapped MAP_GROWSDOWN
-//   region, it's hard to tell if the fault is due to a legitimate stack
-//   access or because of reading/writing non-exist memory (e.g. buffer
-//   overrun). As a rule, if the fault happens below current stack pointer,
-//   Bsd kernel does not expand stack, instead a SIGSEGV is sent to the
-//   application (see Bsd kernel fault.c).
-//
-//   This Bsd feature can cause SIGSEGV when VM bangs thread stack for
-//   stack overflow detection.
-//
-//   Newer version of BsdThreads (since glibc-2.2, or, RH-7.x) and NPTL do
-//   not use this flag. However, the stack of initial thread is not created
-//   by pthread, it is still MAP_GROWSDOWN. Also it's possible (though
-//   unlikely) that user code can create a thread with MAP_GROWSDOWN stack
-//   and then attach the thread to JVM.
-//
-// To get around the problem and allow stack banging on Bsd, we need to
-// manually expand thread stack after receiving the SIGSEGV.
-//
-// There are two ways to expand thread stack to address "bottom", we used
-// both of them in JVM before 1.5:
-//   1. adjust stack pointer first so that it is below "bottom", and then
-//      touch "bottom"
-//   2. mmap() the page in question
-//
-// Now alternate signal stack is gone, it's harder to use 2. For instance,
-// if current sp is already near the lower end of page 101, and we need to
-// call mmap() to map page 100, it is possible that part of the mmap() frame
-// will be placed in page 100. When page 100 is mapped, it is zero-filled.
-// That will destroy the mmap() frame and cause VM to crash.
-//
-// The following code works by adjusting sp first, then accessing the "bottom"
-// page to force a page fault. Bsd kernel will then automatically expand the
-// stack mapping.
-//
-// _expand_stack_to() assumes its frame size is less than page size, which
-// should always be true if the function is not inlined.
-
-#if __GNUC__ < 3    // gcc 2.x does not support noinline attribute
-#define NOINLINE
-#else
-#define NOINLINE __attribute__ ((noinline))
-#endif
-
-static void _expand_stack_to(address bottom) NOINLINE;
-
-static void _expand_stack_to(address bottom) {
-  address sp;
-  size_t size;
-  volatile char *p;
-
-  // Adjust bottom to point to the largest address within the same page, it
-  // gives us a one-page buffer if alloca() allocates slightly more memory.
-  bottom = (address)align_size_down((uintptr_t)bottom, os::Bsd::page_size());
-  bottom += os::Bsd::page_size() - 1;
-
-  // sp might be slightly above current stack pointer; if that's the case, we
-  // will alloca() a little more space than necessary, which is OK. Don't use
-  // os::current_stack_pointer(), as its result can be slightly below current
-  // stack pointer, causing us to not alloca enough to reach "bottom".
-  sp = (address)&sp;
-
-  if (sp > bottom) {
-    size = sp - bottom;
-    p = (volatile char *)alloca(size);
-    assert(p != NULL && p <= (volatile char *)bottom, "alloca problem?");
-    p[0] = '\0';
-  }
-}
-
-bool os::Bsd::manually_expand_stack(JavaThread * t, address addr) {
-  assert(t!=NULL, "just checking");
-  assert(t->osthread()->expanding_stack(), "expand should be set");
-  assert(t->stack_base() != NULL, "stack_base was not initialized");
-
-  if (addr <  t->stack_base() && addr >= t->stack_yellow_zone_base()) {
-    sigset_t mask_all, old_sigset;
-    sigfillset(&mask_all);
-    pthread_sigmask(SIG_SETMASK, &mask_all, &old_sigset);
-    _expand_stack_to(addr);
-    pthread_sigmask(SIG_SETMASK, &old_sigset, NULL);
-    return true;
-  }
-  return false;
-}
-#endif
 
 //////////////////////////////////////////////////////////////////////////////
 // create new thread
@@ -917,43 +660,7 @@
 
 // check if it's safe to start a new thread
 static bool _thread_safety_check(Thread* thread) {
-#ifdef _ALLBSD_SOURCE
-    return true;
-#else
-  if (os::Bsd::is_BsdThreads() && !os::Bsd::is_floating_stack()) {
-    // Fixed stack BsdThreads (SuSE Bsd/x86, and some versions of Redhat)
-    //   Heap is mmap'ed at lower end of memory space. Thread stacks are
-    //   allocated (MAP_FIXED) from high address space. Every thread stack
-    //   occupies a fixed size slot (usually 2Mbytes, but user can change
-    //   it to other values if they rebuild BsdThreads).
-    //
-    // Problem with MAP_FIXED is that mmap() can still succeed even part of
-    // the memory region has already been mmap'ed. That means if we have too
-    // many threads and/or very large heap, eventually thread stack will
-    // collide with heap.
-    //
-    // Here we try to prevent heap/stack collision by comparing current
-    // stack bottom with the highest address that has been mmap'ed by JVM
-    // plus a safety margin for memory maps created by native code.
-    //
-    // This feature can be disabled by setting ThreadSafetyMargin to 0
-    //
-    if (ThreadSafetyMargin > 0) {
-      address stack_bottom = os::current_stack_base() - os::current_stack_size();
-
-      // not safe if our stack extends below the safety margin
-      return stack_bottom - ThreadSafetyMargin >= highest_vm_reserved_address();
-    } else {
-      return true;
-    }
-  } else {
-    // Floating stack BsdThreads or NPTL:
-    //   Unlike fixed stack BsdThreads, thread stacks are not MAP_FIXED. When
-    //   there's not enough space left, pthread_create() will fail. If we come
-    //   here, that means enough space has been reserved for stack.
-    return true;
-  }
-#endif
+  return true;
 }
 
 #ifdef __APPLE__
@@ -991,7 +698,6 @@
     return NULL;
   }
 
-#ifdef _ALLBSD_SOURCE
 #ifdef __APPLE__
   // thread_id is mach thread on macos
   osthread->set_thread_id(::mach_thread_self());
@@ -999,17 +705,6 @@
   // thread_id is pthread_id on BSD
   osthread->set_thread_id(::pthread_self());
 #endif
-#else
-  // thread_id is kernel thread id (similar to Solaris LWP id)
-  osthread->set_thread_id(os::Bsd::gettid());
-
-  if (UseNUMA) {
-    int lgrp_id = os::numa_get_group_id();
-    if (lgrp_id != -1) {
-      thread->set_lgrp_id(lgrp_id);
-    }
-  }
-#endif
   // initialize signal mask for this thread
   os::Bsd::hotspot_sigmask(thread);
 
@@ -1099,23 +794,9 @@
     // let pthread_create() pick the default value.
   }
 
-#ifndef _ALLBSD_SOURCE
-  // glibc guard page
-  pthread_attr_setguardsize(&attr, os::Bsd::default_guard_size(thr_type));
-#endif
-
   ThreadState state;
 
   {
-
-#ifndef _ALLBSD_SOURCE
-    // Serialize thread creation if we are running with fixed stack BsdThreads
-    bool lock = os::Bsd::is_BsdThreads() && !os::Bsd::is_floating_stack();
-    if (lock) {
-      os::Bsd::createThread_lock()->lock_without_safepoint_check();
-    }
-#endif
-
     pthread_t tid;
     int ret = pthread_create(&tid, &attr, (void* (*)(void*)) java_start, thread);
 
@@ -1128,9 +809,6 @@
       // Need to clean up stuff we've allocated so far
       thread->set_osthread(NULL);
       delete osthread;
-#ifndef _ALLBSD_SOURCE
-      if (lock) os::Bsd::createThread_lock()->unlock();
-#endif
       return false;
     }
 
@@ -1146,11 +824,6 @@
       }
     }
 
-#ifndef _ALLBSD_SOURCE
-    if (lock) {
-      os::Bsd::createThread_lock()->unlock();
-    }
-#endif
   }
 
   // Aborted due to thread limit being reached
@@ -1188,15 +861,11 @@
   }
 
   // Store pthread info into the OSThread
-#ifdef _ALLBSD_SOURCE
 #ifdef __APPLE__
   osthread->set_thread_id(::mach_thread_self());
 #else
   osthread->set_thread_id(::pthread_self());
 #endif
-#else
-  osthread->set_thread_id(os::Bsd::gettid());
-#endif
   osthread->set_pthread_id(::pthread_self());
 
   // initialize floating point control register
@@ -1207,35 +876,6 @@
 
   thread->set_osthread(osthread);
 
-#ifndef _ALLBSD_SOURCE
-  if (UseNUMA) {
-    int lgrp_id = os::numa_get_group_id();
-    if (lgrp_id != -1) {
-      thread->set_lgrp_id(lgrp_id);
-    }
-  }
-
-  if (os::Bsd::is_initial_thread()) {
-    // If current thread is initial thread, its stack is mapped on demand,
-    // see notes about MAP_GROWSDOWN. Here we try to force kernel to map
-    // the entire stack region to avoid SEGV in stack banging.
-    // It is also useful to get around the heap-stack-gap problem on SuSE
-    // kernel (see 4821821 for details). We first expand stack to the top
-    // of yellow zone, then enable stack yellow zone (order is significant,
-    // enabling yellow zone first will crash JVM on SuSE Bsd), so there
-    // is no gap between the last two virtual memory regions.
-
-    JavaThread *jt = (JavaThread *)thread;
-    address addr = jt->stack_yellow_zone_base();
-    assert(addr != NULL, "initialization problem?");
-    assert(jt->stack_available(addr) > 0, "stack guard should not be enabled");
-
-    osthread->set_expanding_stack();
-    os::Bsd::manually_expand_stack(jt, addr);
-    osthread->clear_expanding_stack();
-  }
-#endif
-
   // initialize signal mask for this thread
   // and save the caller's signal mask
   os::Bsd::hotspot_sigmask(thread);
@@ -1290,247 +930,6 @@
   return ThreadLocalStorage::thread();
 }
 
-//////////////////////////////////////////////////////////////////////////////
-// initial thread
-
-#ifndef _ALLBSD_SOURCE
-// Check if current thread is the initial thread, similar to Solaris thr_main.
-bool os::Bsd::is_initial_thread(void) {
-  char dummy;
-  // If called before init complete, thread stack bottom will be null.
-  // Can be called if fatal error occurs before initialization.
-  if (initial_thread_stack_bottom() == NULL) return false;
-  assert(initial_thread_stack_bottom() != NULL &&
-         initial_thread_stack_size()   != 0,
-         "os::init did not locate initial thread's stack region");
-  if ((address)&dummy >= initial_thread_stack_bottom() &&
-      (address)&dummy < initial_thread_stack_bottom() + initial_thread_stack_size())
-       return true;
-  else return false;
-}
-
-// Find the virtual memory area that contains addr
-static bool find_vma(address addr, address* vma_low, address* vma_high) {
-  FILE *fp = fopen("/proc/self/maps", "r");
-  if (fp) {
-    address low, high;
-    while (!feof(fp)) {
-      if (fscanf(fp, "%p-%p", &low, &high) == 2) {
-        if (low <= addr && addr < high) {
-           if (vma_low)  *vma_low  = low;
-           if (vma_high) *vma_high = high;
-           fclose (fp);
-           return true;
-        }
-      }
-      for (;;) {
-        int ch = fgetc(fp);
-        if (ch == EOF || ch == (int)'\n') break;
-      }
-    }
-    fclose(fp);
-  }
-  return false;
-}
-
-// Locate initial thread stack. This special handling of initial thread stack
-// is needed because pthread_getattr_np() on most (all?) Bsd distros returns
-// bogus value for initial thread.
-void os::Bsd::capture_initial_stack(size_t max_size) {
-  // stack size is the easy part, get it from RLIMIT_STACK
-  size_t stack_size;
-  struct rlimit rlim;
-  getrlimit(RLIMIT_STACK, &rlim);
-  stack_size = rlim.rlim_cur;
-
-  // 6308388: a bug in ld.so will relocate its own .data section to the
-  //   lower end of primordial stack; reduce ulimit -s value a little bit
-  //   so we won't install guard page on ld.so's data section.
-  stack_size -= 2 * page_size();
-
-  // 4441425: avoid crash with "unlimited" stack size on SuSE 7.1 or Redhat
-  //   7.1, in both cases we will get 2G in return value.
-  // 4466587: glibc 2.2.x compiled w/o "--enable-kernel=2.4.0" (RH 7.0,
-  //   SuSE 7.2, Debian) can not handle alternate signal stack correctly
-  //   for initial thread if its stack size exceeds 6M. Cap it at 2M,
-  //   in case other parts in glibc still assumes 2M max stack size.
-  // FIXME: alt signal stack is gone, maybe we can relax this constraint?
-#ifndef IA64
-  if (stack_size > 2 * K * K) stack_size = 2 * K * K;
-#else
-  // Problem still exists RH7.2 (IA64 anyway) but 2MB is a little small
-  if (stack_size > 4 * K * K) stack_size = 4 * K * K;
-#endif
-
-  // Try to figure out where the stack base (top) is. This is harder.
-  //
-  // When an application is started, glibc saves the initial stack pointer in
-  // a global variable "__libc_stack_end", which is then used by system
-  // libraries. __libc_stack_end should be pretty close to stack top. The
-  // variable is available since the very early days. However, because it is
-  // a private interface, it could disappear in the future.
-  //
-  // Bsd kernel saves start_stack information in /proc/<pid>/stat. Similar
-  // to __libc_stack_end, it is very close to stack top, but isn't the real
-  // stack top. Note that /proc may not exist if VM is running as a chroot
-  // program, so reading /proc/<pid>/stat could fail. Also the contents of
-  // /proc/<pid>/stat could change in the future (though unlikely).
-  //
-  // We try __libc_stack_end first. If that doesn't work, look for
-  // /proc/<pid>/stat. If neither of them works, we use current stack pointer
-  // as a hint, which should work well in most cases.
-
-  uintptr_t stack_start;
-
-  // try __libc_stack_end first
-  uintptr_t *p = (uintptr_t *)dlsym(RTLD_DEFAULT, "__libc_stack_end");
-  if (p && *p) {
-    stack_start = *p;
-  } else {
-    // see if we can get the start_stack field from /proc/self/stat
-    FILE *fp;
-    int pid;
-    char state;
-    int ppid;
-    int pgrp;
-    int session;
-    int nr;
-    int tpgrp;
-    unsigned long flags;
-    unsigned long minflt;
-    unsigned long cminflt;
-    unsigned long majflt;
-    unsigned long cmajflt;
-    unsigned long utime;
-    unsigned long stime;
-    long cutime;
-    long cstime;
-    long prio;
-    long nice;
-    long junk;
-    long it_real;
-    uintptr_t start;
-    uintptr_t vsize;
-    intptr_t rss;
-    uintptr_t rsslim;
-    uintptr_t scodes;
-    uintptr_t ecode;
-    int i;
-
-    // Figure what the primordial thread stack base is. Code is inspired
-    // by email from Hans Boehm. /proc/self/stat begins with current pid,
-    // followed by command name surrounded by parentheses, state, etc.
-    char stat[2048];
-    int statlen;
-
-    fp = fopen("/proc/self/stat", "r");
-    if (fp) {
-      statlen = fread(stat, 1, 2047, fp);
-      stat[statlen] = '\0';
-      fclose(fp);
-
-      // Skip pid and the command string. Note that we could be dealing with
-      // weird command names, e.g. user could decide to rename java launcher
-      // to "java 1.4.2 :)", then the stat file would look like
-      //                1234 (java 1.4.2 :)) R ... ...
-      // We don't really need to know the command string, just find the last
-      // occurrence of ")" and then start parsing from there. See bug 4726580.
-      char * s = strrchr(stat, ')');
-
-      i = 0;
-      if (s) {
-        // Skip blank chars
-        do s++; while (isspace(*s));
-
-#define _UFM UINTX_FORMAT
-#define _DFM INTX_FORMAT
-
-        /*                                     1   1   1   1   1   1   1   1   1   1   2   2    2    2    2    2    2    2    2 */
-        /*              3  4  5  6  7  8   9   0   1   2   3   4   5   6   7   8   9   0   1    2    3    4    5    6    7    8 */
-        i = sscanf(s, "%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld " _UFM _UFM _DFM _UFM _UFM _UFM _UFM,
-             &state,          /* 3  %c  */
-             &ppid,           /* 4  %d  */
-             &pgrp,           /* 5  %d  */
-             &session,        /* 6  %d  */
-             &nr,             /* 7  %d  */
-             &tpgrp,          /* 8  %d  */
-             &flags,          /* 9  %lu  */
-             &minflt,         /* 10 %lu  */
-             &cminflt,        /* 11 %lu  */
-             &majflt,         /* 12 %lu  */
-             &cmajflt,        /* 13 %lu  */
-             &utime,          /* 14 %lu  */
-             &stime,          /* 15 %lu  */
-             &cutime,         /* 16 %ld  */
-             &cstime,         /* 17 %ld  */
-             &prio,           /* 18 %ld  */
-             &nice,           /* 19 %ld  */
-             &junk,           /* 20 %ld  */
-             &it_real,        /* 21 %ld  */
-             &start,          /* 22 UINTX_FORMAT */
-             &vsize,          /* 23 UINTX_FORMAT */
-             &rss,            /* 24 INTX_FORMAT  */
-             &rsslim,         /* 25 UINTX_FORMAT */
-             &scodes,         /* 26 UINTX_FORMAT */
-             &ecode,          /* 27 UINTX_FORMAT */
-             &stack_start);   /* 28 UINTX_FORMAT */
-      }
-
-#undef _UFM
-#undef _DFM
-
-      if (i != 28 - 2) {
-         assert(false, "Bad conversion from /proc/self/stat");
-         // product mode - assume we are the initial thread, good luck in the
-         // embedded case.
-         warning("Can't detect initial thread stack location - bad conversion");
-         stack_start = (uintptr_t) &rlim;
-      }
-    } else {
-      // For some reason we can't open /proc/self/stat (for example, running on
-      // FreeBSD with a Bsd emulator, or inside chroot), this should work for
-      // most cases, so don't abort:
-      warning("Can't detect initial thread stack location - no /proc/self/stat");
-      stack_start = (uintptr_t) &rlim;
-    }
-  }
-
-  // Now we have a pointer (stack_start) very close to the stack top, the
-  // next thing to do is to figure out the exact location of stack top. We
-  // can find out the virtual memory area that contains stack_start by
-  // reading /proc/self/maps, it should be the last vma in /proc/self/maps,
-  // and its upper limit is the real stack top. (again, this would fail if
-  // running inside chroot, because /proc may not exist.)
-
-  uintptr_t stack_top;
-  address low, high;
-  if (find_vma((address)stack_start, &low, &high)) {
-    // success, "high" is the true stack top. (ignore "low", because initial
-    // thread stack grows on demand, its real bottom is high - RLIMIT_STACK.)
-    stack_top = (uintptr_t)high;
-  } else {
-    // failed, likely because /proc/self/maps does not exist
-    warning("Can't detect initial thread stack location - find_vma failed");
-    // best effort: stack_start is normally within a few pages below the real
-    // stack top, use it as stack top, and reduce stack size so we won't put
-    // guard page outside stack.
-    stack_top = stack_start;
-    stack_size -= 16 * page_size();
-  }
-
-  // stack_top could be partially down the page so align it
-  stack_top = align_size_up(stack_top, page_size());
-
-  if (max_size && stack_size > max_size) {
-     _initial_thread_stack_size = max_size;
-  } else {
-     _initial_thread_stack_size = stack_size;
-  }
-
-  _initial_thread_stack_size = align_size_down(_initial_thread_stack_size, page_size());
-  _initial_thread_stack_bottom = (address)stack_top - _initial_thread_stack_size;
-}
-#endif
 
 ////////////////////////////////////////////////////////////////////////////////
 // time support
@@ -1576,7 +975,7 @@
 void os::Bsd::clock_init() {
         // XXXDARWIN: Investigate replacement monotonic clock
 }
-#elif defined(_ALLBSD_SOURCE)
+#else
 void os::Bsd::clock_init() {
   struct timespec res;
   struct timespec tp;
@@ -1586,86 +985,8 @@
     _clock_gettime = ::clock_gettime;
   }
 }
-#else
-void os::Bsd::clock_init() {
-  // we do dlopen's in this particular order due to bug in bsd
-  // dynamical loader (see 6348968) leading to crash on exit
-  void* handle = dlopen("librt.so.1", RTLD_LAZY);
-  if (handle == NULL) {
-    handle = dlopen("librt.so", RTLD_LAZY);
-  }
-
-  if (handle) {
-    int (*clock_getres_func)(clockid_t, struct timespec*) =
-           (int(*)(clockid_t, struct timespec*))dlsym(handle, "clock_getres");
-    int (*clock_gettime_func)(clockid_t, struct timespec*) =
-           (int(*)(clockid_t, struct timespec*))dlsym(handle, "clock_gettime");
-    if (clock_getres_func && clock_gettime_func) {
-      // See if monotonic clock is supported by the kernel. Note that some
-      // early implementations simply return kernel jiffies (updated every
-      // 1/100 or 1/1000 second). It would be bad to use such a low res clock
-      // for nano time (though the monotonic property is still nice to have).
-      // It's fixed in newer kernels, however clock_getres() still returns
-      // 1/HZ. We check if clock_getres() works, but will ignore its reported
-      // resolution for now. Hopefully as people move to new kernels, this
-      // won't be a problem.
-      struct timespec res;
-      struct timespec tp;
-      if (clock_getres_func (CLOCK_MONOTONIC, &res) == 0 &&
-          clock_gettime_func(CLOCK_MONOTONIC, &tp)  == 0) {
-        // yes, monotonic clock is supported
-        _clock_gettime = clock_gettime_func;
-      } else {
-        // close librt if there is no monotonic clock
-        dlclose(handle);
-      }
-    }
-  }
-}
 #endif
 
-#ifndef _ALLBSD_SOURCE
-#ifndef SYS_clock_getres
-
-#if defined(IA32) || defined(AMD64)
-#define SYS_clock_getres IA32_ONLY(266)  AMD64_ONLY(229)
-#define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
-#else
-#warning "SYS_clock_getres not defined for this platform, disabling fast_thread_cpu_time"
-#define sys_clock_getres(x,y)  -1
-#endif
-
-#else
-#define sys_clock_getres(x,y)  ::syscall(SYS_clock_getres, x, y)
-#endif
-
-void os::Bsd::fast_thread_clock_init() {
-  if (!UseBsdPosixThreadCPUClocks) {
-    return;
-  }
-  clockid_t clockid;
-  struct timespec tp;
-  int (*pthread_getcpuclockid_func)(pthread_t, clockid_t *) =
-      (int(*)(pthread_t, clockid_t *)) dlsym(RTLD_DEFAULT, "pthread_getcpuclockid");
-
-  // Switch to using fast clocks for thread cpu time if
-  // the sys_clock_getres() returns 0 error code.
-  // Note, that some kernels may support the current thread
-  // clock (CLOCK_THREAD_CPUTIME_ID) but not the clocks
-  // returned by the pthread_getcpuclockid().
-  // If the fast Posix clocks are supported then the sys_clock_getres()
-  // must return at least tp.tv_sec == 0 which means a resolution
-  // better than 1 sec. This is extra check for reliability.
-
-  if(pthread_getcpuclockid_func &&
-     pthread_getcpuclockid_func(_main_thread, &clockid) == 0 &&
-     sys_clock_getres(clockid, &tp) == 0 && tp.tv_sec == 0) {
-
-    _supports_fast_thread_cpu_time = true;
-    _pthread_getcpuclockid = pthread_getcpuclockid_func;
-  }
-}
-#endif
 
 jlong os::javaTimeNanos() {
   if (Bsd::supports_monotonic_clock()) {
@@ -1978,7 +1299,6 @@
   return false;
 }
 
-#ifdef _ALLBSD_SOURCE
 // ported from solaris version
 bool os::dll_address_to_library_name(address addr, char* buf,
                                      int buflen, int* offset) {
@@ -1994,86 +1314,10 @@
      return false;
   }
 }
-#else
-struct _address_to_library_name {
-  address addr;          // input : memory address
-  size_t  buflen;        //         size of fname
-  char*   fname;         // output: library name
-  address base;          //         library base addr
-};
-
-static int address_to_library_name_callback(struct dl_phdr_info *info,
-                                            size_t size, void *data) {
-  int i;
-  bool found = false;
-  address libbase = NULL;
-  struct _address_to_library_name * d = (struct _address_to_library_name *)data;
-
-  // iterate through all loadable segments
-  for (i = 0; i < info->dlpi_phnum; i++) {
-    address segbase = (address)(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
-    if (info->dlpi_phdr[i].p_type == PT_LOAD) {
-      // base address of a library is the lowest address of its loaded
-      // segments.
-      if (libbase == NULL || libbase > segbase) {
-        libbase = segbase;
-      }
-      // see if 'addr' is within current segment
-      if (segbase <= d->addr &&
-          d->addr < segbase + info->dlpi_phdr[i].p_memsz) {
-        found = true;
-      }
-    }
-  }
-
-  // dlpi_name is NULL or empty if the ELF file is executable, return 0
-  // so dll_address_to_library_name() can fall through to use dladdr() which
-  // can figure out executable name from argv[0].
-  if (found && info->dlpi_name && info->dlpi_name[0]) {
-    d->base = libbase;
-    if (d->fname) {
-      jio_snprintf(d->fname, d->buflen, "%s", info->dlpi_name);
-    }
-    return 1;
-  }
-  return 0;
-}
-
-bool os::dll_address_to_library_name(address addr, char* buf,
-                                     int buflen, int* offset) {
-  Dl_info dlinfo;
-  struct _address_to_library_name data;
-
-  // There is a bug in old glibc dladdr() implementation that it could resolve
-  // to wrong library name if the .so file has a base address != NULL. Here
-  // we iterate through the program headers of all loaded libraries to find
-  // out which library 'addr' really belongs to. This workaround can be
-  // removed once the minimum requirement for glibc is moved to 2.3.x.
-  data.addr = addr;
-  data.fname = buf;
-  data.buflen = buflen;
-  data.base = NULL;
-  int rslt = dl_iterate_phdr(address_to_library_name_callback, (void *)&data);
-
-  if (rslt) {
-     // buf already contains library name
-     if (offset) *offset = addr - data.base;
-     return true;
-  } else if (dladdr((void*)addr, &dlinfo)){
-     if (buf) jio_snprintf(buf, buflen, "%s", dlinfo.dli_fname);
-     if (offset) *offset = addr - (address)dlinfo.dli_fbase;
-     return true;
-  } else {
-     if (buf) buf[0] = '\0';
-     if (offset) *offset = -1;
-     return false;
-  }
-}
-#endif
-
-  // Loads .dll/.so and
-  // in case of error it checks if .dll/.so was built for the
-  // same architecture as Hotspot is running on
+
+// Loads .dll/.so and
+// in case of error it checks if .dll/.so was built for the
+// same architecture as Hotspot is running on
 
 #ifdef __APPLE__
 void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
@@ -2292,7 +1536,6 @@
 
 void os::print_dll_info(outputStream *st) {
    st->print_cr("Dynamic libraries:");
-#ifdef _ALLBSD_SOURCE
 #ifdef RTLD_DI_LINKMAP
     Dl_info dli;
     void *handle;
@@ -2336,16 +1579,6 @@
 #else
    st->print_cr("Error: Cannot print dynamic libraries.");
 #endif
-#else
-   char fname[32];
-   pid_t pid = os::Bsd::gettid();
-
-   jio_snprintf(fname, sizeof(fname), "/proc/%d/maps", pid);
-
-   if (!_print_ascii_file(fname, st)) {
-     st->print("Can not get library information for pid = %d\n", pid);
-   }
-#endif
 }
 
 void os::print_os_info_brief(outputStream* st) {
@@ -2374,22 +1607,10 @@
   st->print("Memory:");
   st->print(" %dk page", os::vm_page_size()>>10);
 
-#ifndef _ALLBSD_SOURCE
-  // values in struct sysinfo are "unsigned long"
-  struct sysinfo si;
-  sysinfo(&si);
-#endif
-
   st->print(", physical " UINT64_FORMAT "k",
             os::physical_memory() >> 10);
   st->print("(" UINT64_FORMAT "k free)",
             os::available_memory() >> 10);
-#ifndef _ALLBSD_SOURCE
-  st->print(", swap " UINT64_FORMAT "k",
-            ((jlong)si.totalswap * si.mem_unit) >> 10);
-  st->print("(" UINT64_FORMAT "k free)",
-            ((jlong)si.freeswap * si.mem_unit) >> 10);
-#endif
   st->cr();
 
   // meminfo
@@ -2786,42 +2007,13 @@
 #endif
 }
 
-#ifndef _ALLBSD_SOURCE
-// Define MAP_HUGETLB here so we can build HotSpot on old systems.
-#ifndef MAP_HUGETLB
-#define MAP_HUGETLB 0x40000
-#endif
-
-// Define MADV_HUGEPAGE here so we can build HotSpot on old systems.
-#ifndef MADV_HUGEPAGE
-#define MADV_HUGEPAGE 14
-#endif
-#endif
 
 bool os::pd_commit_memory(char* addr, size_t size, size_t alignment_hint,
                        bool exec) {
-#ifndef _ALLBSD_SOURCE
-  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
-    int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
-    uintptr_t res =
-      (uintptr_t) ::mmap(addr, size, prot,
-                         MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS|MAP_HUGETLB,
-                         -1, 0);
-    return res != (uintptr_t) MAP_FAILED;
-  }
-#endif
-
   return commit_memory(addr, size, exec);
 }
 
 void os::pd_realign_memory(char *addr, size_t bytes, size_t alignment_hint) {
-#ifndef _ALLBSD_SOURCE
-  if (UseHugeTLBFS && alignment_hint > (size_t)vm_page_size()) {
-    // We don't check the return value: madvise(MADV_HUGEPAGE) may not
-    // be supported or the memory may already be backed by huge pages.
-    ::madvise(addr, bytes, MADV_HUGEPAGE);
-  }
-#endif
 }
 
 void os::pd_free_memory(char *addr, size_t bytes, size_t alignment_hint) {
@@ -2860,111 +2052,6 @@
   return end;
 }
 
-#ifndef _ALLBSD_SOURCE
-// Something to do with the numa-aware allocator needs these symbols
-extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { }
-extern "C" JNIEXPORT void numa_error(char *where) { }
-extern "C" JNIEXPORT int fork1() { return fork(); }
-
-
-// If we are running with libnuma version > 2, then we should
-// be trying to use symbols with versions 1.1
-// If we are running with earlier version, which did not have symbol versions,
-// we should use the base version.
-void* os::Bsd::libnuma_dlsym(void* handle, const char *name) {
-  void *f = dlvsym(handle, name, "libnuma_1.1");
-  if (f == NULL) {
-    f = dlsym(handle, name);
-  }
-  return f;
-}
-
-bool os::Bsd::libnuma_init() {
-  // sched_getcpu() should be in libc.
-  set_sched_getcpu(CAST_TO_FN_PTR(sched_getcpu_func_t,
-                                  dlsym(RTLD_DEFAULT, "sched_getcpu")));
-
-  if (sched_getcpu() != -1) { // Does it work?
-    void *handle = dlopen("libnuma.so.1", RTLD_LAZY);
-    if (handle != NULL) {
-      set_numa_node_to_cpus(CAST_TO_FN_PTR(numa_node_to_cpus_func_t,
-                                           libnuma_dlsym(handle, "numa_node_to_cpus")));
-      set_numa_max_node(CAST_TO_FN_PTR(numa_max_node_func_t,
-                                       libnuma_dlsym(handle, "numa_max_node")));
-      set_numa_available(CAST_TO_FN_PTR(numa_available_func_t,
-                                        libnuma_dlsym(handle, "numa_available")));
-      set_numa_tonode_memory(CAST_TO_FN_PTR(numa_tonode_memory_func_t,
-                                            libnuma_dlsym(handle, "numa_tonode_memory")));
-      set_numa_interleave_memory(CAST_TO_FN_PTR(numa_interleave_memory_func_t,
-                                            libnuma_dlsym(handle, "numa_interleave_memory")));
-
-
-      if (numa_available() != -1) {
-        set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes"));
-        // Create a cpu -> node mapping
-        _cpu_to_node = new (ResourceObj::C_HEAP) GrowableArray<int>(0, true);
-        rebuild_cpu_to_node_map();
-        return true;
-      }
-    }
-  }
-  return false;
-}
-
-// rebuild_cpu_to_node_map() constructs a table mapping cpud id to node id.
-// The table is later used in get_node_by_cpu().
-void os::Bsd::rebuild_cpu_to_node_map() {
-  const size_t NCPUS = 32768; // Since the buffer size computation is very obscure
-                              // in libnuma (possible values are starting from 16,
-                              // and continuing up with every other power of 2, but less
-                              // than the maximum number of CPUs supported by kernel), and
-                              // is a subject to change (in libnuma version 2 the requirements
-                              // are more reasonable) we'll just hardcode the number they use
-                              // in the library.
-  const size_t BitsPerCLong = sizeof(long) * CHAR_BIT;
-
-  size_t cpu_num = os::active_processor_count();
-  size_t cpu_map_size = NCPUS / BitsPerCLong;
-  size_t cpu_map_valid_size =
-    MIN2((cpu_num + BitsPerCLong - 1) / BitsPerCLong, cpu_map_size);
-
-  cpu_to_node()->clear();
-  cpu_to_node()->at_grow(cpu_num - 1);
-  size_t node_num = numa_get_groups_num();
-
-  unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size);
-  for (size_t i = 0; i < node_num; i++) {
-    if (numa_node_to_cpus(i, cpu_map, cpu_map_size * sizeof(unsigned long)) != -1) {
-      for (size_t j = 0; j < cpu_map_valid_size; j++) {
-        if (cpu_map[j] != 0) {
-          for (size_t k = 0; k < BitsPerCLong; k++) {
-            if (cpu_map[j] & (1UL << k)) {
-              cpu_to_node()->at_put(j * BitsPerCLong + k, i);
-            }
-          }
-        }
-      }
-    }
-  }
-  FREE_C_HEAP_ARRAY(unsigned long, cpu_map);
-}
-
-int os::Bsd::get_node_by_cpu(int cpu_id) {
-  if (cpu_to_node() != NULL && cpu_id >= 0 && cpu_id < cpu_to_node()->length()) {
-    return cpu_to_node()->at(cpu_id);
-  }
-  return -1;
-}
-
-GrowableArray<int>* os::Bsd::_cpu_to_node;
-os::Bsd::sched_getcpu_func_t os::Bsd::_sched_getcpu;
-os::Bsd::numa_node_to_cpus_func_t os::Bsd::_numa_node_to_cpus;
-os::Bsd::numa_max_node_func_t os::Bsd::_numa_max_node;
-os::Bsd::numa_available_func_t os::Bsd::_numa_available;
-os::Bsd::numa_tonode_memory_func_t os::Bsd::_numa_tonode_memory;
-os::Bsd::numa_interleave_memory_func_t os::Bsd::_numa_interleave_memory;
-unsigned long* os::Bsd::_numa_all_nodes;
-#endif
 
 bool os::pd_uncommit_memory(char* addr, size_t size) {
 #ifdef __OpenBSD__
@@ -3084,42 +2171,7 @@
 }
 
 bool os::Bsd::hugetlbfs_sanity_check(bool warn, size_t page_size) {
-  bool result = false;
-#ifndef _ALLBSD_SOURCE
-  void *p = mmap (NULL, page_size, PROT_READ|PROT_WRITE,
-                  MAP_ANONYMOUS|MAP_PRIVATE|MAP_HUGETLB,
-                  -1, 0);
-
-  if (p != (void *) -1) {
-    // We don't know if this really is a huge page or not.
-    FILE *fp = fopen("/proc/self/maps", "r");
-    if (fp) {
-      while (!feof(fp)) {
-        char chars[257];
-        long x = 0;
-        if (fgets(chars, sizeof(chars), fp)) {
-          if (sscanf(chars, "%lx-%*x", &x) == 1
-              && x == (long)p) {
-            if (strstr (chars, "hugepage")) {
-              result = true;
-              break;
-            }
-          }
-        }
-      }
-      fclose(fp);
-    }
-    munmap (p, page_size);
-    if (result)
-      return true;
-  }
-
-  if (warn) {
-    warning("HugeTLBFS is not supported by the operating system.");
-  }
-#endif
-
-  return result;
+  return false;
 }
 
 /*
@@ -3164,92 +2216,8 @@
 static size_t _large_page_size = 0;
 
 void os::large_page_init() {
-#ifndef _ALLBSD_SOURCE
-  if (!UseLargePages) {
-    UseHugeTLBFS = false;
-    UseSHM = false;
-    return;
-  }
-
-  if (FLAG_IS_DEFAULT(UseHugeTLBFS) && FLAG_IS_DEFAULT(UseSHM)) {
-    // If UseLargePages is specified on the command line try both methods,
-    // if it's default, then try only HugeTLBFS.
-    if (FLAG_IS_DEFAULT(UseLargePages)) {
-      UseHugeTLBFS = true;
-    } else {
-      UseHugeTLBFS = UseSHM = true;
-    }
-  }
-
-  if (LargePageSizeInBytes) {
-    _large_page_size = LargePageSizeInBytes;
-  } else {
-    // large_page_size on Bsd is used to round up heap size. x86 uses either
-    // 2M or 4M page, depending on whether PAE (Physical Address Extensions)
-    // mode is enabled. AMD64/EM64T uses 2M page in 64bit mode. IA64 can use
-    // page as large as 256M.
-    //
-    // Here we try to figure out page size by parsing /proc/meminfo and looking
-    // for a line with the following format:
-    //    Hugepagesize:     2048 kB
-    //
-    // If we can't determine the value (e.g. /proc is not mounted, or the text
-    // format has been changed), we'll use the largest page size supported by
-    // the processor.
-
-#ifndef ZERO
-    _large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M)
-                       ARM_ONLY(2 * M) PPC_ONLY(4 * M);
-#endif // ZERO
-
-    FILE *fp = fopen("/proc/meminfo", "r");
-    if (fp) {
-      while (!feof(fp)) {
-        int x = 0;
-        char buf[16];
-        if (fscanf(fp, "Hugepagesize: %d", &x) == 1) {
-          if (x && fgets(buf, sizeof(buf), fp) && strcmp(buf, " kB\n") == 0) {
-            _large_page_size = x * K;
-            break;
-          }
-        } else {
-          // skip to next line
-          for (;;) {
-            int ch = fgetc(fp);
-            if (ch == EOF || ch == (int)'\n') break;
-          }
-        }
-      }
-      fclose(fp);
-    }
-  }
-
-  // print a warning if any large page related flag is specified on command line
-  bool warn_on_failure = !FLAG_IS_DEFAULT(UseHugeTLBFS);
-
-  const size_t default_page_size = (size_t)Bsd::page_size();
-  if (_large_page_size > default_page_size) {
-    _page_sizes[0] = _large_page_size;
-    _page_sizes[1] = default_page_size;
-    _page_sizes[2] = 0;
-  }
-  UseHugeTLBFS = UseHugeTLBFS &&
-                 Bsd::hugetlbfs_sanity_check(warn_on_failure, _large_page_size);
-
-  if (UseHugeTLBFS)
-    UseSHM = false;
-
-  UseLargePages = UseHugeTLBFS || UseSHM;
-
-  set_coredump_filter();
-#endif
 }
 
-#ifndef _ALLBSD_SOURCE
-#ifndef SHM_HUGETLB
-#define SHM_HUGETLB 04000
-#endif
-#endif
 
 char* os::reserve_memory_special(size_t bytes, char* req_addr, bool exec) {
   // "exec" is passed in but not used.  Creating the shared image for
@@ -3267,11 +2235,7 @@
 
   // Create a large shared memory region to attach to based on size.
   // Currently, size is the total size of the heap
-#ifndef _ALLBSD_SOURCE
-  int shmid = shmget(key, bytes, SHM_HUGETLB|IPC_CREAT|SHM_R|SHM_W);
-#else
   int shmid = shmget(key, bytes, IPC_CREAT|SHM_R|SHM_W);
-#endif
   if (shmid == -1) {
      // Possible reasons for shmget failure:
      // 1. shmmax is too small for Java heap.
@@ -3558,7 +2522,7 @@
 // this reason, the code should not be used as default (ThreadPriorityPolicy=0).
 // It is only used when ThreadPriorityPolicy=1 and requires root privilege.
 
-#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__)
+#if !defined(__APPLE__)
 int os::java_to_os_priority[CriticalPriority + 1] = {
   19,              // 0 Entry should never be used
 
@@ -3578,7 +2542,7 @@
 
   31               // 11 CriticalPriority
 };
-#elif defined(__APPLE__)
+#else
 /* Using Mach high-level priority assignments */
 int os::java_to_os_priority[CriticalPriority + 1] = {
    0,              // 0 Entry should never be used (MINPRI_USER)
@@ -3599,26 +2563,6 @@
 
   36               // 11 CriticalPriority
 };
-#else
-int os::java_to_os_priority[CriticalPriority + 1] = {
-  19,              // 0 Entry should never be used
-
-   4,              // 1 MinPriority
-   3,              // 2
-   2,              // 3
-
-   1,              // 4
-   0,              // 5 NormPriority
-  -1,              // 6
-
-  -2,              // 7
-  -3,              // 8
-  -4,              // 9 NearMaxPriority
-
-  -5,              // 10 MaxPriority
-
-  -5               // 11 CriticalPriority
-};
 #endif
 
 static int prio_init() {
@@ -4179,22 +3123,6 @@
   }
 }
 
-#ifndef _ALLBSD_SOURCE
-// This is the fastest way to get thread cpu time on Bsd.
-// Returns cpu time (user+sys) for any thread, not only for current.
-// POSIX compliant clocks are implemented in the kernels 2.6.16+.
-// It might work on 2.6.10+ with a special kernel/glibc patch.
-// For reference, please, see IEEE Std 1003.1-2004:
-//   http://www.unix.org/single_unix_specification
-
-jlong os::Bsd::fast_thread_cpu_time(clockid_t clockid) {
-  struct timespec tp;
-  int rc = os::Bsd::clock_gettime(clockid, &tp);
-  assert(rc == 0, "clock_gettime is expected to return 0 code");
-
-  return (tp.tv_sec * NANOSECS_PER_SEC) + tp.tv_nsec;
-}
-#endif
 
 /////
 // glibc on Bsd platform uses non-documented flag
@@ -4458,10 +3386,6 @@
 // this is called _after_ the global arguments have been parsed
 jint os::init_2(void)
 {
-#ifndef _ALLBSD_SOURCE
-  Bsd::fast_thread_clock_init();
-#endif
-
   // Allocate a single page and mark it as readable for safepoint polling
   address polling_page = (address) ::mmap(NULL, Bsd::page_size(), PROT_READ, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
   guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" );
@@ -4518,48 +3442,6 @@
   JavaThread::set_stack_size_at_create(round_to(threadStackSizeInBytes,
         vm_page_size()));
 
-#ifndef _ALLBSD_SOURCE
-  Bsd::capture_initial_stack(JavaThread::stack_size_at_create());
-
-  Bsd::libpthread_init();
-  if (PrintMiscellaneous && (Verbose || WizardMode)) {
-     tty->print_cr("[HotSpot is running with %s, %s(%s)]\n",
-          Bsd::glibc_version(), Bsd::libpthread_version(),
-          Bsd::is_floating_stack() ? "floating stack" : "fixed stack");
-  }
-
-  if (UseNUMA) {
-    if (!Bsd::libnuma_init()) {
-      UseNUMA = false;
-    } else {
-      if ((Bsd::numa_max_node() < 1)) {
-        // There's only one node(they start from 0), disable NUMA.
-        UseNUMA = false;
-      }
-    }
-    // With SHM large pages we cannot uncommit a page, so there's not way
-    // we can make the adaptive lgrp chunk resizing work. If the user specified
-    // both UseNUMA and UseLargePages (or UseSHM) on the command line - warn and
-    // disable adaptive resizing.
-    if (UseNUMA && UseLargePages && UseSHM) {
-      if (!FLAG_IS_DEFAULT(UseNUMA)) {
-        if (FLAG_IS_DEFAULT(UseLargePages) && FLAG_IS_DEFAULT(UseSHM)) {
-          UseLargePages = false;
-        } else {
-          warning("UseNUMA is not fully compatible with SHM large pages, disabling adaptive resizing");
-          UseAdaptiveSizePolicy = false;
-          UseAdaptiveNUMAChunkSizing = false;
-        }
-      } else {
-        UseNUMA = false;
-      }
-    }
-    if (!UseNUMA && ForceNUMA) {
-      UseNUMA = true;
-    }
-  }
-#endif
-
   if (MaxFDLimit) {
     // set the number of file descriptors to max. print out error
     // if getrlimit/setrlimit fails but continue regardless.
@@ -4586,11 +3468,6 @@
     }
   }
 
-#ifndef _ALLBSD_SOURCE
-  // Initialize lock used to serialize thread creation (see os::create_thread)
-  Bsd::set_createThread_lock(new Mutex(Mutex::leaf, "createThread_lock", false));
-#endif
-
   // at-exit methods are called in the reverse order of their registration.
   // atexit functions are called on return from main or as a result of a
   // call to exit(3C). There can be only 32 of these functions registered
@@ -4641,15 +3518,7 @@
 };
 
 int os::active_processor_count() {
-#ifdef _ALLBSD_SOURCE
   return _processor_count;
-#else
-  // Bsd doesn't yet have a (official) notion of processor sets,
-  // so just return the number of online processors.
-  int online_cpus = ::sysconf(_SC_NPROCESSORS_ONLN);
-  assert(online_cpus > 0 && online_cpus <= processor_count(), "sanity check");
-  return online_cpus;
-#endif
 }
 
 void os::set_native_thread_name(const char *name) {
@@ -4703,25 +3572,7 @@
 
 int os::Bsd::safe_cond_timedwait(pthread_cond_t *_cond, pthread_mutex_t *_mutex, const struct timespec *_abstime)
 {
-#ifdef _ALLBSD_SOURCE
   return pthread_cond_timedwait(_cond, _mutex, _abstime);
-#else
-   if (is_NPTL()) {
-      return pthread_cond_timedwait(_cond, _mutex, _abstime);
-   } else {
-#ifndef IA64
-      // 6292965: BsdThreads pthread_cond_timedwait() resets FPU control
-      // word back to default 64bit precision if condvar is signaled. Java
-      // wants 53bit precision.  Save and restore current value.
-      int fpu = get_fpu_control_word();
-#endif // IA64
-      int status = pthread_cond_timedwait(_cond, _mutex, _abstime);
-#ifndef IA64
-      set_fpu_control_word(fpu);
-#endif // IA64
-      return status;
-   }
-#endif
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -5041,20 +3892,6 @@
   return munmap(addr, bytes) == 0;
 }
 
-#ifndef _ALLBSD_SOURCE
-static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time);
-
-static clockid_t thread_cpu_clockid(Thread* thread) {
-  pthread_t tid = thread->osthread()->pthread_id();
-  clockid_t clockid;
-
-  // Get thread clockid
-  int rc = os::Bsd::pthread_getcpuclockid(tid, &clockid);
-  assert(rc == 0, "pthread_getcpuclockid is expected to return 0 code");
-  return clockid;
-}
-#endif
-
 // current_thread_cpu_time(bool) and thread_cpu_time(Thread*, bool)
 // are used by JVM M&M and JVMTI to get user+sys or user CPU time
 // of a thread.
@@ -5065,36 +3902,15 @@
 jlong os::current_thread_cpu_time() {
 #ifdef __APPLE__
   return os::thread_cpu_time(Thread::current(), true /* user + sys */);
-#elif !defined(_ALLBSD_SOURCE)
-  if (os::Bsd::supports_fast_thread_cpu_time()) {
-    return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID);
-  } else {
-    // return user + sys since the cost is the same
-    return slow_thread_cpu_time(Thread::current(), true /* user + sys */);
-  }
 #endif
 }
 
 jlong os::thread_cpu_time(Thread* thread) {
-#ifndef _ALLBSD_SOURCE
-  // consistent with what current_thread_cpu_time() returns
-  if (os::Bsd::supports_fast_thread_cpu_time()) {
-    return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread));
-  } else {
-    return slow_thread_cpu_time(thread, true /* user + sys */);
-  }
-#endif
 }
 
 jlong os::current_thread_cpu_time(bool user_sys_cpu_time) {
 #ifdef __APPLE__
   return os::thread_cpu_time(Thread::current(), user_sys_cpu_time);
-#elif !defined(_ALLBSD_SOURCE)
-  if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) {
-    return os::Bsd::fast_thread_cpu_time(CLOCK_THREAD_CPUTIME_ID);
-  } else {
-    return slow_thread_cpu_time(Thread::current(), user_sys_cpu_time);
-  }
 #endif
 }
 
@@ -5118,106 +3934,9 @@
   } else {
     return ((jlong)tinfo.user_time.seconds * 1000000000) + ((jlong)tinfo.user_time.microseconds * (jlong)1000);
   }
-#elif !defined(_ALLBSD_SOURCE)
-  if (user_sys_cpu_time && os::Bsd::supports_fast_thread_cpu_time()) {
-    return os::Bsd::fast_thread_cpu_time(thread_cpu_clockid(thread));
-  } else {
-    return slow_thread_cpu_time(thread, user_sys_cpu_time);
-  }
 #endif
 }
 
-#ifndef _ALLBSD_SOURCE
-//
-//  -1 on error.
-//
-
-static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time) {
-  static bool proc_pid_cpu_avail = true;
-  static bool proc_task_unchecked = true;
-  static const char *proc_stat_path = "/proc/%d/stat";
-  pid_t  tid = thread->osthread()->thread_id();
-  int i;
-  char *s;
-  char stat[2048];
-  int statlen;
-  char proc_name[64];
-  int count;
-  long sys_time, user_time;
-  char string[64];
-  char cdummy;
-  int idummy;
-  long ldummy;
-  FILE *fp;
-
-  // We first try accessing /proc/<pid>/cpu since this is faster to
-  // process.  If this file is not present (bsd kernels 2.5 and above)
-  // then we open /proc/<pid>/stat.
-  if ( proc_pid_cpu_avail ) {
-    sprintf(proc_name, "/proc/%d/cpu", tid);
-    fp =  fopen(proc_name, "r");
-    if ( fp != NULL ) {
-      count = fscanf( fp, "%s %lu %lu\n", string, &user_time, &sys_time);
-      fclose(fp);
-      if ( count != 3 ) return -1;
-
-      if (user_sys_cpu_time) {
-        return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec);
-      } else {
-        return (jlong)user_time * (1000000000 / clock_tics_per_sec);
-      }
-    }
-    else proc_pid_cpu_avail = false;
-  }
-
-  // The /proc/<tid>/stat aggregates per-process usage on
-  // new Bsd kernels 2.6+ where NPTL is supported.
-  // The /proc/self/task/<tid>/stat still has the per-thread usage.
-  // See bug 6328462.
-  // There can be no directory /proc/self/task on kernels 2.4 with NPTL
-  // and possibly in some other cases, so we check its availability.
-  if (proc_task_unchecked && os::Bsd::is_NPTL()) {
-    // This is executed only once
-    proc_task_unchecked = false;
-    fp = fopen("/proc/self/task", "r");
-    if (fp != NULL) {
-      proc_stat_path = "/proc/self/task/%d/stat";
-      fclose(fp);
-    }
-  }
-
-  sprintf(proc_name, proc_stat_path, tid);
-  fp = fopen(proc_name, "r");
-  if ( fp == NULL ) return -1;
-  statlen = fread(stat, 1, 2047, fp);
-  stat[statlen] = '\0';
-  fclose(fp);
-
-  // Skip pid and the command string. Note that we could be dealing with
-  // weird command names, e.g. user could decide to rename java launcher
-  // to "java 1.4.2 :)", then the stat file would look like
-  //                1234 (java 1.4.2 :)) R ... ...
-  // We don't really need to know the command string, just find the last
-  // occurrence of ")" and then start parsing from there. See bug 4726580.
-  s = strrchr(stat, ')');
-  i = 0;
-  if (s == NULL ) return -1;
-
-  // Skip blank chars
-  do s++; while (isspace(*s));
-
-  count = sscanf(s,"%c %d %d %d %d %d %lu %lu %lu %lu %lu %lu %lu",
-                 &cdummy, &idummy, &idummy, &idummy, &idummy, &idummy,
-                 &ldummy, &ldummy, &ldummy, &ldummy, &ldummy,
-                 &user_time, &sys_time);
-  if ( count != 13 ) return -1;
-  if (user_sys_cpu_time) {
-    return ((jlong)sys_time + (jlong)user_time) * (1000000000 / clock_tics_per_sec);
-  } else {
-    return (jlong)user_time * (1000000000 / clock_tics_per_sec);
-  }
-}
-#endif
 
 void os::current_thread_cpu_time_info(jvmtiTimerInfo *info_ptr) {
   info_ptr->max_value = ALL_64_BITS;       // will not wrap in less than 64 bits
@@ -5236,10 +3955,8 @@
 bool os::is_thread_cpu_time_supported() {
 #ifdef __APPLE__
   return true;
-#elif defined(_ALLBSD_SOURCE)
+#else
   return false;
-#else
-  return true;
 #endif
 }
 
--- a/hotspot/src/os/bsd/vm/os_bsd.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os/bsd/vm/os_bsd.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -56,19 +56,6 @@
   static int sigflags[MAXSIGNUM];
 
   static int (*_clock_gettime)(clockid_t, struct timespec *);
-#ifndef _ALLBSD_SOURCE
-  static int (*_pthread_getcpuclockid)(pthread_t, clockid_t *);
-
-  static address   _initial_thread_stack_bottom;
-  static uintptr_t _initial_thread_stack_size;
-
-  static const char *_glibc_version;
-  static const char *_libpthread_version;
-
-  static bool _is_floating_stack;
-  static bool _is_NPTL;
-  static bool _supports_fast_thread_cpu_time;
-#endif
 
   static GrowableArray<int>* _cpu_to_node;
 
@@ -76,28 +63,14 @@
 
   static julong _physical_memory;
   static pthread_t _main_thread;
-#ifndef _ALLBSD_SOURCE
-  static Mutex* _createThread_lock;
-#endif
   static int _page_size;
 
   static julong available_memory();
   static julong physical_memory() { return _physical_memory; }
   static void initialize_system_info();
 
-#ifndef _ALLBSD_SOURCE
-  static void set_glibc_version(const char *s)      { _glibc_version = s; }
-  static void set_libpthread_version(const char *s) { _libpthread_version = s; }
-#endif
-
   static bool supports_variable_stack_size();
 
-#ifndef _ALLBSD_SOURCE
-  static void set_is_NPTL()                   { _is_NPTL = true;  }
-  static void set_is_BsdThreads()           { _is_NPTL = false; }
-  static void set_is_floating_stack()         { _is_floating_stack = true; }
-#endif
-
   static void rebuild_cpu_to_node_map();
   static GrowableArray<int>* cpu_to_node()    { return _cpu_to_node; }
 
@@ -106,25 +79,10 @@
  public:
 
   static void init_thread_fpu_state();
-#ifndef _ALLBSD_SOURCE
-  static int  get_fpu_control_word();
-  static void set_fpu_control_word(int fpu_control);
-#endif
   static pthread_t main_thread(void)                                { return _main_thread; }
 
-#ifndef _ALLBSD_SOURCE
-  // returns kernel thread id (similar to LWP id on Solaris), which can be
-  // used to access /proc
-  static pid_t gettid();
-  static void set_createThread_lock(Mutex* lk)                      { _createThread_lock = lk; }
-  static Mutex* createThread_lock(void)                             { return _createThread_lock; }
-#endif
   static void hotspot_sigmask(Thread* thread);
 
-#ifndef _ALLBSD_SOURCE
-  static address   initial_thread_stack_bottom(void)                { return _initial_thread_stack_bottom; }
-  static uintptr_t initial_thread_stack_size(void)                  { return _initial_thread_stack_size; }
-#endif
   static bool is_initial_thread(void);
 
   static int page_size(void)                                        { return _page_size; }
@@ -161,23 +119,6 @@
   static struct sigaction *get_chained_signal_action(int sig);
   static bool chained_handler(int sig, siginfo_t* siginfo, void* context);
 
-#ifndef _ALLBSD_SOURCE
-  // GNU libc and libpthread version strings
-  static const char *glibc_version()          { return _glibc_version; }
-  static const char *libpthread_version()     { return _libpthread_version; }
-
-  // NPTL or BsdThreads?
-  static bool is_BsdThreads()               { return !_is_NPTL; }
-  static bool is_NPTL()                       { return _is_NPTL;  }
-
-  // NPTL is always floating stack. BsdThreads could be using floating
-  // stack or fixed stack.
-  static bool is_floating_stack()             { return _is_floating_stack; }
-
-  static void libpthread_init();
-  static bool libnuma_init();
-  static void* libnuma_dlsym(void* handle, const char* name);
-#endif
   // Minimum stack size a thread can be created with (allowing
   // the VM to completely create the thread and enter user code)
   static size_t min_stack_allowed;
@@ -186,22 +127,9 @@
   static size_t default_stack_size(os::ThreadType thr_type);
   static size_t default_guard_size(os::ThreadType thr_type);
 
-#ifndef _ALLBSD_SOURCE
-  static void capture_initial_stack(size_t max_size);
-
-  // Stack overflow handling
-  static bool manually_expand_stack(JavaThread * t, address addr);
-  static int max_register_window_saves_before_flushing();
-#endif
-
   // Real-time clock functions
   static void clock_init(void);
 
-#ifndef _ALLBSD_SOURCE
-  // fast POSIX clocks support
-  static void fast_thread_clock_init(void);
-#endif
-
   static inline bool supports_monotonic_clock() {
     return _clock_gettime != NULL;
   }
@@ -210,18 +138,6 @@
     return _clock_gettime ? _clock_gettime(clock_id, tp) : -1;
   }
 
-#ifndef _ALLBSD_SOURCE
-  static int pthread_getcpuclockid(pthread_t tid, clockid_t *clock_id) {
-    return _pthread_getcpuclockid ? _pthread_getcpuclockid(tid, clock_id) : -1;
-  }
-
-  static bool supports_fast_thread_cpu_time() {
-    return _supports_fast_thread_cpu_time;
-  }
-
-  static jlong fast_thread_cpu_time(clockid_t clockid);
-#endif
-
   // Stack repair handling
 
   // none present
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -22,7 +22,7 @@
  *
  */
 
-// Must be at least Windows 2000 or XP to use VectoredExceptions and IsDebuggerPresent
+// Must be at least Windows 2000 or XP to use IsDebuggerPresent
 #define _WIN32_WINNT 0x500
 
 // no precompiled headers
@@ -110,10 +110,6 @@
 static FILETIME process_user_time;
 static FILETIME process_kernel_time;
 
-#ifdef _WIN64
-PVOID  topLevelVectoredExceptionHandler = NULL;
-#endif
-
 #ifdef _M_IA64
 #define __CPU__ ia64
 #elif _M_AMD64
@@ -136,12 +132,6 @@
     case DLL_PROCESS_DETACH:
       if(ForceTimeHighResolution)
         timeEndPeriod(1L);
-#ifdef _WIN64
-      if (topLevelVectoredExceptionHandler != NULL) {
-        RemoveVectoredExceptionHandler(topLevelVectoredExceptionHandler);
-        topLevelVectoredExceptionHandler = NULL;
-      }
-#endif
       break;
     default:
       break;
@@ -408,20 +398,14 @@
   }
 
 
-  if (UseVectoredExceptions) {
-    // If we are using vectored exception we don't need to set a SEH
-    thread->run();
-  }
-  else {
-    // Install a win32 structured exception handler around every thread created
-    // by VM, so VM can genrate error dump when an exception occurred in non-
-    // Java thread (e.g. VM thread).
-    __try {
-       thread->run();
-    } __except(topLevelExceptionFilter(
-               (_EXCEPTION_POINTERS*)_exception_info())) {
-        // Nothing to do.
-    }
+  // Install a win32 structured exception handler around every thread created
+  // by VM, so VM can genrate error dump when an exception occurred in non-
+  // Java thread (e.g. VM thread).
+  __try {
+     thread->run();
+  } __except(topLevelExceptionFilter(
+             (_EXCEPTION_POINTERS*)_exception_info())) {
+      // Nothing to do.
   }
 
   // One less thread is executing
@@ -2489,16 +2473,6 @@
       }
 #endif
 
-#ifdef _WIN64
-      // Windows will sometimes generate an access violation
-      // when we call malloc.  Since we use VectoredExceptions
-      // on 64 bit platforms, we see this exception.  We must
-      // pass this exception on so Windows can recover.
-      // We check to see if the pc of the fault is in NTDLL.DLL
-      // if so, we pass control on to Windows for handling.
-      if (UseVectoredExceptions && _addr_in_ntdll(pc)) return EXCEPTION_CONTINUE_SEARCH;
-#endif
-
       // Stack overflow or null pointer exception in native code.
       report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,
                    exceptionInfo->ContextRecord);
@@ -2527,30 +2501,8 @@
   }
 
   if (exception_code != EXCEPTION_BREAKPOINT) {
-#ifndef _WIN64
     report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,
                  exceptionInfo->ContextRecord);
-#else
-    // Itanium Windows uses a VectoredExceptionHandler
-    // Which means that C++ programatic exception handlers (try/except)
-    // will get here.  Continue the search for the right except block if
-    // the exception code is not a fatal code.
-    switch ( exception_code ) {
-      case EXCEPTION_ACCESS_VIOLATION:
-      case EXCEPTION_STACK_OVERFLOW:
-      case EXCEPTION_ILLEGAL_INSTRUCTION:
-      case EXCEPTION_ILLEGAL_INSTRUCTION_2:
-      case EXCEPTION_INT_OVERFLOW:
-      case EXCEPTION_INT_DIVIDE_BY_ZERO:
-      case EXCEPTION_UNCAUGHT_CXX_EXCEPTION:
-      {  report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,
-                       exceptionInfo->ContextRecord);
-      }
-        break;
-      default:
-        break;
-    }
-#endif
   }
   return EXCEPTION_CONTINUE_SEARCH;
 }
@@ -3706,18 +3658,6 @@
 
   // Setup Windows Exceptions
 
-  // On Itanium systems, Structured Exception Handling does not
-  // work since stack frames must be walkable by the OS.  Since
-  // much of our code is dynamically generated, and we do not have
-  // proper unwind .xdata sections, the system simply exits
-  // rather than delivering the exception.  To work around
-  // this we use VectorExceptions instead.
-#ifdef _WIN64
-  if (UseVectoredExceptions) {
-    topLevelVectoredExceptionHandler = AddVectoredExceptionHandler( 1, topLevelExceptionFilter);
-  }
-#endif
-
   // for debugging float code generation bugs
   if (ForceFloatExceptions) {
 #ifndef  _WIN64
--- a/hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -25,10 +25,6 @@
 #ifndef OS_CPU_BSD_X86_VM_BYTES_BSD_X86_INLINE_HPP
 #define OS_CPU_BSD_X86_VM_BYTES_BSD_X86_INLINE_HPP
 
-#ifndef _ALLBSD_SOURCE
-#include <byteswap.h>
-#endif
-
 #ifdef __APPLE__
 #include <libkern/OSByteOrder.h>
 #endif
--- a/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -48,7 +48,5 @@
 
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
-// Only used on 64 bit Windows platforms
-define_pd_global(bool, UseVectoredExceptions,    false);
 
 #endif // OS_CPU_BSD_X86_VM_GLOBALS_BSD_X86_HPP
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -76,7 +76,7 @@
 # include <ucontext.h>
 #endif
 
-#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) && !defined(__NetBSD__)
+#if !defined(__APPLE__) && !defined(__NetBSD__)
 # include <pthread_np.h>
 #endif
 
@@ -489,23 +489,6 @@
           // to handle_unexpected_exception way down below.
           thread->disable_stack_red_zone();
           tty->print_raw_cr("An irrecoverable stack overflow has occurred.");
-#ifndef _ALLBSD_SOURCE
-        } else {
-          // Accessing stack address below sp may cause SEGV if current
-          // thread has MAP_GROWSDOWN stack. This should only happen when
-          // current thread was created by user code with MAP_GROWSDOWN flag
-          // and then attached to VM. See notes in os_bsd.cpp.
-          if (thread->osthread()->expanding_stack() == 0) {
-             thread->osthread()->set_expanding_stack();
-             if (os::Bsd::manually_expand_stack(thread, addr)) {
-               thread->osthread()->clear_expanding_stack();
-               return 1;
-             }
-             thread->osthread()->clear_expanding_stack();
-          } else {
-             fatal("recursive segv. expanding stack.");
-          }
-#endif
         }
       }
     }
@@ -744,61 +727,21 @@
   ShouldNotReachHere();
 }
 
-#ifdef _ALLBSD_SOURCE
 // From solaris_i486.s ported to bsd_i486.s
 extern "C" void fixcw();
-#endif
 
 void os::Bsd::init_thread_fpu_state(void) {
 #ifndef AMD64
-# ifdef _ALLBSD_SOURCE
   // Set fpu to 53 bit precision. This happens too early to use a stub.
   fixcw();
-# else
-  // set fpu to 53 bit precision
-  set_fpu_control_word(0x27f);
-# endif
 #endif // !AMD64
 }
 
-#ifndef _ALLBSD_SOURCE
-int os::Bsd::get_fpu_control_word(void) {
-#ifdef AMD64
-  return 0;
-#else
-  int fpu_control;
-  _FPU_GETCW(fpu_control);
-  return fpu_control & 0xffff;
-#endif // AMD64
-}
-
-void os::Bsd::set_fpu_control_word(int fpu_control) {
-#ifndef AMD64
-  _FPU_SETCW(fpu_control);
-#endif // !AMD64
-}
-#endif
 
 // Check that the bsd kernel version is 2.4 or higher since earlier
 // versions do not support SSE without patches.
 bool os::supports_sse() {
-#if defined(AMD64) || defined(_ALLBSD_SOURCE)
   return true;
-#else
-  struct utsname uts;
-  if( uname(&uts) != 0 ) return false; // uname fails?
-  char *minor_string;
-  int major = strtol(uts.release,&minor_string,10);
-  int minor = strtol(minor_string+1,NULL,10);
-  bool result = (major > 2 || (major==2 && minor >= 4));
-#ifndef PRODUCT
-  if (PrintMiscellaneous && Verbose) {
-    tty->print("OS version is %d.%d, which %s support SSE/SSE2\n",
-               major,minor, result ? "DOES" : "does NOT");
-  }
-#endif
-  return result;
-#endif // AMD64
 }
 
 bool os::is_allocatable(size_t bytes) {
@@ -836,46 +779,7 @@
 #define GET_GS() ({int gs; __asm__ volatile("movw %%gs, %w0":"=q"(gs)); gs&0xffff;})
 #endif
 
-#ifdef _ALLBSD_SOURCE
 bool os::Bsd::supports_variable_stack_size() { return true; }
-#else
-// Test if pthread library can support variable thread stack size. BsdThreads
-// in fixed stack mode allocates 2M fixed slot for each thread. BsdThreads
-// in floating stack mode and NPTL support variable stack size.
-bool os::Bsd::supports_variable_stack_size() {
-  if (os::Bsd::is_NPTL()) {
-     // NPTL, yes
-     return true;
-
-  } else {
-    // Note: We can't control default stack size when creating a thread.
-    // If we use non-default stack size (pthread_attr_setstacksize), both
-    // floating stack and non-floating stack BsdThreads will return the
-    // same value. This makes it impossible to implement this function by
-    // detecting thread stack size directly.
-    //
-    // An alternative approach is to check %gs. Fixed-stack BsdThreads
-    // do not use %gs, so its value is 0. Floating-stack BsdThreads use
-    // %gs (either as LDT selector or GDT selector, depending on kernel)
-    // to access thread specific data.
-    //
-    // Note that %gs is a reserved glibc register since early 2001, so
-    // applications are not allowed to change its value (Ulrich Drepper from
-    // Redhat confirmed that all known offenders have been modified to use
-    // either %fs or TSD). In the worst case scenario, when VM is embedded in
-    // a native application that plays with %gs, we might see non-zero %gs
-    // even BsdThreads is running in fixed stack mode. As the result, we'll
-    // return true and skip _thread_safety_check(), so we may not be able to
-    // detect stack-heap collisions. But otherwise it's harmless.
-    //
-#ifdef __GNUC__
-    return (GET_GS() != 0);
-#else
-    return false;
-#endif
-  }
-}
-#endif
 #endif // AMD64
 
 // return default stack size for thr_type
@@ -943,7 +847,7 @@
 
   *bottom = (address)((char *)ss.ss_sp - ss.ss_size);
   *size   = ss.ss_size;
-#elif defined(_ALLBSD_SOURCE)
+#else
   pthread_attr_t attr;
 
   int rslt = pthread_attr_init(&attr);
@@ -963,33 +867,6 @@
   }
 
   pthread_attr_destroy(&attr);
-#else
-  if (os::Bsd::is_initial_thread()) {
-     // initial thread needs special handling because pthread_getattr_np()
-     // may return bogus value.
-     *bottom = os::Bsd::initial_thread_stack_bottom();
-     *size   = os::Bsd::initial_thread_stack_size();
-  } else {
-     pthread_attr_t attr;
-
-     int rslt = pthread_getattr_np(pthread_self(), &attr);
-
-     // JVM needs to know exact stack location, abort if it fails
-     if (rslt != 0) {
-       if (rslt == ENOMEM) {
-         vm_exit_out_of_memory(0, "pthread_getattr_np");
-       } else {
-         fatal(err_msg("pthread_getattr_np failed with errno = %d", rslt));
-       }
-     }
-
-     if (pthread_attr_getstack(&attr, (void **)bottom, size) != 0) {
-         fatal("Can not locate current stack attributes!");
-     }
-
-     pthread_attr_destroy(&attr);
-
-  }
 #endif
   assert(os::current_stack_pointer() >= *bottom &&
          os::current_stack_pointer() < *bottom + *size, "just checking");
--- a/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/bsd_zero/vm/globals_bsd_zero.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -41,7 +41,6 @@
 define_pd_global(intx,  CompilerThreadStackSize, 0);
 define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
 
-define_pd_global(bool,  UseVectoredExceptions,   false);
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 
--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -23,7 +23,7 @@
  *
  */
 
-#if defined(_ALLBSD_SOURCE) && !defined(__APPLE__) && !defined(__NetBSD__)
+#if !defined(__APPLE__) && !defined(__NetBSD__)
 #include <pthread.h>
 # include <pthread_np.h> /* For pthread_attr_get_np */
 #endif
@@ -178,26 +178,6 @@
           thread->disable_stack_red_zone();
           ShouldNotCallThis();
         }
-#ifndef _ALLBSD_SOURCE
-        else {
-          // Accessing stack address below sp may cause SEGV if
-          // current thread has MAP_GROWSDOWN stack. This should
-          // only happen when current thread was created by user
-          // code with MAP_GROWSDOWN flag and then attached to VM.
-          // See notes in os_bsd.cpp.
-          if (thread->osthread()->expanding_stack() == 0) {
-            thread->osthread()->set_expanding_stack();
-            if (os::Bsd::manually_expand_stack(thread, addr)) {
-              thread->osthread()->clear_expanding_stack();
-              return true;
-            }
-            thread->osthread()->clear_expanding_stack();
-          }
-          else {
-            fatal("recursive segv. expanding stack.");
-          }
-        }
-#endif
       }
     }
 
@@ -266,16 +246,6 @@
   // Nothing to do
 }
 
-#ifndef _ALLBSD_SOURCE
-int os::Bsd::get_fpu_control_word() {
-  ShouldNotCallThis();
-}
-
-void os::Bsd::set_fpu_control_word(int fpu) {
-  ShouldNotCallThis();
-}
-#endif
-
 bool os::is_allocatable(size_t bytes) {
 #ifdef _LP64
   return true;
@@ -339,7 +309,7 @@
   stack_top = (address) ss.ss_sp;
   stack_bytes  = ss.ss_size;
   stack_bottom = stack_top - stack_bytes;
-#elif defined(_ALLBSD_SOURCE)
+#else
   pthread_attr_t attr;
 
   int rslt = pthread_attr_init(&attr);
@@ -362,67 +332,6 @@
   pthread_attr_destroy(&attr);
 
   stack_top = stack_bottom + stack_bytes;
-#else /* Linux */
-  pthread_attr_t attr;
-  int res = pthread_getattr_np(pthread_self(), &attr);
-  if (res != 0) {
-    if (res == ENOMEM) {
-      vm_exit_out_of_memory(0, "pthread_getattr_np");
-    }
-    else {
-      fatal(err_msg("pthread_getattr_np failed with errno = " INT32_FORMAT,
-            res));
-    }
-  }
-
-  res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes);
-  if (res != 0) {
-    fatal(err_msg("pthread_attr_getstack failed with errno = " INT32_FORMAT,
-          res));
-  }
-  stack_top = stack_bottom + stack_bytes;
-
-  // The block of memory returned by pthread_attr_getstack() includes
-  // guard pages where present.  We need to trim these off.
-  size_t page_bytes = os::Bsd::page_size();
-  assert(((intptr_t) stack_bottom & (page_bytes - 1)) == 0, "unaligned stack");
-
-  size_t guard_bytes;
-  res = pthread_attr_getguardsize(&attr, &guard_bytes);
-  if (res != 0) {
-    fatal(err_msg(
-        "pthread_attr_getguardsize failed with errno = " INT32_FORMAT, res));
-  }
-  int guard_pages = align_size_up(guard_bytes, page_bytes) / page_bytes;
-  assert(guard_bytes == guard_pages * page_bytes, "unaligned guard");
-
-#ifdef IA64
-  // IA64 has two stacks sharing the same area of memory, a normal
-  // stack growing downwards and a register stack growing upwards.
-  // Guard pages, if present, are in the centre.  This code splits
-  // the stack in two even without guard pages, though in theory
-  // there's nothing to stop us allocating more to the normal stack
-  // or more to the register stack if one or the other were found
-  // to grow faster.
-  int total_pages = align_size_down(stack_bytes, page_bytes) / page_bytes;
-  stack_bottom += (total_pages - guard_pages) / 2 * page_bytes;
-#endif // IA64
-
-  stack_bottom += guard_bytes;
-
-  pthread_attr_destroy(&attr);
-
-  // The initial thread has a growable stack, and the size reported
-  // by pthread_attr_getstack is the maximum size it could possibly
-  // be given what currently mapped.  This can be huge, so we cap it.
-  if (os::Bsd::is_initial_thread()) {
-    stack_bytes = stack_top - stack_bottom;
-
-    if (stack_bytes > JavaThread::stack_size_at_create())
-      stack_bytes = JavaThread::stack_size_at_create();
-
-    stack_bottom = stack_top - stack_bytes;
-  }
 #endif
 
   assert(os::current_stack_pointer() >= stack_bottom, "should do");
--- a/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/linux_sparc/vm/globals_linux_sparc.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -35,7 +35,5 @@
 
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx, HeapBaseMinAddress,      CONST64(4)*G);
-// Only used on 64 bit Windows platforms
-define_pd_global(bool, UseVectoredExceptions, false);
 
 #endif // OS_CPU_LINUX_SPARC_VM_GLOBALS_LINUX_SPARC_HPP
--- a/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/linux_x86/vm/globals_linux_x86.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -46,7 +46,5 @@
 
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx,HeapBaseMinAddress,       2*G);
-// Only used on 64 bit Windows platforms
-define_pd_global(bool, UseVectoredExceptions,    false);
 
 #endif // OS_CPU_LINUX_X86_VM_GLOBALS_LINUX_X86_HPP
--- a/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/linux_zero/vm/globals_linux_zero.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -41,7 +41,6 @@
 define_pd_global(intx,  CompilerThreadStackSize, 0);
 define_pd_global(uintx, JVMInvokeMethodSlack,    8192);
 
-define_pd_global(bool,  UseVectoredExceptions,   false);
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 
--- a/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/globals_solaris_sparc.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -39,8 +39,6 @@
 #else
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
 #endif
-// Only used on 64 bit Windows platforms
-define_pd_global(bool, UseVectoredExceptions,    false);
 
 
 
--- a/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/solaris_x86/vm/globals_solaris_x86.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -45,7 +45,5 @@
 
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx,HeapBaseMinAddress,       256*M);
-// Only used on 64 bit Windows platforms
-define_pd_global(bool, UseVectoredExceptions,    false);
 
 #endif // OS_CPU_SOLARIS_X86_VM_GLOBALS_SOLARIS_X86_HPP
--- a/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/windows_x86/vm/globals_windows_x86.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -47,7 +47,5 @@
 
 // Used on 64 bit platforms for UseCompressedOops base address or CDS
 define_pd_global(uintx, HeapBaseMinAddress,      2*G);
-// Only used on 64 bit Windows platforms
-define_pd_global(bool, UseVectoredExceptions,    false);
 
 #endif // OS_CPU_WINDOWS_X86_VM_GLOBALS_WINDOWS_X86_HPP
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -175,9 +175,6 @@
   PRUNTIME_FUNCTION prt;
   PUNWIND_INFO_EH_ONLY punwind;
 
-  // If we are using Vectored Exceptions we don't need this registration
-  if (UseVectoredExceptions) return true;
-
   BufferBlob* blob = BufferBlob::create("CodeCache Exception Handler", sizeof(DynamicCodeData));
   CodeBuffer cb(blob);
   MacroAssembler* masm = new MacroAssembler(&cb);
--- a/hotspot/src/share/tools/hsdis/hsdis-demo.c	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/tools/hsdis/hsdis-demo.c	Wed Nov 14 16:41:12 2012 -0800
@@ -85,9 +85,11 @@
 
 #include "dlfcn.h"
 
-#define DECODE_INSTRUCTIONS_NAME "decode_instructions_virtual"
+#define DECODE_INSTRUCTIONS_VIRTUAL_NAME "decode_instructions_virtual"
+#define DECODE_INSTRUCTIONS_NAME "decode_instructions"
 #define HSDIS_NAME               "hsdis"
 static void* decode_instructions_pv = 0;
+static void* decode_instructions_sv = 0;
 static const char* hsdis_path[] = {
   HSDIS_NAME"-"LIBARCH LIB_EXT,
   "./" HSDIS_NAME"-"LIBARCH LIB_EXT,
@@ -101,11 +103,12 @@
   void* dllib = NULL;
   const char* *next_in_path = hsdis_path;
   while (1) {
-    decode_instructions_pv = dlsym(dllib, DECODE_INSTRUCTIONS_NAME);
-    if (decode_instructions_pv != NULL)
+    decode_instructions_pv = dlsym(dllib, DECODE_INSTRUCTIONS_VIRTUAL_NAME);
+    decode_instructions_sv = dlsym(dllib, DECODE_INSTRUCTIONS_NAME);
+    if (decode_instructions_pv != NULL || decode_instructions_sv != NULL)
       return NULL;
     if (dllib != NULL)
-      return "plugin does not defined "DECODE_INSTRUCTIONS_NAME;
+      return "plugin does not defined "DECODE_INSTRUCTIONS_VIRTUAL_NAME" and "DECODE_INSTRUCTIONS_NAME;
     for (dllib = NULL; dllib == NULL; ) {
       const char* next_lib = (*next_in_path++);
       if (next_lib == NULL)
@@ -213,20 +216,44 @@
     printf("%s: %s\n", err, dlerror());
     exit(1);
   }
-  printf("Decoding from %p to %p...\n", from, to);
-  decode_instructions_ftype decode_instructions
-    = (decode_instructions_ftype) decode_instructions_pv;
+  decode_func_vtype decode_instructions_v
+    = (decode_func_vtype) decode_instructions_pv;
+  decode_func_stype decode_instructions_s
+    = (decode_func_stype) decode_instructions_sv;
   void* res;
-  if (raw && xml) {
-    res = (*decode_instructions)(from, to, (unsigned char*)from, to - from, simple_handle_event, stdout, NULL, stdout, options);
-  } else if (raw) {
-    res = (*decode_instructions)(from, to, (unsigned char*)from, to - from, simple_handle_event, stdout, NULL, stdout, options);
-  } else {
-    res = (*decode_instructions)(from, to, (unsigned char*)from, to - from,
-                                 handle_event, (void*) event_cookie,
-                                 fprintf_callback, stdout,
-                                 options);
+  if (decode_instructions_pv != NULL) {
+    printf("\nDecoding from %p to %p...with %s\n", from, to, DECODE_INSTRUCTIONS_VIRTUAL_NAME);
+    if (raw) {
+      res = (*decode_instructions_v)(from, to,
+                                     (unsigned char*)from, to - from,
+                                     simple_handle_event, stdout,
+                                     NULL, stdout,
+                                     options, 0);
+    } else {
+      res = (*decode_instructions_v)(from, to,
+                                    (unsigned char*)from, to - from,
+                                     handle_event, (void*) event_cookie,
+                                     fprintf_callback, stdout,
+                                     options, 0);
+    }
+    if (res != (void*)to)
+      printf("*** Result was %p!\n", res);
   }
-  if (res != (void*)to)
-    printf("*** Result was %p!\n", res);
+  void* sres;
+  if (decode_instructions_sv != NULL) {
+    printf("\nDecoding from %p to %p...with old decode_instructions\n", from, to, DECODE_INSTRUCTIONS_NAME);
+    if (raw) {
+      sres = (*decode_instructions_s)(from, to,
+                                      simple_handle_event, stdout,
+                                      NULL, stdout,
+                                      options);
+    } else {
+      sres = (*decode_instructions_s)(from, to,
+                                      handle_event, (void*) event_cookie,
+                                      fprintf_callback, stdout,
+                                      options);
+    }
+    if (sres != (void *)to)
+      printf("*** Result of decode_instructions %p!\n", sres);
+  }
 }
--- a/hotspot/src/share/tools/hsdis/hsdis.c	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/tools/hsdis/hsdis.c	Wed Nov 14 16:41:12 2012 -0800
@@ -99,7 +99,7 @@
                             unsigned char* buffer, uintptr_t length,
                             event_callback_t  event_callback_arg,  void* event_stream_arg,
                             printf_callback_t printf_callback_arg, void* printf_stream_arg,
-                            const char* options) {
+                            const char* options, int newline) {
   struct hsdis_app_data app_data;
   memset(&app_data, 0, sizeof(app_data));
   app_data.start_va    = start_va;
@@ -110,7 +110,7 @@
   app_data.event_stream    = event_stream_arg;
   app_data.printf_callback = printf_callback_arg;
   app_data.printf_stream   = printf_stream_arg;
-  app_data.do_newline = false;
+  app_data.do_newline = newline == 0 ? false : true;
 
   return decode(&app_data, options);
 }
@@ -132,7 +132,7 @@
                              event_stream_arg,
                              printf_callback_arg,
                              printf_stream_arg,
-                             options);
+                             options, false);
 }
 
 static void* decode(struct hsdis_app_data* app_data, const char* options) {
@@ -173,7 +173,7 @@
       if (!app_data->losing) {
         const char* insn_close = format_insn_close("/insn", &app_data->dinfo,
                                                    buf, sizeof(buf));
-        (*event_callback)(event_stream, insn_close, (void*) p) != NULL;
+        (*event_callback)(event_stream, insn_close, (void*) p);
 
         if (app_data->do_newline) {
           /* follow each complete insn by a nice newline */
@@ -182,13 +182,14 @@
       }
     }
 
-    (*event_callback)(event_stream, "/insns", (void*) p);
+    if (app_data->losing) (*event_callback)(event_stream, "/insns", (void*) p);
     return (void*) p;
   }
 }
 
 /* take the address of the function, for luck, and also test the typedef: */
-const decode_instructions_ftype decode_instructions_address = &decode_instructions_virtual;
+const decode_func_vtype decode_func_virtual_address = &decode_instructions_virtual;
+const decode_func_stype decode_func_address = &decode_instructions;
 
 static const char* format_insn_close(const char* close,
                                      disassemble_info* dinfo,
--- a/hotspot/src/share/tools/hsdis/hsdis.h	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/tools/hsdis/hsdis.h	Wed Nov 14 16:41:12 2012 -0800
@@ -47,6 +47,9 @@
    where tag is a simple identifier, signifying (as in XML) a element start,
    element end, and standalone element.  (To render as XML, add angle brackets.)
 */
+#ifndef SHARED_TOOLS_HSDIS_H
+#define SHARED_TOOLS_HSDIS_H
+
 extern
 #ifdef DLL_EXPORT
   DLL_EXPORT
@@ -57,16 +60,37 @@
                                   void* event_stream,
                                   int (*printf_callback)(void*, const char*, ...),
                                   void* printf_stream,
-                                  const char* options);
+                                  const char* options,
+                                  int newline /* bool value for nice new line */);
+
+/* This is the compatability interface for older versions of hotspot */
+extern
+#ifdef DLL_ENTRY
+  DLL_ENTRY
+#endif
+void* decode_instructions(void* start_pv, void* end_pv,
+                    void* (*event_callback)(void*, const char*, void*),
+                    void* event_stream,
+                    int   (*printf_callback)(void*, const char*, ...),
+                    void* printf_stream,
+                    const char* options);
 
 /* convenience typedefs */
 
 typedef void* (*decode_instructions_event_callback_ftype)  (void*, const char*, void*);
 typedef int   (*decode_instructions_printf_callback_ftype) (void*, const char*, ...);
-typedef void* (*decode_instructions_ftype) (uintptr_t start_va, uintptr_t end_va,
-                                            unsigned char* buffer, uintptr_t length,
-                                            decode_instructions_event_callback_ftype event_callback,
-                                            void* event_stream,
-                                            decode_instructions_printf_callback_ftype printf_callback,
-                                            void* printf_stream,
-                                            const char* options);
+typedef void* (*decode_func_vtype) (uintptr_t start_va, uintptr_t end_va,
+                                    unsigned char* buffer, uintptr_t length,
+                                    decode_instructions_event_callback_ftype event_callback,
+                                    void* event_stream,
+                                    decode_instructions_printf_callback_ftype printf_callback,
+                                    void* printf_stream,
+                                    const char* options,
+                                    int newline);
+typedef void* (*decode_func_stype) (void* start_pv, void* end_pv,
+                                    decode_instructions_event_callback_ftype event_callback,
+                                    void* event_stream,
+                                    decode_instructions_printf_callback_ftype printf_callback,
+                                    void* printf_stream,
+                                    const char* options);
+#endif /* SHARED_TOOLS_HSDIS_H */
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -758,7 +758,7 @@
     }
   }
 
-  if (dest->blob() == NULL) {
+  if (dest->blob() == NULL && dest_filled != NULL) {
     // Destination is a final resting place, not just another buffer.
     // Normalize uninitialized bytes in the final padding.
     Copy::fill_to_bytes(dest_filled, dest_end - dest_filled,
--- a/hotspot/src/share/vm/ci/ciEnv.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -768,8 +768,8 @@
       Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc);
       if (m != NULL &&
           (bc == Bytecodes::_invokestatic
-           ?  InstanceKlass::cast(m->method_holder())->is_not_initialized()
-           : !InstanceKlass::cast(m->method_holder())->is_loaded())) {
+           ?  m->method_holder()->is_not_initialized()
+           : !m->method_holder()->is_loaded())) {
         m = NULL;
       }
       if (m != NULL) {
@@ -1056,7 +1056,7 @@
                         method_name,
                         entry_bci);
         }
-        InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
+        method->method_holder()->add_osr_nmethod(nm);
 
       }
     }
--- a/hotspot/src/share/vm/ci/ciMethod.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/ci/ciMethod.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -105,7 +105,7 @@
     CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops());
   }
 
-  if (InstanceKlass::cast(h_m()->method_holder())->is_linked()) {
+  if (h_m()->method_holder()->is_linked()) {
     _can_be_statically_bound = h_m()->can_be_statically_bound();
   } else {
     // Have to use a conservative value in this case.
@@ -188,7 +188,7 @@
 
   // Revert any breakpoint bytecodes in ci's copy
   if (me->number_of_breakpoints() > 0) {
-    BreakpointInfo* bp = InstanceKlass::cast(me->method_holder())->breakpoints();
+    BreakpointInfo* bp = me->method_holder()->breakpoints();
     for (; bp != NULL; bp = bp->next()) {
       if (bp->match(me)) {
         code_at_put(bp->bci(), bp->orig_bytecode());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#include "classfile/bytecodeAssembler.hpp"
+#include "interpreter/bytecodes.hpp"
+#include "memory/oopFactory.hpp"
+#include "oops/constantPool.hpp"
+
+#ifdef TARGET_ARCH_x86
+# include "bytes_x86.hpp"
+#endif
+#ifdef TARGET_ARCH_sparc
+# include "bytes_sparc.hpp"
+#endif
+#ifdef TARGET_ARCH_zero
+# include "bytes_zero.hpp"
+#endif
+#ifdef TARGET_ARCH_arm
+# include "bytes_arm.hpp"
+#endif
+#ifdef TARGET_ARCH_ppc
+# include "bytes_ppc.hpp"
+#endif
+
+u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe) {
+  u2 index;
+  u2* probe = _indices.get(bcpe);
+  if (probe == NULL) {
+    index = _entries.length();
+    _entries.append(bcpe);
+    _indices.put(bcpe, index);
+  } else {
+    index = *probe;
+  }
+  return index + _orig->length();
+}
+
+ConstantPool* BytecodeConstantPool::create_constant_pool(TRAPS) const {
+  if (_entries.length() == 0) {
+    return _orig;
+  }
+
+  ConstantPool* cp = ConstantPool::allocate(
+      _orig->pool_holder()->class_loader_data(),
+      _orig->length() + _entries.length(), CHECK_NULL);
+
+  cp->set_pool_holder(_orig->pool_holder());
+  _orig->copy_cp_to(1, _orig->length() - 1, cp, 1, CHECK_NULL);
+
+  for (int i = 0; i < _entries.length(); ++i) {
+    BytecodeCPEntry entry = _entries.at(i);
+    int idx = i + _orig->length();
+    switch (entry._tag) {
+      case BytecodeCPEntry::UTF8:
+        cp->symbol_at_put(idx, entry._u.utf8);
+        entry._u.utf8->increment_refcount();
+        break;
+      case BytecodeCPEntry::KLASS:
+        cp->unresolved_klass_at_put(
+            idx, cp->symbol_at(entry._u.klass));
+        break;
+      case BytecodeCPEntry::STRING:
+        cp->unresolved_string_at_put(
+            idx, cp->symbol_at(entry._u.string));
+        break;
+      case BytecodeCPEntry::NAME_AND_TYPE:
+        cp->name_and_type_at_put(idx,
+            entry._u.name_and_type.name_index,
+            entry._u.name_and_type.type_index);
+        break;
+      case BytecodeCPEntry::METHODREF:
+        cp->method_at_put(idx,
+            entry._u.methodref.class_index,
+            entry._u.methodref.name_and_type_index);
+        break;
+      default:
+        ShouldNotReachHere();
+    }
+  }
+  return cp;
+}
+
+void BytecodeAssembler::append(u1 imm_u1) {
+  _code->append(imm_u1);
+}
+
+void BytecodeAssembler::append(u2 imm_u2) {
+  _code->append(0);
+  _code->append(0);
+  Bytes::put_Java_u2(_code->adr_at(_code->length() - 2), imm_u2);
+}
+
+void BytecodeAssembler::append(u4 imm_u4) {
+  _code->append(0);
+  _code->append(0);
+  _code->append(0);
+  _code->append(0);
+  Bytes::put_Java_u4(_code->adr_at(_code->length() - 4), imm_u4);
+}
+
+void BytecodeAssembler::xload(u4 index, u1 onebyteop, u1 twobyteop) {
+  if (index < 4) {
+    _code->append(onebyteop + index);
+  } else {
+    _code->append(twobyteop);
+    _code->append((u2)index);
+  }
+}
+
+void BytecodeAssembler::dup() {
+  _code->append(Bytecodes::_dup);
+}
+
+void BytecodeAssembler::_new(Symbol* sym) {
+  u2 cpool_index = _cp->klass(sym);
+  _code->append(Bytecodes::_new);
+  append(cpool_index);
+}
+
+void BytecodeAssembler::load_string(Symbol* sym) {
+  u2 cpool_index = _cp->string(sym);
+  if (cpool_index < 0x100) {
+    ldc(cpool_index);
+  } else {
+    ldc_w(cpool_index);
+  }
+}
+
+void BytecodeAssembler::ldc(u1 index) {
+  _code->append(Bytecodes::_ldc);
+  append(index);
+}
+
+void BytecodeAssembler::ldc_w(u2 index) {
+  _code->append(Bytecodes::_ldc_w);
+  append(index);
+}
+
+void BytecodeAssembler::athrow() {
+  _code->append(Bytecodes::_athrow);
+}
+
+void BytecodeAssembler::iload(u4 index) {
+  xload(index, Bytecodes::_iload_0, Bytecodes::_iload);
+}
+
+void BytecodeAssembler::lload(u4 index) {
+  xload(index, Bytecodes::_lload_0, Bytecodes::_lload);
+}
+
+void BytecodeAssembler::fload(u4 index) {
+  xload(index, Bytecodes::_fload_0, Bytecodes::_fload);
+}
+
+void BytecodeAssembler::dload(u4 index) {
+  xload(index, Bytecodes::_dload_0, Bytecodes::_dload);
+}
+
+void BytecodeAssembler::aload(u4 index) {
+  xload(index, Bytecodes::_aload_0, Bytecodes::_aload);
+}
+
+void BytecodeAssembler::load(BasicType bt, u4 index) {
+  switch (bt) {
+    case T_BOOLEAN:
+    case T_CHAR:
+    case T_BYTE:
+    case T_SHORT:
+    case T_INT:     iload(index); break;
+    case T_FLOAT:   fload(index); break;
+    case T_DOUBLE:  dload(index); break;
+    case T_LONG:    lload(index); break;
+    case T_OBJECT:
+    case T_ARRAY:   aload(index); break;
+    default:
+      ShouldNotReachHere();
+  }
+}
+
+void BytecodeAssembler::checkcast(Symbol* sym) {
+  u2 cpool_index = _cp->klass(sym);
+  _code->append(Bytecodes::_checkcast);
+  append(cpool_index);
+}
+
+void BytecodeAssembler::invokespecial(Method* method) {
+  invokespecial(method->klass_name(), method->name(), method->signature());
+}
+
+void BytecodeAssembler::invokespecial(Symbol* klss, Symbol* name, Symbol* sig) {
+  u2 methodref_index = _cp->methodref(klss, name, sig);
+  _code->append(Bytecodes::_invokespecial);
+  append(methodref_index);
+}
+
+void BytecodeAssembler::invokevirtual(Method* method) {
+  invokevirtual(method->klass_name(), method->name(), method->signature());
+}
+
+void BytecodeAssembler::invokevirtual(Symbol* klss, Symbol* name, Symbol* sig) {
+  u2 methodref_index = _cp->methodref(klss, name, sig);
+  _code->append(Bytecodes::_invokevirtual);
+  append(methodref_index);
+}
+
+void BytecodeAssembler::ireturn() {
+  _code->append(Bytecodes::_ireturn);
+}
+
+void BytecodeAssembler::lreturn() {
+  _code->append(Bytecodes::_lreturn);
+}
+
+void BytecodeAssembler::freturn() {
+  _code->append(Bytecodes::_freturn);
+}
+
+void BytecodeAssembler::dreturn() {
+  _code->append(Bytecodes::_dreturn);
+}
+
+void BytecodeAssembler::areturn() {
+  _code->append(Bytecodes::_areturn);
+}
+
+void BytecodeAssembler::_return() {
+  _code->append(Bytecodes::_return);
+}
+
+void BytecodeAssembler::_return(BasicType bt) {
+  switch (bt) {
+    case T_BOOLEAN:
+    case T_CHAR:
+    case T_BYTE:
+    case T_SHORT:
+    case T_INT:     ireturn(); break;
+    case T_FLOAT:   freturn(); break;
+    case T_DOUBLE:  dreturn(); break;
+    case T_LONG:    lreturn(); break;
+    case T_OBJECT:
+    case T_ARRAY:   areturn(); break;
+    case T_VOID:    _return(); break;
+    default:
+      ShouldNotReachHere();
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,214 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_BYTECODEASSEMBLER_HPP
+#define SHARE_VM_CLASSFILE_BYTECODEASSEMBLER_HPP
+
+#include "memory/allocation.hpp"
+#include "oops/method.hpp"
+#include "oops/symbol.hpp"
+#include "utilities/globalDefinitions.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/resourceHash.hpp"
+
+
+/**
+ * Bytecode Assembler
+ *
+ * These classes are used to synthesize code for creating new methods from
+ * within the VM.  This is only a partial implementation of an assembler;
+ * only the bytecodes that are needed by clients are implemented at this time.
+ * This is used during default method analysis to create overpass methods
+ * and add them to a call during parsing.  Other uses (such as creating
+ * bridges) may come later.  Any missing bytecodes can be implemented on an
+ * as-need basis.
+ */
+
+class BytecodeBuffer : public GrowableArray<u1> {
+ public:
+  BytecodeBuffer() : GrowableArray<u1>(20) {}
+};
+
+// Entries in a yet-to-be-created constant pool.  Limited types for now.
+class BytecodeCPEntry VALUE_OBJ_CLASS_SPEC {
+ public:
+  enum tag {
+    ERROR_TAG,
+    UTF8,
+    KLASS,
+    STRING,
+    NAME_AND_TYPE,
+    METHODREF
+  };
+
+  u1 _tag;
+  union {
+    Symbol* utf8;
+    u2 klass;
+    u2 string;
+    struct {
+      u2 name_index;
+      u2 type_index;
+    } name_and_type;
+    struct {
+      u2 class_index;
+      u2 name_and_type_index;
+    } methodref;
+    uintptr_t hash;
+  } _u;
+
+  BytecodeCPEntry() : _tag(ERROR_TAG) { _u.hash = 0; }
+  BytecodeCPEntry(u1 tag) : _tag(tag) { _u.hash = 0; }
+
+  static BytecodeCPEntry utf8(Symbol* symbol) {
+    BytecodeCPEntry bcpe(UTF8);
+    bcpe._u.utf8 = symbol;
+    return bcpe;
+  }
+
+  static BytecodeCPEntry klass(u2 index) {
+    BytecodeCPEntry bcpe(KLASS);
+    bcpe._u.klass = index;
+    return bcpe;
+  }
+
+  static BytecodeCPEntry string(u2 index) {
+    BytecodeCPEntry bcpe(STRING);
+    bcpe._u.string = index;
+    return bcpe;
+  }
+
+  static BytecodeCPEntry name_and_type(u2 name, u2 type) {
+    BytecodeCPEntry bcpe(NAME_AND_TYPE);
+    bcpe._u.name_and_type.name_index = name;
+    bcpe._u.name_and_type.type_index = type;
+    return bcpe;
+  }
+
+  static BytecodeCPEntry methodref(u2 class_index, u2 nat) {
+    BytecodeCPEntry bcpe(METHODREF);
+    bcpe._u.methodref.class_index = class_index;
+    bcpe._u.methodref.name_and_type_index = nat;
+    return bcpe;
+  }
+
+  static bool equals(BytecodeCPEntry const& e0, BytecodeCPEntry const& e1) {
+    return e0._tag == e1._tag && e0._u.hash == e1._u.hash;
+  }
+
+  static unsigned hash(BytecodeCPEntry const& e0) {
+    return (unsigned)(e0._tag ^ e0._u.hash);
+  }
+};
+
+class BytecodeConstantPool : ResourceObj {
+ private:
+  typedef ResourceHashtable<BytecodeCPEntry, u2,
+      &BytecodeCPEntry::hash, &BytecodeCPEntry::equals> IndexHash;
+
+  ConstantPool* _orig;
+  GrowableArray<BytecodeCPEntry> _entries;
+  IndexHash _indices;
+
+  u2 find_or_add(BytecodeCPEntry const& bcpe);
+
+ public:
+
+  BytecodeConstantPool(ConstantPool* orig) : _orig(orig) {}
+
+  BytecodeCPEntry const& at(u2 index) const { return _entries.at(index); }
+
+  InstanceKlass* pool_holder() const {
+    return InstanceKlass::cast(_orig->pool_holder());
+  }
+
+  u2 utf8(Symbol* sym) {
+    return find_or_add(BytecodeCPEntry::utf8(sym));
+  }
+
+  u2 klass(Symbol* class_name) {
+    return find_or_add(BytecodeCPEntry::klass(utf8(class_name)));
+  }
+
+  u2 string(Symbol* str) {
+    return find_or_add(BytecodeCPEntry::string(utf8(str)));
+  }
+
+  u2 name_and_type(Symbol* name, Symbol* sig) {
+    return find_or_add(BytecodeCPEntry::name_and_type(utf8(name), utf8(sig)));
+  }
+
+  u2 methodref(Symbol* class_name, Symbol* name, Symbol* sig) {
+    return find_or_add(BytecodeCPEntry::methodref(
+        klass(class_name), name_and_type(name, sig)));
+  }
+
+  ConstantPool* create_constant_pool(TRAPS) const;
+};
+
+// Partial bytecode assembler - only what we need for creating
+// overpass methods for default methods is implemented
+class BytecodeAssembler : StackObj {
+ private:
+  BytecodeBuffer* _code;
+  BytecodeConstantPool* _cp;
+
+  void append(u1 imm_u1);
+  void append(u2 imm_u2);
+  void append(u4 imm_u4);
+
+  void xload(u4 index, u1 quick, u1 twobyte);
+
+ public:
+  BytecodeAssembler(BytecodeBuffer* buffer, BytecodeConstantPool* cp)
+    : _code(buffer), _cp(cp) {}
+
+  void aload(u4 index);
+  void areturn();
+  void athrow();
+  void checkcast(Symbol* sym);
+  void dload(u4 index);
+  void dreturn();
+  void dup();
+  void fload(u4 index);
+  void freturn();
+  void iload(u4 index);
+  void invokespecial(Method* method);
+  void invokespecial(Symbol* cls, Symbol* name, Symbol* sig);
+  void invokevirtual(Method* method);
+  void invokevirtual(Symbol* cls, Symbol* name, Symbol* sig);
+  void ireturn();
+  void ldc(u1 index);
+  void ldc_w(u2 index);
+  void lload(u4 index);
+  void lreturn();
+  void _new(Symbol* sym);
+  void _return();
+
+  void load_string(Symbol* sym);
+  void load(BasicType bt, u4 index);
+  void _return(BasicType bt);
+};
+
+#endif // SHARE_VM_CLASSFILE_BYTECODEASSEMBLER_HPP
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -27,6 +27,8 @@
 #include "classfile/classLoader.hpp"
 #include "classfile/classLoaderData.hpp"
 #include "classfile/classLoaderData.inline.hpp"
+#include "classfile/defaultMethods.hpp"
+#include "classfile/genericSignatures.hpp"
 #include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
@@ -84,6 +86,9 @@
 // - to check NameAndType_info signatures more aggressively
 #define JAVA_7_VERSION                    51
 
+// Extension method support.
+#define JAVA_8_VERSION                    52
+
 
 void ClassFileParser::parse_constant_pool_entries(ClassLoaderData* loader_data, constantPoolHandle cp, int length, TRAPS) {
   // Use a local copy of ClassFileStream. It helps the C++ compiler to optimize
@@ -785,6 +790,7 @@
                                                  ClassLoaderData* loader_data,
                                                  Handle protection_domain,
                                                  Symbol* class_name,
+                                                 bool* has_default_methods,
                                                  TRAPS) {
   ClassFileStream* cfs = stream();
   assert(length > 0, "only called for length>0");
@@ -821,6 +827,9 @@
     if (!Klass::cast(interf())->is_interface()) {
       THROW_MSG_(vmSymbols::java_lang_IncompatibleClassChangeError(), "Implementing class", NULL);
     }
+    if (InstanceKlass::cast(interf())->has_default_methods()) {
+      *has_default_methods = true;
+    }
     interfaces->at_put(index, interf());
   }
 
@@ -1928,7 +1937,8 @@
     if (method_attribute_name == vmSymbols::tag_code()) {
       // Parse Code attribute
       if (_need_verify) {
-        guarantee_property(!access_flags.is_native() && !access_flags.is_abstract(),
+        guarantee_property(
+            !access_flags.is_native() && !access_flags.is_abstract(),
                         "Code attribute in native or abstract methods in class file %s",
                          CHECK_(nullHandle));
       }
@@ -2125,7 +2135,9 @@
         runtime_visible_annotations_length = method_attribute_length;
         runtime_visible_annotations = cfs->get_u1_buffer();
         assert(runtime_visible_annotations != NULL, "null visible annotations");
-        parse_annotations(runtime_visible_annotations, runtime_visible_annotations_length, cp, &parsed_annotations, CHECK_(nullHandle));
+        parse_annotations(runtime_visible_annotations,
+            runtime_visible_annotations_length, cp, &parsed_annotations,
+            CHECK_(nullHandle));
         cfs->skip_u1(runtime_visible_annotations_length, CHECK_(nullHandle));
       } else if (PreserveAllAnnotations && method_attribute_name == vmSymbols::tag_runtime_invisible_annotations()) {
         runtime_invisible_annotations_length = method_attribute_length;
@@ -2169,12 +2181,10 @@
   }
 
   // All sizing information for a Method* is finally available, now create it
-  Method* m = Method::allocate(loader_data, code_length, access_flags,
-                               linenumber_table_length,
-                               total_lvt_length,
-                               exception_table_length,
-                               checked_exceptions_length,
-                               CHECK_(nullHandle));
+  Method* m = Method::allocate(
+      loader_data, code_length, access_flags, linenumber_table_length,
+      total_lvt_length, exception_table_length, checked_exceptions_length,
+      ConstMethod::NORMAL, CHECK_(nullHandle));
 
   ClassLoadingService::add_class_method_size(m->size()*HeapWordSize);
 
@@ -2204,7 +2214,6 @@
   // Fill in code attribute information
   m->set_max_stack(max_stack);
   m->set_max_locals(max_locals);
-
   m->constMethod()->set_stackmap_data(stackmap_data);
 
   // Copy byte codes
@@ -2356,6 +2365,7 @@
                                                Array<AnnotationArray*>** methods_annotations,
                                                Array<AnnotationArray*>** methods_parameter_annotations,
                                                Array<AnnotationArray*>** methods_default_annotations,
+                                               bool* has_default_methods,
                                                TRAPS) {
   ClassFileStream* cfs = stream();
   AnnotationArray* method_annotations = NULL;
@@ -2382,6 +2392,10 @@
       if (method->is_final()) {
         *has_final_method = true;
       }
+      if (is_interface && !method->is_abstract() && !method->is_static()) {
+        // default method
+        *has_default_methods = true;
+      }
       methods->at_put(index, method());
       if (*methods_annotations == NULL) {
         *methods_annotations =
@@ -2907,6 +2921,34 @@
 }
 
 
+#ifndef PRODUCT
+static void parseAndPrintGenericSignatures(
+    instanceKlassHandle this_klass, TRAPS) {
+  assert(ParseAllGenericSignatures == true, "Shouldn't call otherwise");
+  ResourceMark rm;
+
+  if (this_klass->generic_signature() != NULL) {
+    using namespace generic;
+    ClassDescriptor* spec = ClassDescriptor::parse_generic_signature(this_klass(), CHECK);
+
+    tty->print_cr("Parsing %s", this_klass->generic_signature()->as_C_string());
+    spec->print_on(tty);
+
+    for (int i = 0; i < this_klass->methods()->length(); ++i) {
+      Method* m = this_klass->methods()->at(i);
+      MethodDescriptor* method_spec = MethodDescriptor::parse_generic_signature(m, spec);
+      Symbol* sig = m->generic_signature();
+      if (sig == NULL) {
+        sig = m->signature();
+      }
+      tty->print_cr("Parsing %s", sig->as_C_string());
+      method_spec->print_on(tty);
+    }
+  }
+}
+#endif // ndef PRODUCT
+
+
 instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name,
                                                     Handle class_loader,
                                                     Handle protection_domain,
@@ -2923,6 +2965,8 @@
   unsigned char *cached_class_file_bytes = NULL;
   jint cached_class_file_length;
   ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
+  bool has_default_methods = false;
+  ResourceMark rm(THREAD);
 
   ClassFileStream* cfs = stream();
   // Timing
@@ -3138,7 +3182,9 @@
     if (itfs_len == 0) {
       local_interfaces = Universe::the_empty_klass_array();
     } else {
-      local_interfaces = parse_interfaces(cp, itfs_len, loader_data, protection_domain, _class_name, CHECK_(nullHandle));
+      local_interfaces = parse_interfaces(
+          cp, itfs_len, loader_data, protection_domain, _class_name,
+          &has_default_methods, CHECK_(nullHandle));
     }
 
     u2 java_fields_count = 0;
@@ -3164,6 +3210,7 @@
                                             &methods_annotations,
                                             &methods_parameter_annotations,
                                             &methods_default_annotations,
+                                            &has_default_methods,
                                             CHECK_(nullHandle));
 
     // Additional attributes
@@ -3193,6 +3240,11 @@
       super_klass = instanceKlassHandle(THREAD, kh());
     }
     if (super_klass.not_null()) {
+
+      if (super_klass->has_default_methods()) {
+        has_default_methods = true;
+      }
+
       if (super_klass->is_interface()) {
         ResourceMark rm(THREAD);
         Exceptions::fthrow(
@@ -3229,14 +3281,11 @@
     int itable_size = 0;
     int num_miranda_methods = 0;
 
-    klassVtable::compute_vtable_size_and_num_mirandas(vtable_size,
-                                                      num_miranda_methods,
-                                                      super_klass(),
-                                                      methods,
-                                                      access_flags,
-                                                      class_loader,
-                                                      class_name,
-                                                      local_interfaces,
+    GrowableArray<Method*> all_mirandas(20);
+
+    klassVtable::compute_vtable_size_and_num_mirandas(
+        &vtable_size, &num_miranda_methods, &all_mirandas, super_klass(), methods,
+        access_flags, class_loader, class_name, local_interfaces,
                                                       CHECK_(nullHandle));
 
     // Size of Java itable (in words)
@@ -3656,6 +3705,7 @@
 
     this_klass->set_minor_version(minor_version);
     this_klass->set_major_version(major_version);
+    this_klass->set_has_default_methods(has_default_methods);
 
     // Set up Method*::intrinsic_id as soon as we know the names of methods.
     // (We used to do this lazily, but now we query it in Rewriter,
@@ -3673,6 +3723,16 @@
                                         cached_class_file_length);
     }
 
+    // Fill in field values obtained by parse_classfile_attributes
+    if (parsed_annotations.has_any_annotations())
+      parsed_annotations.apply_to(this_klass);
+    // Create annotations
+    if (_annotations != NULL && this_klass->annotations() == NULL) {
+      Annotations* anno = Annotations::allocate(loader_data, CHECK_NULL);
+      this_klass->set_annotations(anno);
+    }
+    apply_parsed_class_attributes(this_klass);
+
     // Miranda methods
     if ((num_miranda_methods > 0) ||
         // if this class introduced new miranda methods or
@@ -3682,18 +3742,6 @@
       this_klass->set_has_miranda_methods(); // then set a flag
     }
 
-    // Fill in field values obtained by parse_classfile_attributes
-    if (parsed_annotations.has_any_annotations()) {
-      parsed_annotations.apply_to(this_klass);
-    }
-    // Create annotations
-    if (_annotations != NULL && this_klass->annotations() == NULL) {
-      Annotations* anno = Annotations::allocate(loader_data, CHECK_NULL);
-      this_klass->set_annotations(anno);
-    }
-    apply_parsed_class_attributes(this_klass);
-
-    // Compute transitive closure of interfaces this class implements
     this_klass->set_transitive_interfaces(transitive_interfaces);
 
     // Fill in information needed to compute superclasses.
@@ -3702,6 +3750,7 @@
     // Initialize itable offset tables
     klassItable::setup_itable_offset_table(this_klass);
 
+    // Compute transitive closure of interfaces this class implements
     // Do final class setup
     fill_oop_maps(this_klass, nonstatic_oop_map_count, nonstatic_oop_offsets, nonstatic_oop_counts);
 
@@ -3726,6 +3775,21 @@
       check_illegal_static_method(this_klass, CHECK_(nullHandle));
     }
 
+
+#ifdef ASSERT
+    if (ParseAllGenericSignatures) {
+      parseAndPrintGenericSignatures(this_klass, CHECK_(nullHandle));
+    }
+#endif
+
+    // Generate any default methods - default methods are interface methods
+    // that have a default implementation.  This is new with Lambda project.
+    if (has_default_methods && !access_flags.is_interface() &&
+        local_interfaces->length() > 0) {
+      DefaultMethods::generate_default_methods(
+          this_klass(), &all_mirandas, CHECK_(nullHandle));
+    }
+
     // Allocate mirror and initialize static fields
     java_lang_Class::create_mirror(this_klass, CHECK_(nullHandle));
 
@@ -3744,6 +3808,7 @@
                                              false /* not shared class */);
 
     if (TraceClassLoading) {
+      ResourceMark rm;
       // print in a single call to reduce interleaving of output
       if (cfs->source() != NULL) {
         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
@@ -3758,13 +3823,13 @@
           tty->print("[Loaded %s]\n", this_klass->external_name());
         }
       } else {
-        ResourceMark rm;
         tty->print("[Loaded %s from %s]\n", this_klass->external_name(),
                    InstanceKlass::cast(class_loader->klass())->external_name());
       }
     }
 
     if (TraceClassResolution) {
+      ResourceMark rm;
       // print out the superclass.
       const char * from = Klass::cast(this_klass())->external_name();
       if (this_klass->java_super() != NULL) {
@@ -3785,6 +3850,7 @@
 
 #ifndef PRODUCT
     if( PrintCompactFieldsSavings ) {
+      ResourceMark rm;
       if( nonstatic_field_size < orig_nonstatic_field_size ) {
         tty->print("[Saved %d of %d bytes in %s]\n",
                  (orig_nonstatic_field_size - nonstatic_field_size)*heapOopSize,
@@ -3811,7 +3877,6 @@
   return this_klass;
 }
 
-
 unsigned int
 ClassFileParser::compute_oop_map_count(instanceKlassHandle super,
                                        unsigned int nonstatic_oop_map_count,
@@ -4128,7 +4193,7 @@
           }
 
           // continue to look from super_m's holder's super.
-          k = InstanceKlass::cast(super_m->method_holder())->super();
+          k = super_m->method_holder()->super();
           continue;
         }
 
@@ -4263,13 +4328,16 @@
   const bool is_strict       = (flags & JVM_ACC_STRICT)       != 0;
   const bool is_synchronized = (flags & JVM_ACC_SYNCHRONIZED) != 0;
   const bool major_gte_15    = _major_version >= JAVA_1_5_VERSION;
+  const bool major_gte_8     = _major_version >= JAVA_8_VERSION;
   const bool is_initializer  = (name == vmSymbols::object_initializer_name());
 
   bool is_illegal = false;
 
   if (is_interface) {
-    if (!is_abstract || !is_public || is_static || is_final ||
-        is_native || (major_gte_15 && (is_synchronized || is_strict))) {
+    if (!is_public || is_static || is_final || is_native ||
+        ((is_synchronized || is_strict) && major_gte_15 &&
+            (!major_gte_8 || is_abstract)) ||
+        (!major_gte_8 && !is_abstract)) {
       is_illegal = true;
     }
   } else { // not interface
--- a/hotspot/src/share/vm/classfile/classFileParser.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/classFileParser.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -151,6 +151,7 @@
                                   ClassLoaderData* loader_data,
                                   Handle protection_domain,
                                   Symbol* class_name,
+                                  bool* has_default_methods,
                                   TRAPS);
   void record_defined_class_dependencies(instanceKlassHandle defined_klass, TRAPS);
 
@@ -188,6 +189,7 @@
                                 Array<AnnotationArray*>** methods_annotations,
                                 Array<AnnotationArray*>** methods_parameter_annotations,
                                 Array<AnnotationArray*>** methods_default_annotations,
+                                bool* has_default_method,
                                 TRAPS);
   Array<int>* sort_methods(ClassLoaderData* loader_data,
                            Array<Method*>* methods,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,1387 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+#include "classfile/bytecodeAssembler.hpp"
+#include "classfile/defaultMethods.hpp"
+#include "classfile/genericSignatures.hpp"
+#include "classfile/symbolTable.hpp"
+#include "memory/allocation.hpp"
+#include "memory/metadataFactory.hpp"
+#include "memory/resourceArea.hpp"
+#include "runtime/signature.hpp"
+#include "runtime/thread.hpp"
+#include "oops/instanceKlass.hpp"
+#include "oops/klass.hpp"
+#include "oops/method.hpp"
+#include "utilities/accessFlags.hpp"
+#include "utilities/exceptions.hpp"
+#include "utilities/ostream.hpp"
+#include "utilities/pair.hpp"
+#include "utilities/resourceHash.hpp"
+
+typedef enum { QUALIFIED, DISQUALIFIED } QualifiedState;
+
+// Because we use an iterative algorithm when iterating over the type
+// hierarchy, we can't use traditional scoped objects which automatically do
+// cleanup in the destructor when the scope is exited.  PseudoScope (and
+// PseudoScopeMark) provides a similar functionality, but for when you want a
+// scoped object in non-stack memory (such as in resource memory, as we do
+// here).  You've just got to remember to call 'destroy()' on the scope when
+// leaving it (and marks have to be explicitly added).
+class PseudoScopeMark : public ResourceObj {
+ public:
+  virtual void destroy() = 0;
+};
+
+class PseudoScope : public ResourceObj {
+ private:
+  GrowableArray<PseudoScopeMark*> _marks;
+ public:
+
+  static PseudoScope* cast(void* data) {
+    return static_cast<PseudoScope*>(data);
+  }
+
+  void add_mark(PseudoScopeMark* psm) {
+   _marks.append(psm);
+  }
+
+  void destroy() {
+    for (int i = 0; i < _marks.length(); ++i) {
+      _marks.at(i)->destroy();
+    }
+  }
+};
+
+class ContextMark : public PseudoScopeMark {
+ private:
+  generic::Context::Mark _mark;
+ public:
+  ContextMark(const generic::Context::Mark& cm) : _mark(cm) {}
+  virtual void destroy() { _mark.destroy(); }
+};
+
+#ifndef PRODUCT
+static void print_slot(outputStream* str, Symbol* name, Symbol* signature) {
+  ResourceMark rm;
+  str->print("%s%s", name->as_C_string(), signature->as_C_string());
+}
+
+static void print_method(outputStream* str, Method* mo, bool with_class=true) {
+  ResourceMark rm;
+  if (with_class) {
+    str->print("%s.", mo->klass_name()->as_C_string());
+  }
+  print_slot(str, mo->name(), mo->signature());
+}
+#endif // ndef PRODUCT
+
+/**
+ * Perform a depth-first iteration over the class hierarchy, applying
+ * algorithmic logic as it goes.
+ *
+ * This class is one half of the inheritance hierarchy analysis mechanism.
+ * It is meant to be used in conjunction with another class, the algorithm,
+ * which is indicated by the ALGO template parameter.  This class can be
+ * paired with any algorithm class that provides the required methods.
+ *
+ * This class contains all the mechanics for iterating over the class hierarchy
+ * starting at a particular root, without recursing (thus limiting stack growth
+ * from this point).  It visits each superclass (if present) and superinterface
+ * in a depth-first manner, with callbacks to the ALGO class as each class is
+ * encountered (visit()), The algorithm can cut-off further exploration of a
+ * particular branch by returning 'false' from a visit() call.
+ *
+ * The ALGO class, must provide a visit() method, which each of which will be
+ * called once for each node in the inheritance tree during the iteration.  In
+ * addition, it can provide a memory block via new_node_data(InstanceKlass*),
+ * which it can use for node-specific storage (and access via the
+ * current_data() and data_at_depth(int) methods).
+ *
+ * Bare minimum needed to be an ALGO class:
+ * class Algo : public HierarchyVisitor<Algo> {
+ *   void* new_node_data(InstanceKlass* cls) { return NULL; }
+ *   void free_node_data(void* data) { return; }
+ *   bool visit() { return true; }
+ * };
+ */
+template <class ALGO>
+class HierarchyVisitor : StackObj {
+ private:
+
+  class Node : public ResourceObj {
+   public:
+    InstanceKlass* _class;
+    bool _super_was_visited;
+    int _interface_index;
+    void* _algorithm_data;
+
+    Node(InstanceKlass* cls, void* data, bool visit_super)
+        : _class(cls), _super_was_visited(!visit_super),
+          _interface_index(0), _algorithm_data(data) {}
+
+    int number_of_interfaces() { return _class->local_interfaces()->length(); }
+    int interface_index() { return _interface_index; }
+    void set_super_visited() { _super_was_visited = true; }
+    void increment_visited_interface() { ++_interface_index; }
+    void set_all_interfaces_visited() {
+      _interface_index = number_of_interfaces();
+    }
+    bool has_visited_super() { return _super_was_visited; }
+    bool has_visited_all_interfaces() {
+      return interface_index() >= number_of_interfaces();
+    }
+    InstanceKlass* interface_at(int index) {
+      return InstanceKlass::cast(_class->local_interfaces()->at(index));
+    }
+    InstanceKlass* next_super() { return _class->java_super(); }
+    InstanceKlass* next_interface() {
+      return interface_at(interface_index());
+    }
+  };
+
+  bool _cancelled;
+  GrowableArray<Node*> _path;
+
+  Node* current_top() const { return _path.top(); }
+  bool has_more_nodes() const { return !_path.is_empty(); }
+  void push(InstanceKlass* cls, void* data) {
+    assert(cls != NULL, "Requires a valid instance class");
+    Node* node = new Node(cls, data, has_super(cls));
+    _path.push(node);
+  }
+  void pop() { _path.pop(); }
+
+  void reset_iteration() {
+    _cancelled = false;
+    _path.clear();
+  }
+  bool is_cancelled() const { return _cancelled; }
+
+  static bool has_super(InstanceKlass* cls) {
+    return cls->super() != NULL && !cls->is_interface();
+  }
+
+  Node* node_at_depth(int i) const {
+    return (i >= _path.length()) ? NULL : _path.at(_path.length() - i - 1);
+  }
+
+ protected:
+
+  // Accessors available to the algorithm
+  int current_depth() const { return _path.length() - 1; }
+
+  InstanceKlass* class_at_depth(int i) {
+    Node* n = node_at_depth(i);
+    return n == NULL ? NULL : n->_class;
+  }
+  InstanceKlass* current_class() { return class_at_depth(0); }
+
+  void* data_at_depth(int i) {
+    Node* n = node_at_depth(i);
+    return n == NULL ? NULL : n->_algorithm_data;
+  }
+  void* current_data() { return data_at_depth(0); }
+
+  void cancel_iteration() { _cancelled = true; }
+
+ public:
+
+  void run(InstanceKlass* root) {
+    ALGO* algo = static_cast<ALGO*>(this);
+
+    reset_iteration();
+
+    void* algo_data = algo->new_node_data(root);
+    push(root, algo_data);
+    bool top_needs_visit = true;
+
+    do {
+      Node* top = current_top();
+      if (top_needs_visit) {
+        if (algo->visit() == false) {
+          // algorithm does not want to continue along this path.  Arrange
+          // it so that this state is immediately popped off the stack
+          top->set_super_visited();
+          top->set_all_interfaces_visited();
+        }
+        top_needs_visit = false;
+      }
+
+      if (top->has_visited_super() && top->has_visited_all_interfaces()) {
+        algo->free_node_data(top->_algorithm_data);
+        pop();
+      } else {
+        InstanceKlass* next = NULL;
+        if (top->has_visited_super() == false) {
+          next = top->next_super();
+          top->set_super_visited();
+        } else {
+          next = top->next_interface();
+          top->increment_visited_interface();
+        }
+        assert(next != NULL, "Otherwise we shouldn't be here");
+        algo_data = algo->new_node_data(next);
+        push(next, algo_data);
+        top_needs_visit = true;
+      }
+    } while (!is_cancelled() && has_more_nodes());
+  }
+};
+
+#ifndef PRODUCT
+class PrintHierarchy : public HierarchyVisitor<PrintHierarchy> {
+ public:
+
+  bool visit() {
+    InstanceKlass* cls = current_class();
+    streamIndentor si(tty, current_depth() * 2);
+    tty->indent().print_cr("%s", cls->name()->as_C_string());
+    return true;
+  }
+
+  void* new_node_data(InstanceKlass* cls) { return NULL; }
+  void free_node_data(void* data) { return; }
+};
+#endif // ndef PRODUCT
+
+// Used to register InstanceKlass objects and all related metadata structures
+// (Methods, ConstantPools) as "in-use" by the current thread so that they can't
+// be deallocated by class redefinition while we're using them.  The classes are
+// de-registered when this goes out of scope.
+//
+// Once a class is registered, we need not bother with methodHandles or
+// constantPoolHandles for it's associated metadata.
+class KeepAliveRegistrar : public StackObj {
+ private:
+  Thread* _thread;
+  GrowableArray<ConstantPool*> _keep_alive;
+
+ public:
+  KeepAliveRegistrar(Thread* thread) : _thread(thread), _keep_alive(20) {
+    assert(thread == Thread::current(), "Must be current thread");
+  }
+
+  ~KeepAliveRegistrar() {
+    for (int i = _keep_alive.length() - 1; i >= 0; --i) {
+      ConstantPool* cp = _keep_alive.at(i);
+      int idx = _thread->metadata_handles()->find_from_end(cp);
+      assert(idx > 0, "Must be in the list");
+      _thread->metadata_handles()->remove_at(idx);
+    }
+  }
+
+  // Register a class as 'in-use' by the thread.  It's fine to register a class
+  // multiple times (though perhaps inefficient)
+  void register_class(InstanceKlass* ik) {
+    ConstantPool* cp = ik->constants();
+    _keep_alive.push(cp);
+    _thread->metadata_handles()->push(cp);
+  }
+};
+
+class KeepAliveVisitor : public HierarchyVisitor<KeepAliveVisitor> {
+ private:
+  KeepAliveRegistrar* _registrar;
+
+ public:
+  KeepAliveVisitor(KeepAliveRegistrar* registrar) : _registrar(registrar) {}
+
+  void* new_node_data(InstanceKlass* cls) { return NULL; }
+  void free_node_data(void* data) { return; }
+
+  bool visit() {
+    _registrar->register_class(current_class());
+    return true;
+  }
+};
+
+// A method family contains a set of all methods that implement a single
+// language-level method.  Because of erasure, these methods may have different
+// signatures.  As members of the set are collected while walking over the
+// hierarchy, they are tagged with a qualification state.  The qualification
+// state for an erased method is set to disqualified if there exists a path
+// from the root of hierarchy to the method that contains an interleaving
+// language-equivalent method defined in an interface.
+class MethodFamily : public ResourceObj {
+ private:
+
+  generic::MethodDescriptor* _descriptor; // language-level description
+  GrowableArray<Pair<Method*,QualifiedState> > _members;
+  ResourceHashtable<Method*, int> _member_index;
+
+  Method* _selected_target;  // Filled in later, if a unique target exists
+  Symbol* _exception_message; // If no unique target is found
+
+  bool contains_method(Method* method) {
+    int* lookup = _member_index.get(method);
+    return lookup != NULL;
+  }
+
+  void add_method(Method* method, QualifiedState state) {
+    Pair<Method*,QualifiedState> entry(method, state);
+    _member_index.put(method, _members.length());
+    _members.append(entry);
+  }
+
+  void disqualify_method(Method* method) {
+    int* index = _member_index.get(method);
+    assert(index != NULL && *index >= 0 && *index < _members.length(), "bad index");
+    _members.at(*index).second = DISQUALIFIED;
+  }
+
+  Symbol* generate_no_defaults_message(TRAPS) const;
+  Symbol* generate_abstract_method_message(Method* method, TRAPS) const;
+  Symbol* generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const;
+
+ public:
+
+  MethodFamily(generic::MethodDescriptor* canonical_desc)
+      : _descriptor(canonical_desc), _selected_target(NULL),
+        _exception_message(NULL) {}
+
+  generic::MethodDescriptor* descriptor() const { return _descriptor; }
+
+  bool descriptor_matches(generic::MethodDescriptor* md, generic::Context* ctx) {
+    return descriptor()->covariant_match(md, ctx);
+  }
+
+  void set_target_if_empty(Method* m) {
+    if (_selected_target == NULL && !m->is_overpass()) {
+      _selected_target = m;
+    }
+  }
+
+  void record_qualified_method(Method* m) {
+    // If the method already exists in the set as qualified, this operation is
+    // redundant.  If it already exists as disqualified, then we leave it as
+    // disqualfied.  Thus we only add to the set if it's not already in the
+    // set.
+    if (!contains_method(m)) {
+      add_method(m, QUALIFIED);
+    }
+  }
+
+  void record_disqualified_method(Method* m) {
+    // If not in the set, add it as disqualified.  If it's already in the set,
+    // then set the state to disqualified no matter what the previous state was.
+    if (!contains_method(m)) {
+      add_method(m, DISQUALIFIED);
+    } else {
+      disqualify_method(m);
+    }
+  }
+
+  bool has_target() const { return _selected_target != NULL; }
+  bool throws_exception() { return _exception_message != NULL; }
+
+  Method* get_selected_target() { return _selected_target; }
+  Symbol* get_exception_message() { return _exception_message; }
+
+  // Either sets the target or the exception error message
+  void determine_target(InstanceKlass* root, TRAPS) {
+    if (has_target() || throws_exception()) {
+      return;
+    }
+
+    GrowableArray<Method*> qualified_methods;
+    for (int i = 0; i < _members.length(); ++i) {
+      Pair<Method*,QualifiedState> entry = _members.at(i);
+      if (entry.second == QUALIFIED) {
+        qualified_methods.append(entry.first);
+      }
+    }
+
+    if (qualified_methods.length() == 0) {
+      _exception_message = generate_no_defaults_message(CHECK);
+    } else if (qualified_methods.length() == 1) {
+      Method* method = qualified_methods.at(0);
+      if (method->is_abstract()) {
+        _exception_message = generate_abstract_method_message(method, CHECK);
+      } else {
+        _selected_target = qualified_methods.at(0);
+      }
+    } else {
+      _exception_message = generate_conflicts_message(&qualified_methods,CHECK);
+    }
+
+    assert((has_target() ^ throws_exception()) == 1,
+           "One and only one must be true");
+  }
+
+  bool contains_signature(Symbol* query) {
+    for (int i = 0; i < _members.length(); ++i) {
+      if (query == _members.at(i).first->signature()) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const {
+    print_on(str, 0);
+  }
+
+  void print_on(outputStream* str, int indent) const {
+    streamIndentor si(str, indent * 2);
+
+    generic::Context ctx(NULL); // empty, as _descriptor already canonicalized
+    TempNewSymbol family = descriptor()->reify_signature(&ctx, Thread::current());
+    str->indent().print_cr("Logical Method %s:", family->as_C_string());
+
+    streamIndentor si2(str);
+    for (int i = 0; i < _members.length(); ++i) {
+      str->indent();
+      print_method(str, _members.at(i).first);
+      if (_members.at(i).second == DISQUALIFIED) {
+        str->print(" (disqualified)");
+      }
+      str->print_cr("");
+    }
+
+    if (_selected_target != NULL) {
+      print_selected(str, 1);
+    }
+  }
+
+  void print_selected(outputStream* str, int indent) const {
+    assert(has_target(), "Should be called otherwise");
+    streamIndentor si(str, indent * 2);
+    str->indent().print("Selected method: ");
+    print_method(str, _selected_target);
+    str->print_cr("");
+  }
+
+  void print_exception(outputStream* str, int indent) {
+    assert(throws_exception(), "Should be called otherwise");
+    streamIndentor si(str, indent * 2);
+    str->indent().print_cr("%s", _exception_message->as_C_string());
+  }
+#endif // ndef PRODUCT
+};
+
+Symbol* MethodFamily::generate_no_defaults_message(TRAPS) const {
+  return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL);
+}
+
+Symbol* MethodFamily::generate_abstract_method_message(Method* method, TRAPS) const {
+  Symbol* klass = method->klass_name();
+  Symbol* name = method->name();
+  Symbol* sig = method->signature();
+  stringStream ss;
+  ss.print("Method ");
+  ss.write((const char*)klass->bytes(), klass->utf8_length());
+  ss.print(".");
+  ss.write((const char*)name->bytes(), name->utf8_length());
+  ss.write((const char*)sig->bytes(), sig->utf8_length());
+  ss.print(" is abstract");
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
+}
+
+Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
+  stringStream ss;
+  ss.print("Conflicting default methods:");
+  for (int i = 0; i < methods->length(); ++i) {
+    Method* method = methods->at(i);
+    Symbol* klass = method->klass_name();
+    Symbol* name = method->name();
+    ss.print(" ");
+    ss.write((const char*)klass->bytes(), klass->utf8_length());
+    ss.print(".");
+    ss.write((const char*)name->bytes(), name->utf8_length());
+  }
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
+}
+
+class StateRestorer;
+
+// StatefulMethodFamily is a wrapper around MethodFamily that maintains the
+// qualification state during hierarchy visitation, and applies that state
+// when adding members to the MethodFamily.
+class StatefulMethodFamily : public ResourceObj {
+  friend class StateRestorer;
+ private:
+  MethodFamily* _method;
+  QualifiedState _qualification_state;
+
+  void set_qualification_state(QualifiedState state) {
+    _qualification_state = state;
+  }
+
+ public:
+  StatefulMethodFamily(generic::MethodDescriptor* md, generic::Context* ctx) {
+    _method = new MethodFamily(md->canonicalize(ctx));
+    _qualification_state = QUALIFIED;
+  }
+
+  void set_target_if_empty(Method* m) { _method->set_target_if_empty(m); }
+
+  MethodFamily* get_method_family() { return _method; }
+
+  bool descriptor_matches(generic::MethodDescriptor* md, generic::Context* ctx) {
+    return _method->descriptor_matches(md, ctx);
+  }
+
+  StateRestorer* record_method_and_dq_further(Method* mo);
+};
+
+class StateRestorer : public PseudoScopeMark {
+ private:
+  StatefulMethodFamily* _method;
+  QualifiedState _state_to_restore;
+ public:
+  StateRestorer(StatefulMethodFamily* dm, QualifiedState state)
+      : _method(dm), _state_to_restore(state) {}
+  ~StateRestorer() { destroy(); }
+  void restore_state() { _method->set_qualification_state(_state_to_restore); }
+  virtual void destroy() { restore_state(); }
+};
+
+StateRestorer* StatefulMethodFamily::record_method_and_dq_further(Method* mo) {
+  StateRestorer* mark = new StateRestorer(this, _qualification_state);
+  if (_qualification_state == QUALIFIED) {
+    _method->record_qualified_method(mo);
+  } else {
+    _method->record_disqualified_method(mo);
+  }
+  // Everything found "above"??? this method in the hierarchy walk is set to
+  // disqualified
+  set_qualification_state(DISQUALIFIED);
+  return mark;
+}
+
+class StatefulMethodFamilies : public ResourceObj {
+ private:
+  GrowableArray<StatefulMethodFamily*> _methods;
+
+ public:
+  StatefulMethodFamily* find_matching(
+      generic::MethodDescriptor* md, generic::Context* ctx) {
+    for (int i = 0; i < _methods.length(); ++i) {
+      StatefulMethodFamily* existing = _methods.at(i);
+      if (existing->descriptor_matches(md, ctx)) {
+        return existing;
+      }
+    }
+    return NULL;
+  }
+
+  StatefulMethodFamily* find_matching_or_create(
+      generic::MethodDescriptor* md, generic::Context* ctx) {
+    StatefulMethodFamily* method = find_matching(md, ctx);
+    if (method == NULL) {
+      method = new StatefulMethodFamily(md, ctx);
+      _methods.append(method);
+    }
+    return method;
+  }
+
+  void extract_families_into(GrowableArray<MethodFamily*>* array) {
+    for (int i = 0; i < _methods.length(); ++i) {
+      array->append(_methods.at(i)->get_method_family());
+    }
+  }
+};
+
+// Represents a location corresponding to a vtable slot for methods that
+// neither the class nor any of it's ancestors provide an implementaion.
+// Default methods may be present to fill this slot.
+class EmptyVtableSlot : public ResourceObj {
+ private:
+  Symbol* _name;
+  Symbol* _signature;
+  int _size_of_parameters;
+  MethodFamily* _binding;
+
+ public:
+  EmptyVtableSlot(Method* method)
+      : _name(method->name()), _signature(method->signature()),
+        _size_of_parameters(method->size_of_parameters()), _binding(NULL) {}
+
+  Symbol* name() const { return _name; }
+  Symbol* signature() const { return _signature; }
+  int size_of_parameters() const { return _size_of_parameters; }
+
+  void bind_family(MethodFamily* lm) { _binding = lm; }
+  bool is_bound() { return _binding != NULL; }
+  MethodFamily* get_binding() { return _binding; }
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const {
+    print_slot(str, name(), signature());
+  }
+#endif // ndef PRODUCT
+};
+
+static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
+    InstanceKlass* klass, GrowableArray<Method*>* mirandas, TRAPS) {
+
+  assert(klass != NULL, "Must be valid class");
+
+  GrowableArray<EmptyVtableSlot*>* slots = new GrowableArray<EmptyVtableSlot*>();
+
+  // All miranda methods are obvious candidates
+  for (int i = 0; i < mirandas->length(); ++i) {
+    EmptyVtableSlot* slot = new EmptyVtableSlot(mirandas->at(i));
+    slots->append(slot);
+  }
+
+  // Also any overpasses in our superclasses, that we haven't implemented.
+  // (can't use the vtable because it is not guaranteed to be initialized yet)
+  InstanceKlass* super = klass->java_super();
+  while (super != NULL) {
+    for (int i = 0; i < super->methods()->length(); ++i) {
+      Method* m = super->methods()->at(i);
+      if (m->is_overpass()) {
+        // m is a method that would have been a miranda if not for the
+        // default method processing that occurred on behalf of our superclass,
+        // so it's a method we want to re-examine in this new context.  That is,
+        // unless we have a real implementation of it in the current class.
+        Method* impl = klass->lookup_method(m->name(), m->signature());
+        if (impl == NULL || impl->is_overpass()) {
+          slots->append(new EmptyVtableSlot(m));
+        }
+      }
+    }
+    super = super->java_super();
+  }
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    tty->print_cr("Slots that need filling:");
+    streamIndentor si(tty);
+    for (int i = 0; i < slots->length(); ++i) {
+      tty->indent();
+      slots->at(i)->print_on(tty);
+      tty->print_cr("");
+    }
+  }
+#endif // ndef PRODUCT
+  return slots;
+}
+
+// Iterates over the type hierarchy looking for all methods with a specific
+// method name.  The result of this is a set of method families each of
+// which is populated with a set of methods that implement the same
+// language-level signature.
+class FindMethodsByName : public HierarchyVisitor<FindMethodsByName> {
+ private:
+  // Context data
+  Thread* THREAD;
+  generic::DescriptorCache* _cache;
+  Symbol* _method_name;
+  generic::Context* _ctx;
+  StatefulMethodFamilies _families;
+
+ public:
+
+  FindMethodsByName(generic::DescriptorCache* cache, Symbol* name,
+      generic::Context* ctx, Thread* thread) :
+    _cache(cache), _method_name(name), _ctx(ctx), THREAD(thread) {}
+
+  void get_discovered_families(GrowableArray<MethodFamily*>* methods) {
+    _families.extract_families_into(methods);
+  }
+
+  void* new_node_data(InstanceKlass* cls) { return new PseudoScope(); }
+  void free_node_data(void* node_data) {
+    PseudoScope::cast(node_data)->destroy();
+  }
+
+  bool visit() {
+    PseudoScope* scope = PseudoScope::cast(current_data());
+    InstanceKlass* klass = current_class();
+    InstanceKlass* sub = current_depth() > 0 ? class_at_depth(1) : NULL;
+
+    ContextMark* cm = new ContextMark(_ctx->mark());
+    scope->add_mark(cm); // will restore context when scope is freed
+
+    _ctx->apply_type_arguments(sub, klass, THREAD);
+
+    int start, end = 0;
+    start = klass->find_method_by_name(_method_name, &end);
+    if (start != -1) {
+      for (int i = start; i < end; ++i) {
+        Method* m = klass->methods()->at(i);
+        // This gets the method's parameter list with its generic type
+        // parameters resolved
+        generic::MethodDescriptor* md = _cache->descriptor_for(m, THREAD);
+
+        // Find all methods on this hierarchy that match this method
+        // (name, signature).   This class collects other families of this
+        // method name.
+        StatefulMethodFamily* family =
+            _families.find_matching_or_create(md, _ctx);
+
+        if (klass->is_interface()) {
+          // ???
+          StateRestorer* restorer = family->record_method_and_dq_further(m);
+          scope->add_mark(restorer);
+        } else {
+          // This is the rule that methods in classes "win" (bad word) over
+          // methods in interfaces.  This works because of single inheritance
+          family->set_target_if_empty(m);
+        }
+      }
+    }
+    return true;
+  }
+};
+
+#ifndef PRODUCT
+static void print_families(
+    GrowableArray<MethodFamily*>* methods, Symbol* match) {
+  streamIndentor si(tty, 4);
+  if (methods->length() == 0) {
+    tty->indent();
+    tty->print_cr("No Logical Method found");
+  }
+  for (int i = 0; i < methods->length(); ++i) {
+    tty->indent();
+    MethodFamily* lm = methods->at(i);
+    if (lm->contains_signature(match)) {
+      tty->print_cr("<Matching>");
+    } else {
+      tty->print_cr("<Non-Matching>");
+    }
+    lm->print_on(tty, 1);
+  }
+}
+#endif // ndef PRODUCT
+
+static void merge_in_new_methods(InstanceKlass* klass,
+    GrowableArray<Method*>* new_methods, TRAPS);
+static void create_overpasses(
+    GrowableArray<EmptyVtableSlot*>* slots, InstanceKlass* klass, TRAPS);
+
+// This is the guts of the default methods implementation.  This is called just
+// after the classfile has been parsed if some ancestor has default methods.
+//
+// First if finds any name/signature slots that need any implementation (either
+// because they are miranda or a superclass's implementation is an overpass
+// itself).  For each slot, iterate over the hierarchy, using generic signature
+// information to partition any methods that match the name into method families
+// where each family contains methods whose signatures are equivalent at the
+// language level (i.e., their reified parameters match and return values are
+// covariant). Check those sets to see if they contain a signature that matches
+// the slot we're looking at (if we're lucky, there might be other empty slots
+// that we can fill using the same analysis).
+//
+// For each slot filled, we generate an overpass method that either calls the
+// unique default method candidate using invokespecial, or throws an exception
+// (in the case of no default method candidates, or more than one valid
+// candidate).  These methods are then added to the class's method list.  If
+// the method set we're using contains methods (qualified or not) with a
+// different runtime signature than the method we're creating, then we have to
+// create bridges with those signatures too.
+void DefaultMethods::generate_default_methods(
+    InstanceKlass* klass, GrowableArray<Method*>* mirandas, TRAPS) {
+
+  // This resource mark is the bound for all memory allocation that takes
+  // place during default method processing.  After this goes out of scope,
+  // all (Resource) objects' memory will be reclaimed.  Be careful if adding an
+  // embedded resource mark under here as that memory can't be used outside
+  // whatever scope it's in.
+  ResourceMark rm(THREAD);
+
+  generic::DescriptorCache cache;
+
+  // Keep entire hierarchy alive for the duration of the computation
+  KeepAliveRegistrar keepAlive(THREAD);
+  KeepAliveVisitor loadKeepAlive(&keepAlive);
+  loadKeepAlive.run(klass);
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    ResourceMark rm;  // be careful with these!
+    tty->print_cr("Class %s requires default method processing",
+        klass->name()->as_klass_external_name());
+    PrintHierarchy printer;
+    printer.run(klass);
+  }
+#endif // ndef PRODUCT
+
+  GrowableArray<EmptyVtableSlot*>* empty_slots =
+      find_empty_vtable_slots(klass, mirandas, CHECK);
+
+  for (int i = 0; i < empty_slots->length(); ++i) {
+    EmptyVtableSlot* slot = empty_slots->at(i);
+#ifndef PRODUCT
+    if (TraceDefaultMethods) {
+      streamIndentor si(tty, 2);
+      tty->indent().print("Looking for default methods for slot ");
+      slot->print_on(tty);
+      tty->print_cr("");
+    }
+#endif // ndef PRODUCT
+    if (slot->is_bound()) {
+#ifndef PRODUCT
+      if (TraceDefaultMethods) {
+        streamIndentor si(tty, 4);
+        tty->indent().print_cr("Already bound to logical method:");
+        slot->get_binding()->print_on(tty, 1);
+      }
+#endif // ndef PRODUCT
+      continue; // covered by previous processing
+    }
+
+    generic::Context ctx(&cache);
+    FindMethodsByName visitor(&cache, slot->name(), &ctx, CHECK);
+    visitor.run(klass);
+
+    GrowableArray<MethodFamily*> discovered_families;
+    visitor.get_discovered_families(&discovered_families);
+
+#ifndef PRODUCT
+    if (TraceDefaultMethods) {
+      print_families(&discovered_families, slot->signature());
+    }
+#endif // ndef PRODUCT
+
+    // Find and populate any other slots that match the discovered families
+    for (int j = i; j < empty_slots->length(); ++j) {
+      EmptyVtableSlot* open_slot = empty_slots->at(j);
+
+      if (slot->name() == open_slot->name()) {
+        for (int k = 0; k < discovered_families.length(); ++k) {
+          MethodFamily* lm = discovered_families.at(k);
+
+          if (lm->contains_signature(open_slot->signature())) {
+            lm->determine_target(klass, CHECK);
+            open_slot->bind_family(lm);
+          }
+        }
+      }
+    }
+  }
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    tty->print_cr("Creating overpasses...");
+  }
+#endif // ndef PRODUCT
+
+  create_overpasses(empty_slots, klass, CHECK);
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    tty->print_cr("Default method processing complete");
+  }
+#endif // ndef PRODUCT
+}
+
+
+/**
+ * Generic analysis was used upon interface '_target' and found a unique
+ * default method candidate with generic signature '_method_desc'.  This
+ * method is only viable if it would also be in the set of default method
+ * candidates if we ran a full analysis on the current class.
+ *
+ * The only reason that the method would not be in the set of candidates for
+ * the current class is if that there's another covariantly matching method
+ * which is "more specific" than the found method -- i.e., one could find a
+ * path in the interface hierarchy in which the matching method appears
+ * before we get to '_target'.
+ *
+ * In order to determine this, we examine all of the implemented
+ * interfaces.  If we find path that leads to the '_target' interface, then
+ * we examine that path to see if there are any methods that would shadow
+ * the selected method along that path.
+ */
+class ShadowChecker : public HierarchyVisitor<ShadowChecker> {
+ private:
+  generic::DescriptorCache* _cache;
+  Thread* THREAD;
+
+  InstanceKlass* _target;
+
+  Symbol* _method_name;
+  InstanceKlass* _method_holder;
+  generic::MethodDescriptor* _method_desc;
+  bool _found_shadow;
+
+  bool path_has_shadow() {
+    generic::Context ctx(_cache);
+
+    for (int i = current_depth() - 1; i > 0; --i) {
+      InstanceKlass* ik = class_at_depth(i);
+      InstanceKlass* sub = class_at_depth(i + 1);
+      ctx.apply_type_arguments(sub, ik, THREAD);
+
+      if (ik->is_interface()) {
+        int end;
+        int start = ik->find_method_by_name(_method_name, &end);
+        if (start != -1) {
+          for (int j = start; j < end; ++j) {
+            Method* mo = ik->methods()->at(j);
+            generic::MethodDescriptor* md = _cache->descriptor_for(mo, THREAD);
+            if (_method_desc->covariant_match(md, &ctx)) {
+              return true;
+            }
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+ public:
+
+  ShadowChecker(generic::DescriptorCache* cache, Thread* thread,
+      Symbol* name, InstanceKlass* holder, generic::MethodDescriptor* desc,
+      InstanceKlass* target)
+    : _cache(cache), THREAD(thread), _method_name(name), _method_holder(holder),
+      _method_desc(desc), _target(target), _found_shadow(false) {}
+
+  void* new_node_data(InstanceKlass* cls) { return NULL; }
+  void free_node_data(void* data) { return; }
+
+  bool visit() {
+    InstanceKlass* ik = current_class();
+    if (ik == _target && current_depth() == 1) {
+      return false; // This was the specified super -- no need to search it
+    }
+    if (ik == _method_holder || ik == _target) {
+      // We found a path that should be examined to see if it shadows _method
+      if (path_has_shadow()) {
+        _found_shadow = true;
+        cancel_iteration();
+      }
+      return false; // no need to continue up hierarchy
+    }
+    return true;
+  }
+
+  bool found_shadow() { return _found_shadow; }
+};
+
+// This is called during linktime when we find an invokespecial call that
+// refers to a direct superinterface.  It indicates that we should find the
+// default method in the hierarchy of that superinterface, and if that method
+// would have been a candidate from the point of view of 'this' class, then we
+// return that method.
+Method* DefaultMethods::find_super_default(
+    Klass* cls, Klass* super, Symbol* method_name, Symbol* sig, TRAPS) {
+
+  ResourceMark rm(THREAD);
+
+  assert(cls != NULL && super != NULL, "Need real classes");
+
+  InstanceKlass* current_class = InstanceKlass::cast(cls);
+  InstanceKlass* direction = InstanceKlass::cast(super);
+
+  // Keep entire hierarchy alive for the duration of the computation
+  KeepAliveRegistrar keepAlive(THREAD);
+  KeepAliveVisitor loadKeepAlive(&keepAlive);
+  loadKeepAlive.run(current_class);
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    tty->print_cr("Finding super default method %s.%s%s from %s",
+      direction->name()->as_C_string(),
+      method_name->as_C_string(), sig->as_C_string(),
+      current_class->name()->as_C_string());
+  }
+#endif // ndef PRODUCT
+
+  if (!direction->is_interface()) {
+    // We should not be here
+    return NULL;
+  }
+
+  generic::DescriptorCache cache;
+  generic::Context ctx(&cache);
+
+  // Prime the initial generic context for current -> direction
+  ctx.apply_type_arguments(current_class, direction, CHECK_NULL);
+
+  FindMethodsByName visitor(&cache, method_name, &ctx, CHECK_NULL);
+  visitor.run(direction);
+
+  GrowableArray<MethodFamily*> families;
+  visitor.get_discovered_families(&families);
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    print_families(&families, sig);
+  }
+#endif // ndef PRODUCT
+
+  MethodFamily* selected_family = NULL;
+
+  for (int i = 0; i < families.length(); ++i) {
+    MethodFamily* lm = families.at(i);
+    if (lm->contains_signature(sig)) {
+      lm->determine_target(current_class, CHECK_NULL);
+      selected_family = lm;
+    }
+  }
+
+  if (selected_family->has_target()) {
+    Method* target = selected_family->get_selected_target();
+    InstanceKlass* holder = InstanceKlass::cast(target->method_holder());
+
+    // Verify that the identified method is valid from the context of
+    // the current class
+    ShadowChecker checker(&cache, THREAD, target->name(),
+        holder, selected_family->descriptor(), direction);
+    checker.run(current_class);
+
+    if (checker.found_shadow()) {
+#ifndef PRODUCT
+      if (TraceDefaultMethods) {
+        tty->print_cr("    Only candidate found was shadowed.");
+      }
+#endif // ndef PRODUCT
+      THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(),
+                 "Accessible default method not found", NULL);
+    } else {
+#ifndef PRODUCT
+      if (TraceDefaultMethods) {
+        tty->print("    Returning ");
+        print_method(tty, target, true);
+        tty->print_cr("");
+      }
+#endif // ndef PRODUCT
+      return target;
+    }
+  } else {
+    assert(selected_family->throws_exception(), "must have target or throw");
+    THROW_MSG_(vmSymbols::java_lang_AbstractMethodError(),
+               selected_family->get_exception_message()->as_C_string(), NULL);
+  }
+}
+
+
+static int assemble_redirect(
+    BytecodeConstantPool* cp, BytecodeBuffer* buffer,
+    Symbol* incoming, Method* target, TRAPS) {
+
+  BytecodeAssembler assem(buffer, cp);
+
+  SignatureStream in(incoming, true);
+  SignatureStream out(target->signature(), true);
+  u2 parameter_count = 0;
+
+  assem.aload(parameter_count++); // load 'this'
+
+  while (!in.at_return_type()) {
+    assert(!out.at_return_type(), "Parameter counts do not match");
+    BasicType bt = in.type();
+    assert(out.type() == bt, "Parameter types are not compatible");
+    assem.load(bt, parameter_count);
+    if (in.is_object() && in.as_symbol(THREAD) != out.as_symbol(THREAD)) {
+      assem.checkcast(out.as_symbol(THREAD));
+    } else if (bt == T_LONG || bt == T_DOUBLE) {
+      ++parameter_count; // longs and doubles use two slots
+    }
+    ++parameter_count;
+    in.next();
+    out.next();
+  }
+  assert(out.at_return_type(), "Parameter counts do not match");
+  assert(in.type() == out.type(), "Return types are not compatible");
+
+  if (parameter_count == 1 && (in.type() == T_LONG || in.type() == T_DOUBLE)) {
+    ++parameter_count; // need room for return value
+  }
+  if (target->method_holder()->is_interface()) {
+    assem.invokespecial(target);
+  } else {
+    assem.invokevirtual(target);
+  }
+
+  if (in.is_object() && in.as_symbol(THREAD) != out.as_symbol(THREAD)) {
+    assem.checkcast(in.as_symbol(THREAD));
+  }
+  assem._return(in.type());
+  return parameter_count;
+}
+
+static int assemble_abstract_method_error(
+    BytecodeConstantPool* cp, BytecodeBuffer* buffer, Symbol* message, TRAPS) {
+
+  Symbol* errorName = vmSymbols::java_lang_AbstractMethodError();
+  Symbol* init = vmSymbols::object_initializer_name();
+  Symbol* sig = vmSymbols::string_void_signature();
+
+  BytecodeAssembler assem(buffer, cp);
+
+  assem._new(errorName);
+  assem.dup();
+  assem.load_string(message);
+  assem.invokespecial(errorName, init, sig);
+  assem.athrow();
+
+  return 3; // max stack size: [ exception, exception, string ]
+}
+
+static Method* new_method(
+    BytecodeConstantPool* cp, BytecodeBuffer* bytecodes, Symbol* name,
+    Symbol* sig, AccessFlags flags, int max_stack, int params,
+    ConstMethod::MethodType mt, TRAPS) {
+
+  address code_start = static_cast<address>(bytecodes->adr_at(0));
+  int code_length = bytecodes->length();
+
+  Method* m = Method::allocate(cp->pool_holder()->class_loader_data(),
+      code_length, flags, 0, 0, 0, 0, mt, CHECK_NULL);
+
+  m->set_constants(NULL); // This will get filled in later
+  m->set_name_index(cp->utf8(name));
+  m->set_signature_index(cp->utf8(sig));
+  m->set_generic_signature_index(0);
+#ifdef CC_INTERP
+  ResultTypeFinder rtf(sig);
+  m->set_result_index(rtf.type());
+#endif
+  m->set_size_of_parameters(params);
+  m->set_max_stack(max_stack);
+  m->set_max_locals(params);
+  m->constMethod()->set_stackmap_data(NULL);
+  m->set_code(code_start);
+  m->set_force_inline(true);
+
+  return m;
+}
+
+static void switchover_constant_pool(BytecodeConstantPool* bpool,
+    InstanceKlass* klass, GrowableArray<Method*>* new_methods, TRAPS) {
+
+  if (new_methods->length() > 0) {
+    ConstantPool* cp = bpool->create_constant_pool(CHECK);
+    if (cp != klass->constants()) {
+      klass->class_loader_data()->add_to_deallocate_list(klass->constants());
+      klass->set_constants(cp);
+      cp->set_pool_holder(klass);
+
+      for (int i = 0; i < new_methods->length(); ++i) {
+        new_methods->at(i)->set_constants(cp);
+      }
+      for (int i = 0; i < klass->methods()->length(); ++i) {
+        Method* mo = klass->methods()->at(i);
+        mo->set_constants(cp);
+      }
+    }
+  }
+}
+
+// A "bridge" is a method created by javac to bridge the gap between
+// an implementation and a generically-compatible, but different, signature.
+// Bridges have actual bytecode implementation in classfiles.
+// An "overpass", on the other hand, performs the same function as a bridge
+// but does not occur in a classfile; the VM creates overpass itself,
+// when it needs a path to get from a call site to an default method, and
+// a bridge doesn't exist.
+static void create_overpasses(
+    GrowableArray<EmptyVtableSlot*>* slots,
+    InstanceKlass* klass, TRAPS) {
+
+  GrowableArray<Method*> overpasses;
+  BytecodeConstantPool bpool(klass->constants());
+
+  for (int i = 0; i < slots->length(); ++i) {
+    EmptyVtableSlot* slot = slots->at(i);
+
+    if (slot->is_bound()) {
+      MethodFamily* method = slot->get_binding();
+      int max_stack = 0;
+      BytecodeBuffer buffer;
+
+#ifndef PRODUCT
+      if (TraceDefaultMethods) {
+        tty->print("for slot: ");
+        slot->print_on(tty);
+        tty->print_cr("");
+        if (method->has_target()) {
+          method->print_selected(tty, 1);
+        } else {
+          method->print_exception(tty, 1);
+        }
+      }
+#endif // ndef PRODUCT
+      if (method->has_target()) {
+        Method* selected = method->get_selected_target();
+        max_stack = assemble_redirect(
+            &bpool, &buffer, slot->signature(), selected, CHECK);
+      } else if (method->throws_exception()) {
+        max_stack = assemble_abstract_method_error(
+            &bpool, &buffer, method->get_exception_message(), CHECK);
+      }
+      AccessFlags flags = accessFlags_from(
+          JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE);
+      Method* m = new_method(&bpool, &buffer, slot->name(), slot->signature(),
+          flags, max_stack, slot->size_of_parameters(),
+          ConstMethod::OVERPASS, CHECK);
+      if (m != NULL) {
+        overpasses.push(m);
+      }
+    }
+  }
+
+#ifndef PRODUCT
+  if (TraceDefaultMethods) {
+    tty->print_cr("Created %d overpass methods", overpasses.length());
+  }
+#endif // ndef PRODUCT
+
+  switchover_constant_pool(&bpool, klass, &overpasses, CHECK);
+  merge_in_new_methods(klass, &overpasses, CHECK);
+}
+
+static void sort_methods(GrowableArray<Method*>* methods) {
+  // Note that this must sort using the same key as is used for sorting
+  // methods in InstanceKlass.
+  bool sorted = true;
+  for (int i = methods->length() - 1; i > 0; --i) {
+    for (int j = 0; j < i; ++j) {
+      Method* m1 = methods->at(j);
+      Method* m2 = methods->at(j + 1);
+      if ((uintptr_t)m1->name() > (uintptr_t)m2->name()) {
+        methods->at_put(j, m2);
+        methods->at_put(j + 1, m1);
+        sorted = false;
+      }
+    }
+    if (sorted) break;
+    sorted = true;
+  }
+#ifdef ASSERT
+  uintptr_t prev = 0;
+  for (int i = 0; i < methods->length(); ++i) {
+    Method* mh = methods->at(i);
+    uintptr_t nv = (uintptr_t)mh->name();
+    assert(nv >= prev, "Incorrect overpass method ordering");
+    prev = nv;
+  }
+#endif
+}
+
+static void merge_in_new_methods(InstanceKlass* klass,
+    GrowableArray<Method*>* new_methods, TRAPS) {
+
+  enum { ANNOTATIONS, PARAMETERS, DEFAULTS, NUM_ARRAYS };
+
+  Array<AnnotationArray*>* original_annots[NUM_ARRAYS];
+
+  Array<Method*>* original_methods = klass->methods();
+  Annotations* annots = klass->annotations();
+  original_annots[ANNOTATIONS] = annots->methods_annotations();
+  original_annots[PARAMETERS]  = annots->methods_parameter_annotations();
+  original_annots[DEFAULTS]    = annots->methods_default_annotations();
+
+  Array<int>* original_ordering = klass->method_ordering();
+  Array<int>* merged_ordering = Universe::the_empty_int_array();
+
+  int new_size = klass->methods()->length() + new_methods->length();
+
+  Array<AnnotationArray*>* merged_annots[NUM_ARRAYS];
+
+  Array<Method*>* merged_methods = MetadataFactory::new_array<Method*>(
+      klass->class_loader_data(), new_size, NULL, CHECK);
+  for (int i = 0; i < NUM_ARRAYS; ++i) {
+    if (original_annots[i] != NULL) {
+      merged_annots[i] = MetadataFactory::new_array<AnnotationArray*>(
+          klass->class_loader_data(), new_size, CHECK);
+    } else {
+      merged_annots[i] = NULL;
+    }
+  }
+  if (original_ordering != NULL && original_ordering->length() > 0) {
+    merged_ordering = MetadataFactory::new_array<int>(
+        klass->class_loader_data(), new_size, CHECK);
+  }
+  int method_order_index = klass->methods()->length();
+
+  sort_methods(new_methods);
+
+  // Perform grand merge of existing methods and new methods
+  int orig_idx = 0;
+  int new_idx = 0;
+
+  for (int i = 0; i < new_size; ++i) {
+    Method* orig_method = NULL;
+    Method* new_method = NULL;
+    if (orig_idx < original_methods->length()) {
+      orig_method = original_methods->at(orig_idx);
+    }
+    if (new_idx < new_methods->length()) {
+      new_method = new_methods->at(new_idx);
+    }
+
+    if (orig_method != NULL &&
+        (new_method == NULL || orig_method->name() < new_method->name())) {
+      merged_methods->at_put(i, orig_method);
+      original_methods->at_put(orig_idx, NULL);
+      for (int j = 0; j < NUM_ARRAYS; ++j) {
+        if (merged_annots[j] != NULL) {
+          merged_annots[j]->at_put(i, original_annots[j]->at(orig_idx));
+          original_annots[j]->at_put(orig_idx, NULL);
+        }
+      }
+      if (merged_ordering->length() > 0) {
+        merged_ordering->at_put(i, original_ordering->at(orig_idx));
+      }
+      ++orig_idx;
+    } else {
+      merged_methods->at_put(i, new_method);
+      if (merged_ordering->length() > 0) {
+        merged_ordering->at_put(i, method_order_index++);
+      }
+      ++new_idx;
+    }
+    // update idnum for new location
+    merged_methods->at(i)->set_method_idnum(i);
+  }
+
+  // Verify correct order
+#ifdef ASSERT
+  uintptr_t prev = 0;
+  for (int i = 0; i < merged_methods->length(); ++i) {
+    Method* mo = merged_methods->at(i);
+    uintptr_t nv = (uintptr_t)mo->name();
+    assert(nv >= prev, "Incorrect method ordering");
+    prev = nv;
+  }
+#endif
+
+  // Replace klass methods with new merged lists
+  klass->set_methods(merged_methods);
+  annots->set_methods_annotations(merged_annots[ANNOTATIONS]);
+  annots->set_methods_parameter_annotations(merged_annots[PARAMETERS]);
+  annots->set_methods_default_annotations(merged_annots[DEFAULTS]);
+
+  ClassLoaderData* cld = klass->class_loader_data();
+  MetadataFactory::free_array(cld, original_methods);
+  for (int i = 0; i < NUM_ARRAYS; ++i) {
+    MetadataFactory::free_array(cld, original_annots[i]);
+  }
+  if (original_ordering->length() > 0) {
+    klass->set_method_ordering(merged_ordering);
+    MetadataFactory::free_array(cld, original_ordering);
+  }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/defaultMethods.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
+#define SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
+
+#include "runtime/handles.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/exceptions.hpp"
+
+class InstanceKlass;
+class Symbol;
+class Method;
+
+class DefaultMethods : AllStatic {
+ public:
+
+  // Analyzes class and determines which default methods are inherited
+  // from interfaces (and has no other implementation).  For each method
+  // (and each different signature the method could have), create an
+  // "overpass" method that is an instance method that redirects to the
+  // default method.  Overpass methods are added to the methods lists for
+  // the class.
+  static void generate_default_methods(
+      InstanceKlass* klass, GrowableArray<Method*>* mirandas, TRAPS);
+
+
+  // Called during linking when an invokespecial to an direct interface
+  // method is found.  Selects and returns a method if there is a unique
+  // default method in the 'super_iface' part of the hierarchy which is
+  // also a candidate default for 'this_klass'.  Otherwise throws an AME.
+  static Method* find_super_default(
+      Klass* this_klass, Klass* super_iface,
+      Symbol* method_name, Symbol* method_sig, TRAPS);
+};
+
+#endif // SHARE_VM_CLASSFILE_DEFAULTMETHODS_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/genericSignatures.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,1272 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "precompiled.hpp"
+
+#include "classfile/genericSignatures.hpp"
+#include "classfile/symbolTable.hpp"
+#include "classfile/systemDictionary.hpp"
+#include "memory/resourceArea.hpp"
+
+namespace generic {
+
+// Helper class for parsing the generic signature Symbol in klass and methods
+class DescriptorStream : public ResourceObj {
+ private:
+  Symbol* _symbol;
+  int _offset;
+  int _mark;
+  const char* _parse_error;
+
+  void set_parse_error(const char* error) {
+    assert(error != NULL, "Can't set NULL error string");
+    _parse_error = error;
+  }
+
+ public:
+  DescriptorStream(Symbol* sym)
+      : _symbol(sym), _offset(0), _mark(-1), _parse_error(NULL) {}
+
+  const char* parse_error() const {
+    return _parse_error;
+  }
+
+  bool at_end() { return _offset >= _symbol->utf8_length(); }
+
+  char peek() {
+    if (at_end()) {
+      set_parse_error("Peeking past end of signature");
+      return '\0';
+    } else {
+      return _symbol->byte_at(_offset);
+    }
+  }
+
+  char read() {
+    if (at_end()) {
+      set_parse_error("Reading past end of signature");
+      return '\0';
+    } else {
+      return _symbol->byte_at(_offset++);
+    }
+  }
+
+  void read(char expected) {
+    char c = read();
+    assert_char(c, expected, 0);
+  }
+
+  void assert_char(char c, char expected, int pos = -1) {
+    if (c != expected) {
+      const char* fmt = "Parse error at %d: expected %c but got %c";
+      size_t len = strlen(fmt) + 5;
+      char* buffer = NEW_RESOURCE_ARRAY(char, len);
+      jio_snprintf(buffer, len, fmt, _offset + pos, expected, c);
+      set_parse_error(buffer);
+    }
+  }
+
+  void push(char c) {
+    assert(c == _symbol->byte_at(_offset - 1), "Pushing back wrong value");
+    --_offset;
+  }
+
+  void expect_end() {
+    if (!at_end()) {
+      set_parse_error("Unexpected data trailing signature");
+    }
+  }
+
+  bool has_mark() { return _mark != -1; }
+
+  void set_mark() {
+    _mark = _offset;
+  }
+
+  Identifier* identifier_from_mark() {
+    assert(has_mark(), "Mark should be set");
+    if (!has_mark()) {
+      set_parse_error("Expected mark to be set");
+      return NULL;
+    } else {
+      Identifier* id = new Identifier(_symbol, _mark, _offset - 1);
+      _mark = -1;
+      return id;
+    }
+  }
+};
+
+
+#define CHECK_FOR_PARSE_ERROR()         \
+  if (STREAM->parse_error() != NULL) {   \
+    if (VerifyGenericSignatures) {      \
+      fatal(STREAM->parse_error());      \
+    }                                   \
+    return NULL;                        \
+  } 0
+
+#define READ() STREAM->read(); CHECK_FOR_PARSE_ERROR()
+#define PEEK() STREAM->peek(); CHECK_FOR_PARSE_ERROR()
+#define PUSH(c) STREAM->push(c)
+#define EXPECT(c) STREAM->read(c); CHECK_FOR_PARSE_ERROR()
+#define EXPECTED(c, ch) STREAM->assert_char(c, ch); CHECK_FOR_PARSE_ERROR()
+#define EXPECT_END() STREAM->expect_end(); CHECK_FOR_PARSE_ERROR()
+
+#define CHECK_STREAM STREAM); CHECK_FOR_PARSE_ERROR(); (0
+
+#ifndef PRODUCT
+void Identifier::print_on(outputStream* str) const {
+  for (int i = _begin; i < _end; ++i) {
+    str->print("%c", (char)_sym->byte_at(i));
+  }
+}
+#endif // ndef PRODUCT
+
+bool Identifier::equals(Identifier* other) {
+  if (_sym == other->_sym && _begin == other->_begin && _end == other->_end) {
+    return true;
+  } else if (_end - _begin != other->_end - other->_begin) {
+    return false;
+  } else {
+    size_t len = _end - _begin;
+    char* addr = ((char*)_sym->bytes()) + _begin;
+    char* oaddr = ((char*)other->_sym->bytes()) + other->_begin;
+    return strncmp(addr, oaddr, len) == 0;
+  }
+}
+
+bool Identifier::equals(Symbol* sym) {
+  Identifier id(sym, 0, sym->utf8_length());
+  return equals(&id);
+}
+
+/**
+ * A formal type parameter may be found in the the enclosing class, but it could
+ * also come from an enclosing method or outer class, in the case of inner-outer
+ * classes or anonymous classes.  For example:
+ *
+ * class Outer<T,V> {
+ *   class Inner<W> {
+ *     void m(T t, V v, W w);
+ *   }
+ * }
+ *
+ * In this case, the type variables in m()'s signature are not all found in the
+ * immediate enclosing class (Inner).  class Inner has only type parameter W,
+ * but it's outer_class field will reference Outer's descriptor which contains
+ * T & V (no outer_method in this case).
+ *
+ * If you have an anonymous class, it has both an enclosing method *and* an
+ * enclosing class where type parameters can be declared:
+ *
+ * class MOuter<T> {
+ *   <V> void bar(V v) {
+ *     Runnable r = new Runnable() {
+ *       public void run() {}
+ *       public void foo(T t, V v) { ... }
+ *     };
+ *   }
+ * }
+ *
+ * In this case, foo will be a member of some class, Runnable$1, which has no
+ * formal parameters itself, but has an outer_method (bar()) which provides
+ * type parameter V, and an outer class MOuter with type parameter T.
+ *
+ * It is also possible that the outer class is itself an inner class to some
+ * other class (or an anonymous class with an enclosing method), so we need to
+ * follow the outer_class/outer_method chain to it's end when looking for a
+ * type parameter.
+ */
+TypeParameter* Descriptor::find_type_parameter(Identifier* id, int* depth) {
+
+  int current_depth = 0;
+
+  MethodDescriptor* outer_method = as_method_signature();
+  ClassDescriptor* outer_class = as_class_signature();
+
+  if (outer_class == NULL) { // 'this' is a method signature; use the holder
+    outer_class = outer_method->outer_class();
+  }
+
+  while (outer_method != NULL || outer_class != NULL) {
+    if (outer_method != NULL) {
+      for (int i = 0; i < outer_method->type_parameters().length(); ++i) {
+        TypeParameter* p = outer_method->type_parameters().at(i);
+        if (p->identifier()->equals(id)) {
+          *depth = -1; // indicates this this is a method parameter
+          return p;
+        }
+      }
+    }
+    if (outer_class != NULL) {
+      for (int i = 0; i < outer_class->type_parameters().length(); ++i) {
+        TypeParameter* p = outer_class->type_parameters().at(i);
+        if (p->identifier()->equals(id)) {
+          *depth = current_depth;
+          return p;
+        }
+      }
+      outer_method = outer_class->outer_method();
+      outer_class = outer_class->outer_class();
+      ++current_depth;
+    }
+  }
+
+  if (VerifyGenericSignatures) {
+    fatal("Could not resolve identifier");
+  }
+
+  return NULL;
+}
+
+ClassDescriptor* ClassDescriptor::parse_generic_signature(Klass* klass, TRAPS) {
+  return parse_generic_signature(klass, NULL, CHECK_NULL);
+}
+
+ClassDescriptor* ClassDescriptor::parse_generic_signature(
+      Klass* klass, Symbol* original_name, TRAPS) {
+
+  InstanceKlass* ik = InstanceKlass::cast(klass);
+  Symbol* sym = ik->generic_signature();
+
+  ClassDescriptor* spec;
+
+  if (sym == NULL || (spec = ClassDescriptor::parse_generic_signature(sym)) == NULL) {
+    spec = ClassDescriptor::placeholder(ik);
+  }
+
+  u2 outer_index = get_outer_class_index(ik, CHECK_NULL);
+  if (outer_index != 0) {
+    if (original_name == NULL) {
+      original_name = ik->name();
+    }
+    Handle class_loader = Handle(THREAD, ik->class_loader());
+    Handle protection_domain = Handle(THREAD, ik->protection_domain());
+
+    Symbol* outer_name = ik->constants()->klass_name_at(outer_index);
+    Klass* outer = SystemDictionary::find(
+        outer_name, class_loader, protection_domain, CHECK_NULL);
+    if (outer == NULL && !THREAD->is_Compiler_thread()) {
+      outer = SystemDictionary::resolve_super_or_fail(original_name,
+          outer_name, class_loader, protection_domain, false, CHECK_NULL);
+    }
+
+    InstanceKlass* outer_ik;
+    ClassDescriptor* outer_spec = NULL;
+    if (outer == NULL) {
+      outer_spec = ClassDescriptor::placeholder(ik);
+      assert(false, "Outer class not loaded and not loadable from here");
+    } else {
+      outer_ik = InstanceKlass::cast(outer);
+      outer_spec = parse_generic_signature(outer, original_name, CHECK_NULL);
+    }
+    spec->set_outer_class(outer_spec);
+
+    u2 encl_method_idx = ik->enclosing_method_method_index();
+    if (encl_method_idx != 0 && outer_ik != NULL) {
+      ConstantPool* cp = ik->constants();
+      u2 name_index = cp->name_ref_index_at(encl_method_idx);
+      u2 sig_index = cp->signature_ref_index_at(encl_method_idx);
+      Symbol* name = cp->symbol_at(name_index);
+      Symbol* sig = cp->symbol_at(sig_index);
+      Method* m = outer_ik->find_method(name, sig);
+      if (m != NULL) {
+        Symbol* gsig = m->generic_signature();
+        if (gsig != NULL) {
+          MethodDescriptor* gms = MethodDescriptor::parse_generic_signature(gsig, outer_spec);
+          spec->set_outer_method(gms);
+        }
+      } else if (VerifyGenericSignatures) {
+        ResourceMark rm;
+        stringStream ss;
+        ss.print("Could not find method %s %s in class %s",
+          name->as_C_string(), sig->as_C_string(), outer_name->as_C_string());
+        fatal(ss.as_string());
+      }
+    }
+  }
+
+  spec->bind_variables_to_parameters();
+  return spec;
+}
+
+ClassDescriptor* ClassDescriptor::placeholder(InstanceKlass* klass) {
+  GrowableArray<TypeParameter*> formals;
+  GrowableArray<ClassType*> interfaces;
+  ClassType* super_type = NULL;
+
+  Klass* super_klass = klass->super();
+  if (super_klass != NULL) {
+    InstanceKlass* super = InstanceKlass::cast(super_klass);
+    super_type = ClassType::from_symbol(super->name());
+  }
+
+  for (int i = 0; i < klass->local_interfaces()->length(); ++i) {
+    InstanceKlass* iface = InstanceKlass::cast(klass->local_interfaces()->at(i));
+    interfaces.append(ClassType::from_symbol(iface->name()));
+  }
+  return new ClassDescriptor(formals, super_type, interfaces);
+}
+
+ClassDescriptor* ClassDescriptor::parse_generic_signature(Symbol* sym) {
+
+  DescriptorStream ds(sym);
+  DescriptorStream* STREAM = &ds;
+
+  GrowableArray<TypeParameter*> parameters(8);
+  char c = READ();
+  if (c == '<') {
+    c = READ();
+    while (c != '>') {
+      PUSH(c);
+      TypeParameter* ftp = TypeParameter::parse_generic_signature(CHECK_STREAM);
+      parameters.append(ftp);
+      c = READ();
+    }
+  } else {
+    PUSH(c);
+  }
+
+  EXPECT('L');
+  ClassType* super = ClassType::parse_generic_signature(CHECK_STREAM);
+
+  GrowableArray<ClassType*> signatures(2);
+  while (!STREAM->at_end()) {
+    EXPECT('L');
+    ClassType* iface = ClassType::parse_generic_signature(CHECK_STREAM);
+    signatures.append(iface);
+  }
+
+  EXPECT_END();
+
+  return new ClassDescriptor(parameters, super, signatures);
+}
+
+#ifndef PRODUCT
+void ClassDescriptor::print_on(outputStream* str) const {
+  str->indent().print_cr("ClassDescriptor {");
+  {
+    streamIndentor si(str);
+    if (_type_parameters.length() > 0) {
+      str->indent().print_cr("Formals {");
+      {
+        streamIndentor si(str);
+        for (int i = 0; i < _type_parameters.length(); ++i) {
+          _type_parameters.at(i)->print_on(str);
+        }
+      }
+      str->indent().print_cr("}");
+    }
+    if (_super != NULL) {
+      str->indent().print_cr("Superclass: ");
+      {
+        streamIndentor si(str);
+        _super->print_on(str);
+      }
+    }
+    if (_interfaces.length() > 0) {
+      str->indent().print_cr("SuperInterfaces: {");
+      {
+        streamIndentor si(str);
+        for (int i = 0; i < _interfaces.length(); ++i) {
+          _interfaces.at(i)->print_on(str);
+        }
+      }
+      str->indent().print_cr("}");
+    }
+    if (_outer_method != NULL) {
+      str->indent().print_cr("Outer Method: {");
+      {
+        streamIndentor si(str);
+        _outer_method->print_on(str);
+      }
+      str->indent().print_cr("}");
+    }
+    if (_outer_class != NULL) {
+      str->indent().print_cr("Outer Class: {");
+      {
+        streamIndentor si(str);
+        _outer_class->print_on(str);
+      }
+      str->indent().print_cr("}");
+    }
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+ClassType* ClassDescriptor::interface_desc(Symbol* sym) {
+  for (int i = 0; i < _interfaces.length(); ++i) {
+    if (_interfaces.at(i)->identifier()->equals(sym)) {
+      return _interfaces.at(i);
+    }
+  }
+  if (VerifyGenericSignatures) {
+    fatal("Did not find expected interface");
+  }
+  return NULL;
+}
+
+void ClassDescriptor::bind_variables_to_parameters() {
+  if (_outer_class != NULL) {
+    _outer_class->bind_variables_to_parameters();
+  }
+  if (_outer_method != NULL) {
+    _outer_method->bind_variables_to_parameters();
+  }
+  for (int i = 0; i < _type_parameters.length(); ++i) {
+    _type_parameters.at(i)->bind_variables_to_parameters(this, i);
+  }
+  if (_super != NULL) {
+    _super->bind_variables_to_parameters(this);
+  }
+  for (int i = 0; i < _interfaces.length(); ++i) {
+    _interfaces.at(i)->bind_variables_to_parameters(this);
+  }
+}
+
+ClassDescriptor* ClassDescriptor::canonicalize(Context* ctx) {
+
+  GrowableArray<TypeParameter*> type_params(_type_parameters.length());
+  for (int i = 0; i < _type_parameters.length(); ++i) {
+    type_params.append(_type_parameters.at(i)->canonicalize(ctx, 0));
+  }
+
+  ClassDescriptor* outer = _outer_class == NULL ? NULL :
+      _outer_class->canonicalize(ctx);
+
+  ClassType* super = _super == NULL ? NULL : _super->canonicalize(ctx, 0);
+
+  GrowableArray<ClassType*> interfaces(_interfaces.length());
+  for (int i = 0; i < _interfaces.length(); ++i) {
+    interfaces.append(_interfaces.at(i)->canonicalize(ctx, 0));
+  }
+
+  MethodDescriptor* md = _outer_method == NULL ? NULL :
+      _outer_method->canonicalize(ctx);
+
+  return new ClassDescriptor(type_params, super, interfaces, outer, md);
+}
+
+u2 ClassDescriptor::get_outer_class_index(InstanceKlass* klass, TRAPS) {
+  int inner_index = InstanceKlass::inner_class_inner_class_info_offset;
+  int outer_index = InstanceKlass::inner_class_outer_class_info_offset;
+  int name_offset = InstanceKlass::inner_class_inner_name_offset;
+  int next_offset = InstanceKlass::inner_class_next_offset;
+
+  if (klass->inner_classes() == NULL || klass->inner_classes()->length() == 0) {
+    // No inner class info => no declaring class
+    return 0;
+  }
+
+  Array<u2>* i_icls = klass->inner_classes();
+  ConstantPool* i_cp = klass->constants();
+  int i_length = i_icls->length();
+
+  // Find inner_klass attribute
+  for (int i = 0; i + next_offset < i_length; i += next_offset) {
+    u2 ioff = i_icls->at(i + inner_index);
+    u2 ooff = i_icls->at(i + outer_index);
+    u2 noff = i_icls->at(i + name_offset);
+    if (ioff != 0) {
+      // Check to see if the name matches the class we're looking for
+      // before attempting to find the class.
+      if (i_cp->klass_name_at_matches(klass, ioff) && ooff != 0) {
+        return ooff;
+      }
+    }
+  }
+
+  // It may be anonymous; try for that.
+  u2 encl_method_class_idx = klass->enclosing_method_class_index();
+  if (encl_method_class_idx != 0) {
+    return encl_method_class_idx;
+  }
+
+  return 0;
+}
+
+MethodDescriptor* MethodDescriptor::parse_generic_signature(Method* m, ClassDescriptor* outer) {
+  Symbol* generic_sig = m->generic_signature();
+  MethodDescriptor* md = NULL;
+  if (generic_sig == NULL || (md = parse_generic_signature(generic_sig, outer)) == NULL) {
+    md = parse_generic_signature(m->signature(), outer);
+  }
+  assert(md != NULL, "Could not parse method signature");
+  md->bind_variables_to_parameters();
+  return md;
+}
+
+MethodDescriptor* MethodDescriptor::parse_generic_signature(Symbol* sym, ClassDescriptor* outer) {
+
+  DescriptorStream ds(sym);
+  DescriptorStream* STREAM = &ds;
+
+  GrowableArray<TypeParameter*> params(8);
+  char c = READ();
+  if (c == '<') {
+    c = READ();
+    while (c != '>') {
+      PUSH(c);
+      TypeParameter* ftp = TypeParameter::parse_generic_signature(CHECK_STREAM);
+      params.append(ftp);
+      c = READ();
+    }
+  } else {
+    PUSH(c);
+  }
+
+  EXPECT('(');
+
+  GrowableArray<Type*> parameters(8);
+  c = READ();
+  while (c != ')') {
+    PUSH(c);
+    Type* arg = Type::parse_generic_signature(CHECK_STREAM);
+    parameters.append(arg);
+    c = READ();
+  }
+
+  Type* rt = Type::parse_generic_signature(CHECK_STREAM);
+
+  GrowableArray<Type*> throws;
+  while (!STREAM->at_end()) {
+    EXPECT('^');
+    Type* spec = Type::parse_generic_signature(CHECK_STREAM);
+    throws.append(spec);
+  }
+
+  return new MethodDescriptor(params, outer, parameters, rt, throws);
+}
+
+void MethodDescriptor::bind_variables_to_parameters() {
+  for (int i = 0; i < _type_parameters.length(); ++i) {
+    _type_parameters.at(i)->bind_variables_to_parameters(this, i);
+  }
+  for (int i = 0; i < _parameters.length(); ++i) {
+    _parameters.at(i)->bind_variables_to_parameters(this);
+  }
+  _return_type->bind_variables_to_parameters(this);
+  for (int i = 0; i < _throws.length(); ++i) {
+    _throws.at(i)->bind_variables_to_parameters(this);
+  }
+}
+
+bool MethodDescriptor::covariant_match(MethodDescriptor* other, Context* ctx) {
+
+  if (_parameters.length() == other->_parameters.length()) {
+    for (int i = 0; i < _parameters.length(); ++i) {
+      if (!_parameters.at(i)->covariant_match(other->_parameters.at(i), ctx)) {
+        return false;
+      }
+    }
+
+    if (_return_type->as_primitive() != NULL) {
+      return _return_type->covariant_match(other->_return_type, ctx);
+    } else {
+      // return type is a reference
+      return other->_return_type->as_class() != NULL ||
+             other->_return_type->as_variable() != NULL ||
+             other->_return_type->as_array() != NULL;
+    }
+  } else {
+    return false;
+  }
+}
+
+MethodDescriptor* MethodDescriptor::canonicalize(Context* ctx) {
+
+  GrowableArray<TypeParameter*> type_params(_type_parameters.length());
+  for (int i = 0; i < _type_parameters.length(); ++i) {
+    type_params.append(_type_parameters.at(i)->canonicalize(ctx, 0));
+  }
+
+  ClassDescriptor* outer = _outer_class == NULL ? NULL :
+      _outer_class->canonicalize(ctx);
+
+  GrowableArray<Type*> params(_parameters.length());
+  for (int i = 0; i < _parameters.length(); ++i) {
+    params.append(_parameters.at(i)->canonicalize(ctx, 0));
+  }
+
+  Type* rt = _return_type->canonicalize(ctx, 0);
+
+  GrowableArray<Type*> throws(_throws.length());
+  for (int i = 0; i < _throws.length(); ++i) {
+    throws.append(_throws.at(i)->canonicalize(ctx, 0));
+  }
+
+  return new MethodDescriptor(type_params, outer, params, rt, throws);
+}
+
+#ifndef PRODUCT
+TempNewSymbol MethodDescriptor::reify_signature(Context* ctx, TRAPS) {
+  stringStream ss(256);
+
+  ss.print("(");
+  for (int i = 0; i < _parameters.length(); ++i) {
+    _parameters.at(i)->reify_signature(&ss, ctx);
+  }
+  ss.print(")");
+  _return_type->reify_signature(&ss, ctx);
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
+}
+
+void MethodDescriptor::print_on(outputStream* str) const {
+  str->indent().print_cr("MethodDescriptor {");
+  {
+    streamIndentor si(str);
+    if (_type_parameters.length() > 0) {
+      str->indent().print_cr("Formals: {");
+      {
+        streamIndentor si(str);
+        for (int i = 0; i < _type_parameters.length(); ++i) {
+          _type_parameters.at(i)->print_on(str);
+        }
+      }
+      str->indent().print_cr("}");
+    }
+    str->indent().print_cr("Parameters: {");
+    {
+      streamIndentor si(str);
+      for (int i = 0; i < _parameters.length(); ++i) {
+        _parameters.at(i)->print_on(str);
+      }
+    }
+    str->indent().print_cr("}");
+    str->indent().print_cr("Return Type: ");
+    {
+      streamIndentor si(str);
+      _return_type->print_on(str);
+    }
+
+    if (_throws.length() > 0) {
+      str->indent().print_cr("Throws: {");
+      {
+        streamIndentor si(str);
+        for (int i = 0; i < _throws.length(); ++i) {
+          _throws.at(i)->print_on(str);
+        }
+      }
+      str->indent().print_cr("}");
+    }
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+TypeParameter* TypeParameter::parse_generic_signature(DescriptorStream* STREAM) {
+  STREAM->set_mark();
+  char c = READ();
+  while (c != ':') {
+    c = READ();
+  }
+
+  Identifier* id = STREAM->identifier_from_mark();
+
+  ClassType* class_bound = NULL;
+  GrowableArray<ClassType*> interface_bounds(8);
+
+  c = READ();
+  if (c != '>') {
+    if (c != ':') {
+      EXPECTED(c, 'L');
+      class_bound = ClassType::parse_generic_signature(CHECK_STREAM);
+      c = READ();
+    }
+
+    while (c == ':') {
+      EXPECT('L');
+      ClassType* fts = ClassType::parse_generic_signature(CHECK_STREAM);
+      interface_bounds.append(fts);
+      c = READ();
+    }
+  }
+  PUSH(c);
+
+  return new TypeParameter(id, class_bound, interface_bounds);
+}
+
+void TypeParameter::bind_variables_to_parameters(Descriptor* sig, int position) {
+  if (_class_bound != NULL) {
+    _class_bound->bind_variables_to_parameters(sig);
+  }
+  for (int i = 0; i < _interface_bounds.length(); ++i) {
+    _interface_bounds.at(i)->bind_variables_to_parameters(sig);
+  }
+  _position = position;
+}
+
+Type* TypeParameter::resolve(
+    Context* ctx, int inner_depth, int ctx_depth) {
+
+  if (inner_depth == -1) {
+    // This indicates that the parameter is a method type parameter, which
+    // isn't resolveable using the class hierarchy context
+    return bound();
+  }
+
+  ClassType* provider = ctx->at_depth(ctx_depth);
+  if (provider != NULL) {
+    for (int i = 0; i < inner_depth && provider != NULL; ++i) {
+      provider = provider->outer_class();
+    }
+    if (provider != NULL) {
+      TypeArgument* arg = provider->type_argument_at(_position);
+      if (arg != NULL) {
+        Type* value = arg->lower_bound();
+        return value->canonicalize(ctx, ctx_depth + 1);
+      }
+    }
+  }
+
+  return bound();
+}
+
+TypeParameter* TypeParameter::canonicalize(Context* ctx, int ctx_depth) {
+  ClassType* bound = _class_bound == NULL ? NULL :
+     _class_bound->canonicalize(ctx, ctx_depth);
+
+  GrowableArray<ClassType*> ifaces(_interface_bounds.length());
+  for (int i = 0; i < _interface_bounds.length(); ++i) {
+    ifaces.append(_interface_bounds.at(i)->canonicalize(ctx, ctx_depth));
+  }
+
+  TypeParameter* ret = new TypeParameter(_identifier, bound, ifaces);
+  ret->_position = _position;
+  return ret;
+}
+
+ClassType* TypeParameter::bound() {
+  if (_class_bound != NULL) {
+    return _class_bound;
+  }
+
+  if (_interface_bounds.length() == 1) {
+    return _interface_bounds.at(0);
+  }
+
+  return ClassType::java_lang_Object(); // TODO: investigate this case
+}
+
+#ifndef PRODUCT
+void TypeParameter::print_on(outputStream* str) const {
+  str->indent().print_cr("Formal: {");
+  {
+    streamIndentor si(str);
+
+    str->indent().print("Identifier: ");
+    _identifier->print_on(str);
+    str->print_cr("");
+    if (_class_bound != NULL) {
+      str->indent().print_cr("Class Bound: ");
+      streamIndentor si(str);
+      _class_bound->print_on(str);
+    }
+    if (_interface_bounds.length() > 0) {
+      str->indent().print_cr("Interface Bounds: {");
+      {
+        streamIndentor si(str);
+        for (int i = 0; i < _interface_bounds.length(); ++i) {
+          _interface_bounds.at(i)->print_on(str);
+        }
+      }
+      str->indent().print_cr("}");
+    }
+    str->indent().print_cr("Ordinal Position: %d", _position);
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+Type* Type::parse_generic_signature(DescriptorStream* STREAM) {
+  char c = READ();
+  switch (c) {
+    case 'L':
+      return ClassType::parse_generic_signature(CHECK_STREAM);
+    case 'T':
+      return TypeVariable::parse_generic_signature(CHECK_STREAM);
+    case '[':
+      return ArrayType::parse_generic_signature(CHECK_STREAM);
+    default:
+      return new PrimitiveType(c);
+  }
+}
+
+Identifier* ClassType::parse_generic_signature_simple(GrowableArray<TypeArgument*>* args,
+    bool* has_inner, DescriptorStream* STREAM) {
+  STREAM->set_mark();
+
+  char c = READ();
+  while (c != ';' && c != '.' && c != '<') { c = READ(); }
+  Identifier* id = STREAM->identifier_from_mark();
+
+  if (c == '<') {
+    c = READ();
+    while (c != '>') {
+      PUSH(c);
+      TypeArgument* arg = TypeArgument::parse_generic_signature(CHECK_STREAM);
+      args->append(arg);
+      c = READ();
+    }
+    c = READ();
+  }
+
+  *has_inner = (c == '.');
+  if (!(*has_inner)) {
+    EXPECTED(c, ';');
+  }
+
+  return id;
+}
+
+ClassType* ClassType::parse_generic_signature(DescriptorStream* STREAM) {
+  return parse_generic_signature(NULL, CHECK_STREAM);
+}
+
+ClassType* ClassType::parse_generic_signature(ClassType* outer, DescriptorStream* STREAM) {
+  GrowableArray<TypeArgument*> args;
+  ClassType* gct = NULL;
+  bool has_inner = false;
+
+  Identifier* id = parse_generic_signature_simple(&args, &has_inner, STREAM);
+  if (id != NULL) {
+    gct = new ClassType(id, args, outer);
+
+    if (has_inner) {
+      gct = parse_generic_signature(gct, CHECK_STREAM);
+    }
+  }
+  return gct;
+}
+
+ClassType* ClassType::from_symbol(Symbol* sym) {
+  assert(sym != NULL, "Must not be null");
+  GrowableArray<TypeArgument*> args;
+  Identifier* id = new Identifier(sym, 0, sym->utf8_length());
+  return new ClassType(id, args, NULL);
+}
+
+ClassType* ClassType::java_lang_Object() {
+  return from_symbol(vmSymbols::java_lang_Object());
+}
+
+void ClassType::bind_variables_to_parameters(Descriptor* sig) {
+  for (int i = 0; i < _type_arguments.length(); ++i) {
+    _type_arguments.at(i)->bind_variables_to_parameters(sig);
+  }
+  if (_outer_class != NULL) {
+    _outer_class->bind_variables_to_parameters(sig);
+  }
+}
+
+TypeArgument* ClassType::type_argument_at(int i) {
+  if (i >= 0 && i < _type_arguments.length()) {
+    return _type_arguments.at(i);
+  } else {
+    return NULL;
+  }
+}
+
+#ifndef PRODUCT
+void ClassType::reify_signature(stringStream* ss, Context* ctx) {
+  ss->print("L");
+  _identifier->print_on(ss);
+  ss->print(";");
+}
+
+void ClassType::print_on(outputStream* str) const {
+  str->indent().print_cr("Class {");
+  {
+    streamIndentor si(str);
+    str->indent().print("Name: ");
+    _identifier->print_on(str);
+    str->print_cr("");
+    if (_type_arguments.length() != 0) {
+      str->indent().print_cr("Type Arguments: {");
+      {
+        streamIndentor si(str);
+        for (int j = 0; j < _type_arguments.length(); ++j) {
+          _type_arguments.at(j)->print_on(str);
+        }
+      }
+      str->indent().print_cr("}");
+    }
+    if (_outer_class != NULL) {
+      str->indent().print_cr("Outer Class: ");
+      streamIndentor sir(str);
+      _outer_class->print_on(str);
+    }
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+bool ClassType::covariant_match(Type* other, Context* ctx) {
+
+  if (other == this) {
+    return true;
+  }
+
+  TypeVariable* variable = other->as_variable();
+  if (variable != NULL) {
+    other = variable->resolve(ctx, 0);
+  }
+
+  ClassType* outer = outer_class();
+  ClassType* other_class = other->as_class();
+
+  if (other_class == NULL ||
+      (outer == NULL) != (other_class->outer_class() == NULL)) {
+    return false;
+  }
+
+  if (!_identifier->equals(other_class->_identifier)) {
+    return false;
+  }
+
+  if (outer != NULL && !outer->covariant_match(other_class->outer_class(), ctx)) {
+    return false;
+  }
+
+  return true;
+}
+
+ClassType* ClassType::canonicalize(Context* ctx, int ctx_depth) {
+
+  GrowableArray<TypeArgument*> args(_type_arguments.length());
+  for (int i = 0; i < _type_arguments.length(); ++i) {
+    args.append(_type_arguments.at(i)->canonicalize(ctx, ctx_depth));
+  }
+
+  ClassType* outer = _outer_class == NULL ? NULL :
+      _outer_class->canonicalize(ctx, ctx_depth);
+
+  return new ClassType(_identifier, args, outer);
+}
+
+TypeVariable* TypeVariable::parse_generic_signature(DescriptorStream* STREAM) {
+  STREAM->set_mark();
+  char c = READ();
+  while (c != ';') {
+    c = READ();
+  }
+  Identifier* id = STREAM->identifier_from_mark();
+
+  return new TypeVariable(id);
+}
+
+void TypeVariable::bind_variables_to_parameters(Descriptor* sig) {
+  _parameter = sig->find_type_parameter(_id, &_inner_depth);
+  if (VerifyGenericSignatures && _parameter == NULL) {
+    fatal("Could not find formal parameter");
+  }
+}
+
+Type* TypeVariable::resolve(Context* ctx, int ctx_depth) {
+  if (parameter() != NULL) {
+    return parameter()->resolve(ctx, inner_depth(), ctx_depth);
+  } else {
+    if (VerifyGenericSignatures) {
+      fatal("Type variable matches no parameter");
+    }
+    return NULL;
+  }
+}
+
+bool TypeVariable::covariant_match(Type* other, Context* ctx) {
+
+  if (other == this) {
+    return true;
+  }
+
+  Context my_context(NULL); // empty, results in erasure
+  Type* my_type = resolve(&my_context, 0);
+  if (my_type == NULL) {
+    return false;
+  }
+
+  return my_type->covariant_match(other, ctx);
+}
+
+Type* TypeVariable::canonicalize(Context* ctx, int ctx_depth) {
+  return resolve(ctx, ctx_depth);
+}
+
+#ifndef PRODUCT
+void TypeVariable::reify_signature(stringStream* ss, Context* ctx) {
+  Type* type = resolve(ctx, 0);
+  if (type != NULL) {
+    type->reify_signature(ss, ctx);
+  }
+}
+
+void TypeVariable::print_on(outputStream* str) const {
+  str->indent().print_cr("Type Variable {");
+  {
+    streamIndentor si(str);
+    str->indent().print("Name: ");
+    _id->print_on(str);
+    str->print_cr("");
+    str->indent().print_cr("Inner depth: %d", _inner_depth);
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+ArrayType* ArrayType::parse_generic_signature(DescriptorStream* STREAM) {
+  Type* base = Type::parse_generic_signature(CHECK_STREAM);
+  return new ArrayType(base);
+}
+
+void ArrayType::bind_variables_to_parameters(Descriptor* sig) {
+  assert(_base != NULL, "Invalid base");
+  _base->bind_variables_to_parameters(sig);
+}
+
+bool ArrayType::covariant_match(Type* other, Context* ctx) {
+  assert(_base != NULL, "Invalid base");
+
+  if (other == this) {
+    return true;
+  }
+
+  ArrayType* other_array = other->as_array();
+  return (other_array != NULL && _base->covariant_match(other_array->_base, ctx));
+}
+
+ArrayType* ArrayType::canonicalize(Context* ctx, int ctx_depth) {
+  assert(_base != NULL, "Invalid base");
+  return new ArrayType(_base->canonicalize(ctx, ctx_depth));
+}
+
+#ifndef PRODUCT
+void ArrayType::reify_signature(stringStream* ss, Context* ctx) {
+  assert(_base != NULL, "Invalid base");
+  ss->print("[");
+  _base->reify_signature(ss, ctx);
+}
+
+void ArrayType::print_on(outputStream* str) const {
+  str->indent().print_cr("Array {");
+  {
+    streamIndentor si(str);
+    _base->print_on(str);
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+bool PrimitiveType::covariant_match(Type* other, Context* ctx) {
+
+  PrimitiveType* other_prim = other->as_primitive();
+  return (other_prim != NULL && _type == other_prim->_type);
+}
+
+PrimitiveType* PrimitiveType::canonicalize(Context* ctx, int ctxd) {
+  return this;
+}
+
+#ifndef PRODUCT
+void PrimitiveType::reify_signature(stringStream* ss, Context* ctx) {
+  ss->print("%c", _type);
+}
+
+void PrimitiveType::print_on(outputStream* str) const {
+  str->indent().print_cr("Primitive: '%c'", _type);
+}
+#endif // ndef PRODUCT
+
+void PrimitiveType::bind_variables_to_parameters(Descriptor* sig) {
+}
+
+TypeArgument* TypeArgument::parse_generic_signature(DescriptorStream* STREAM) {
+  char c = READ();
+  Type* type = NULL;
+
+  switch (c) {
+    case '*':
+      return new TypeArgument(ClassType::java_lang_Object(), NULL);
+      break;
+    default:
+      PUSH(c);
+      // fall-through
+    case '+':
+    case '-':
+      type = Type::parse_generic_signature(CHECK_STREAM);
+      if (c == '+') {
+        return new TypeArgument(type, NULL);
+      } else if (c == '-') {
+        return new TypeArgument(ClassType::java_lang_Object(), type);
+      } else {
+        return new TypeArgument(type, type);
+      }
+  }
+}
+
+void TypeArgument::bind_variables_to_parameters(Descriptor* sig) {
+  assert(_lower_bound != NULL, "Invalid lower bound");
+  _lower_bound->bind_variables_to_parameters(sig);
+  if (_upper_bound != NULL && _upper_bound != _lower_bound) {
+    _upper_bound->bind_variables_to_parameters(sig);
+  }
+}
+
+bool TypeArgument::covariant_match(TypeArgument* other, Context* ctx) {
+  assert(_lower_bound != NULL, "Invalid lower bound");
+
+  if (other == this) {
+    return true;
+  }
+
+  if (!_lower_bound->covariant_match(other->lower_bound(), ctx)) {
+    return false;
+  }
+  return true;
+}
+
+TypeArgument* TypeArgument::canonicalize(Context* ctx, int ctx_depth) {
+  assert(_lower_bound != NULL, "Invalid lower bound");
+  Type* lower = _lower_bound->canonicalize(ctx, ctx_depth);
+  Type* upper = NULL;
+
+  if (_upper_bound == _lower_bound) {
+    upper = lower;
+  } else if (_upper_bound != NULL) {
+    upper = _upper_bound->canonicalize(ctx, ctx_depth);
+  }
+
+  return new TypeArgument(lower, upper);
+}
+
+#ifndef PRODUCT
+void TypeArgument::print_on(outputStream* str) const {
+  str->indent().print_cr("TypeArgument {");
+  {
+    streamIndentor si(str);
+    if (_lower_bound != NULL) {
+      str->indent().print("Lower bound: ");
+      _lower_bound->print_on(str);
+    }
+    if (_upper_bound != NULL) {
+      str->indent().print("Upper bound: ");
+      _upper_bound->print_on(str);
+    }
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+void Context::Mark::destroy() {
+  if (is_active()) {
+    _context->reset_to_mark(_marked_size);
+  }
+  deactivate();
+}
+
+void Context::apply_type_arguments(
+    InstanceKlass* current, InstanceKlass* super, TRAPS) {
+  assert(_cache != NULL, "Cannot use an empty context");
+  ClassType* spec = NULL;
+  if (current != NULL) {
+    ClassDescriptor* descriptor = _cache->descriptor_for(current, CHECK);
+    if (super == current->super()) {
+      spec = descriptor->super();
+    } else {
+      spec = descriptor->interface_desc(super->name());
+    }
+    if (spec != NULL) {
+      _type_arguments.push(spec);
+    }
+  }
+}
+
+void Context::reset_to_mark(int size) {
+  _type_arguments.trunc_to(size);
+}
+
+ClassType* Context::at_depth(int i) const {
+  if (i < _type_arguments.length()) {
+    return _type_arguments.at(_type_arguments.length() - 1 - i);
+  }
+  return NULL;
+}
+
+#ifndef PRODUCT
+void Context::print_on(outputStream* str) const {
+  str->indent().print_cr("Context {");
+  for (int i = 0; i < _type_arguments.length(); ++i) {
+    streamIndentor si(str);
+    str->indent().print("leval %d: ", i);
+    ClassType* ct = at_depth(i);
+    if (ct == NULL) {
+      str->print_cr("<empty>");
+      continue;
+    } else {
+      str->print_cr("{");
+    }
+
+    for (int j = 0; j < ct->type_arguments_length(); ++j) {
+      streamIndentor si(str);
+      TypeArgument* ta = ct->type_argument_at(j);
+      Type* bound = ta->lower_bound();
+      bound->print_on(str);
+    }
+    str->indent().print_cr("}");
+  }
+  str->indent().print_cr("}");
+}
+#endif // ndef PRODUCT
+
+ClassDescriptor* DescriptorCache::descriptor_for(InstanceKlass* ik, TRAPS) {
+
+  ClassDescriptor** existing = _class_descriptors.get(ik);
+  if (existing == NULL) {
+    ClassDescriptor* cd = ClassDescriptor::parse_generic_signature(ik, CHECK_NULL);
+    _class_descriptors.put(ik, cd);
+    return cd;
+  } else {
+    return *existing;
+  }
+}
+
+MethodDescriptor* DescriptorCache::descriptor_for(
+    Method* mh, ClassDescriptor* cd, TRAPS) {
+  assert(mh != NULL && cd != NULL, "Should not be NULL");
+  MethodDescriptor** existing = _method_descriptors.get(mh);
+  if (existing == NULL) {
+    MethodDescriptor* md = MethodDescriptor::parse_generic_signature(mh, cd);
+    _method_descriptors.put(mh, md);
+    return md;
+  } else {
+    return *existing;
+  }
+}
+MethodDescriptor* DescriptorCache::descriptor_for(Method* mh, TRAPS) {
+  ClassDescriptor* cd = descriptor_for(
+      InstanceKlass::cast(mh->method_holder()), CHECK_NULL);
+  return descriptor_for(mh, cd, THREAD);
+}
+
+} // namespace generic
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/classfile/genericSignatures.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,467 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_CLASSFILE_GENERICSIGNATURES_HPP
+#define SHARE_VM_CLASSFILE_GENERICSIGNATURES_HPP
+
+#include "classfile/symbolTable.hpp"
+#include "memory/allocation.hpp"
+#include "runtime/signature.hpp"
+#include "utilities/growableArray.hpp"
+#include "utilities/resourceHash.hpp"
+
+class stringStream;
+
+namespace generic {
+
+class Identifier;
+class ClassDescriptor;
+class MethodDescriptor;
+
+class TypeParameter; // a formal type parameter declared in generic signatures
+class TypeArgument;  // The "type value" passed to fill parameters in supertypes
+class TypeVariable;  // A usage of a type parameter as a value
+/**
+ * Example:
+ *
+ * <T, V> class Foo extends Bar<String> { int m(V v) {} }
+ * ^^^^^^                       ^^^^^^          ^^
+ * type parameters            type argument    type variable
+ *
+ * Note that a type variable could be passed as an argument too:
+ * <T, V> class Foo extends Bar<T> { int m(V v) {} }
+ *                             ^^^
+ *                             type argument's value is a type variable
+ */
+
+
+class Type;
+class ClassType;
+class ArrayType;
+class PrimitiveType;
+class Context;
+class DescriptorCache;
+
+class DescriptorStream;
+
+class Identifier : public ResourceObj {
+ private:
+  Symbol* _sym;
+  int _begin;
+  int _end;
+
+ public:
+  Identifier(Symbol* sym, int begin, int end) :
+    _sym(sym), _begin(begin), _end(end) {}
+
+  bool equals(Identifier* other);
+  bool equals(Symbol* sym);
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const;
+#endif // ndef PRODUCT
+};
+
+class Descriptor : public ResourceObj {
+ protected:
+  GrowableArray<TypeParameter*> _type_parameters;
+  ClassDescriptor* _outer_class;
+
+  Descriptor(GrowableArray<TypeParameter*>& params,
+    ClassDescriptor* outer)
+    : _type_parameters(params), _outer_class(outer) {}
+
+ public:
+
+  ClassDescriptor* outer_class() { return _outer_class; }
+  void set_outer_class(ClassDescriptor* sig) { _outer_class = sig; }
+
+  virtual ClassDescriptor* as_class_signature() { return NULL; }
+  virtual MethodDescriptor* as_method_signature() { return NULL; }
+
+  bool is_class_signature() { return as_class_signature() != NULL; }
+  bool is_method_signature() { return as_method_signature() != NULL; }
+
+  GrowableArray<TypeParameter*>& type_parameters() {
+    return _type_parameters;
+  }
+
+  TypeParameter* find_type_parameter(Identifier* id, int* param_depth);
+
+  virtual void bind_variables_to_parameters() = 0;
+
+#ifndef PRODUCT
+  virtual void print_on(outputStream* str) const = 0;
+#endif
+};
+
+class ClassDescriptor : public Descriptor {
+ private:
+  ClassType* _super;
+  GrowableArray<ClassType*> _interfaces;
+  MethodDescriptor* _outer_method;
+
+  ClassDescriptor(GrowableArray<TypeParameter*>& ftp, ClassType* scs,
+      GrowableArray<ClassType*>& sis, ClassDescriptor* outer_class = NULL,
+      MethodDescriptor* outer_method = NULL)
+        : Descriptor(ftp, outer_class), _super(scs), _interfaces(sis),
+          _outer_method(outer_method) {}
+
+  static u2 get_outer_class_index(InstanceKlass* k, TRAPS);
+  static ClassDescriptor* parse_generic_signature(Klass* k, Symbol* original_name, TRAPS);
+
+ public:
+
+  virtual ClassDescriptor* as_class_signature() { return this; }
+
+  MethodDescriptor* outer_method() { return _outer_method; }
+  void set_outer_method(MethodDescriptor* m) { _outer_method = m; }
+
+  ClassType* super() { return _super; }
+  ClassType* interface_desc(Symbol* sym);
+
+  static ClassDescriptor* parse_generic_signature(Klass* k, TRAPS);
+  static ClassDescriptor* parse_generic_signature(Symbol* sym);
+
+  // For use in superclass chains in positions where this is no generic info
+  static ClassDescriptor* placeholder(InstanceKlass* klass);
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const;
+#endif
+
+  ClassDescriptor* canonicalize(Context* ctx);
+
+  // Linking sets the position index in any contained TypeVariable type
+  // to correspond to the location of that identifier in the formal type
+  // parameters.
+  void bind_variables_to_parameters();
+};
+
+class MethodDescriptor : public Descriptor {
+ private:
+  GrowableArray<Type*> _parameters;
+  Type* _return_type;
+  GrowableArray<Type*> _throws;
+
+  MethodDescriptor(GrowableArray<TypeParameter*>& ftp, ClassDescriptor* outer,
+      GrowableArray<Type*>& sigs, Type* rt, GrowableArray<Type*>& throws)
+      : Descriptor(ftp, outer), _parameters(sigs), _return_type(rt),
+        _throws(throws) {}
+
+ public:
+
+  static MethodDescriptor* parse_generic_signature(Method* m, ClassDescriptor* outer);
+  static MethodDescriptor* parse_generic_signature(Symbol* sym, ClassDescriptor* outer);
+
+  MethodDescriptor* as_method_signature() { return this; }
+
+  // Performs generic analysis on the method parameters to determine
+  // if both methods refer to the same argument types.
+  bool covariant_match(MethodDescriptor* other, Context* ctx);
+
+  // Returns a new method descriptor with all generic variables
+  // removed and replaced with whatever is indicated using the Context.
+  MethodDescriptor* canonicalize(Context* ctx);
+
+  void bind_variables_to_parameters();
+
+#ifndef PRODUCT
+  TempNewSymbol reify_signature(Context* ctx, TRAPS);
+  void print_on(outputStream* str) const;
+#endif
+};
+
+class TypeParameter : public ResourceObj {
+ private:
+  Identifier* _identifier;
+  ClassType* _class_bound;
+  GrowableArray<ClassType*> _interface_bounds;
+
+  // The position is the ordinal location of the parameter within the
+  // formal parameter list (excluding outer classes).  It is only set for
+  // formal type parameters that are associated with a class -- method
+  // type parameters are left as -1.  When resolving a generic variable to
+  // find the actual type, this index is used to access the generic type
+  // argument in the provided context object.
+  int _position; // Assigned during variable linking
+
+  TypeParameter(Identifier* id, ClassType* class_bound,
+    GrowableArray<ClassType*>& interface_bounds) :
+      _identifier(id), _class_bound(class_bound),
+      _interface_bounds(interface_bounds), _position(-1) {}
+
+ public:
+  static TypeParameter* parse_generic_signature(DescriptorStream* str);
+
+  ClassType* bound();
+  int position() { return _position; }
+
+  void bind_variables_to_parameters(Descriptor* sig, int position);
+  Identifier* identifier() { return _identifier; }
+
+  Type* resolve(Context* ctx, int inner_depth, int ctx_depth);
+  TypeParameter* canonicalize(Context* ctx, int ctx_depth);
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const;
+#endif
+};
+
+class Type : public ResourceObj {
+ public:
+  static Type* parse_generic_signature(DescriptorStream* str);
+
+  virtual ClassType* as_class() { return NULL; }
+  virtual TypeVariable* as_variable() { return NULL; }
+  virtual ArrayType* as_array() { return NULL; }
+  virtual PrimitiveType* as_primitive() { return NULL; }
+
+  virtual bool covariant_match(Type* gt, Context* ctx) = 0;
+  virtual Type* canonicalize(Context* ctx, int ctx_depth) = 0;
+
+  virtual void bind_variables_to_parameters(Descriptor* sig) = 0;
+
+#ifndef PRODUCT
+  virtual void reify_signature(stringStream* ss, Context* ctx) = 0;
+  virtual void print_on(outputStream* str) const = 0;
+#endif
+};
+
+class ClassType : public Type {
+  friend class ClassDescriptor;
+ protected:
+  Identifier* _identifier;
+  GrowableArray<TypeArgument*> _type_arguments;
+  ClassType* _outer_class;
+
+  ClassType(Identifier* identifier,
+      GrowableArray<TypeArgument*>& args,
+      ClassType* outer)
+      : _identifier(identifier), _type_arguments(args), _outer_class(outer) {}
+
+  // Returns true if there are inner classes to read
+  static Identifier* parse_generic_signature_simple(
+      GrowableArray<TypeArgument*>* args,
+      bool* has_inner, DescriptorStream* str);
+
+  static ClassType* parse_generic_signature(ClassType* outer,
+      DescriptorStream* str);
+  static ClassType* from_symbol(Symbol* sym);
+
+ public:
+  ClassType* as_class() { return this; }
+
+  static ClassType* parse_generic_signature(DescriptorStream* str);
+  static ClassType* java_lang_Object();
+
+  Identifier* identifier() { return _identifier; }
+  int type_arguments_length() { return _type_arguments.length(); }
+  TypeArgument* type_argument_at(int i);
+
+  virtual ClassType* outer_class() { return _outer_class; }
+
+  bool covariant_match(Type* gt, Context* ctx);
+  ClassType* canonicalize(Context* ctx, int context_depth);
+
+  void bind_variables_to_parameters(Descriptor* sig);
+
+#ifndef PRODUCT
+  void reify_signature(stringStream* ss, Context* ctx);
+  void print_on(outputStream* str) const;
+#endif
+};
+
+class TypeVariable : public Type {
+ private:
+  Identifier* _id;
+  TypeParameter* _parameter; // assigned during linking
+
+  // how many steps "out" from inner classes, -1 if method
+  int _inner_depth;
+
+  TypeVariable(Identifier* id)
+      : _id(id), _parameter(NULL), _inner_depth(0) {}
+
+ public:
+  TypeVariable* as_variable() { return this; }
+
+  static TypeVariable* parse_generic_signature(DescriptorStream* str);
+
+  Identifier* identifier() { return _id; }
+  TypeParameter* parameter() { return _parameter; }
+  int inner_depth() { return _inner_depth; }
+
+  void bind_variables_to_parameters(Descriptor* sig);
+
+  Type* resolve(Context* ctx, int ctx_depth);
+  bool covariant_match(Type* gt, Context* ctx);
+  Type* canonicalize(Context* ctx, int ctx_depth);
+
+#ifndef PRODUCT
+  void reify_signature(stringStream* ss, Context* ctx);
+  void print_on(outputStream* str) const;
+#endif
+};
+
+class ArrayType : public Type {
+ private:
+  Type* _base;
+
+  ArrayType(Type* base) : _base(base) {}
+
+ public:
+  ArrayType* as_array() { return this; }
+
+  static ArrayType* parse_generic_signature(DescriptorStream* str);
+
+  bool covariant_match(Type* gt, Context* ctx);
+  ArrayType* canonicalize(Context* ctx, int ctx_depth);
+
+  void bind_variables_to_parameters(Descriptor* sig);
+
+#ifndef PRODUCT
+  void reify_signature(stringStream* ss, Context* ctx);
+  void print_on(outputStream* str) const;
+#endif
+};
+
+class PrimitiveType : public Type {
+  friend class Type;
+ private:
+  char _type; // includes V for void
+
+  PrimitiveType(char& type) : _type(type) {}
+
+ public:
+  PrimitiveType* as_primitive() { return this; }
+
+  bool covariant_match(Type* gt, Context* ctx);
+  PrimitiveType* canonicalize(Context* ctx, int ctx_depth);
+
+  void bind_variables_to_parameters(Descriptor* sig);
+
+#ifndef PRODUCT
+  void reify_signature(stringStream* ss, Context* ctx);
+  void print_on(outputStream* str) const;
+#endif
+};
+
+class TypeArgument : public ResourceObj {
+ private:
+  Type* _lower_bound;
+  Type* _upper_bound; // may be null or == _lower_bound
+
+  TypeArgument(Type* lower_bound, Type* upper_bound)
+      : _lower_bound(lower_bound), _upper_bound(upper_bound) {}
+
+ public:
+
+  static TypeArgument* parse_generic_signature(DescriptorStream* str);
+
+  Type* lower_bound() { return _lower_bound; }
+  Type* upper_bound() { return _upper_bound; }
+
+  void bind_variables_to_parameters(Descriptor* sig);
+  TypeArgument* canonicalize(Context* ctx, int ctx_depth);
+
+  bool covariant_match(TypeArgument* a, Context* ctx);
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const;
+#endif
+};
+
+
+class Context : public ResourceObj {
+ private:
+  DescriptorCache* _cache;
+  GrowableArray<ClassType*> _type_arguments;
+
+  void reset_to_mark(int size);
+
+ public:
+  // When this object goes out of scope or 'destroy' is
+  // called, then the application of the type to the
+  // context is wound-back (unless it's been deactivated).
+  class Mark : public StackObj {
+   private:
+    mutable Context* _context;
+    int _marked_size;
+
+    bool is_active() const { return _context != NULL; }
+    void deactivate() const { _context = NULL; }
+
+   public:
+    Mark() : _context(NULL), _marked_size(0) {}
+    Mark(Context* ctx, int sz) : _context(ctx), _marked_size(sz) {}
+    Mark(const Mark& m) : _context(m._context), _marked_size(m._marked_size) {
+      m.deactivate(); // Ownership is transferred
+    }
+
+    Mark& operator=(const Mark& cm) {
+      destroy();
+      _context = cm._context;
+      _marked_size = cm._marked_size;
+      cm.deactivate();
+      return *this;
+    }
+
+    void destroy();
+    ~Mark() { destroy(); }
+  };
+
+  Context(DescriptorCache* cache) : _cache(cache) {}
+
+  Mark mark() { return Mark(this, _type_arguments.length()); }
+  void apply_type_arguments(InstanceKlass* current, InstanceKlass* super,TRAPS);
+
+  ClassType* at_depth(int i) const;
+
+#ifndef PRODUCT
+  void print_on(outputStream* str) const;
+#endif
+};
+
+/**
+ * Contains a cache of descriptors for classes and methods so they can be
+ * looked-up instead of reparsing each time they are needed.
+ */
+class DescriptorCache : public ResourceObj {
+ private:
+  ResourceHashtable<InstanceKlass*, ClassDescriptor*> _class_descriptors;
+  ResourceHashtable<Method*, MethodDescriptor*> _method_descriptors;
+
+ public:
+  ClassDescriptor* descriptor_for(InstanceKlass* ikh, TRAPS);
+
+  MethodDescriptor* descriptor_for(Method* mh, ClassDescriptor* cd, TRAPS);
+  // Class descriptor derived from method holder
+  MethodDescriptor* descriptor_for(Method* mh, TRAPS);
+};
+
+} // namespace generic
+
+#endif // SHARE_VM_CLASSFILE_GENERICSIGNATURES_HPP
+
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1156,7 +1156,7 @@
 // Print stack trace element to resource allocated buffer
 char* java_lang_Throwable::print_stack_element_to_buffer(Method* method, int bci) {
   // Get strings and string lengths
-  InstanceKlass* klass = InstanceKlass::cast(method->method_holder());
+  InstanceKlass* klass = method->method_holder();
   const char* klass_name  = klass->external_name();
   int buf_len = (int)strlen(klass_name);
   char* source_file_name;
@@ -1747,14 +1747,14 @@
   Handle element = ik->allocate_instance_handle(CHECK_0);
   // Fill in class name
   ResourceMark rm(THREAD);
-  const char* str = InstanceKlass::cast(method->method_holder())->external_name();
+  const char* str = method->method_holder()->external_name();
   oop classname = StringTable::intern((char*) str, CHECK_0);
   java_lang_StackTraceElement::set_declaringClass(element(), classname);
   // Fill in method name
   oop methodname = StringTable::intern(method->name(), CHECK_0);
   java_lang_StackTraceElement::set_methodName(element(), methodname);
   // Fill in source file name
-  Symbol* source = InstanceKlass::cast(method->method_holder())->source_file_name();
+  Symbol* source = method->method_holder()->source_file_name();
   if (ShowHiddenFrames && source == NULL)
     source = vmSymbols::unknown_class_name();
   oop filename = StringTable::intern(source, CHECK_0);
--- a/hotspot/src/share/vm/classfile/systemDictionary.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -137,6 +137,7 @@
   /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */                              \
   /* Universe::is_gte_jdk14x_version() is not set up by this point. */                                                   \
   /* It's okay if this turns out to be NULL in non-1.4 JDKs. */                                                          \
+  do_klass(lambda_MagicLambdaImpl_klass,                java_lang_invoke_MagicLambdaImpl, Opt ) \
   do_klass(reflect_MagicAccessorImpl_klass,             sun_reflect_MagicAccessorImpl,             Opt                 ) \
   do_klass(reflect_MethodAccessorImpl_klass,            sun_reflect_MethodAccessorImpl,            Opt_Only_JDK14NewRef) \
   do_klass(reflect_ConstructorAccessorImpl_klass,       sun_reflect_ConstructorAccessorImpl,       Opt_Only_JDK14NewRef) \
--- a/hotspot/src/share/vm/classfile/verifier.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/verifier.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -446,7 +446,7 @@
           bytecode_name = "<illegal>";
       }
     }
-    InstanceKlass* ik = InstanceKlass::cast(method->method_holder());
+    InstanceKlass* ik = method->method_holder();
     ss->indent().print_cr("Location:");
     streamIndentor si2(ss);
     ss->indent().print_cr("%s.%s%s @%d: %s",
@@ -555,9 +555,10 @@
     if (was_recursively_verified())  return;
 
     Method* m = methods->at(index);
-    if (m->is_native() || m->is_abstract()) {
+    if (m->is_native() || m->is_abstract() || m->is_overpass()) {
       // If m is native or abstract, skip it.  It is checked in class file
-      // parser that methods do not override a final method.
+      // parser that methods do not override a final method.  Overpass methods
+      // are trusted since the VM generates them.
       continue;
     }
     verify_method(methodHandle(THREAD, m), CHECK_VERIFY(this));
@@ -1849,7 +1850,7 @@
   if ((index <= 0) || (index >= nconstants)) {
     verify_error(ErrorContext::bad_cp_index(bci, index),
         "Illegal constant pool index %d in class %s",
-        index, InstanceKlass::cast(cp->pool_holder())->external_name());
+        index, cp->pool_holder()->external_name());
     return;
   }
 }
@@ -1868,7 +1869,7 @@
   if ((types & (1 << tag)) == 0) {
     verify_error(ErrorContext::bad_cp_index(bci, index),
       "Illegal type at constant pool entry %d in class %s",
-      index, InstanceKlass::cast(cp->pool_holder())->external_name());
+      index, cp->pool_holder()->external_name());
     return;
   }
 }
@@ -1880,7 +1881,7 @@
   if (!tag.is_klass() && !tag.is_unresolved_klass()) {
     verify_error(ErrorContext::bad_cp_index(bci, index),
         "Illegal type at constant pool entry %d in class %s",
-        index, InstanceKlass::cast(cp->pool_holder())->external_name());
+        index, cp->pool_holder()->external_name());
     return;
   }
 }
@@ -2304,11 +2305,21 @@
   // Make sure the constant pool item is the right type
   u2 index = bcs->get_index_u2();
   Bytecodes::Code opcode = bcs->raw_code();
-  unsigned int types = (opcode == Bytecodes::_invokeinterface
-                                ? 1 << JVM_CONSTANT_InterfaceMethodref
-                      : opcode == Bytecodes::_invokedynamic
-                                ? 1 << JVM_CONSTANT_InvokeDynamic
-                                : 1 << JVM_CONSTANT_Methodref);
+  unsigned int types;
+  switch (opcode) {
+    case Bytecodes::_invokeinterface:
+      types = 1 << JVM_CONSTANT_InterfaceMethodref;
+      break;
+    case Bytecodes::_invokedynamic:
+      types = 1 << JVM_CONSTANT_InvokeDynamic;
+      break;
+    case Bytecodes::_invokespecial:
+      types = (1 << JVM_CONSTANT_InterfaceMethodref) |
+              (1 << JVM_CONSTANT_Methodref);
+      break;
+    default:
+      types = 1 << JVM_CONSTANT_Methodref;
+  }
   verify_cp_type(bcs->bci(), index, cp, types, CHECK_VERIFY(this));
 
   // Get method name and signature
--- a/hotspot/src/share/vm/classfile/vmSymbols.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -507,7 +507,7 @@
 }
 
 void vmIntrinsics::verify_method(ID actual_id, Method* m) {
-  Symbol* mk = Klass::cast(m->method_holder())->name();
+  Symbol* mk = m->method_holder()->name();
   ID declared_id = match_method_with_klass(m, mk);
 
   if (declared_id == actual_id)  return; // success
--- a/hotspot/src/share/vm/classfile/vmSymbols.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -115,6 +115,7 @@
   /* Java runtime version access */                                                               \
   template(sun_misc_Version,                          "sun/misc/Version")                         \
   template(java_runtime_name_name,                    "java_runtime_name")                        \
+  template(java_runtime_version_name,                 "java_runtime_version")                     \
                                                                                                   \
   /* class file format tags */                                                                    \
   template(tag_source_file,                           "SourceFile")                               \
@@ -258,6 +259,7 @@
   template(java_lang_invoke_DontInline_signature,     "Ljava/lang/invoke/DontInline;")            \
   template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \
   template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;")  \
+  template(java_lang_invoke_MagicLambdaImpl,          "java/lang/invoke/MagicLambdaImpl")         \
   /* internal up-calls made only by the JVM, via class sun.invoke.MethodHandleNatives: */         \
   template(findMethodHandleType_name,                 "findMethodHandleType")                     \
   template(findMethodHandleType_signature,       "(Ljava/lang/Class;[Ljava/lang/Class;)Ljava/lang/invoke/MethodType;") \
--- a/hotspot/src/share/vm/code/compiledIC.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/code/compiledIC.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -191,8 +191,8 @@
     int index = klassItable::compute_itable_index(call_info->resolved_method()());
     entry = VtableStubs::create_stub(false, index, method());
     assert(entry != NULL, "entry not computed");
-    Klass* k = call_info->resolved_method()->method_holder();
-    assert(Klass::cast(k)->is_interface(), "sanity check");
+    InstanceKlass* k = call_info->resolved_method()->method_holder();
+    assert(k->is_interface(), "sanity check");
     InlineCacheBuffer::create_transition_stub(this, k, entry);
   } else {
     // Can be different than method->vtable_index(), due to package-private etc.
--- a/hotspot/src/share/vm/code/dependencies.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -829,7 +829,7 @@
       }
       if (   !Dependencies::is_concrete_method(lm)
           && !Dependencies::is_concrete_method(m)
-          && Klass::cast(lm->method_holder())->is_subtype_of(m->method_holder()))
+          && lm->method_holder()->is_subtype_of(m->method_holder()))
         // Method m is overridden by lm, but both are non-concrete.
         return true;
     }
@@ -1160,7 +1160,11 @@
 
   // We could also return false if m does not yet appear to be
   // executed, if the VM version supports this distinction also.
-  return !m->is_abstract();
+  return !m->is_abstract() &&
+         !InstanceKlass::cast(m->method_holder())->is_interface();
+         // TODO: investigate whether default methods should be
+         // considered as "concrete" in this situation.  For now they
+         // are not.
 }
 
 
--- a/hotspot/src/share/vm/code/nmethod.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/code/nmethod.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1263,7 +1263,7 @@
   assert(_entry_bci != InvocationEntryBci, "wrong kind of nmethod");
   // Remove from list of active nmethods
   if (method() != NULL)
-    InstanceKlass::cast(method()->method_holder())->remove_osr_nmethod(this);
+    method()->method_holder()->remove_osr_nmethod(this);
   // Set entry as invalid
   _entry_bci = InvalidOSREntryBci;
 }
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1051,7 +1051,7 @@
   guarantee(!method->is_abstract(), "cannot compile abstract methods");
   assert(method->method_holder()->oop_is_instance(),
          "sanity check");
-  assert(!InstanceKlass::cast(method->method_holder())->is_not_initialized(),
+  assert(!method->method_holder()->is_not_initialized(),
          "method holder must be initialized");
   assert(!method->is_method_handle_intrinsic(), "do not enqueue these guys");
 
@@ -1206,7 +1206,7 @@
   assert(method->method_holder()->oop_is_instance(), "not an instance method");
   assert(osr_bci == InvocationEntryBci || (0 <= osr_bci && osr_bci < method->code_size()), "bci out of range");
   assert(!method->is_abstract() && (osr_bci == InvocationEntryBci || !method->is_native()), "cannot compile abstract/native methods");
-  assert(!InstanceKlass::cast(method->method_holder())->is_not_initialized(), "method holder must be initialized");
+  assert(!method->method_holder()->is_not_initialized(), "method holder must be initialized");
 
   if (!TieredCompilation) {
     comp_level = CompLevel_highest_tier;
--- a/hotspot/src/share/vm/compiler/compilerOracle.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -67,7 +67,7 @@
 
   // utility method
   MethodMatcher* find(methodHandle method) {
-    Symbol* class_name  = Klass::cast(method->method_holder())->name();
+    Symbol* class_name  = method->method_holder()->name();
     Symbol* method_name = method->name();
     for (MethodMatcher* current = this; current != NULL; current = current->_next) {
       if (match(class_name, current->class_name(), current->_class_mode) &&
@@ -624,7 +624,7 @@
   assert(has_command_file(), "command file must be specified");
   fileStream stream(fopen(cc_file(), "at"));
   stream.print("exclude ");
-  Klass::cast(method->method_holder())->name()->print_symbol_on(&stream);
+  method->method_holder()->name()->print_symbol_on(&stream);
   stream.print(".");
   method->name()->print_symbol_on(&stream);
   method->signature()->print_symbol_on(&stream);
--- a/hotspot/src/share/vm/compiler/disassembler.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -55,16 +55,18 @@
 bool        Disassembler::_tried_to_load_library = false;
 
 // This routine is in the shared library:
+Disassembler::decode_func_virtual Disassembler::_decode_instructions_virtual = NULL;
 Disassembler::decode_func Disassembler::_decode_instructions = NULL;
 
 static const char hsdis_library_name[] = "hsdis-"HOTSPOT_LIB_ARCH;
-static const char decode_instructions_name[] = "decode_instructions_virtual";
-
+static const char decode_instructions_virtual_name[] = "decode_instructions_virtual";
+static const char decode_instructions_name[] = "decode_instructions";
+static bool use_new_version = true;
 #define COMMENT_COLUMN  40 LP64_ONLY(+8) /*could be an option*/
 #define BYTES_COMMENT   ";..."  /* funky byte display comment */
 
 bool Disassembler::load_library() {
-  if (_decode_instructions != NULL) {
+  if (_decode_instructions_virtual != NULL || _decode_instructions != NULL) {
     // Already succeeded.
     return true;
   }
@@ -123,11 +125,19 @@
     _library = os::dll_load(buf, ebuf, sizeof ebuf);
   }
   if (_library != NULL) {
+    _decode_instructions_virtual = CAST_TO_FN_PTR(Disassembler::decode_func_virtual,
+                                          os::dll_lookup(_library, decode_instructions_virtual_name));
+  }
+  if (_decode_instructions_virtual == NULL) {
+    // could not spot in new version, try old version
     _decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func,
                                           os::dll_lookup(_library, decode_instructions_name));
+    use_new_version = false;
+  } else {
+    use_new_version = true;
   }
   _tried_to_load_library = true;
-  if (_decode_instructions == NULL) {
+  if (_decode_instructions_virtual == NULL && _decode_instructions == NULL) {
     tty->print_cr("Could not load %s; %s; %s", buf,
                   ((_library != NULL)
                    ? "entry point is missing"
@@ -450,17 +460,31 @@
     // This is mainly for debugging the library itself.
     FILE* out = stdout;
     FILE* xmlout = (_print_raw > 1 ? out : NULL);
-    return (address)
-      (*Disassembler::_decode_instructions)((uintptr_t)start, (uintptr_t)end,
-                                            start, end - start,
+    return use_new_version ?
+      (address)
+      (*Disassembler::_decode_instructions_virtual)((uintptr_t)start, (uintptr_t)end,
+                                                    start, end - start,
+                                                    NULL, (void*) xmlout,
+                                                    NULL, (void*) out,
+                                                    options(), 0/*nice new line*/)
+      :
+      (address)
+      (*Disassembler::_decode_instructions)(start, end,
                                             NULL, (void*) xmlout,
                                             NULL, (void*) out,
                                             options());
   }
 
-  return (address)
-    (*Disassembler::_decode_instructions)((uintptr_t)start, (uintptr_t)end,
-                                          start, end - start,
+  return use_new_version ?
+    (address)
+    (*Disassembler::_decode_instructions_virtual)((uintptr_t)start, (uintptr_t)end,
+                                                  start, end - start,
+                                                  &event_to_env,  (void*) this,
+                                                  &printf_to_env, (void*) this,
+                                                  options(), 0/*nice new line*/)
+    :
+    (address)
+    (*Disassembler::_decode_instructions)(start, end,
                                           &event_to_env,  (void*) this,
                                           &printf_to_env, (void*) this,
                                           options());
--- a/hotspot/src/share/vm/compiler/disassembler.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/compiler/disassembler.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -49,18 +49,27 @@
   friend class decode_env;
  private:
   // this is the type of the dll entry point:
-  typedef void* (*decode_func)(uintptr_t start_va, uintptr_t end_va,
+  typedef void* (*decode_func_virtual)(uintptr_t start_va, uintptr_t end_va,
                                unsigned char* buffer, uintptr_t length,
                                void* (*event_callback)(void*, const char*, void*),
                                void* event_stream,
                                int (*printf_callback)(void*, const char*, ...),
                                void* printf_stream,
+                               const char* options,
+                               int newline);
+  // this is the type of the dll entry point for old version:
+  typedef void* (*decode_func)(void* start_va, void* end_va,
+                               void* (*event_callback)(void*, const char*, void*),
+                               void* event_stream,
+                               int (*printf_callback)(void*, const char*, ...),
+                               void* printf_stream,
                                const char* options);
   // points to the library.
   static void*    _library;
   // bailout
   static bool     _tried_to_load_library;
   // points to the decode function.
+  static decode_func_virtual _decode_instructions_virtual;
   static decode_func _decode_instructions;
   // tries to load library and return whether it succedded.
   static bool load_library();
@@ -85,7 +94,9 @@
 
  public:
   static bool can_decode() {
-    return (_decode_instructions != NULL) || load_library();
+    return (_decode_instructions_virtual != NULL) ||
+           (_decode_instructions != NULL) ||
+           load_library();
   }
   static void decode(CodeBlob *cb,               outputStream* st = NULL);
   static void decode(nmethod* nm,                outputStream* st = NULL);
--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -320,6 +320,7 @@
   void bang_stack_shadow_pages(bool native_call);
 
   void generate_all();
+  void initialize_method_handle_entries();
 
  public:
   AbstractInterpreterGenerator(StubQueue* _code);
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -235,10 +235,6 @@
 #endif
 #endif
 
-// JavaStack Implementation
-#define MORE_STACK(count)  \
-    (topOfStack -= ((count) * Interpreter::stackElementWords))
-
 
 #define UPDATE_PC(opsize) {pc += opsize; }
 /*
@@ -575,7 +571,7 @@
 
 /* 0xE0 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
 /* 0xE4 */ &&opc_default,     &&opc_fast_aldc,      &&opc_fast_aldc_w,  &&opc_return_register_finalizer,
-/* 0xE8 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
+/* 0xE8 */ &&opc_invokehandle,&&opc_default,        &&opc_default,      &&opc_default,
 /* 0xEC */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
 
 /* 0xF0 */ &&opc_default,     &&opc_default,        &&opc_default,      &&opc_default,
@@ -1773,7 +1769,7 @@
 
           oop obj;
           if ((Bytecodes::Code)opcode == Bytecodes::_getstatic) {
-            Klass* k = (Klass*) cache->f1();
+            Klass* k = cache->f1_as_klass();
             obj = k->java_mirror();
             MORE_STACK(1);  // Assume single slot push
           } else {
@@ -1885,7 +1881,7 @@
             --count;
           }
           if ((Bytecodes::Code)opcode == Bytecodes::_putstatic) {
-            Klass* k = (Klass*) cache->f1();
+            Klass* k = cache->f1_as_klass();
             obj = k->java_mirror();
           } else {
             --count;
@@ -2190,6 +2186,7 @@
       }
 
       CASE(_invokedynamic): {
+
         if (!EnableInvokeDynamic) {
           // We should not encounter this bytecode if !EnableInvokeDynamic.
           // The verifier will stop it.  However, if we get past the verifier,
@@ -2199,26 +2196,64 @@
           ShouldNotReachHere();
         }
 
-        int index = Bytes::get_native_u4(pc+1);
+        u4 index = Bytes::get_native_u4(pc+1);
+        ConstantPoolCacheEntry* cache = cp->constant_pool()->invokedynamic_cp_cache_entry_at(index);
 
         // We are resolved if the resolved_references field contains a non-null object (CallSite, etc.)
         // This kind of CP cache entry does not need to match the flags byte, because
         // there is a 1-1 relation between bytecode type and CP entry type.
-        ConstantPool* constants = METHOD->constants();
-        oop result = constants->resolved_references()->obj_at(index);
-        if (result == NULL) {
+        if (! cache->is_resolved((Bytecodes::Code) opcode)) {
           CALL_VM(InterpreterRuntime::resolve_invokedynamic(THREAD),
                   handle_exception);
-          result = THREAD->vm_result();
+          cache = cp->constant_pool()->invokedynamic_cp_cache_entry_at(index);
+        }
+
+        Method* method = cache->f1_as_method();
+        VERIFY_OOP(method);
+
+        if (cache->has_appendix()) {
+          ConstantPool* constants = METHOD->constants();
+          SET_STACK_OBJECT(cache->appendix_if_resolved(constants), 0);
+          MORE_STACK(1);
+        }
+
+        istate->set_msg(call_method);
+        istate->set_callee(method);
+        istate->set_callee_entry_point(method->from_interpreted_entry());
+        istate->set_bcp_advance(5);
+
+        UPDATE_PC_AND_RETURN(0); // I'll be back...
+      }
+
+      CASE(_invokehandle): {
+
+        if (!EnableInvokeDynamic) {
+          ShouldNotReachHere();
         }
 
-        VERIFY_OOP(result);
-        oop method_handle = java_lang_invoke_CallSite::target(result);
-        CHECK_NULL(method_handle);
-
-        istate->set_msg(call_method_handle);
-        istate->set_callee((Method*) method_handle);
-        istate->set_bcp_advance(5);
+        u2 index = Bytes::get_native_u2(pc+1);
+        ConstantPoolCacheEntry* cache = cp->entry_at(index);
+
+        if (! cache->is_resolved((Bytecodes::Code) opcode)) {
+          CALL_VM(InterpreterRuntime::resolve_invokehandle(THREAD),
+                  handle_exception);
+          cache = cp->entry_at(index);
+        }
+
+        Method* method = cache->f1_as_method();
+
+        VERIFY_OOP(method);
+
+        if (cache->has_appendix()) {
+          ConstantPool* constants = METHOD->constants();
+          SET_STACK_OBJECT(cache->appendix_if_resolved(constants), 0);
+          MORE_STACK(1);
+        }
+
+        istate->set_msg(call_method);
+        istate->set_callee(method);
+        istate->set_callee_entry_point(method->from_interpreted_entry());
+        istate->set_bcp_advance(3);
 
         UPDATE_PC_AND_RETURN(0); // I'll be back...
       }
--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -50,6 +50,10 @@
 
 #ifdef CC_INTERP
 
+// JavaStack Implementation
+#define MORE_STACK(count)  \
+    (topOfStack -= ((count) * Interpreter::stackElementWords))
+
 // CVM definitions find hotspot equivalents...
 
 union VMJavaVal64 {
@@ -107,7 +111,6 @@
          rethrow_exception,         // unwinding and throwing exception
          // requests to frame manager from C++ interpreter
          call_method,               // request for new frame from interpreter, manager responds with method_entry
-         call_method_handle,        // like the above, except the callee is a method handle
          return_from_method,        // request from interpreter to unwind, manager responds with method_continue
          more_monitors,             // need a new monitor
          throwing_exception,        // unwind stack and rethrow
--- a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -117,7 +117,6 @@
     method_entry(empty);
     method_entry(accessor);
     method_entry(abstract);
-    method_entry(method_handle);
     method_entry(java_lang_math_sin   );
     method_entry(java_lang_math_cos   );
     method_entry(java_lang_math_tan   );
@@ -125,7 +124,12 @@
     method_entry(java_lang_math_sqrt  );
     method_entry(java_lang_math_log   );
     method_entry(java_lang_math_log10 );
+    method_entry(java_lang_math_pow );
+    method_entry(java_lang_math_exp );
     method_entry(java_lang_ref_reference_get);
+
+    initialize_method_handle_entries();
+
     Interpreter::_native_entry_begin = Interpreter::code()->code_end();
     method_entry(native);
     method_entry(native_synchronized);
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -464,3 +464,11 @@
     }
   }
 }
+
+void AbstractInterpreterGenerator::initialize_method_handle_entries() {
+  // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate:
+  for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) {
+    Interpreter::MethodKind kind = (Interpreter::MethodKind) i;
+    Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract];
+  }
+}
--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -733,12 +733,7 @@
                                  get_index_u2_cpcache(thread, bytecode), bytecode, CHECK);
   } // end JvmtiHideSingleStepping
 
-  cache_entry(thread)->set_method_handle(
-      pool,
-      info.resolved_method(),
-      info.resolved_appendix(),
-      info.resolved_method_type(),
-      pool->resolved_references());
+  cache_entry(thread)->set_method_handle(pool, info);
 }
 IRT_END
 
@@ -762,12 +757,7 @@
   } // end JvmtiHideSingleStepping
 
   ConstantPoolCacheEntry* cp_cache_entry = pool->invokedynamic_cp_cache_entry_at(index);
-  cp_cache_entry->set_dynamic_call(
-      pool,
-      info.resolved_method(),
-      info.resolved_appendix(),
-      info.resolved_method_type(),
-      pool->resolved_references());
+  cp_cache_entry->set_dynamic_call(pool, info);
 }
 IRT_END
 
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -23,6 +23,7 @@
  */
 
 #include "precompiled.hpp"
+#include "classfile/defaultMethods.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
 #include "compiler/compileBroker.hpp"
@@ -132,7 +133,7 @@
       // don't force compilation, resolve was on behalf of compiler
       return;
     }
-    if (InstanceKlass::cast(selected_method->method_holder())->is_not_initialized()) {
+    if (selected_method->method_holder()->is_not_initialized()) {
       // 'is_not_initialized' means not only '!is_initialized', but also that
       // initialization has not been started yet ('!being_initialized')
       // Do not force compilation of methods in uninitialized classes.
@@ -404,21 +405,13 @@
                                   Symbol* method_name, Symbol* method_signature,
                                   KlassHandle current_klass, bool check_access, TRAPS) {
 
-  // 1. check if klass is not interface
-  if (resolved_klass->is_interface()) {
-    ResourceMark rm(THREAD);
-    char buf[200];
-    jio_snprintf(buf, sizeof(buf), "Found interface %s, but class was expected", Klass::cast(resolved_klass())->external_name());
-    THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
-  }
-
   Handle nested_exception;
 
-  // 2. lookup method in resolved klass and its super klasses
+  // 1. lookup method in resolved klass and its super klasses
   lookup_method_in_klasses(resolved_method, resolved_klass, method_name, method_signature, CHECK);
 
   if (resolved_method.is_null()) { // not found in the class hierarchy
-    // 3. lookup method in all the interfaces implemented by the resolved klass
+    // 2. lookup method in all the interfaces implemented by the resolved klass
     lookup_method_in_interfaces(resolved_method, resolved_klass, method_name, method_signature, CHECK);
 
     if (resolved_method.is_null()) {
@@ -432,7 +425,7 @@
     }
 
     if (resolved_method.is_null()) {
-      // 4. method lookup failed
+      // 3. method lookup failed
       ResourceMark rm(THREAD);
       THROW_MSG_CAUSE(vmSymbols::java_lang_NoSuchMethodError(),
                       Method::name_and_sig_as_C_string(Klass::cast(resolved_klass()),
@@ -442,6 +435,15 @@
     }
   }
 
+  // 4. check if klass is not interface
+  if (resolved_klass->is_interface() && resolved_method->is_abstract()) {
+    ResourceMark rm(THREAD);
+    char buf[200];
+    jio_snprintf(buf, sizeof(buf), "Found interface %s, but class was expected",
+        resolved_klass()->external_name());
+    THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
+  }
+
   // 5. check if method is concrete
   if (resolved_method->is_abstract() && !resolved_klass->is_abstract()) {
     ResourceMark rm(THREAD);
@@ -464,7 +466,7 @@
 
     // check loader constraints
     Handle loader (THREAD, InstanceKlass::cast(current_klass())->class_loader());
-    Handle class_loader (THREAD, InstanceKlass::cast(resolved_method->method_holder())->class_loader());
+    Handle class_loader (THREAD, resolved_method->method_holder()->class_loader());
     {
       ResourceMark rm(THREAD);
       char* failed_type_name =
@@ -526,7 +528,7 @@
   if (check_access) {
     HandleMark hm(THREAD);
     Handle loader (THREAD, InstanceKlass::cast(current_klass())->class_loader());
-    Handle class_loader (THREAD, InstanceKlass::cast(resolved_method->method_holder())->class_loader());
+    Handle class_loader (THREAD, resolved_method->method_holder()->class_loader());
     {
       ResourceMark rm(THREAD);
       char* failed_type_name =
@@ -743,6 +745,27 @@
                                                    Symbol* method_name, Symbol* method_signature,
                                                    KlassHandle current_klass, bool check_access, TRAPS) {
 
+  if (resolved_klass->is_interface() && current_klass() != NULL) {
+    // If the target class is a direct interface, treat this as a "super"
+    // default call.
+    //
+    // If the current method is an overpass that happens to call a direct
+    // super-interface's method, then we'll end up rerunning the default method
+    // analysis even though we don't need to, but that's ok since it will end
+    // up with the same answer.
+    InstanceKlass* ik = InstanceKlass::cast(current_klass());
+    Array<Klass*>* interfaces = ik->local_interfaces();
+    int num_interfaces = interfaces->length();
+    for (int index = 0; index < num_interfaces; index++) {
+      if (interfaces->at(index) == resolved_klass()) {
+        Method* method = DefaultMethods::find_super_default(current_klass(),
+            resolved_klass(), method_name, method_signature, CHECK);
+        resolved_method = methodHandle(THREAD, method);
+        return;
+      }
+    }
+  }
+
   resolve_method(resolved_method, resolved_klass, method_name, method_signature, current_klass, check_access, CHECK);
 
   // check if method name is <init>, that it is found in same klass as static type
@@ -784,11 +807,17 @@
   { KlassHandle method_klass  = KlassHandle(THREAD,
                                             resolved_method->method_holder());
 
-    if (check_access &&
+    const bool direct_calling_default_method =
+      resolved_klass() != NULL && resolved_method() != NULL &&
+      resolved_klass->is_interface() && !resolved_method->is_abstract();
+
+    if (!direct_calling_default_method &&
+        check_access &&
         // a) check if ACC_SUPER flag is set for the current class
         current_klass->is_super() &&
         // b) check if the method class is a superclass of the current class (superclass relation is not reflexive!)
-        current_klass->is_subtype_of(method_klass()) && current_klass() != method_klass() &&
+        current_klass->is_subtype_of(method_klass()) &&
+        current_klass() != method_klass() &&
         // c) check if the method is not <init>
         resolved_method->name() != vmSymbols::object_initializer_name()) {
       // Lookup super method
@@ -881,12 +910,12 @@
 
   // Virtual methods cannot be resolved before its klass has been linked, for otherwise the Method*'s
   // has not been rewritten, and the vtable initialized.
-  assert(InstanceKlass::cast(resolved_method->method_holder())->is_linked(), "must be linked");
+  assert(resolved_method->method_holder()->is_linked(), "must be linked");
 
   // Virtual methods cannot be resolved before its klass has been linked, for otherwise the Method*'s
   // has not been rewritten, and the vtable initialized. Make sure to do this after the nullcheck, since
   // a missing receiver might result in a bogus lookup.
-  assert(InstanceKlass::cast(resolved_method->method_holder())->is_linked(), "must be linked");
+  assert(resolved_method->method_holder()->is_linked(), "must be linked");
 
   // do lookup based on receiver klass using the vtable index
   if (resolved_method->method_holder()->is_interface()) { // miranda method
--- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -373,11 +373,7 @@
   method_entry(java_lang_math_pow  )
   method_entry(java_lang_ref_reference_get)
 
-  // method handle entry kinds are generated later in MethodHandlesAdapterGenerator::generate:
-  for (int i = Interpreter::method_handle_invoke_FIRST; i <= Interpreter::method_handle_invoke_LAST; i++) {
-    Interpreter::MethodKind kind = (Interpreter::MethodKind) i;
-    Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract];
-  }
+  initialize_method_handle_entries();
 
   // all native method kinds (must be one contiguous block)
   Interpreter::_native_entry_begin = Interpreter::code()->code_end();
--- a/hotspot/src/share/vm/memory/collectorPolicy.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -742,6 +742,8 @@
   uint gc_count = 0;
   uint full_gc_count = 0;
 
+  assert(!Heap_lock->owned_by_self(), "Should not be holding the Heap_lock");
+
   do {
     MetaWord* result = NULL;
     if (GC_locker::is_active_and_needs_gc()) {
@@ -756,7 +758,6 @@
       }
       JavaThread* jthr = JavaThread::current();
       if (!jthr->in_critical()) {
-        MutexUnlocker mul(Heap_lock);
         // Wait for JNI critical section to be exited
         GC_locker::stall_until_clear();
         // The GC invoked by the last thread leaving the critical
--- a/hotspot/src/share/vm/oops/constMethod.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/constMethod.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -34,29 +34,30 @@
 const u2 ConstMethod::UNSET_IDNUM = 0xFFFF;
 
 ConstMethod* ConstMethod::allocate(ClassLoaderData* loader_data,
-                                            int byte_code_size,
-                                            int compressed_line_number_size,
-                                            int localvariable_table_length,
-                                            int exception_table_length,
-                                            int checked_exceptions_length,
-                                            TRAPS) {
+                                   int byte_code_size,
+                                   int compressed_line_number_size,
+                                   int localvariable_table_length,
+                                   int exception_table_length,
+                                   int checked_exceptions_length,
+                                   MethodType method_type,
+                                   TRAPS) {
   int size = ConstMethod::size(byte_code_size,
                                       compressed_line_number_size,
                                       localvariable_table_length,
                                       exception_table_length,
                                       checked_exceptions_length);
   return new (loader_data, size, true, THREAD) ConstMethod(
-                       byte_code_size, compressed_line_number_size,
-                       localvariable_table_length, exception_table_length,
-                       checked_exceptions_length, size);
+      byte_code_size, compressed_line_number_size, localvariable_table_length,
+      exception_table_length, checked_exceptions_length, method_type, size);
 }
 
 ConstMethod::ConstMethod(int byte_code_size,
-                                       int compressed_line_number_size,
-                                       int localvariable_table_length,
-                                       int exception_table_length,
-                                       int checked_exceptions_length,
-                                       int size) {
+                         int compressed_line_number_size,
+                         int localvariable_table_length,
+                         int exception_table_length,
+                         int checked_exceptions_length,
+                         MethodType method_type,
+                         int size) {
 
   No_Safepoint_Verifier no_safepoint;
   set_interpreter_kind(Interpreter::invalid);
@@ -69,6 +70,7 @@
                             compressed_line_number_size,
                             localvariable_table_length,
                             exception_table_length);
+  set_method_type(method_type);
   assert(this->size() == size, "wrong size for object");
 }
 
@@ -111,8 +113,7 @@
 }
 
 Method* ConstMethod::method() const {
-    return InstanceKlass::cast(_constants->pool_holder())->method_with_idnum(
-                               _method_idnum);
+    return _constants->pool_holder()->method_with_idnum(_method_idnum);
   }
 
 // linenumber table - note that length is unknown until decompression,
--- a/hotspot/src/share/vm/oops/constMethod.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/constMethod.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -108,12 +108,17 @@
 
 class ConstMethod : public MetaspaceObj {
   friend class VMStructs;
+
+public:
+  typedef enum { NORMAL, OVERPASS } MethodType;
+
 private:
   enum {
     _has_linenumber_table = 1,
     _has_checked_exceptions = 2,
     _has_localvariable_table = 4,
-    _has_exception_table = 8
+    _has_exception_table = 8,
+    _is_overpass = 16
   };
 
   // Bit vector of signature
@@ -145,19 +150,22 @@
 
   // Constructor
   ConstMethod(int byte_code_size,
-                     int compressed_line_number_size,
-                     int localvariable_table_length,
-                     int exception_table_length,
-                     int checked_exceptions_length,
-                     int size);
+              int compressed_line_number_size,
+              int localvariable_table_length,
+              int exception_table_length,
+              int checked_exceptions_length,
+              MethodType is_overpass,
+              int size);
 public:
+
   static ConstMethod* allocate(ClassLoaderData* loader_data,
-                                 int byte_code_size,
-                                 int compressed_line_number_size,
-                                 int localvariable_table_length,
-                                 int exception_table_length,
-                                 int checked_exceptions_length,
-                                 TRAPS);
+                               int byte_code_size,
+                               int compressed_line_number_size,
+                               int localvariable_table_length,
+                               int exception_table_length,
+                               int checked_exceptions_length,
+                               MethodType mt,
+                               TRAPS);
 
   bool is_constMethod() const { return true; }
 
@@ -179,6 +187,19 @@
   bool has_exception_handler() const
     { return (_flags & _has_exception_table) != 0; }
 
+  MethodType method_type() const {
+    return ((_flags & _is_overpass) == 0) ? NORMAL : OVERPASS;
+  }
+
+  void set_method_type(MethodType mt) {
+    if (mt == NORMAL) {
+      _flags &= ~(_is_overpass);
+    } else {
+      _flags |= _is_overpass;
+    }
+  }
+
+
   void set_interpreter_kind(int kind)      { _interpreter_kind = kind; }
   int  interpreter_kind(void) const        { return _interpreter_kind; }
 
--- a/hotspot/src/share/vm/oops/constantPool.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/constantPool.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -228,7 +228,7 @@
       } else {
         do_resolve = true;
         name   = this_oop->unresolved_klass_at(which);
-        loader = Handle(THREAD, InstanceKlass::cast(this_oop->pool_holder())->class_loader());
+        loader = Handle(THREAD, this_oop->pool_holder()->class_loader());
       }
     }
   } // unlocking constantPool
@@ -247,7 +247,7 @@
 
   if (do_resolve) {
     // this_oop must be unlocked during resolve_or_fail
-    oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain();
+    oop protection_domain = this_oop->pool_holder()->protection_domain();
     Handle h_prot (THREAD, protection_domain);
     Klass* k_oop = SystemDictionary::resolve_or_fail(name, loader, h_prot, true, THREAD);
     KlassHandle k;
@@ -315,7 +315,7 @@
         vframeStream vfst(JavaThread::current());
         if (!vfst.at_end()) {
           line_number = vfst.method()->line_number_from_bci(vfst.bci());
-          Symbol* s = InstanceKlass::cast(vfst.method()->method_holder())->source_file_name();
+          Symbol* s = vfst.method()->method_holder()->source_file_name();
           if (s != NULL) {
             source_file = s->as_C_string();
           }
@@ -325,11 +325,11 @@
         // only print something if the classes are different
         if (source_file != NULL) {
           tty->print("RESOLVE %s %s %s:%d\n",
-                     InstanceKlass::cast(this_oop->pool_holder())->external_name(),
+                     this_oop->pool_holder()->external_name(),
                      InstanceKlass::cast(k())->external_name(), source_file, line_number);
         } else {
           tty->print("RESOLVE %s %s\n",
-                     InstanceKlass::cast(this_oop->pool_holder())->external_name(),
+                     this_oop->pool_holder()->external_name(),
                      InstanceKlass::cast(k())->external_name());
         }
       }
@@ -339,7 +339,7 @@
       // Only updated constant pool - if it is resolved.
       do_resolve = this_oop->tag_at(which).is_unresolved_klass();
       if (do_resolve) {
-        ClassLoaderData* this_key = InstanceKlass::cast(this_oop->pool_holder())->class_loader_data();
+        ClassLoaderData* this_key = this_oop->pool_holder()->class_loader_data();
         if (!this_key->is_the_null_class_loader_data()) {
           this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM
         }
@@ -367,8 +367,8 @@
     assert(entry.is_unresolved(), "must be either symbol or klass");
     Thread *thread = Thread::current();
     Symbol* name = entry.get_symbol();
-    oop loader = InstanceKlass::cast(this_oop->pool_holder())->class_loader();
-    oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain();
+    oop loader = this_oop->pool_holder()->class_loader();
+    oop protection_domain = this_oop->pool_holder()->protection_domain();
     Handle h_prot (thread, protection_domain);
     Handle h_loader (thread, loader);
     Klass* k = SystemDictionary::find(name, h_loader, h_prot, thread);
@@ -409,8 +409,8 @@
   } else {
     assert(entry.is_unresolved(), "must be either symbol or klass");
     Symbol*  name  = entry.get_symbol();
-    oop loader = InstanceKlass::cast(this_oop->pool_holder())->class_loader();
-    oop protection_domain = Klass::cast(this_oop->pool_holder())->protection_domain();
+    oop loader = this_oop->pool_holder()->class_loader();
+    oop protection_domain = this_oop->pool_holder()->protection_domain();
     Handle h_loader(THREAD, loader);
     Handle h_prot  (THREAD, protection_domain);
     KlassHandle k(THREAD, SystemDictionary::find(name, h_loader, h_prot, THREAD));
@@ -1143,16 +1143,21 @@
   int from_oplen = operand_array_length(from_cp->operands());
   int old_oplen  = operand_array_length(to_cp->operands());
   if (from_oplen != 0) {
+    ClassLoaderData* loader_data = to_cp->pool_holder()->class_loader_data();
     // append my operands to the target's operands array
     if (old_oplen == 0) {
-      to_cp->set_operands(from_cp->operands());  // reuse; do not merge
+      // Can't just reuse from_cp's operand list because of deallocation issues
+      int len = from_cp->operands()->length();
+      Array<u2>* new_ops = MetadataFactory::new_array<u2>(loader_data, len, CHECK);
+      Copy::conjoint_memory_atomic(
+          from_cp->operands()->adr_at(0), new_ops->adr_at(0), len * sizeof(u2));
+      to_cp->set_operands(new_ops);
     } else {
       int old_len  = to_cp->operands()->length();
       int from_len = from_cp->operands()->length();
       int old_off  = old_oplen * sizeof(u2);
       int from_off = from_oplen * sizeof(u2);
       // Use the metaspace for the destination constant pool
-      ClassLoaderData* loader_data = to_cp->pool_holder()->class_loader_data();
       Array<u2>* new_operands = MetadataFactory::new_array<u2>(loader_data, old_len + from_len, CHECK);
       int fillp = 0, len = 0;
       // first part of dest
@@ -1785,7 +1790,7 @@
     assert(cp_patches->at(index).is_null(),
            err_msg("Unused constant pool patch at %d in class file %s",
                    index,
-                   InstanceKlass::cast(pool_holder())->external_name()));
+                   pool_holder()->external_name()));
   }
 #endif // ASSERT
 }
@@ -1943,7 +1948,7 @@
   st->print(" for ");
   pool_holder()->print_value_on(st);
   if (pool_holder() != NULL) {
-    bool extra = (InstanceKlass::cast(pool_holder())->constants() != this);
+    bool extra = (pool_holder()->constants() != this);
     if (extra)  st->print(" (extra)");
   }
   if (cache() != NULL) {
--- a/hotspot/src/share/vm/oops/constantPool.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/constantPool.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -86,8 +86,8 @@
   friend class Universe;             // For null constructor
  private:
   Array<u1>*           _tags;        // the tag array describing the constant pool's contents
-  ConstantPoolCache* _cache;       // the cache holding interpreter runtime information
-  Klass*               _pool_holder; // the corresponding class
+  ConstantPoolCache*   _cache;       // the cache holding interpreter runtime information
+  InstanceKlass*       _pool_holder; // the corresponding class
   Array<u2>*           _operands;    // for variable-sized (InvokeDynamic) nodes, usually empty
 
   // Array of resolved objects from the constant pool and map from resolved
@@ -193,9 +193,9 @@
   void set_on_stack(const bool value);
 
   // Klass holding pool
-  Klass* pool_holder() const              { return _pool_holder; }
-  void set_pool_holder(Klass* k)          { _pool_holder = k; }
-  Klass** pool_holder_addr()              { return &_pool_holder; }
+  InstanceKlass* pool_holder() const      { return _pool_holder; }
+  void set_pool_holder(InstanceKlass* k)  { _pool_holder = k; }
+  InstanceKlass** pool_holder_addr()      { return &_pool_holder; }
 
   // Interpreter runtime support
   ConstantPoolCache* cache() const        { return _cache; }
--- a/hotspot/src/share/vm/oops/cpCache.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/cpCache.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -231,8 +231,8 @@
 
 
 void ConstantPoolCacheEntry::set_interface_call(methodHandle method, int index) {
-  Klass* interf = method->method_holder();
-  assert(InstanceKlass::cast(interf)->is_interface(), "must be an interface");
+  InstanceKlass* interf = method->method_holder();
+  assert(interf->is_interface(), "must be an interface");
   assert(!method->is_final_method(), "interfaces do not have final methods; cannot link to one here");
   set_f1(interf);
   set_f2(index);
@@ -243,25 +243,17 @@
 }
 
 
-void ConstantPoolCacheEntry::set_method_handle(constantPoolHandle cpool,
-                                               methodHandle adapter,
-                                               Handle appendix, Handle method_type,
-                                               objArrayHandle resolved_references) {
-  set_method_handle_common(cpool, Bytecodes::_invokehandle, adapter, appendix, method_type, resolved_references);
+void ConstantPoolCacheEntry::set_method_handle(constantPoolHandle cpool, const CallInfo &call_info) {
+  set_method_handle_common(cpool, Bytecodes::_invokehandle, call_info);
 }
 
-void ConstantPoolCacheEntry::set_dynamic_call(constantPoolHandle cpool,
-                                              methodHandle adapter,
-                                              Handle appendix, Handle method_type,
-                                              objArrayHandle resolved_references) {
-  set_method_handle_common(cpool, Bytecodes::_invokedynamic, adapter, appendix, method_type, resolved_references);
+void ConstantPoolCacheEntry::set_dynamic_call(constantPoolHandle cpool, const CallInfo &call_info) {
+  set_method_handle_common(cpool, Bytecodes::_invokedynamic, call_info);
 }
 
 void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
                                                       Bytecodes::Code invoke_code,
-                                                      methodHandle adapter,
-                                                      Handle appendix, Handle method_type,
-                                                      objArrayHandle resolved_references) {
+                                                      const CallInfo &call_info) {
   // NOTE: This CPCE can be the subject of data races.
   // There are three words to update: flags, refs[f2], f1 (in that order).
   // Writers must store all other values before f1.
@@ -276,6 +268,9 @@
     return;
   }
 
+  const methodHandle adapter = call_info.resolved_method();
+  const Handle appendix      = call_info.resolved_appendix();
+  const Handle method_type   = call_info.resolved_method_type();
   const bool has_appendix    = appendix.not_null();
   const bool has_method_type = method_type.not_null();
 
@@ -315,6 +310,7 @@
   // This allows us to create fewer method oops, while keeping type safety.
   //
 
+  objArrayHandle resolved_references = cpool->resolved_references();
   // Store appendix, if any.
   if (has_appendix) {
     const int appendix_index = f2_as_index() + _indy_resolved_references_appendix_offset;
@@ -421,7 +417,7 @@
         if (!(*trace_name_printed)) {
           // RC_TRACE_MESG macro has an embedded ResourceMark
           RC_TRACE_MESG(("adjust: name=%s",
-            Klass::cast(old_method->method_holder())->external_name()));
+            old_method->method_holder()->external_name()));
           *trace_name_printed = true;
         }
         // RC_TRACE macro has an embedded ResourceMark
@@ -449,7 +445,7 @@
       if (!(*trace_name_printed)) {
         // RC_TRACE_MESG macro has an embedded ResourceMark
         RC_TRACE_MESG(("adjust: name=%s",
-          Klass::cast(old_method->method_holder())->external_name()));
+          old_method->method_holder()->external_name()));
         *trace_name_printed = true;
       }
       // RC_TRACE macro has an embedded ResourceMark
--- a/hotspot/src/share/vm/oops/cpCache.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/cpCache.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -117,6 +117,8 @@
 // The fields are volatile so that they are stored in the order written in the
 // source code.  The _indices field with the bytecode must be written last.
 
+class CallInfo;
+
 class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
   friend class VMStructs;
   friend class constantPoolCacheKlass;
@@ -223,18 +225,12 @@
 
   void set_method_handle(
     constantPoolHandle cpool,                    // holding constant pool (required for locking)
-    methodHandle method,                         // adapter for invokeExact, etc.
-    Handle appendix,                             // stored in refs[f2+0]; could be a java.lang.invoke.MethodType
-    Handle method_type,                          // stored in refs[f2+1]; is a java.lang.invoke.MethodType
-    objArrayHandle resolved_references
+    const CallInfo &call_info                    // Call link information
   );
 
   void set_dynamic_call(
     constantPoolHandle cpool,                    // holding constant pool (required for locking)
-    methodHandle method,                         // adapter for this call site
-    Handle appendix,                             // stored in refs[f2+0]; could be a java.lang.invoke.CallSite
-    Handle method_type,                          // stored in refs[f2+1]; is a java.lang.invoke.MethodType
-    objArrayHandle resolved_references
+    const CallInfo &call_info                    // Call link information
   );
 
   // Common code for invokedynamic and MH invocations.
@@ -255,10 +251,7 @@
   void set_method_handle_common(
     constantPoolHandle cpool,                    // holding constant pool (required for locking)
     Bytecodes::Code invoke_code,                 // _invokehandle or _invokedynamic
-    methodHandle adapter,                        // invoker method (f1)
-    Handle appendix,                             // appendix such as CallSite, MethodType, etc. (refs[f2+0])
-    Handle method_type,                          // MethodType (refs[f2+1])
-    objArrayHandle resolved_references
+    const CallInfo &call_info                    // Call link information
   );
 
   // invokedynamic and invokehandle call sites have two entries in the
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -743,6 +743,35 @@
     }
   }
 
+  if (this_oop->has_default_methods()) {
+    // Step 7.5: initialize any interfaces which have default methods
+    for (int i = 0; i < this_oop->local_interfaces()->length(); ++i) {
+      Klass* iface = this_oop->local_interfaces()->at(i);
+      InstanceKlass* ik = InstanceKlass::cast(iface);
+      if (ik->has_default_methods() && ik->should_be_initialized()) {
+        ik->initialize(THREAD);
+
+        if (HAS_PENDING_EXCEPTION) {
+          Handle e(THREAD, PENDING_EXCEPTION);
+          CLEAR_PENDING_EXCEPTION;
+          {
+            EXCEPTION_MARK;
+            // Locks object, set state, and notify all waiting threads
+            this_oop->set_initialization_state_and_notify(
+                initialization_error, THREAD);
+
+            // ignore any exception thrown, superclass initialization error is
+            // thrown below
+            CLEAR_PENDING_EXCEPTION;
+          }
+          DTRACE_CLASSINIT_PROBE_WAIT(
+              super__failed, InstanceKlass::cast(this_oop()), -1, wait);
+          THROW_OOP(e());
+        }
+      }
+    }
+  }
+
   // Step 8
   {
     assert(THREAD->is_Java_thread(), "non-JavaThread in initialize_impl");
@@ -1252,11 +1281,7 @@
 }
 #endif
 
-Method* InstanceKlass::find_method(Symbol* name, Symbol* signature) const {
-  return InstanceKlass::find_method(methods(), name, signature);
-}
-
-Method* InstanceKlass::find_method(Array<Method*>* methods, Symbol* name, Symbol* signature) {
+static int binary_search(Array<Method*>* methods, Symbol* name) {
   int len = methods->length();
   // methods are sorted, so do binary search
   int l = 0;
@@ -1267,43 +1292,70 @@
     assert(m->is_method(), "must be method");
     int res = m->name()->fast_compare(name);
     if (res == 0) {
-      // found matching name; do linear search to find matching signature
-      // first, quick check for common case
-      if (m->signature() == signature) return m;
-      // search downwards through overloaded methods
-      int i;
-      for (i = mid - 1; i >= l; i--) {
-        Method* m = methods->at(i);
-        assert(m->is_method(), "must be method");
-        if (m->name() != name) break;
-        if (m->signature() == signature) return m;
-      }
-      // search upwards
-      for (i = mid + 1; i <= h; i++) {
-        Method* m = methods->at(i);
-        assert(m->is_method(), "must be method");
-        if (m->name() != name) break;
-        if (m->signature() == signature) return m;
-      }
-      // not found
-#ifdef ASSERT
-      int index = linear_search(methods, name, signature);
-      assert(index == -1, err_msg("binary search should have found entry %d", index));
-#endif
-      return NULL;
+      return mid;
     } else if (res < 0) {
       l = mid + 1;
     } else {
       h = mid - 1;
     }
   }
+  return -1;
+}
+
+Method* InstanceKlass::find_method(Symbol* name, Symbol* signature) const {
+  return InstanceKlass::find_method(methods(), name, signature);
+}
+
+Method* InstanceKlass::find_method(
+    Array<Method*>* methods, Symbol* name, Symbol* signature) {
+  int hit = binary_search(methods, name);
+  if (hit != -1) {
+    Method* m = methods->at(hit);
+    // Do linear search to find matching signature.  First, quick check
+    // for common case
+    if (m->signature() == signature) return m;
+    // search downwards through overloaded methods
+    int i;
+    for (i = hit - 1; i >= 0; --i) {
+        Method* m = methods->at(i);
+        assert(m->is_method(), "must be method");
+        if (m->name() != name) break;
+        if (m->signature() == signature) return m;
+    }
+    // search upwards
+    for (i = hit + 1; i < methods->length(); ++i) {
+        Method* m = methods->at(i);
+        assert(m->is_method(), "must be method");
+        if (m->name() != name) break;
+        if (m->signature() == signature) return m;
+    }
+    // not found
 #ifdef ASSERT
-  int index = linear_search(methods, name, signature);
-  assert(index == -1, err_msg("binary search should have found entry %d", index));
+    int index = linear_search(methods, name, signature);
+    assert(index == -1, err_msg("binary search should have found entry %d", index));
 #endif
+  }
   return NULL;
 }
 
+int InstanceKlass::find_method_by_name(Symbol* name, int* end) {
+  return find_method_by_name(methods(), name, end);
+}
+
+int InstanceKlass::find_method_by_name(
+    Array<Method*>* methods, Symbol* name, int* end_ptr) {
+  assert(end_ptr != NULL, "just checking");
+  int start = binary_search(methods, name);
+  int end = start + 1;
+  if (start != -1) {
+    while (start - 1 >= 0 && (methods->at(start - 1))->name() == name) --start;
+    while (end < methods->length() && (methods->at(end))->name() == name) ++end;
+    *end_ptr = end;
+    return start;
+  }
+  return -1;
+}
+
 Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
   Klass* klass = const_cast<InstanceKlass*>(this);
   while (klass != NULL) {
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -245,6 +245,10 @@
   unsigned char * _cached_class_file_bytes;       // JVMTI: cached class file, before retransformable agent modified it in CFLH
   jint            _cached_class_file_len;         // JVMTI: length of above
   JvmtiCachedClassFieldMap* _jvmti_cached_class_field_map;  // JVMTI: used during heap iteration
+
+  // true if class, superclass, or implemented interfaces have default methods
+  bool            _has_default_methods;
+
   volatile u2     _idnum_allocated_count;         // JNI/JVMTI: increments with the addition of methods, old ids don't change
   // Method array.
   Array<Method*>* _methods;
@@ -492,6 +496,13 @@
   // (returns NULL if not found)
   Method* lookup_method_in_all_interfaces(Symbol* name, Symbol* signature) const;
 
+  // Find method indices by name.  If a method with the specified name is
+  // found the index to the first method is returned, and 'end' is filled in
+  // with the index of first non-name-matching method.  If no method is found
+  // -1 is returned.
+  int find_method_by_name(Symbol* name, int* end);
+  static int find_method_by_name(Array<Method*>* methods, Symbol* name, int* end);
+
   // constant pool
   ConstantPool* constants() const        { return _constants; }
   void set_constants(ConstantPool* c)    { _constants = c; }
@@ -592,6 +603,9 @@
     return _jvmti_cached_class_field_map;
   }
 
+  bool has_default_methods() const { return _has_default_methods; }
+  void set_has_default_methods(bool b) { _has_default_methods = b; }
+
   // for adding methods, ConstMethod::UNSET_IDNUM means no more ids available
   inline u2 next_method_idnum();
   void set_initial_method_idnum(u2 value)             { _idnum_allocated_count = value; }
@@ -728,7 +742,6 @@
   GrowableArray<Klass*>* compute_secondary_supers(int num_extra_slots);
   bool compute_is_subtype_of(Klass* k);
   bool can_be_primary_super_slow() const;
-  Klass* java_super() const              { return super(); }
   int oop_size(oop obj)  const             { return size_helper(); }
   bool oop_is_instance_slow() const        { return true; }
 
@@ -750,6 +763,10 @@
     return (InstanceKlass*) k;
   }
 
+  InstanceKlass* java_super() const {
+    return (super() == NULL) ? NULL : cast(super());
+  }
+
   // Sizing (in words)
   static int header_size()            { return align_object_offset(sizeof(InstanceKlass)/HeapWordSize); }
   static int size(int vtable_length, int itable_length,
--- a/hotspot/src/share/vm/oops/klassVtable.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/klassVtable.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -54,22 +54,16 @@
 // the same name and signature as m), then m is a Miranda method which is
 // entered as a public abstract method in C's vtable.  From then on it should
 // treated as any other public method in C for method over-ride purposes.
-void klassVtable::compute_vtable_size_and_num_mirandas(int &vtable_length,
-                                                       int &num_miranda_methods,
-                                                       Klass* super,
-                                                       Array<Method*>* methods,
-                                                       AccessFlags class_flags,
-                                                       Handle classloader,
-                                                       Symbol* classname,
-                                                       Array<Klass*>* local_interfaces,
-                                                       TRAPS
-                                                       ) {
-
+void klassVtable::compute_vtable_size_and_num_mirandas(
+    int* vtable_length_ret, int* num_new_mirandas,
+    GrowableArray<Method*>* all_mirandas, Klass* super,
+    Array<Method*>* methods, AccessFlags class_flags,
+    Handle classloader, Symbol* classname, Array<Klass*>* local_interfaces,
+    TRAPS) {
   No_Safepoint_Verifier nsv;
 
   // set up default result values
-  vtable_length = 0;
-  num_miranda_methods = 0;
+  int vtable_length = 0;
 
   // start off with super's vtable length
   InstanceKlass* sk = (InstanceKlass*)super;
@@ -86,9 +80,12 @@
     }
   }
 
+  GrowableArray<Method*> new_mirandas(20);
   // compute the number of mirandas methods that must be added to the end
-  num_miranda_methods = get_num_mirandas(super, methods, local_interfaces);
-  vtable_length += (num_miranda_methods * vtableEntry::size());
+  get_mirandas(&new_mirandas, all_mirandas, super, methods, local_interfaces);
+  *num_new_mirandas = new_mirandas.length();
+
+  vtable_length += *num_new_mirandas * vtableEntry::size();
 
   if (Universe::is_bootstrapping() && vtable_length == 0) {
     // array classes don't have their superclass set correctly during
@@ -109,6 +106,8 @@
          "bad vtable size for class Object");
   assert(vtable_length % vtableEntry::size() == 0, "bad vtable length");
   assert(vtable_length >= Universe::base_vtable_size(), "vtable too small");
+
+  *vtable_length_ret = vtable_length;
 }
 
 int klassVtable::index_of(Method* m, int len) const {
@@ -191,7 +190,7 @@
     }
 
     // add miranda methods; it will also update the value of initialized
-    fill_in_mirandas(initialized);
+    fill_in_mirandas(&initialized);
 
     // In class hierarchies where the accessibility is not increasing (i.e., going from private ->
     // package_private -> publicprotected), the vtable might actually be smaller than our initial
@@ -249,6 +248,11 @@
   return superk;
 }
 
+// Methods that are "effectively" final don't need vtable entries.
+bool method_is_effectively_final(
+    AccessFlags klass_flags, methodHandle target) {
+  return target->is_final() || klass_flags.is_final() && !target->is_overpass();
+}
 
 // Update child's copy of super vtable for overrides
 // OR return true if a new vtable entry is required
@@ -269,7 +273,7 @@
     return false;
   }
 
-  if (klass->is_final() || target_method()->is_final()) {
+  if (method_is_effectively_final(klass->access_flags(), target_method)) {
     // a final method never needs a new entry; final methods can be statically
     // resolved and they have to be present in the vtable only if they override
     // a super's method, in which case they re-use its entry
@@ -303,7 +307,7 @@
     if (super_method->name() == name && super_method->signature() == signature) {
 
       // get super_klass for method_holder for the found method
-      InstanceKlass* super_klass =  InstanceKlass::cast(super_method->method_holder());
+      InstanceKlass* super_klass =  super_method->method_holder();
 
       if ((super_klass->is_override(super_method, target_loader, target_classname, THREAD)) ||
       ((klass->major_version() >= VTABLE_TRANSITIVE_OVERRIDE_VERSION)
@@ -406,7 +410,8 @@
                                          Symbol* classname,
                                          AccessFlags class_flags,
                                          TRAPS) {
-  if ((class_flags.is_final() || target_method()->is_final()) ||
+
+  if (method_is_effectively_final(class_flags, target_method) ||
       // a final method never needs a new entry; final methods can be statically
       // resolved and they have to be present in the vtable only if they override
       // a super's method, in which case they re-use its entry
@@ -447,7 +452,7 @@
     }
     // get the class holding the matching method
     // make sure you use that class for is_override
-    InstanceKlass* superk = InstanceKlass::cast(super_method->method_holder());
+    InstanceKlass* superk = super_method->method_holder();
     // we want only instance method matches
     // pretend private methods are not in the super vtable
     // since we do override around them: e.g. a.m pub/b.m private/c.m pub,
@@ -502,7 +507,7 @@
 
   // miranda methods are interface methods in a class's vtable
   if (mhk->is_interface()) {
-    assert(m->is_public() && m->is_abstract(), "should be public and abstract");
+    assert(m->is_public(), "should be public");
     assert(ik()->implements_interface(method_holder) , "this class should implement the interface");
     assert(is_miranda(m, ik()->methods(), ik()->super()), "should be a miranda_method");
     return true;
@@ -532,19 +537,19 @@
   return false;
 }
 
-void klassVtable::add_new_mirandas_to_list(GrowableArray<Method*>* list_of_current_mirandas,
-                                           Array<Method*>* current_interface_methods,
-                                           Array<Method*>* class_methods,
-                                           Klass* super) {
+void klassVtable::add_new_mirandas_to_lists(
+    GrowableArray<Method*>* new_mirandas, GrowableArray<Method*>* all_mirandas,
+    Array<Method*>* current_interface_methods, Array<Method*>* class_methods,
+    Klass* super) {
   // iterate thru the current interface's method to see if it a miranda
   int num_methods = current_interface_methods->length();
   for (int i = 0; i < num_methods; i++) {
     Method* im = current_interface_methods->at(i);
     bool is_duplicate = false;
-    int num_of_current_mirandas = list_of_current_mirandas->length();
+    int num_of_current_mirandas = new_mirandas->length();
     // check for duplicate mirandas in different interfaces we implement
     for (int j = 0; j < num_of_current_mirandas; j++) {
-      Method* miranda = list_of_current_mirandas->at(j);
+      Method* miranda = new_mirandas->at(j);
       if ((im->name() == miranda->name()) &&
           (im->signature() == miranda->signature())) {
         is_duplicate = true;
@@ -557,51 +562,47 @@
         InstanceKlass *sk = InstanceKlass::cast(super);
         // check if it is a duplicate of a super's miranda
         if (sk->lookup_method_in_all_interfaces(im->name(), im->signature()) == NULL) {
-          list_of_current_mirandas->append(im);
+          new_mirandas->append(im);
+        }
+        if (all_mirandas != NULL) {
+          all_mirandas->append(im);
         }
       }
     }
   }
 }
 
-void klassVtable::get_mirandas(GrowableArray<Method*>* mirandas,
+void klassVtable::get_mirandas(GrowableArray<Method*>* new_mirandas,
+                               GrowableArray<Method*>* all_mirandas,
                                Klass* super, Array<Method*>* class_methods,
                                Array<Klass*>* local_interfaces) {
-  assert((mirandas->length() == 0) , "current mirandas must be 0");
+  assert((new_mirandas->length() == 0) , "current mirandas must be 0");
 
   // iterate thru the local interfaces looking for a miranda
   int num_local_ifs = local_interfaces->length();
   for (int i = 0; i < num_local_ifs; i++) {
     InstanceKlass *ik = InstanceKlass::cast(local_interfaces->at(i));
-    add_new_mirandas_to_list(mirandas, ik->methods(), class_methods, super);
+    add_new_mirandas_to_lists(new_mirandas, all_mirandas,
+                              ik->methods(), class_methods, super);
     // iterate thru each local's super interfaces
     Array<Klass*>* super_ifs = ik->transitive_interfaces();
     int num_super_ifs = super_ifs->length();
     for (int j = 0; j < num_super_ifs; j++) {
       InstanceKlass *sik = InstanceKlass::cast(super_ifs->at(j));
-      add_new_mirandas_to_list(mirandas, sik->methods(), class_methods, super);
+      add_new_mirandas_to_lists(new_mirandas, all_mirandas,
+                                sik->methods(), class_methods, super);
     }
   }
 }
 
-// get number of mirandas
-int klassVtable::get_num_mirandas(Klass* super, Array<Method*>* class_methods, Array<Klass*>* local_interfaces) {
-  ResourceMark rm;
-  GrowableArray<Method*>* mirandas = new GrowableArray<Method*>(20);
-  get_mirandas(mirandas, super, class_methods, local_interfaces);
-  return mirandas->length();
-}
-
 // fill in mirandas
-void klassVtable::fill_in_mirandas(int& initialized) {
-  ResourceMark rm;
-  GrowableArray<Method*>* mirandas = new GrowableArray<Method*>(20);
-  InstanceKlass *this_ik = ik();
-  get_mirandas(mirandas, this_ik->super(), this_ik->methods(), this_ik->local_interfaces());
-  int num_mirandas = mirandas->length();
-  for (int i = 0; i < num_mirandas; i++) {
-    put_method_at(mirandas->at(i), initialized);
-    initialized++;
+void klassVtable::fill_in_mirandas(int* initialized) {
+  GrowableArray<Method*> mirandas(20);
+  get_mirandas(&mirandas, NULL, ik()->super(), ik()->methods(),
+               ik()->local_interfaces());
+  for (int i = 0; i < mirandas.length(); i++) {
+    put_method_at(mirandas.at(i), *initialized);
+    ++(*initialized);
   }
 }
 
@@ -629,7 +630,7 @@
           if (!(*trace_name_printed)) {
             // RC_TRACE_MESG macro has an embedded ResourceMark
             RC_TRACE_MESG(("adjust: name=%s",
-                           Klass::cast(old_method->method_holder())->external_name()));
+                           old_method->method_holder()->external_name()));
             *trace_name_printed = true;
           }
           // RC_TRACE macro has an embedded ResourceMark
@@ -744,7 +745,7 @@
     Method* target = klass->uncached_lookup_method(method_name, method_signature);
     while (target != NULL && target->is_static()) {
       // continue with recursive lookup through the superclass
-      Klass* super = Klass::cast(target->method_holder())->super();
+      Klass* super = target->method_holder()->super();
       target = (super == NULL) ? (Method*)NULL : Klass::cast(super)->uncached_lookup_method(method_name, method_signature);
     }
     if (target == NULL || !target->is_public() || target->is_abstract()) {
@@ -754,7 +755,7 @@
       // if checkconstraints requested
       methodHandle  target_h (THREAD, target); // preserve across gc
       if (checkconstraints) {
-        Handle method_holder_loader (THREAD, InstanceKlass::cast(target->method_holder())->class_loader());
+        Handle method_holder_loader (THREAD, target->method_holder()->class_loader());
         if (method_holder_loader() != interface_loader()) {
           ResourceMark rm(THREAD);
           char* failed_type_name =
@@ -824,7 +825,7 @@
           if (!(*trace_name_printed)) {
             // RC_TRACE_MESG macro has an embedded ResourceMark
             RC_TRACE_MESG(("adjust: name=%s",
-              Klass::cast(old_method->method_holder())->external_name()));
+              old_method->method_holder()->external_name()));
             *trace_name_printed = true;
           }
           // RC_TRACE macro has an embedded ResourceMark
@@ -959,9 +960,9 @@
 
 // m must be a method in an interface
 int klassItable::compute_itable_index(Method* m) {
-  Klass* intf = m->method_holder();
-  assert(InstanceKlass::cast(intf)->is_interface(), "sanity check");
-  Array<Method*>* methods = InstanceKlass::cast(intf)->methods();
+  InstanceKlass* intf = m->method_holder();
+  assert(intf->is_interface(), "sanity check");
+  Array<Method*>* methods = intf->methods();
   int index = 0;
   while(methods->at(index) != m) {
     index++;
--- a/hotspot/src/share/vm/oops/klassVtable.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/klassVtable.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -84,11 +84,11 @@
   bool is_initialized();
 
   // computes vtable length (in words) and the number of miranda methods
-  static void compute_vtable_size_and_num_mirandas(int &vtable_length, int &num_miranda_methods,
-                                                   Klass* super, Array<Method*>* methods,
-                                                   AccessFlags class_flags, Handle classloader,
-                                                   Symbol* classname, Array<Klass*>* local_interfaces,
-                                                   TRAPS);
+  static void compute_vtable_size_and_num_mirandas(
+      int* vtable_length, int* num_new_mirandas,
+      GrowableArray<Method*>* all_mirandas, Klass* super,
+      Array<Method*>* methods, AccessFlags class_flags, Handle classloader,
+      Symbol* classname, Array<Klass*>* local_interfaces, TRAPS);
 
   // RedefineClasses() API support:
   // If any entry of this vtable points to any of old_methods,
@@ -125,12 +125,17 @@
 
   // support for miranda methods
   bool is_miranda_entry_at(int i);
-  void fill_in_mirandas(int& initialized);
+  void fill_in_mirandas(int* initialized);
   static bool is_miranda(Method* m, Array<Method*>* class_methods, Klass* super);
-  static void add_new_mirandas_to_list(GrowableArray<Method*>* list_of_current_mirandas, Array<Method*>* current_interface_methods, Array<Method*>* class_methods, Klass* super);
-  static void get_mirandas(GrowableArray<Method*>* mirandas, Klass* super, Array<Method*>* class_methods, Array<Klass*>* local_interfaces);
-  static int get_num_mirandas(Klass* super, Array<Method*>* class_methods, Array<Klass*>* local_interfaces);
-
+  static void add_new_mirandas_to_lists(
+      GrowableArray<Method*>* new_mirandas,
+      GrowableArray<Method*>* all_mirandas,
+      Array<Method*>* current_interface_methods, Array<Method*>* class_methods,
+      Klass* super);
+  static void get_mirandas(
+      GrowableArray<Method*>* new_mirandas,
+      GrowableArray<Method*>* all_mirandas, Klass* super,
+      Array<Method*>* class_methods, Array<Klass*>* local_interfaces);
 
   void verify_against(outputStream* st, klassVtable* vt, int index);
   inline InstanceKlass* ik() const;
--- a/hotspot/src/share/vm/oops/method.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/method.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -35,6 +35,7 @@
 #include "memory/generation.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/oopFactory.hpp"
+#include "oops/constMethod.hpp"
 #include "oops/methodData.hpp"
 #include "oops/method.hpp"
 #include "oops/oop.inline.hpp"
@@ -57,22 +58,24 @@
 // Implementation of Method
 
 Method* Method::allocate(ClassLoaderData* loader_data,
-                            int byte_code_size,
-                            AccessFlags access_flags,
-                            int compressed_line_number_size,
-                            int localvariable_table_length,
-                            int exception_table_length,
-                            int checked_exceptions_length,
-                            TRAPS) {
+                         int byte_code_size,
+                         AccessFlags access_flags,
+                         int compressed_line_number_size,
+                         int localvariable_table_length,
+                         int exception_table_length,
+                         int checked_exceptions_length,
+                         ConstMethod::MethodType method_type,
+                         TRAPS) {
   assert(!access_flags.is_native() || byte_code_size == 0,
          "native methods should not contain byte codes");
   ConstMethod* cm = ConstMethod::allocate(loader_data,
-                                      byte_code_size,
-                                      compressed_line_number_size,
-                                      localvariable_table_length,
-                                      exception_table_length,
-                                      checked_exceptions_length,
-                                      CHECK_NULL);
+                                          byte_code_size,
+                                          compressed_line_number_size,
+                                          localvariable_table_length,
+                                          exception_table_length,
+                                          checked_exceptions_length,
+                                          method_type,
+                                          CHECK_NULL);
 
   int size = Method::size(access_flags.is_native());
 
@@ -240,12 +243,12 @@
       warning("oopmap should only be accessed by the "
               "VM, GC task or CMS threads (or during debugging)");
       InterpreterOopMap local_mask;
-      InstanceKlass::cast(method_holder())->mask_for(h_this, bci, &local_mask);
+      method_holder()->mask_for(h_this, bci, &local_mask);
       local_mask.print();
     }
   }
 #endif
-  InstanceKlass::cast(method_holder())->mask_for(h_this, bci, mask);
+  method_holder()->mask_for(h_this, bci, mask);
   return;
 }
 
@@ -520,7 +523,7 @@
 bool Method::is_final_method() const {
   // %%% Should return true for private methods also,
   // since there is no way to override them.
-  return is_final() || Klass::cast(method_holder())->is_final();
+  return is_final() || method_holder()->is_final();
 }
 
 
@@ -552,7 +555,7 @@
 
 bool Method::has_valid_initializer_flags() const {
   return (is_static() ||
-          InstanceKlass::cast(method_holder())->major_version() < 51);
+          method_holder()->major_version() < 51);
 }
 
 bool Method::is_static_initializer() const {
@@ -614,7 +617,7 @@
   if( constants()->tag_at(klass_index).is_unresolved_klass() ) {
     Thread *thread = Thread::current();
     Symbol* klass_name = constants()->klass_name_at(klass_index);
-    Handle loader(thread, InstanceKlass::cast(method_holder())->class_loader());
+    Handle loader(thread, method_holder()->class_loader());
     Handle prot  (thread, Klass::cast(method_holder())->protection_domain());
     return SystemDictionary::find(klass_name, loader, prot, thread) != NULL;
   } else {
@@ -932,7 +935,7 @@
 
   // If method is an interface, we skip it - except if it
   // is a miranda method
-  if (InstanceKlass::cast(method_holder())->is_interface()) {
+  if (method_holder()->is_interface()) {
     // Check that method is not a miranda method
     if (ik->lookup_method(name(), signature()) == NULL) {
       // No implementation exist - so miranda method
@@ -1017,7 +1020,7 @@
     ConstantPool* cp_oop = ConstantPool::allocate(loader_data, cp_length, CHECK_(empty));
     cp = constantPoolHandle(THREAD, cp_oop);
   }
-  cp->set_pool_holder(holder());
+  cp->set_pool_holder(InstanceKlass::cast(holder()));
   cp->symbol_at_put(_imcp_invoke_name,       name);
   cp->symbol_at_put(_imcp_invoke_signature,  signature);
   cp->set_preresolution();
@@ -1031,7 +1034,7 @@
   methodHandle m;
   {
     Method* m_oop = Method::allocate(loader_data, 0, accessFlags_from(flags_bits),
-                                              0, 0, 0, 0, CHECK_(empty));
+            0, 0, 0, 0, ConstMethod::NORMAL, CHECK_(empty));
     m = methodHandle(THREAD, m_oop);
   }
   m->set_constants(cp());
@@ -1083,15 +1086,16 @@
   int localvariable_len = m->localvariable_table_length();
   int exception_table_len = m->exception_table_length();
 
-  ClassLoaderData* loader_data = m()->method_holder()->class_loader_data();
+  ClassLoaderData* loader_data = m->method_holder()->class_loader_data();
   Method* newm_oop = Method::allocate(loader_data,
-                                               new_code_length,
-                                              flags,
-                                              new_compressed_linenumber_size,
-                                              localvariable_len,
-                                              exception_table_len,
-                                              checked_exceptions_len,
-                                              CHECK_(methodHandle()));
+                                      new_code_length,
+                                      flags,
+                                      new_compressed_linenumber_size,
+                                      localvariable_len,
+                                      exception_table_len,
+                                      checked_exceptions_len,
+                                      m->method_type(),
+                                      CHECK_(methodHandle()));
   methodHandle newm (THREAD, newm_oop);
   int new_method_size = newm->method_size();
 
@@ -1233,8 +1237,8 @@
     return false;
   }
   bool sig_is_loaded = true;
-  Handle class_loader(THREAD, InstanceKlass::cast(m->method_holder())->class_loader());
-  Handle protection_domain(THREAD, Klass::cast(m->method_holder())->protection_domain());
+  Handle class_loader(THREAD, m->method_holder()->class_loader());
+  Handle protection_domain(THREAD, m->method_holder()->protection_domain());
   ResourceMark rm(THREAD);
   Symbol*  signature = m->signature();
   for(SignatureStream ss(signature); !ss.is_done(); ss.next()) {
@@ -1260,8 +1264,8 @@
 }
 
 bool Method::has_unloaded_classes_in_signature(methodHandle m, TRAPS) {
-  Handle class_loader(THREAD, InstanceKlass::cast(m->method_holder())->class_loader());
-  Handle protection_domain(THREAD, Klass::cast(m->method_holder())->protection_domain());
+  Handle class_loader(THREAD, m->method_holder()->class_loader());
+  Handle protection_domain(THREAD, m->method_holder()->protection_domain());
   ResourceMark rm(THREAD);
   Symbol*  signature = m->signature();
   for(SignatureStream ss(signature); !ss.is_done(); ss.next()) {
@@ -1468,7 +1472,7 @@
 
 
 Bytecodes::Code Method::orig_bytecode_at(int bci) const {
-  BreakpointInfo* bp = InstanceKlass::cast(method_holder())->breakpoints();
+  BreakpointInfo* bp = method_holder()->breakpoints();
   for (; bp != NULL; bp = bp->next()) {
     if (bp->match(this, bci)) {
       return bp->orig_bytecode();
@@ -1480,7 +1484,7 @@
 
 void Method::set_orig_bytecode_at(int bci, Bytecodes::Code code) {
   assert(code != Bytecodes::_breakpoint, "cannot patch breakpoints this way");
-  BreakpointInfo* bp = InstanceKlass::cast(method_holder())->breakpoints();
+  BreakpointInfo* bp = method_holder()->breakpoints();
   for (; bp != NULL; bp = bp->next()) {
     if (bp->match(this, bci)) {
       bp->set_orig_bytecode(code);
@@ -1490,7 +1494,7 @@
 }
 
 void Method::set_breakpoint(int bci) {
-  InstanceKlass* ik = InstanceKlass::cast(method_holder());
+  InstanceKlass* ik = method_holder();
   BreakpointInfo *bp = new BreakpointInfo(this, bci);
   bp->set_next(ik->breakpoints());
   ik->set_breakpoints(bp);
@@ -1499,7 +1503,7 @@
 }
 
 static void clear_matches(Method* m, int bci) {
-  InstanceKlass* ik = InstanceKlass::cast(m->method_holder());
+  InstanceKlass* ik = m->method_holder();
   BreakpointInfo* prev_bp = NULL;
   BreakpointInfo* next_bp;
   for (BreakpointInfo* bp = ik->breakpoints(); bp != NULL; bp = next_bp) {
@@ -1782,7 +1786,7 @@
 bool Method::is_method_id(jmethodID mid) {
   Method* m = resolve_jmethod_id(mid);
   assert(m != NULL, "should be called with non-null method");
-  InstanceKlass* ik = InstanceKlass::cast(m->method_holder());
+  InstanceKlass* ik = m->method_holder();
   ClassLoaderData* cld = ik->class_loader_data();
   if (cld->jmethod_ids() == NULL) return false;
   return (cld->jmethod_ids()->contains((Method**)mid));
--- a/hotspot/src/share/vm/oops/method.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/oops/method.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -30,7 +30,6 @@
 #include "compiler/oopMap.hpp"
 #include "interpreter/invocationCounter.hpp"
 #include "oops/annotations.hpp"
-#include "oops/constMethod.hpp"
 #include "oops/constantPool.hpp"
 #include "oops/instanceKlass.hpp"
 #include "oops/oop.hpp"
@@ -104,6 +103,7 @@
 class LocalVariableTableElement;
 class AdapterHandlerEntry;
 class MethodData;
+class ConstMethod;
 
 class Method : public Metadata {
  friend class VMStructs;
@@ -158,14 +158,16 @@
   // Constructor
   Method(ConstMethod* xconst, AccessFlags access_flags, int size);
  public:
+
   static Method* allocate(ClassLoaderData* loader_data,
-                            int byte_code_size,
-                            AccessFlags access_flags,
-                            int compressed_line_number_size,
-                            int localvariable_table_length,
-                            int exception_table_length,
-                            int checked_exceptions_length,
-                            TRAPS);
+                          int byte_code_size,
+                          AccessFlags access_flags,
+                          int compressed_line_number_size,
+                          int localvariable_table_length,
+                          int exception_table_length,
+                          int checked_exceptions_length,
+                          ConstMethod::MethodType method_type,
+                          TRAPS);
 
   Method() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); }
 
@@ -207,21 +209,21 @@
 
   // annotations support
   AnnotationArray* annotations() const           {
-    InstanceKlass* ik = InstanceKlass::cast(method_holder());
+    InstanceKlass* ik = method_holder();
     if (ik->annotations() == NULL) {
       return NULL;
     }
     return ik->annotations()->get_method_annotations_of(method_idnum());
   }
   AnnotationArray* parameter_annotations() const {
-    InstanceKlass* ik = InstanceKlass::cast(method_holder());
+    InstanceKlass* ik = method_holder();
     if (ik->annotations() == NULL) {
       return NULL;
     }
     return ik->annotations()->get_method_parameter_annotations_of(method_idnum());
   }
   AnnotationArray* annotation_default() const    {
-    InstanceKlass* ik = InstanceKlass::cast(method_holder());
+    InstanceKlass* ik = method_holder();
     if (ik->annotations() == NULL) {
       return NULL;
     }
@@ -494,7 +496,7 @@
                        { return constMethod()->compressed_linenumber_table(); }
 
   // method holder (the Klass* holding this method)
-  Klass* method_holder() const                 { return constants()->pool_holder(); }
+  InstanceKlass* method_holder() const         { return constants()->pool_holder(); }
 
   void compute_size_of_parameters(Thread *thread); // word size of parameters (receiver if any + arguments)
   Symbol* klass_name() const;                    // returns the name of the method holder
@@ -695,18 +697,18 @@
 
   // Get this method's jmethodID -- allocate if it doesn't exist
   jmethodID jmethod_id()                            { methodHandle this_h(this);
-                                                      return InstanceKlass::get_jmethod_id(InstanceKlass::cast(method_holder()), this_h); }
+                                                      return InstanceKlass::get_jmethod_id(method_holder(), this_h); }
 
   // Lookup the jmethodID for this method.  Return NULL if not found.
   // NOTE that this function can be called from a signal handler
   // (see AsyncGetCallTrace support for Forte Analyzer) and this
   // needs to be async-safe. No allocation should be done and
   // so handles are not used to avoid deadlock.
-  jmethodID find_jmethod_id_or_null()               { return InstanceKlass::cast(method_holder())->jmethod_id_or_null(this); }
+  jmethodID find_jmethod_id_or_null()               { return method_holder()->jmethod_id_or_null(this); }
 
   // JNI static invoke cached itable index accessors
-  int cached_itable_index()                         { return InstanceKlass::cast(method_holder())->cached_itable_index(method_idnum()); }
-  void set_cached_itable_index(int index)           { InstanceKlass::cast(method_holder())->set_cached_itable_index(method_idnum(), index); }
+  int cached_itable_index()                         { return method_holder()->cached_itable_index(method_idnum()); }
+  void set_cached_itable_index(int index)           { method_holder()->set_cached_itable_index(method_idnum(), index); }
 
   // Support for inlining of intrinsic methods
   vmIntrinsics::ID intrinsic_id() const          { return (vmIntrinsics::ID) _intrinsic_id;           }
@@ -725,14 +727,18 @@
   void set_dont_inline(bool x)  {        _dont_inline = x;  }
   bool  is_hidden()             { return _hidden;           }
   void set_hidden(bool x)       {        _hidden = x;       }
+  ConstMethod::MethodType method_type() const {
+      return _constMethod->method_type();
+  }
+  bool is_overpass() const { return method_type() == ConstMethod::OVERPASS; }
 
   // On-stack replacement support
   bool has_osr_nmethod(int level, bool match_level) {
-   return InstanceKlass::cast(method_holder())->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL;
+   return method_holder()->lookup_osr_nmethod(this, InvocationEntryBci, level, match_level) != NULL;
   }
 
   nmethod* lookup_osr_nmethod_for(int bci, int level, bool match_level) {
-    return InstanceKlass::cast(method_holder())->lookup_osr_nmethod(this, bci, level, match_level);
+    return method_holder()->lookup_osr_nmethod(this, bci, level, match_level);
   }
 
   // Inline cache support
--- a/hotspot/src/share/vm/opto/escape.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/opto/escape.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1386,12 +1386,12 @@
     // Non-escaped allocation returned from Java or runtime call have
     // unknown values in fields.
     for (EdgeIterator i(pta); i.has_next(); i.next()) {
-      PointsToNode* ptn = i.get();
-      if (ptn->is_Field() && ptn->as_Field()->is_oop()) {
-        if (add_edge(ptn, phantom_obj)) {
+      PointsToNode* field = i.get();
+      if (field->is_Field() && field->as_Field()->is_oop()) {
+        if (add_edge(field, phantom_obj)) {
           // New edge was added
           new_edges++;
-          add_field_uses_to_worklist(ptn->as_Field());
+          add_field_uses_to_worklist(field->as_Field());
         }
       }
     }
@@ -1413,30 +1413,30 @@
   // captured by Initialize node.
   //
   for (EdgeIterator i(pta); i.has_next(); i.next()) {
-    PointsToNode* ptn = i.get(); // Field (AddP)
-    if (!ptn->is_Field() || !ptn->as_Field()->is_oop())
+    PointsToNode* field = i.get(); // Field (AddP)
+    if (!field->is_Field() || !field->as_Field()->is_oop())
       continue; // Not oop field
-    int offset = ptn->as_Field()->offset();
+    int offset = field->as_Field()->offset();
     if (offset == Type::OffsetBot) {
       if (!visited_bottom_offset) {
         // OffsetBot is used to reference array's element,
         // always add reference to NULL to all Field nodes since we don't
         // known which element is referenced.
-        if (add_edge(ptn, null_obj)) {
+        if (add_edge(field, null_obj)) {
           // New edge was added
           new_edges++;
-          add_field_uses_to_worklist(ptn->as_Field());
+          add_field_uses_to_worklist(field->as_Field());
           visited_bottom_offset = true;
         }
       }
     } else {
       // Check only oop fields.
-      const Type* adr_type = ptn->ideal_node()->as_AddP()->bottom_type();
+      const Type* adr_type = field->ideal_node()->as_AddP()->bottom_type();
       if (adr_type->isa_rawptr()) {
 #ifdef ASSERT
         // Raw pointers are used for initializing stores so skip it
         // since it should be recorded already
-        Node* base = get_addp_base(ptn->ideal_node());
+        Node* base = get_addp_base(field->ideal_node());
         assert(adr_type->isa_rawptr() && base->is_Proj() &&
                (base->in(0) == alloc),"unexpected pointer type");
 #endif
@@ -1446,10 +1446,54 @@
         offsets_worklist.append(offset);
         Node* value = NULL;
         if (ini != NULL) {
-          BasicType ft = UseCompressedOops ? T_NARROWOOP : T_OBJECT;
-          Node* store = ini->find_captured_store(offset, type2aelembytes(ft), phase);
-          if (store != NULL && store->is_Store()) {
+          // StoreP::memory_type() == T_ADDRESS
+          BasicType ft = UseCompressedOops ? T_NARROWOOP : T_ADDRESS;
+          Node* store = ini->find_captured_store(offset, type2aelembytes(ft, true), phase);
+          // Make sure initializing store has the same type as this AddP.
+          // This AddP may reference non existing field because it is on a
+          // dead branch of bimorphic call which is not eliminated yet.
+          if (store != NULL && store->is_Store() &&
+              store->as_Store()->memory_type() == ft) {
             value = store->in(MemNode::ValueIn);
+#ifdef ASSERT
+            if (VerifyConnectionGraph) {
+              // Verify that AddP already points to all objects the value points to.
+              PointsToNode* val = ptnode_adr(value->_idx);
+              assert((val != NULL), "should be processed already");
+              PointsToNode* missed_obj = NULL;
+              if (val->is_JavaObject()) {
+                if (!field->points_to(val->as_JavaObject())) {
+                  missed_obj = val;
+                }
+              } else {
+                if (!val->is_LocalVar() || (val->edge_count() == 0)) {
+                  tty->print_cr("----------init store has invalid value -----");
+                  store->dump();
+                  val->dump();
+                  assert(val->is_LocalVar() && (val->edge_count() > 0), "should be processed already");
+                }
+                for (EdgeIterator j(val); j.has_next(); j.next()) {
+                  PointsToNode* obj = j.get();
+                  if (obj->is_JavaObject()) {
+                    if (!field->points_to(obj->as_JavaObject())) {
+                      missed_obj = obj;
+                      break;
+                    }
+                  }
+                }
+              }
+              if (missed_obj != NULL) {
+                tty->print_cr("----------field---------------------------------");
+                field->dump();
+                tty->print_cr("----------missed referernce to object-----------");
+                missed_obj->dump();
+                tty->print_cr("----------object referernced by init store -----");
+                store->dump();
+                val->dump();
+                assert(!field->points_to(missed_obj->as_JavaObject()), "missed JavaObject reference");
+              }
+            }
+#endif
           } else {
             // There could be initializing stores which follow allocation.
             // For example, a volatile field store is not collected
@@ -1462,10 +1506,10 @@
         }
         if (value == NULL) {
           // A field's initializing value was not recorded. Add NULL.
-          if (add_edge(ptn, null_obj)) {
+          if (add_edge(field, null_obj)) {
             // New edge was added
             new_edges++;
-            add_field_uses_to_worklist(ptn->as_Field());
+            add_field_uses_to_worklist(field->as_Field());
           }
         }
       }
@@ -1607,7 +1651,26 @@
       }
       // Verify that all fields have initializing values.
       if (field->edge_count() == 0) {
+        tty->print_cr("----------field does not have references----------");
         field->dump();
+        for (BaseIterator i(field); i.has_next(); i.next()) {
+          PointsToNode* base = i.get();
+          tty->print_cr("----------field has next base---------------------");
+          base->dump();
+          if (base->is_JavaObject() && (base != phantom_obj) && (base != null_obj)) {
+            tty->print_cr("----------base has fields-------------------------");
+            for (EdgeIterator j(base); j.has_next(); j.next()) {
+              j.get()->dump();
+            }
+            tty->print_cr("----------base has references---------------------");
+            for (UseIterator j(base); j.has_next(); j.next()) {
+              j.get()->dump();
+            }
+          }
+        }
+        for (UseIterator i(field); i.has_next(); i.next()) {
+          i.get()->dump();
+        }
         assert(field->edge_count() > 0, "sanity");
       }
     }
@@ -1967,7 +2030,7 @@
   if (is_JavaObject()) {
     return (this == ptn);
   }
-  assert(is_LocalVar(), "sanity");
+  assert(is_LocalVar() || is_Field(), "sanity");
   for (EdgeIterator i(this); i.has_next(); i.next()) {
     if (i.get() == ptn)
       return true;
@@ -3127,10 +3190,14 @@
     EscapeState fields_es = fields_escape_state();
     tty->print("%s(%s) ", esc_names[(int)es], esc_names[(int)fields_es]);
     if (nt == PointsToNode::JavaObject && !this->scalar_replaceable())
-      tty->print("NSR");
+      tty->print("NSR ");
   }
   if (is_Field()) {
     FieldNode* f = (FieldNode*)this;
+    if (f->is_oop())
+      tty->print("oop ");
+    if (f->offset() > 0)
+      tty->print("+%d ", f->offset());
     tty->print("(");
     for (BaseIterator i(f); i.has_next(); i.next()) {
       PointsToNode* b = i.get();
--- a/hotspot/src/share/vm/prims/jni.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/jni.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -2985,7 +2985,7 @@
   }
 
   // A jfieldID for a static field is a JNIid specifying the field holder and the offset within the Klass*
-  JNIid* id = InstanceKlass::cast(fd.field_holder())->jni_id_for(fd.offset());
+  JNIid* id = fd.field_holder()->jni_id_for(fd.offset());
   debug_only(id->set_is_static_field_id();)
 
   debug_only(id->verify(fd.field_holder()));
@@ -4016,7 +4016,7 @@
   if (PrintJNIResolving) {
     ResourceMark rm(THREAD);
     tty->print_cr("[Registering JNI native method %s.%s]",
-      Klass::cast(method->method_holder())->external_name(),
+      method->method_holder()->external_name(),
       method->name()->as_C_string());
   }
   return true;
--- a/hotspot/src/share/vm/prims/jvm.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -125,7 +125,7 @@
   int line_number = -1;
   const char * source_file = NULL;
   const char * trace = "explicit";
-  Klass* caller = NULL;
+  InstanceKlass* caller = NULL;
   JavaThread* jthread = JavaThread::current();
   if (jthread->has_last_Java_frame()) {
     vframeStream vfst(jthread);
@@ -153,17 +153,17 @@
     // that caller, otherwise keep quiet since this should be picked up elsewhere.
     bool found_it = false;
     if (!vfst.at_end() &&
-        InstanceKlass::cast(vfst.method()->method_holder())->name() == vmSymbols::java_lang_Class() &&
+        vfst.method()->method_holder()->name() == vmSymbols::java_lang_Class() &&
         vfst.method()->name() == vmSymbols::forName0_name()) {
       vfst.next();
       if (!vfst.at_end() &&
-          InstanceKlass::cast(vfst.method()->method_holder())->name() == vmSymbols::java_lang_Class() &&
+          vfst.method()->method_holder()->name() == vmSymbols::java_lang_Class() &&
           vfst.method()->name() == vmSymbols::forName_name()) {
         vfst.next();
         found_it = true;
       }
     } else if (last_caller != NULL &&
-               InstanceKlass::cast(last_caller->method_holder())->name() ==
+               last_caller->method_holder()->name() ==
                vmSymbols::java_lang_ClassLoader() &&
                (last_caller->name() == vmSymbols::loadClassInternal_name() ||
                 last_caller->name() == vmSymbols::loadClass_name())) {
@@ -182,7 +182,7 @@
         // show method name if it's a native method
         trace = vfst.method()->name_and_sig_as_C_string();
       }
-      Symbol* s = InstanceKlass::cast(caller)->source_file_name();
+      Symbol* s = caller->source_file_name();
       if (s != NULL) {
         source_file = s->as_C_string();
       }
@@ -190,8 +190,8 @@
   }
   if (caller != NULL) {
     if (to_class != caller) {
-      const char * from = Klass::cast(caller)->external_name();
-      const char * to = Klass::cast(to_class)->external_name();
+      const char * from = caller->external_name();
+      const char * to = to_class->external_name();
       // print in a single call to reduce interleaving between threads
       if (source_file != NULL) {
         tty->print("RESOLVE %s %s %s:%d (%s)\n", from, to, source_file, line_number, trace);
@@ -1228,7 +1228,7 @@
       privileged_context = Handle(thread, thread->privileged_stack_top()->privileged_context());
       protection_domain  = thread->privileged_stack_top()->protection_domain();
     } else {
-      protection_domain = InstanceKlass::cast(method->method_holder())->protection_domain();
+      protection_domain = method->method_holder()->protection_domain();
     }
 
     if ((previous_protection_domain != protection_domain) && (protection_domain != NULL)) {
@@ -3048,10 +3048,10 @@
 
     Method* m = vfst.method();
     if (!m->is_native()) {
-      Klass* holder = m->method_holder();
-      oop      loader = InstanceKlass::cast(holder)->class_loader();
+      InstanceKlass* holder = m->method_holder();
+      oop loader = holder->class_loader();
       if (loader != NULL && !java_lang_ClassLoader::is_trusted_loader(loader)) {
-        return (jclass) JNIHandles::make_local(env, Klass::cast(holder)->java_mirror());
+        return (jclass) JNIHandles::make_local(env, holder->java_mirror());
       }
     }
   }
@@ -3071,9 +3071,9 @@
 
     Method* m = vfst.method();
     if (!m->is_native()) {
-      Klass* holder = m->method_holder();
+      InstanceKlass* holder = m->method_holder();
       assert(holder->is_klass(), "just checking");
-      oop loader = InstanceKlass::cast(holder)->class_loader();
+      oop loader = holder->class_loader();
       if (loader != NULL && !java_lang_ClassLoader::is_trusted_loader(loader)) {
         return JNIHandles::make_local(env, loader);
       }
@@ -3148,9 +3148,9 @@
 
   for(vframeStream vfst(thread); !vfst.at_end(); vfst.next()) {
     if (!vfst.method()->is_native()) {
-      Klass* holder = vfst.method()->method_holder();
+      InstanceKlass* holder = vfst.method()->method_holder();
       assert(holder->is_klass(), "just checking");
-      if (InstanceKlass::cast(holder)->name() == class_name_sym) {
+      if (holder->name() == class_name_sym) {
         return depth;
       }
       depth++;
@@ -3171,9 +3171,9 @@
 
     Method* m = vfst.method();
     if (!m->is_native()) {
-      Klass* holder = m->method_holder();
+      InstanceKlass* holder = m->method_holder();
       assert(holder->is_klass(), "just checking");
-      oop loader = InstanceKlass::cast(holder)->class_loader();
+      oop loader = holder->class_loader();
       if (loader != NULL && !java_lang_ClassLoader::is_trusted_loader(loader)) {
         return depth;
       }
@@ -3322,8 +3322,7 @@
   for (vframeStream vfst(thread); !vfst.at_end(); vfst.next()) {
     // UseNewReflection
     vfst.skip_reflection_related_frames(); // Only needed for 1.4 reflection
-    Klass* holder = vfst.method()->method_holder();
-    oop loader = InstanceKlass::cast(holder)->class_loader();
+    oop loader = vfst.method()->method_holder()->class_loader();
     if (loader != NULL) {
       return JNIHandles::make_local(env, loader);
     }
@@ -3365,9 +3364,9 @@
          !vfst.at_end() && loader == NULL;
          vfst.next()) {
       if (!vfst.method()->is_native()) {
-        Klass* holder = vfst.method()->method_holder();
-        loader             = InstanceKlass::cast(holder)->class_loader();
-        protection_domain  = InstanceKlass::cast(holder)->protection_domain();
+        InstanceKlass* holder = vfst.method()->method_holder();
+        loader             = holder->class_loader();
+        protection_domain  = holder->protection_domain();
       }
     }
   } else {
--- a/hotspot/src/share/vm/prims/jvmti.xml	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/jvmti.xml	Wed Nov 14 16:41:12 2012 -0800
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
 <?xml-stylesheet type="text/xsl" href="jvmti.xsl"?>
 <!--
- Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2002, 2012, 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
@@ -358,7 +358,7 @@
 <specification label="JVM(TM) Tool Interface"
         majorversion="1"
         minorversion="2"
-        microversion="1">
+        microversion="2">
   <title subtitle="Version">
     <tm>JVM</tm> Tool Interface
   </title>
@@ -405,7 +405,7 @@
     interfaces are more appropriate than <jvmti/> for many tools. 
     For more information on the Java Platform Debugger Architecture, 
     see the 
-    <externallink id="http://java.sun.com/products/jpda/">Java 
+    <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/architecture.html">Java 
       Platform Debugger Architecture website</externallink>. 
   </intro>
 
@@ -693,7 +693,7 @@
     An agent creates a <jvmti/> environment 
     by passing a <jvmti/> version 
     as the interface ID to the JNI Invocation API function 
-    <externallink id="http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/invocation.html#GetEnv"><code>GetEnv</code></externallink>.
+    <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html#GetEnv"><code>GetEnv</code></externallink>.
     See <internallink id="jvmtiEnvAccess">Accessing <jvmti/> Functions</internallink>
     for more details on the creation and use of 
     <jvmti/> environments.
@@ -797,7 +797,7 @@
     Modified UTF-8 differs 
     from standard UTF-8 in the representation of supplementary characters 
     and of the null character. See the
-    <externallink id="http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp16542">
+    <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html#wp16542">
       Modified UTF-8 Strings</externallink>
     section of the JNI specification for details.
   </intro>
@@ -827,7 +827,7 @@
     by calling <jvmti/> functions. 
     Access to <jvmti/> functions is by use of an interface pointer
     in the same manner as 
-    <externallink id="http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/design.html">Java 
+    <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/design.html">Java 
       Native Interface (JNI) functions</externallink> are accessed.
     The <jvmti/> interface pointer is called the 
     <i>environment pointer</i>.
@@ -919,7 +919,7 @@
     local references--these local references are created 
     during the <jvmti/> call.
     Local references are a resource that must be managed (see the 
-    <externallink id="http://java.sun.com/javase/6/docs/guide/jni/spec/functions.html#wp18654">JNI Documentation</externallink>).  
+    <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#wp18654">JNI Documentation</externallink>).  
     When threads return from native code all local references
     are freed.  Note that some threads, including typical
     agent threads, will never return from native code.
@@ -954,7 +954,7 @@
       <jvmti/> function.
       See the
       <externallink 
-        id="http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/design.html#wp770"
+        id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/design.html#wp770"
              >Java Exceptions</externallink>
       section of the JNI specification for information on handling exceptions.
     </intro>
@@ -2024,7 +2024,7 @@
 	<p/>
 	Upon execution of <code>proc</code>, the new thread will be attached to the
 	VM--see the JNI documentation on 
-	<externallink id="http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/invocation.html#wp1060"
+	<externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html#wp1060"
 		      >Attaching to the VM</externallink>.
       </description>
       <origin>jvmdiClone</origin>
@@ -4010,7 +4010,7 @@
 	  </inptr>
 	  <description>
 	    Details about the reference. 
-            Set when the <paramlink id="reference_kind"/> is
+            Set when the <datalink id="jvmtiHeapReferenceCallback.reference_kind">reference_kind</datalink> is
             <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>,
 	    <datalink id="JVMTI_HEAP_REFERENCE_STATIC_FIELD"/>,
 	    <datalink id="JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT"/>,
@@ -4378,7 +4378,7 @@
         do not control which objects are visited but they do control which
         objects and primitive values are reported by the callbacks.
         For example, if the only callback that was set is
-        <paramlink id="array_primitive_value_callback"/> and <code>klass</code>
+        <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
         is set to the array of bytes class, then only arrays of byte will be
         reported.  
         The table below summarizes this:
@@ -4414,7 +4414,7 @@
           </tr>
           <tr>
             <th align="left">
-              <fieldlink id="object_reference_callback" struct="jvmtiHeapCallbacks"/>
+              <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
               in <paramlink id="callbacks"/> set
             </th>
             <td>
@@ -4570,7 +4570,7 @@
         do not control which objects are visited but they do control which
         objects and primitive values are reported by the callbacks.
         For example, if the only callback that was set is
-        <paramlink id="array_primitive_value_callback"/> and <code>klass</code>
+        <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/> and <code>klass</code>
         is set to the array of bytes class, then only arrays of byte will be
         reported. The table below summarizes this (contrast this with 
         <functionlink id="FollowReferences"/>):
@@ -4606,7 +4606,7 @@
           </tr>
           <tr>
             <th align="left">
-              <fieldlink id="object_callback" struct="jvmtiHeapCallbacks"/>
+              <fieldlink id="array_primitive_value_callback" struct="jvmtiHeapCallbacks"/>
               in <paramlink id="callbacks"/> set
             </th>
             <td>
@@ -6478,7 +6478,7 @@
       <synopsis>Get Class Signature</synopsis>
       <description>
         For the class indicated by <code>klass</code>, return the 
-        <externallink id="http://java.sun.com/javase/6/docs/guide/jni/spec/types.html#wp16432">JNI 
+        <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html#wp16432">JNI 
             type signature</externallink> 
         and the generic signature of the class.
         For example, <code>java.util.List</code> is <code>"Ljava/util/List;"</code>
@@ -8763,7 +8763,7 @@
       Provides the ability to intercept and resend 
       Java Native Interface (JNI) function calls
       by manipulating the JNI function table.
-      See <externallink id="http://java.sun.com/javase/6/docs/guide/jni/spec/functions.html">JNI
+      See <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html">JNI
 	Functions</externallink> in the <i>Java Native Interface Specification</i>.
       <p/>
       The following example illustrates intercepting the 
@@ -10446,7 +10446,7 @@
 	  for a class. The segment is typically a directory or JAR file.
 	  <p/>	  
 	  In the live phase the <paramlink id="segment"/> may be used to specify any platform-dependent
-	  path to a <externallink id="http://java.sun.com/javase/6/docs/guide/jar/jar.html">
+	  path to a <externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html">
 	  JAR file</externallink>. The agent should take care that the JAR file does not
           contain any classes or resources other than those to be defined by the bootstrap
           class loader for the purposes of instrumentation.
@@ -10494,7 +10494,7 @@
 	  for a class. The segment is typically a directory or JAR file.
 	  <p/>	  
 	  In the live phase the <paramlink id="segment"/> is a platform-dependent path to a <externallink 
-	  id="http://java.sun.com/javase/6/docs/guide/jar/jar.html">JAR file</externallink> to be
+	  id="http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html">JAR file</externallink> to be
 	  searched after the system class loader unsuccessfully searches for a class. The agent should
           take care that the JAR file does not contain any classes or resources other than those to be
           defined by the system class loader for the purposes of instrumentation.
@@ -13128,6 +13128,12 @@
 	Unsigned 8 bits.
       </description>
     </basetype>
+    <basetype id="jchar">
+      <description>
+	Holds a Java programming language <code>char</code>.
+	Unsigned 16 bits.
+      </description>
+    </basetype>
     <basetype id="jint">
       <description>
 	Holds a Java programming language <code>int</code>. 
@@ -13285,7 +13291,7 @@
       <description>
 	Typedef for the JNI function table <code>JNINativeInterface</code>
 	defined in the 
-	<externallink id="http://java.sun.com/javase/6/docs/guide/jni/spec/functions.html#wp23720">JNI Specification</externallink>.
+	<externallink id="http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/functions.html#wp23720">JNI Specification</externallink>.
 	The JNI reference implementation defines this with an underscore.
       </description>
     </basetype>
@@ -14252,6 +14258,9 @@
   <change date="6 August 2006" version="1.1.102">
       Add ResourceExhaustedEvent.
   </change>
+  <change date="11 October 2012" version="1.2.2">
+      Fixed the "HTTP" and "Missing Anchor" errors reported by the LinkCheck tool.
+  </change>
 </changehistory>
 
 </specification>
--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -753,7 +753,7 @@
 
   unsigned char* p = bytecodes;
   Bytecodes::Code code;
-  bool is_rewritten = InstanceKlass::cast(mh->method_holder())->is_rewritten();
+  bool is_rewritten = mh->method_holder()->is_rewritten();
 
   while ((code = bs.next()) >= 0) {
     assert(Bytecodes::is_java_code(code), "sanity check");
--- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -2822,7 +2822,7 @@
   JavaThread* current_thread  = JavaThread::current();
 
   // does the klass have any local variable information?
-  InstanceKlass* ik = InstanceKlass::cast(method_oop->method_holder());
+  InstanceKlass* ik = method_oop->method_holder();
   if (!ik->access_flags().has_localvariable_table()) {
     return (JVMTI_ERROR_ABSENT_INFORMATION);
   }
--- a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -69,7 +69,7 @@
   enum {
     JDK15_JVMTI_VERSION = JVMTI_VERSION_1_0 +  33,  /* version: 1.0.33  */
     JDK16_JVMTI_VERSION = JVMTI_VERSION_1_1 + 102,  /* version: 1.1.102 */
-    JDK17_JVMTI_VERSION = JVMTI_VERSION_1_2 +   1   /* version: 1.2.1   */
+    JDK17_JVMTI_VERSION = JVMTI_VERSION_1_2 +   2   /* version: 1.2.2   */
   };
 
   static jvmtiPhase  get_phase()                    { return _phase; }
--- a/hotspot/src/share/vm/prims/methodHandles.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -233,7 +233,7 @@
   methodHandle m = info.resolved_method();
   KlassHandle defc = info.resolved_klass();
   int vmindex = -1;
-  if (defc->is_interface() && Klass::cast(m->method_holder())->is_interface()) {
+  if (defc->is_interface() && m->method_holder()->is_interface()) {
     // LinkResolver does not report itable indexes!  (fix this?)
     vmindex = klassItable::compute_itable_index(m());
   } else if (m->can_be_statically_bound()) {
@@ -749,8 +749,8 @@
       DEBUG_ONLY(vmtarget = NULL);  // safety
       if (m.is_null())  break;
       if (!have_defc) {
-        Klass* defc = m->method_holder();
-        java_lang_invoke_MemberName::set_clazz(mname(), Klass::cast(defc)->java_mirror());
+        InstanceKlass* defc = m->method_holder();
+        java_lang_invoke_MemberName::set_clazz(mname(), defc->java_mirror());
       }
       if (!have_name) {
         //not java_lang_String::create_from_symbol; let's intern member names
--- a/hotspot/src/share/vm/prims/nativeLookup.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/prims/nativeLookup.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -165,8 +165,7 @@
   // Note: It is critical for bootstrapping that Java_java_lang_ClassLoader_00024NativeLibrary_find
   // gets found the first time around - otherwise an infinite loop can occure. This is
   // another VM/library dependency
-  Handle loader(THREAD,
-                InstanceKlass::cast(method->method_holder())->class_loader());
+  Handle loader(THREAD, method->method_holder()->class_loader());
   if (loader.is_null()) {
     entry = lookup_special_native(jni_name);
     if (entry == NULL) {
@@ -393,7 +392,7 @@
     if (PrintJNIResolving) {
       ResourceMark rm(THREAD);
       tty->print_cr("[Dynamic-linking native method %s.%s ... JNI]",
-        Klass::cast(method->method_holder())->external_name(),
+        method->method_holder()->external_name(),
         method->name()->as_C_string());
     }
   }
--- a/hotspot/src/share/vm/runtime/arguments.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/arguments.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -257,6 +257,7 @@
   { "MaxPermHeapExpansion", JDK_Version::jdk(8),  JDK_Version::jdk(9) },
   { "CMSRevisitStackSize",           JDK_Version::jdk(8), JDK_Version::jdk(9) },
   { "PrintRevisitStats",             JDK_Version::jdk(8), JDK_Version::jdk(9) },
+  { "UseVectoredExceptions",         JDK_Version::jdk(8), JDK_Version::jdk(9) },
 #ifdef PRODUCT
   { "DesiredMethodLimit",
                            JDK_Version::jdk_update(7, 2), JDK_Version::jdk(8) },
@@ -2568,7 +2569,9 @@
          FLAG_SET_CMDLINE(uintx, MaxNewSize, NewSize);
       }
 
+#ifndef _ALLBSD_SOURCE  // UseLargePages is not yet supported on BSD.
       FLAG_SET_DEFAULT(UseLargePages, true);
+#endif
 
       // Increase some data structure sizes for efficiency
       FLAG_SET_CMDLINE(uintx, BaseFootPrintEstimate, MaxHeapSize);
@@ -3133,6 +3136,10 @@
   UNSUPPORTED_OPTION(UseG1GC, "G1 GC");
 #endif
 
+#ifdef _ALLBSD_SOURCE  // UseLargePages is not yet supported on BSD.
+  UNSUPPORTED_OPTION(UseLargePages, "-XX:+UseLargePages");
+#endif
+
 #if !INCLUDE_ALTERNATE_GCS
   if (UseParallelGC) {
     warning("Parallel GC is not supported in this VM.  Using Serial GC.");
--- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -627,7 +627,7 @@
   // negative filter: should send NOT be inlined?  returns NULL (--> inline) or rejection msg
   if (m->is_abstract()) return (_msg = "abstract method");
   // note: we allow ik->is_abstract()
-  if (!InstanceKlass::cast(m->method_holder())->is_initialized()) return (_msg = "method holder not initialized");
+  if (!m->method_holder()->is_initialized()) return (_msg = "method holder not initialized");
   if (m->is_native()) return (_msg = "native method");
   nmethod* m_code = m->code();
   if (m_code != NULL && m_code->code_size() > InlineSmallCode)
--- a/hotspot/src/share/vm/runtime/deoptimization.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1191,12 +1191,12 @@
 
   if (!constant_pool->tag_at(index).is_symbol()) return;
 
-  Handle class_loader (THREAD, InstanceKlass::cast(constant_pool->pool_holder())->class_loader());
+  Handle class_loader (THREAD, constant_pool->pool_holder()->class_loader());
   Symbol*  symbol  = constant_pool->symbol_at(index);
 
   // class name?
   if (symbol->byte_at(0) != '(') {
-    Handle protection_domain (THREAD, Klass::cast(constant_pool->pool_holder())->protection_domain());
+    Handle protection_domain (THREAD, constant_pool->pool_holder()->protection_domain());
     SystemDictionary::resolve_or_null(symbol, class_loader, protection_domain, CHECK);
     return;
   }
@@ -1206,7 +1206,7 @@
   for (SignatureStream ss(symbol); !ss.is_done(); ss.next()) {
     if (ss.is_object()) {
       Symbol* class_name = ss.as_symbol(CHECK);
-      Handle protection_domain (THREAD, Klass::cast(constant_pool->pool_holder())->protection_domain());
+      Handle protection_domain (THREAD, constant_pool->pool_holder()->protection_domain());
       SystemDictionary::resolve_or_null(class_name, class_loader, protection_domain, CHECK);
     }
   }
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -36,7 +36,7 @@
 
 
 oop fieldDescriptor::loader() const {
-  return InstanceKlass::cast(_cp->pool_holder())->class_loader();
+  return _cp->pool_holder()->class_loader();
 }
 
 Symbol* fieldDescriptor::generic_signature() const {
@@ -45,7 +45,7 @@
   }
 
   int idx = 0;
-  InstanceKlass* ik = InstanceKlass::cast(field_holder());
+  InstanceKlass* ik = field_holder();
   for (AllFieldStream fs(ik); !fs.done(); fs.next()) {
     if (idx == _index) {
       return fs.generic_signature();
@@ -58,7 +58,7 @@
 }
 
 AnnotationArray* fieldDescriptor::annotations() const {
-  InstanceKlass* ik = InstanceKlass::cast(field_holder());
+  InstanceKlass* ik = field_holder();
   Array<AnnotationArray*>* md = ik->fields_annotations();
   if (md == NULL)
     return NULL;
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -43,12 +43,12 @@
 
   // update the access_flags for the field in the klass
   void update_klass_field_access_flag() {
-    InstanceKlass* ik = InstanceKlass::cast(field_holder());
+    InstanceKlass* ik = field_holder();
     ik->field(index())->set_access_flags(_access_flags.as_short());
   }
 
   FieldInfo* field() const {
-    InstanceKlass* ik = InstanceKlass::cast(field_holder());
+    InstanceKlass* ik = field_holder();
     return ik->field(_index);
   }
 
@@ -59,46 +59,46 @@
   Symbol* signature() const {
     return field()->signature(_cp);
   }
-  Klass* field_holder() const        { return _cp->pool_holder(); }
-  ConstantPool* constants() const    { return _cp(); }
-  AccessFlags access_flags() const     { return _access_flags; }
-  oop loader() const;
+  InstanceKlass* field_holder()   const    { return _cp->pool_holder(); }
+  ConstantPool* constants()       const    { return _cp(); }
+  AccessFlags access_flags()      const    { return _access_flags; }
+  oop loader()                    const;
   // Offset (in words) of field from start of instanceOop / Klass*
-  int offset() const                   { return field()->offset(); }
-  Symbol* generic_signature() const;
-  int index() const                    { return _index; }
-  AnnotationArray* annotations() const;
+  int offset()                    const    { return field()->offset(); }
+  Symbol* generic_signature()     const;
+  int index()                     const    { return _index; }
+  AnnotationArray* annotations()  const;
 
   // Initial field value
-  bool has_initial_value() const          { return field()->initval_index() != 0; }
-  int initial_value_index() const         { return field()->initval_index(); }
+  bool has_initial_value()        const    { return field()->initval_index() != 0; }
+  int initial_value_index()       const    { return field()->initval_index(); }
   constantTag initial_value_tag() const;  // The tag will return true on one of is_int(), is_long(), is_single(), is_double()
-  jint        int_initial_value() const;
-  jlong       long_initial_value() const;
-  jfloat      float_initial_value() const;
-  jdouble     double_initial_value() const;
-  oop         string_initial_value(TRAPS) const;
+  jint int_initial_value()        const;
+  jlong long_initial_value()      const;
+  jfloat float_initial_value()    const;
+  jdouble double_initial_value()  const;
+  oop string_initial_value(TRAPS) const;
 
   // Field signature type
-  BasicType field_type() const            { return FieldType::basic_type(signature()); }
+  BasicType field_type()          const    { return FieldType::basic_type(signature()); }
 
   // Access flags
-  bool is_public() const                  { return access_flags().is_public(); }
-  bool is_private() const                 { return access_flags().is_private(); }
-  bool is_protected() const               { return access_flags().is_protected(); }
-  bool is_package_private() const         { return !is_public() && !is_private() && !is_protected(); }
+  bool is_public()                const    { return access_flags().is_public(); }
+  bool is_private()               const    { return access_flags().is_private(); }
+  bool is_protected()             const    { return access_flags().is_protected(); }
+  bool is_package_private()       const    { return !is_public() && !is_private() && !is_protected(); }
 
-  bool is_static() const                  { return access_flags().is_static(); }
-  bool is_final() const                   { return access_flags().is_final(); }
-  bool is_volatile() const                { return access_flags().is_volatile(); }
-  bool is_transient() const               { return access_flags().is_transient(); }
+  bool is_static()                const    { return access_flags().is_static(); }
+  bool is_final()                 const    { return access_flags().is_final(); }
+  bool is_volatile()              const    { return access_flags().is_volatile(); }
+  bool is_transient()             const    { return access_flags().is_transient(); }
 
-  bool is_synthetic() const               { return access_flags().is_synthetic(); }
+  bool is_synthetic()             const    { return access_flags().is_synthetic(); }
 
-  bool is_field_access_watched() const    { return access_flags().is_field_access_watched(); }
+  bool is_field_access_watched()  const    { return access_flags().is_field_access_watched(); }
   bool is_field_modification_watched() const
-                                          { return access_flags().is_field_modification_watched(); }
-  bool has_generic_signature() const      { return access_flags().field_has_generic_signature(); }
+                                           { return access_flags().is_field_modification_watched(); }
+  bool has_generic_signature()    const    { return access_flags().field_has_generic_signature(); }
 
   void set_is_field_access_watched(const bool value) {
     _access_flags.set_is_field_access_watched(value);
--- a/hotspot/src/share/vm/runtime/globals.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -857,9 +857,6 @@
   develop(bool, BreakAtWarning, false,                                      \
           "Execute breakpoint upon encountering VM warning")                \
                                                                             \
-  product_pd(bool, UseVectoredExceptions,                                   \
-          "Temp Flag - Use Vectored Exceptions rather than SEH (Windows Only)") \
-                                                                            \
   develop(bool, TraceVMOperation, false,                                    \
           "Trace vm operations")                                            \
                                                                             \
@@ -3599,6 +3596,15 @@
   product(uintx, StringTableSize, 1009,                                     \
           "Number of buckets in the interned String table")                 \
                                                                             \
+  develop(bool, TraceDefaultMethods, false,                                 \
+          "Trace the default method processing steps")                      \
+                                                                            \
+  develop(bool, ParseAllGenericSignatures, false,                           \
+          "Parse all generic signatures while classloading")                \
+                                                                            \
+  develop(bool, VerifyGenericSignatures, false,                             \
+          "Abort VM on erroneous or inconsistent generic signatures")       \
+                                                                            \
   product(bool, UseVMInterruptibleIO, false,                                \
           "(Unstable, Solaris-specific) Thread interrupt before or with "   \
           "EINTR for I/O operations results in OS_INTRPT. The default value"\
--- a/hotspot/src/share/vm/runtime/java.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/java.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -688,6 +688,7 @@
 
 JDK_Version JDK_Version::_current;
 const char* JDK_Version::_runtime_name;
+const char* JDK_Version::_runtime_version;
 
 void JDK_Version::initialize() {
   jdk_version_info info;
--- a/hotspot/src/share/vm/runtime/java.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/java.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -75,6 +75,7 @@
 
   static JDK_Version _current;
   static const char* _runtime_name;
+  static const char* _runtime_version;
 
   // In this class, we promote the minor version of release to be the
   // major version for releases >= 5 in anticipation of the JDK doing the
@@ -189,6 +190,13 @@
     _runtime_name = name;
   }
 
+  static const char* runtime_version() {
+    return _runtime_version;
+  }
+  static void set_runtime_version(const char* version) {
+    _runtime_version = version;
+  }
+
   // Convenience methods for queries on the current major/minor version
   static bool is_jdk12x_version() {
     return current().compare_major(2) == 0;
--- a/hotspot/src/share/vm/runtime/javaCalls.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/javaCalls.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -189,7 +189,7 @@
   assert(method->name() == vmSymbols::object_initializer_name(),    "Should only be called for default constructor");
   assert(method->signature() == vmSymbols::void_method_signature(), "Should only be called for default constructor");
 
-  InstanceKlass* ik = InstanceKlass::cast(method->method_holder());
+  InstanceKlass* ik = method->method_holder();
   if (ik->is_initialized() && ik->has_vanilla_constructor()) {
     // safe to skip constructor call
   } else {
@@ -344,11 +344,11 @@
 
 
 #ifdef ASSERT
-  { Klass* holder = method->method_holder();
+  { InstanceKlass* holder = method->method_holder();
     // A klass might not be initialized since JavaCall's might be used during the executing of
     // the <clinit>. For example, a Thread.start might start executing on an object that is
     // not fully initialized! (bad Java programming style)
-    assert(InstanceKlass::cast(holder)->is_linked(), "rewritting must have taken place");
+    assert(holder->is_linked(), "rewritting must have taken place");
   }
 #endif
 
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -140,6 +140,7 @@
 Monitor* JfrMsg_lock                  = NULL;
 Mutex*   JfrBuffer_lock               = NULL;
 Mutex*   JfrStream_lock               = NULL;
+Monitor* PeriodicTask_lock            = NULL;
 
 #define MAX_NUM_MUTEX 128
 static Monitor * _mutex_array[MAX_NUM_MUTEX];
@@ -285,6 +286,7 @@
   def(JfrMsg_lock                  , Monitor, nonleaf+2,   true);
   def(JfrBuffer_lock               , Mutex,   nonleaf+3,   true);
   def(JfrStream_lock               , Mutex,   nonleaf+4,   true);
+  def(PeriodicTask_lock            , Monitor, nonleaf+5,   true);
 }
 
 GCMutexLocker::GCMutexLocker(Monitor * mutex) {
--- a/hotspot/src/share/vm/runtime/mutexLocker.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -142,6 +142,7 @@
 extern Monitor* JfrMsg_lock;                     // protects JFR messaging
 extern Mutex*   JfrBuffer_lock;                  // protects JFR buffer operations
 extern Mutex*   JfrStream_lock;                  // protects JFR stream access
+extern Monitor* PeriodicTask_lock;               // protects the periodic task structure
 
 // A MutexLocker provides mutual exclusion with respect to a given mutex
 // for the scope which contains the locker.  The lock is an OS lock, not
--- a/hotspot/src/share/vm/runtime/reflection.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/reflection.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -56,14 +56,14 @@
     vframeStream vfst(jthread);
     // skip over any frames belonging to java.lang.Class
     while (!vfst.at_end() &&
-           InstanceKlass::cast(vfst.method()->method_holder())->name() == vmSymbols::java_lang_Class()) {
+           vfst.method()->method_holder()->name() == vmSymbols::java_lang_Class()) {
       vfst.next();
     }
     if (!vfst.at_end()) {
       // this frame is a likely suspect
       caller = vfst.method()->method_holder();
       line_number = vfst.method()->line_number_from_bci(vfst.bci());
-      Symbol* s = InstanceKlass::cast(vfst.method()->method_holder())->source_file_name();
+      Symbol* s = vfst.method()->method_holder()->source_file_name();
       if (s != NULL) {
         source_file = s->as_C_string();
       }
@@ -472,6 +472,12 @@
     return true;
   }
 
+  // Also allow all accesses from
+  // java/lang/invoke/MagicLambdaImpl subclasses to succeed trivially.
+  if (current_class->is_subclass_of(SystemDictionary::lambda_MagicLambdaImpl_klass())) {
+    return true;
+  }
+
   return can_relax_access_check_for(current_class, new_class, classloader_only);
 }
 
@@ -564,6 +570,12 @@
     return true;
   }
 
+  // Also allow all accesses from
+  // java/lang/invoke/MagicLambdaImpl subclasses to succeed trivially.
+  if (current_class->is_subclass_of(SystemDictionary::lambda_MagicLambdaImpl_klass())) {
+    return true;
+  }
+
   return can_relax_access_check_for(
     current_class, field_class, classloader_only);
 }
@@ -630,8 +642,8 @@
     case T_OBJECT:
     case T_ARRAY:
       Symbol* name        = ss->as_symbol(CHECK_NULL);
-      oop loader            = InstanceKlass::cast(method->method_holder())->class_loader();
-      oop protection_domain = InstanceKlass::cast(method->method_holder())->protection_domain();
+      oop loader            = method->method_holder()->class_loader();
+      oop protection_domain = method->method_holder()->protection_domain();
       Klass* k = SystemDictionary::resolve_or_fail(
                                        name,
                                        Handle(THREAD, loader),
@@ -702,7 +714,7 @@
   assert(!method()->is_initializer() ||
          (for_constant_pool_access && method()->is_static()) ||
          (method()->name() == vmSymbols::class_initializer_name()
-    && Klass::cast(method()->method_holder())->is_interface() && JDK_Version::is_jdk12x_version()), "should call new_constructor instead");
+    && method()->method_holder()->is_interface() && JDK_Version::is_jdk12x_version()), "should call new_constructor instead");
   instanceKlassHandle holder (THREAD, method->method_holder());
   int slot = method->method_idnum();
 
@@ -820,7 +832,7 @@
   Handle type = new_type(signature, holder, CHECK_NULL);
   Handle rh  = java_lang_reflect_Field::create(CHECK_NULL);
 
-  java_lang_reflect_Field::set_clazz(rh(), Klass::cast(fd->field_holder())->java_mirror());
+  java_lang_reflect_Field::set_clazz(rh(), fd->field_holder()->java_mirror());
   java_lang_reflect_Field::set_slot(rh(), fd->index());
   java_lang_reflect_Field::set_name(rh(), name());
   java_lang_reflect_Field::set_type(rh(), type());
@@ -888,7 +900,7 @@
       method = reflected_method;
     } else {
       // resolve based on the receiver
-      if (InstanceKlass::cast(reflected_method->method_holder())->is_interface()) {
+      if (reflected_method->method_holder()->is_interface()) {
         // resolve interface call
         if (ReflectionWrapResolutionErrors) {
           // new default: 6531596
--- a/hotspot/src/share/vm/runtime/task.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/task.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -61,7 +61,7 @@
 }
 #endif
 
-void PeriodicTask::real_time_tick(size_t delay_time) {
+void PeriodicTask::real_time_tick(int delay_time) {
 #ifndef PRODUCT
   if (ProfilerCheckIntervals) {
     _ticks++;
@@ -73,19 +73,39 @@
     _intervalHistogram[ms]++;
   }
 #endif
-  int orig_num_tasks = _num_tasks;
-  for(int index = 0; index < _num_tasks; index++) {
-    _tasks[index]->execute_if_pending(delay_time);
-    if (_num_tasks < orig_num_tasks) { // task dis-enrolled itself
-      index--;  // re-do current slot as it has changed
-      orig_num_tasks = _num_tasks;
+
+  {
+    MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+    int orig_num_tasks = _num_tasks;
+
+    for(int index = 0; index < _num_tasks; index++) {
+      _tasks[index]->execute_if_pending(delay_time);
+      if (_num_tasks < orig_num_tasks) { // task dis-enrolled itself
+        index--;  // re-do current slot as it has changed
+        orig_num_tasks = _num_tasks;
+      }
     }
   }
 }
 
+int PeriodicTask::time_to_wait() {
+  MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ?
+                     NULL : PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+
+  if (_num_tasks == 0) {
+    return 0; // sleep until shutdown or a task is enrolled
+  }
+
+  int delay = _tasks[0]->time_to_next_interval();
+  for (int index = 1; index < _num_tasks; index++) {
+    delay = MIN2(delay, _tasks[index]->time_to_next_interval());
+  }
+  return delay;
+}
+
 
 PeriodicTask::PeriodicTask(size_t interval_time) :
-  _counter(0), _interval(interval_time) {
+  _counter(0), _interval((int) interval_time) {
   // Sanity check the interval time
   assert(_interval >= PeriodicTask::min_interval &&
          _interval <= PeriodicTask::max_interval &&
@@ -94,33 +114,40 @@
 }
 
 PeriodicTask::~PeriodicTask() {
-  if (is_enrolled())
-    disenroll();
-}
-
-bool PeriodicTask::is_enrolled() const {
-  for(int index = 0; index < _num_tasks; index++)
-    if (_tasks[index] == this) return true;
-  return false;
+  disenroll();
 }
 
 void PeriodicTask::enroll() {
-  assert(WatcherThread::watcher_thread() == NULL, "dynamic enrollment of tasks not yet supported");
+  MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ?
+                     NULL : PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
 
-  if (_num_tasks == PeriodicTask::max_tasks)
+  if (_num_tasks == PeriodicTask::max_tasks) {
     fatal("Overflow in PeriodicTask table");
+  }
   _tasks[_num_tasks++] = this;
+
+  WatcherThread* thread = WatcherThread::watcher_thread();
+  if (thread) {
+    thread->unpark();
+  } else {
+    WatcherThread::start();
+  }
 }
 
 void PeriodicTask::disenroll() {
-  assert(WatcherThread::watcher_thread() == NULL ||
-         Thread::current() == WatcherThread::watcher_thread(),
-         "dynamic disenrollment currently only handled from WatcherThread from within task() method");
+  MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ?
+                     NULL : PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
 
   int index;
-  for(index = 0; index < _num_tasks && _tasks[index] != this; index++);
-  if (index == _num_tasks) return;
+  for(index = 0; index < _num_tasks && _tasks[index] != this; index++)
+    ;
+
+  if (index == _num_tasks) {
+    return;
+  }
+
   _num_tasks--;
+
   for (; index < _num_tasks; index++) {
     _tasks[index] = _tasks[index+1];
   }
--- a/hotspot/src/share/vm/runtime/task.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/task.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -49,12 +49,12 @@
   static int num_tasks()   { return _num_tasks; }
 
  private:
-  size_t _counter;
-  const size_t _interval;
+  int _counter;
+  const int _interval;
 
   static int _num_tasks;
   static PeriodicTask* _tasks[PeriodicTask::max_tasks];
-  static void real_time_tick(size_t delay_time);
+  static void real_time_tick(int delay_time);
 
 #ifndef PRODUCT
   static elapsedTimer _timer;                      // measures time between ticks
@@ -69,51 +69,36 @@
   PeriodicTask(size_t interval_time); // interval is in milliseconds of elapsed time
   ~PeriodicTask();
 
-  // Tells whether is enrolled
-  bool is_enrolled() const;
-
   // Make the task active
-  // NOTE: this may only be called before the WatcherThread has been started
+  // For dynamic enrollment at the time T, the task will execute somewhere
+  // between T and T + interval_time.
   void enroll();
 
   // Make the task deactive
-  // NOTE: this may only be called either while the WatcherThread is
-  // inactive or by a task from within its task() method. One-shot or
-  // several-shot tasks may be implemented this way.
   void disenroll();
 
-  void execute_if_pending(size_t delay_time) {
-    _counter += delay_time;
-    if (_counter >= _interval) {
+  void execute_if_pending(int delay_time) {
+    // make sure we don't overflow
+    jlong tmp = (jlong) _counter + (jlong) delay_time;
+
+    if (tmp >= (jlong) _interval) {
       _counter = 0;
       task();
+    } else {
+      _counter += delay_time;
     }
   }
 
   // Returns how long (time in milliseconds) before the next time we should
   // execute this task.
-  size_t time_to_next_interval() const {
+  int time_to_next_interval() const {
     assert(_interval > _counter,  "task counter greater than interval?");
     return _interval - _counter;
   }
 
   // Calculate when the next periodic task will fire.
   // Called by the WatcherThread's run method.
-  // This assumes that periodic tasks aren't entering the system
-  // dynamically, except for during startup.
-  static size_t time_to_wait() {
-    if (_num_tasks == 0) {
-      // Don't wait any more; shut down the thread since we don't
-      // currently support dynamic enrollment.
-      return 0;
-    }
-
-    size_t delay = _tasks[0]->time_to_next_interval();
-    for (int index = 1; index < _num_tasks; index++) {
-      delay = MIN2(delay, _tasks[index]->time_to_next_interval());
-    }
-    return delay;
-  }
+  static int time_to_wait();
 
   // The task to perform at each period
   virtual void task() = 0;
--- a/hotspot/src/share/vm/runtime/thread.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1042,6 +1042,7 @@
 }
 
 char java_runtime_name[128] = "";
+char java_runtime_version[128] = "";
 
 // extract the JRE name from sun.misc.Version.java_runtime_name
 static const char* get_java_runtime_name(TRAPS) {
@@ -1064,6 +1065,27 @@
   }
 }
 
+// extract the JRE version from sun.misc.Version.java_runtime_version
+static const char* get_java_runtime_version(TRAPS) {
+  Klass* k = SystemDictionary::find(vmSymbols::sun_misc_Version(),
+                                      Handle(), Handle(), CHECK_AND_CLEAR_NULL);
+  fieldDescriptor fd;
+  bool found = k != NULL &&
+               InstanceKlass::cast(k)->find_local_field(vmSymbols::java_runtime_version_name(),
+                                                        vmSymbols::string_signature(), &fd);
+  if (found) {
+    oop name_oop = k->java_mirror()->obj_field(fd.offset());
+    if (name_oop == NULL)
+      return NULL;
+    const char* name = java_lang_String::as_utf8_string(name_oop,
+                                                        java_runtime_version,
+                                                        sizeof(java_runtime_version));
+    return name;
+  } else {
+    return NULL;
+  }
+}
+
 // General purpose hook into Java code, run once when the VM is initialized.
 // The Java library method itself may be changed independently from the VM.
 static void call_postVMInitHook(TRAPS) {
@@ -1195,6 +1217,7 @@
 // timer interrupts exists on the platform.
 
 WatcherThread* WatcherThread::_watcher_thread   = NULL;
+bool WatcherThread::_startable = false;
 volatile bool  WatcherThread::_should_terminate = false;
 
 WatcherThread::WatcherThread() : Thread() {
@@ -1215,6 +1238,55 @@
   }
 }
 
+int WatcherThread::sleep() const {
+  MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+
+  // remaining will be zero if there are no tasks,
+  // causing the WatcherThread to sleep until a task is
+  // enrolled
+  int remaining = PeriodicTask::time_to_wait();
+  int time_slept = 0;
+
+  // we expect this to timeout - we only ever get unparked when
+  // we should terminate or when a new task has been enrolled
+  OSThreadWaitState osts(this->osthread(), false /* not Object.wait() */);
+
+  jlong time_before_loop = os::javaTimeNanos();
+
+  for (;;) {
+    bool timedout = PeriodicTask_lock->wait(Mutex::_no_safepoint_check_flag, remaining);
+    jlong now = os::javaTimeNanos();
+
+    if (remaining == 0) {
+        // if we didn't have any tasks we could have waited for a long time
+        // consider the time_slept zero and reset time_before_loop
+        time_slept = 0;
+        time_before_loop = now;
+    } else {
+        // need to recalulate since we might have new tasks in _tasks
+        time_slept = (int) ((now - time_before_loop) / 1000000);
+    }
+
+    // Change to task list or spurious wakeup of some kind
+    if (timedout || _should_terminate) {
+        break;
+    }
+
+    remaining = PeriodicTask::time_to_wait();
+    if (remaining == 0) {
+        // Last task was just disenrolled so loop around and wait until
+        // another task gets enrolled
+        continue;
+    }
+
+    remaining -= time_slept;
+    if (remaining <= 0)
+      break;
+  }
+
+  return time_slept;
+}
+
 void WatcherThread::run() {
   assert(this == watcher_thread(), "just checking");
 
@@ -1227,26 +1299,7 @@
 
     // Calculate how long it'll be until the next PeriodicTask work
     // should be done, and sleep that amount of time.
-    size_t time_to_wait = PeriodicTask::time_to_wait();
-
-    // we expect this to timeout - we only ever get unparked when
-    // we should terminate
-    {
-      OSThreadWaitState osts(this->osthread(), false /* not Object.wait() */);
-
-      jlong prev_time = os::javaTimeNanos();
-      for (;;) {
-        int res= _SleepEvent->park(time_to_wait);
-        if (res == OS_TIMEOUT || _should_terminate)
-          break;
-        // spurious wakeup of some kind
-        jlong now = os::javaTimeNanos();
-        time_to_wait -= (now - prev_time) / 1000000;
-        if (time_to_wait <= 0)
-          break;
-        prev_time = now;
-      }
-    }
+    int time_waited = sleep();
 
     if (is_error_reported()) {
       // A fatal error has happened, the error handler(VMError::report_and_die)
@@ -1276,13 +1329,7 @@
       }
     }
 
-    PeriodicTask::real_time_tick(time_to_wait);
-
-    // If we have no more tasks left due to dynamic disenrollment,
-    // shut down the thread since we don't currently support dynamic enrollment
-    if (PeriodicTask::num_tasks() == 0) {
-      _should_terminate = true;
-    }
+    PeriodicTask::real_time_tick(time_waited);
   }
 
   // Signal that it is terminated
@@ -1297,22 +1344,33 @@
 }
 
 void WatcherThread::start() {
-  if (watcher_thread() == NULL) {
+  assert(PeriodicTask_lock->owned_by_self(), "PeriodicTask_lock required");
+
+  if (watcher_thread() == NULL && _startable) {
     _should_terminate = false;
     // Create the single instance of WatcherThread
     new WatcherThread();
   }
 }
 
+void WatcherThread::make_startable() {
+  assert(PeriodicTask_lock->owned_by_self(), "PeriodicTask_lock required");
+  _startable = true;
+}
+
 void WatcherThread::stop() {
+  {
+    MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+    _should_terminate = true;
+    OrderAccess::fence();  // ensure WatcherThread sees update in main loop
+
+    WatcherThread* watcher = watcher_thread();
+    if (watcher != NULL)
+      watcher->unpark();
+  }
+
   // it is ok to take late safepoints here, if needed
   MutexLocker mu(Terminator_lock);
-  _should_terminate = true;
-  OrderAccess::fence();  // ensure WatcherThread sees update in main loop
-
-  Thread* watcher = watcher_thread();
-  if (watcher != NULL)
-    watcher->_SleepEvent->unpark();
 
   while(watcher_thread() != NULL) {
     // This wait should make safepoint checks, wait without a timeout,
@@ -1330,6 +1388,11 @@
   }
 }
 
+void WatcherThread::unpark() {
+  MutexLockerEx ml(PeriodicTask_lock->owned_by_self() ? NULL : PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+  PeriodicTask_lock->notify();
+}
+
 void WatcherThread::print_on(outputStream* st) const {
   st->print("\"%s\" ", name());
   Thread::print_on(st);
@@ -3473,6 +3536,7 @@
 
       // get the Java runtime name after java.lang.System is initialized
       JDK_Version::set_runtime_name(get_java_runtime_name(THREAD));
+      JDK_Version::set_runtime_version(get_java_runtime_version(THREAD));
     } else {
       warning("java.lang.System not initialized");
     }
@@ -3635,12 +3699,18 @@
     }
   }
 
-  // Start up the WatcherThread if there are any periodic tasks
-  // NOTE:  All PeriodicTasks should be registered by now. If they
-  //   aren't, late joiners might appear to start slowly (we might
-  //   take a while to process their first tick).
-  if (PeriodicTask::num_tasks() > 0) {
-    WatcherThread::start();
+  {
+      MutexLockerEx ml(PeriodicTask_lock, Mutex::_no_safepoint_check_flag);
+      // Make sure the watcher thread can be started by WatcherThread::start()
+      // or by dynamic enrollment.
+      WatcherThread::make_startable();
+      // Start up the WatcherThread if there are any periodic tasks
+      // NOTE:  All PeriodicTasks should be registered by now. If they
+      //   aren't, late joiners might appear to start slowly (we might
+      //   take a while to process their first tick).
+      if (PeriodicTask::num_tasks() > 0) {
+          WatcherThread::start();
+      }
   }
 
   // Give os specific code one last chance to start
--- a/hotspot/src/share/vm/runtime/thread.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/thread.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -722,6 +722,7 @@
  private:
   static WatcherThread* _watcher_thread;
 
+  static bool _startable;
   volatile static bool _should_terminate; // updated without holding lock
  public:
   enum SomeConstants {
@@ -738,6 +739,7 @@
   char* name() const { return (char*)"VM Periodic Task Thread"; }
   void print_on(outputStream* st) const;
   void print() const { print_on(tty); }
+  void unpark();
 
   // Returns the single instance of WatcherThread
   static WatcherThread* watcher_thread()         { return _watcher_thread; }
@@ -745,6 +747,12 @@
   // Create and start the single instance of WatcherThread, or stop it on shutdown
   static void start();
   static void stop();
+  // Only allow start once the VM is sufficiently initialized
+  // Otherwise the first task to enroll will trigger the start
+  static void make_startable();
+
+ private:
+  int sleep() const;
 };
 
 
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -161,7 +161,7 @@
   // If this is the first frame, and java.lang.Object.wait(...) then print out the receiver.
   if (frame_count == 0) {
     if (method()->name() == vmSymbols::wait_name() &&
-        InstanceKlass::cast(method()->method_holder())->name() == vmSymbols::java_lang_Object()) {
+        method()->method_holder()->name() == vmSymbols::java_lang_Object()) {
       StackValueCollection* locs = locals();
       if (!locs->is_empty()) {
         StackValue* sv = locs->at(0);
@@ -407,7 +407,7 @@
     if (Universe::reflect_invoke_cache()->is_same_method(method())) {
       // This is Method.invoke() -- skip it
     } else if (use_new_reflection &&
-              Klass::cast(method()->method_holder())
+              method()->method_holder()
                  ->is_subclass_of(SystemDictionary::reflect_MethodAccessorImpl_klass())) {
       // This is an auxilary frame -- skip it
     } else if (method()->is_method_handle_intrinsic() ||
@@ -471,8 +471,8 @@
 void vframeStreamCommon::skip_reflection_related_frames() {
   while (!at_end() &&
          (JDK_Version::is_gte_jdk14x_version() && UseNewReflection &&
-          (Klass::cast(method()->method_holder())->is_subclass_of(SystemDictionary::reflect_MethodAccessorImpl_klass()) ||
-           Klass::cast(method()->method_holder())->is_subclass_of(SystemDictionary::reflect_ConstructorAccessorImpl_klass())))) {
+          (method()->method_holder()->is_subclass_of(SystemDictionary::reflect_MethodAccessorImpl_klass()) ||
+           method()->method_holder()->is_subclass_of(SystemDictionary::reflect_ConstructorAccessorImpl_klass())))) {
     next();
   }
 }
@@ -547,13 +547,13 @@
 
 void javaVFrame::print_value() const {
   Method*    m = method();
-  Klass*     k = m->method_holder();
+  InstanceKlass*     k = m->method_holder();
   tty->print_cr("frame( sp=" INTPTR_FORMAT ", unextended_sp=" INTPTR_FORMAT ", fp=" INTPTR_FORMAT ", pc=" INTPTR_FORMAT ")",
                 _fr.sp(),  _fr.unextended_sp(), _fr.fp(), _fr.pc());
   tty->print("%s.%s", Klass::cast(k)->internal_name(), m->name()->as_C_string());
 
   if (!m->is_native()) {
-    Symbol*  source_name = InstanceKlass::cast(k)->source_file_name();
+    Symbol*  source_name = k->source_file_name();
     int        line_number = m->line_number_from_bci(bci());
     if (source_name != NULL && (line_number != -1)) {
       tty->print("(%s:%d)", source_name->as_C_string(), line_number);
--- a/hotspot/src/share/vm/runtime/vmStructs.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -289,7 +289,7 @@
   nonstatic_field(CompiledICHolder,     _holder_klass,                                 Klass*)                                \
   nonstatic_field(ConstantPool,         _tags,                                         Array<u1>*)                            \
   nonstatic_field(ConstantPool,         _cache,                                        ConstantPoolCache*)             \
-  nonstatic_field(ConstantPool,         _pool_holder,                                  Klass*)                                \
+  nonstatic_field(ConstantPool,         _pool_holder,                                  InstanceKlass*)                        \
   nonstatic_field(ConstantPool,         _operands,                                     Array<u2>*)                            \
   nonstatic_field(ConstantPool,         _length,                                       int)                                   \
   nonstatic_field(ConstantPool,         _resolved_references,                          jobject)                               \
@@ -2474,7 +2474,7 @@
   /* frame              */                                                \
   /**********************/                                                \
                                                                           \
-  X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset))      \
+  NOT_ZERO(X86_ONLY(declare_constant(frame::entry_frame_call_wrapper_offset)))      \
   declare_constant(frame::pc_return_offset)                               \
                                                                           \
   /*************/                                                         \
--- a/hotspot/src/share/vm/services/heapDumper.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/services/heapDumper.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -1117,8 +1117,8 @@
   writer->write_symbolID(m->name());                // method's name
   writer->write_symbolID(m->signature());           // method's signature
 
-  assert(Klass::cast(m->method_holder())->oop_is_instance(), "not InstanceKlass");
-  writer->write_symbolID(InstanceKlass::cast(m->method_holder())->source_file_name());  // source file name
+  assert(m->method_holder()->oop_is_instance(), "not InstanceKlass");
+  writer->write_symbolID(m->method_holder()->source_file_name());  // source file name
   writer->write_u4(class_serial_num);               // class serial number
   writer->write_u4((u4) line_number);               // line number
 }
--- a/hotspot/src/share/vm/services/memPtr.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/services/memPtr.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -311,6 +311,17 @@
   inline bool contains_address(address add) const {
     return (addr() <= add && addr() + size() > add);
   }
+
+  // if this memory region overlaps another region
+  inline bool overlaps_region(const MemPointerRecord* other) const {
+    assert(other != NULL, "Just check");
+    assert(size() > 0 && other->size() > 0, "empty range");
+    return contains_address(other->addr()) ||
+           contains_address(other->addr() + other->size() - 1) || // exclude end address
+           other->contains_address(addr()) ||
+           other->contains_address(addr() + size() - 1); // exclude end address
+  }
+
 };
 
 // MemPointerRecordEx also records callsite pc, from where
--- a/hotspot/src/share/vm/services/memSnapshot.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/services/memSnapshot.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -31,6 +31,69 @@
 #include "services/memSnapshot.hpp"
 #include "services/memTracker.hpp"
 
+#ifdef ASSERT
+
+void decode_pointer_record(MemPointerRecord* rec) {
+  tty->print("Pointer: [" PTR_FORMAT " - " PTR_FORMAT  "] size = %d bytes", rec->addr(),
+    rec->addr() + rec->size(), (int)rec->size());
+  tty->print(" type = %s", MemBaseline::type2name(FLAGS_TO_MEMORY_TYPE(rec->flags())));
+  if (rec->is_vm_pointer()) {
+    if (rec->is_allocation_record()) {
+      tty->print_cr(" (reserve)");
+    } else if (rec->is_commit_record()) {
+      tty->print_cr(" (commit)");
+    } else if (rec->is_uncommit_record()) {
+      tty->print_cr(" (uncommit)");
+    } else if (rec->is_deallocation_record()) {
+      tty->print_cr(" (release)");
+    } else {
+      tty->print_cr(" (tag)");
+    }
+  } else {
+    if (rec->is_arena_size_record()) {
+      tty->print_cr(" (arena size)");
+    } else if (rec->is_allocation_record()) {
+      tty->print_cr(" (malloc)");
+    } else {
+      tty->print_cr(" (free)");
+    }
+  }
+  if (MemTracker::track_callsite()) {
+    char buf[1024];
+    address pc = ((MemPointerRecordEx*)rec)->pc();
+    if (pc != NULL && os::dll_address_to_function_name(pc, buf, sizeof(buf), NULL)) {
+      tty->print_cr("\tfrom %s", buf);
+    } else {
+      tty->print_cr("\tcould not decode pc = " PTR_FORMAT "", pc);
+    }
+  }
+}
+
+void decode_vm_region_record(VMMemRegion* rec) {
+  tty->print("VM Region [" PTR_FORMAT " - " PTR_FORMAT "]", rec->addr(),
+    rec->addr() + rec->size());
+  tty->print(" type = %s", MemBaseline::type2name(FLAGS_TO_MEMORY_TYPE(rec->flags())));
+  if (rec->is_allocation_record()) {
+    tty->print_cr(" (reserved)");
+  } else if (rec->is_commit_record()) {
+    tty->print_cr(" (committed)");
+  } else {
+    ShouldNotReachHere();
+  }
+  if (MemTracker::track_callsite()) {
+    char buf[1024];
+    address pc = ((VMMemRegionEx*)rec)->pc();
+    if (pc != NULL && os::dll_address_to_function_name(pc, buf, sizeof(buf), NULL)) {
+      tty->print_cr("\tfrom %s", buf);
+    } else {
+      tty->print_cr("\tcould not decode pc = " PTR_FORMAT "", pc);
+    }
+
+  }
+}
+
+#endif
+
 
 bool VMMemPointerIterator::insert_record(MemPointerRecord* rec) {
   VMMemRegionEx new_rec;
@@ -73,52 +136,61 @@
     return true;
   }
   assert(cur->base() > rec->addr(), "Just check: locate()");
-  assert(rec->addr() + rec->size() <= cur->base(), "Can not overlap");
+  assert(!cur->overlaps_region(rec), "overlapping reserved regions");
   return insert_record(rec);
 }
 
 // we do consolidate committed regions
 bool VMMemPointerIterator::add_committed_region(MemPointerRecord* rec) {
   assert(rec->is_commit_record(), "Sanity check");
-  VMMemRegion* cur;
-  cur = (VMMemRegion*)current();
-  assert(cur->is_reserved_region() && cur->contains_region(rec),
+  VMMemRegion* reserved_rgn = (VMMemRegion*)current();
+  assert(reserved_rgn->is_reserved_region() && reserved_rgn->contains_region(rec),
     "Sanity check");
 
   // thread's native stack is always marked as "committed", ignore
   // the "commit" operation for creating stack guard pages
-  if (FLAGS_TO_MEMORY_TYPE(cur->flags()) == mtThreadStack &&
+  if (FLAGS_TO_MEMORY_TYPE(reserved_rgn->flags()) == mtThreadStack &&
       FLAGS_TO_MEMORY_TYPE(rec->flags()) != mtThreadStack) {
     return true;
   }
 
-  cur = (VMMemRegion*)next();
-  while (cur != NULL && cur->is_committed_region()) {
+  // if the reserved region has any committed regions
+  VMMemRegion* committed_rgn  = (VMMemRegion*)next();
+  while (committed_rgn != NULL && committed_rgn->is_committed_region()) {
     // duplicated commit records
-    if(cur->contains_region(rec)) {
+    if(committed_rgn->contains_region(rec)) {
       return true;
-    }
-    if (cur->base() > rec->addr()) {
-      // committed regions can not overlap
-      assert(rec->addr() + rec->size() <= cur->base(), "Can not overlap");
-      if (rec->addr() + rec->size() == cur->base()) {
-        cur->expand_region(rec->addr(), rec->size());
-        return true;
+    } else if (committed_rgn->overlaps_region(rec)) {
+      // overlaps front part
+      if (rec->addr() < committed_rgn->addr()) {
+        committed_rgn->expand_region(rec->addr(),
+          committed_rgn->addr() - rec->addr());
       } else {
-        return insert_record(rec);
+        // overlaps tail part
+        address committed_rgn_end = committed_rgn->addr() +
+              committed_rgn->size();
+        assert(committed_rgn_end < rec->addr() + rec->size(),
+             "overlap tail part");
+        committed_rgn->expand_region(committed_rgn_end,
+          (rec->addr() + rec->size()) - committed_rgn_end);
       }
-    } else if (cur->base() + cur->size() == rec->addr()) {
-      cur->expand_region(rec->addr(), rec->size());
+    } else if (committed_rgn->base() + committed_rgn->size() == rec->addr()) {
+      // adjunct each other
+      committed_rgn->expand_region(rec->addr(), rec->size());
       VMMemRegion* next_reg = (VMMemRegion*)next();
       // see if we can consolidate next committed region
       if (next_reg != NULL && next_reg->is_committed_region() &&
-        next_reg->base() == cur->base() + cur->size()) {
-          cur->expand_region(next_reg->base(), next_reg->size());
+        next_reg->base() == committed_rgn->base() + committed_rgn->size()) {
+          committed_rgn->expand_region(next_reg->base(), next_reg->size());
+          // delete merged region
           remove();
       }
       return true;
+    } else if (committed_rgn->base() > rec->addr()) {
+      // found the location, insert this committed region
+      return insert_record(rec);
     }
-    cur = (VMMemRegion*)next();
+    committed_rgn = (VMMemRegion*)next();
   }
   return insert_record(rec);
 }
--- a/hotspot/src/share/vm/utilities/growableArray.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/utilities/growableArray.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -217,7 +217,12 @@
     return missed;
   }
 
-  E at(int i) const {
+  E& at(int i) {
+    assert(0 <= i && i < _len, "illegal index");
+    return _data[i];
+  }
+
+  E const& at(int i) const {
     assert(0 <= i && i < _len, "illegal index");
     return _data[i];
   }
--- a/hotspot/src/share/vm/utilities/macros.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/utilities/macros.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -282,6 +282,22 @@
 #define NOT_WIN64(code) code
 #endif
 
+#if defined(ZERO)
+#define ZERO_ONLY(code) code
+#define NOT_ZERO(code)
+#else
+#define ZERO_ONLY(code)
+#define NOT_ZERO(code) code
+#endif
+
+#if defined(SHARK)
+#define SHARK_ONLY(code) code
+#define NOT_SHARK(code)
+#else
+#define SHARK_ONLY(code)
+#define NOT_SHARK(code) code
+#endif
+
 #if defined(IA32) || defined(AMD64)
 #define X86
 #define X86_ONLY(code) code
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/utilities/pair.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_UTILITIES_PAIR_HPP
+#define SHARE_VM_UTILITIES_PAIR_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
+template<typename T, typename V,  typename ALLOC_BASE = ResourceObj>
+class Pair : public ALLOC_BASE {
+ public:
+  T first;
+  V second;
+
+  Pair() {}
+  Pair(T t, V v) : first(t), second(v) {}
+};
+
+
+#endif // SHARE_VM_UTILITIES_PAIR_HPP
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/src/share/vm/utilities/resourceHash.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#ifndef SHARE_VM_UTILITIES_RESOURCEHASH_HPP
+#define SHARE_VM_UTILITIES_RESOURCEHASH_HPP
+
+#include "memory/allocation.hpp"
+#include "utilities/top.hpp"
+
+template<typename K> struct ResourceHashtableFns {
+    typedef unsigned (*hash_fn)(K const&);
+    typedef bool (*equals_fn)(K const&, K const&);
+};
+
+template<typename K> unsigned primitive_hash(const K& k) {
+  unsigned hash = (unsigned)((uintptr_t)k);
+  return hash ^ (hash > 3); // just in case we're dealing with aligned ptrs
+}
+
+template<typename K> bool primitive_equals(const K& k0, const K& k1) {
+  return k0 == k1;
+}
+
+template<
+    typename K, typename V,
+    typename ResourceHashtableFns<K>::hash_fn   HASH   = primitive_hash<K>,
+    typename ResourceHashtableFns<K>::equals_fn EQUALS = primitive_equals<K>,
+    unsigned SIZE = 256
+    >
+class ResourceHashtable : public ResourceObj {
+ private:
+
+  class Node : public ResourceObj {
+   public:
+    unsigned _hash;
+    K _key;
+    V _value;
+    Node* _next;
+
+    Node(unsigned hash, K const& key, V const& value) :
+        _hash(hash), _key(key), _value(value), _next(NULL) {}
+  };
+
+  Node* _table[SIZE];
+
+  // Returns a pointer to where the node where the value would reside if
+  // it's in the table.
+  Node** lookup_node(unsigned hash, K const& key) {
+    unsigned index = hash % SIZE;
+    Node** ptr = &_table[index];
+    while (*ptr != NULL) {
+      Node* node = *ptr;
+      if (node->_hash == hash && EQUALS(key, node->_key)) {
+        break;
+      }
+      ptr = &(node->_next);
+    }
+    return ptr;
+  }
+
+  Node const** lookup_node(unsigned hash, K const& key) const {
+    return const_cast<Node const**>(
+        const_cast<ResourceHashtable*>(this)->lookup_node(hash, key));
+  }
+
+ public:
+  ResourceHashtable() { memset(_table, 0, SIZE * sizeof(Node*)); }
+
+  bool contains(K const& key) const {
+    return get(key) != NULL;
+  }
+
+  V* get(K const& key) const {
+    unsigned hv = HASH(key);
+    Node const** ptr = lookup_node(hv, key);
+    if (*ptr != NULL) {
+      return const_cast<V*>(&(*ptr)->_value);
+    } else {
+      return NULL;
+    }
+  }
+
+  // Inserts or replaces a value in the table
+  void put(K const& key, V const& value) {
+    unsigned hv = HASH(key);
+    Node** ptr = lookup_node(hv, key);
+    if (*ptr != NULL) {
+      (*ptr)->_value = value;
+    } else {
+      *ptr = new Node(hv, key, value);
+    }
+  }
+
+  // ITER contains bool do_entry(K const&, V const&), which will be
+  // called for each entry in the table.  If do_entry() returns false,
+  // the iteration is cancelled.
+  template<class ITER>
+  void iterate(ITER* iter) const {
+    Node* const* bucket = _table;
+    while (bucket < &_table[SIZE]) {
+      Node* node = *bucket;
+      while (node != NULL) {
+        bool cont = iter->do_entry(node->_key, node->_value);
+        if (!cont) { return; }
+        node = node->_next;
+      }
+      ++bucket;
+    }
+  }
+};
+
+
+#endif // SHARE_VM_UTILITIES_RESOURCEHASH_HPP
--- a/hotspot/src/share/vm/utilities/taskqueue.hpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp	Wed Nov 14 16:41:12 2012 -0800
@@ -496,9 +496,7 @@
     }
   }
 
-  bool steal_1_random(uint queue_num, int* seed, E& t);
   bool steal_best_of_2(uint queue_num, int* seed, E& t);
-  bool steal_best_of_all(uint queue_num, int* seed, E& t);
 
   void register_queue(uint i, T* q);
 
@@ -538,46 +536,6 @@
 }
 
 template<class T, MEMFLAGS F> bool
-GenericTaskQueueSet<T, F>::steal_best_of_all(uint queue_num, int* seed, E& t) {
-  if (_n > 2) {
-    int best_k;
-    uint best_sz = 0;
-    for (uint k = 0; k < _n; k++) {
-      if (k == queue_num) continue;
-      uint sz = _queues[k]->size();
-      if (sz > best_sz) {
-        best_sz = sz;
-        best_k = k;
-      }
-    }
-    return best_sz > 0 && _queues[best_k]->pop_global(t);
-  } else if (_n == 2) {
-    // Just try the other one.
-    int k = (queue_num + 1) % 2;
-    return _queues[k]->pop_global(t);
-  } else {
-    assert(_n == 1, "can't be zero.");
-    return false;
-  }
-}
-
-template<class T, MEMFLAGS F> bool
-GenericTaskQueueSet<T, F>::steal_1_random(uint queue_num, int* seed, E& t) {
-  if (_n > 2) {
-    uint k = queue_num;
-    while (k == queue_num) k = TaskQueueSetSuper::randomParkAndMiller(seed) % _n;
-    return _queues[2]->pop_global(t);
-  } else if (_n == 2) {
-    // Just try the other one.
-    int k = (queue_num + 1) % 2;
-    return _queues[k]->pop_global(t);
-  } else {
-    assert(_n == 1, "can't be zero.");
-    return false;
-  }
-}
-
-template<class T, MEMFLAGS F> bool
 GenericTaskQueueSet<T, F>::steal_best_of_2(uint queue_num, int* seed, E& t) {
   if (_n > 2) {
     uint k1 = queue_num;
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Tue Nov 13 20:02:39 2012 -0800
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Nov 14 16:41:12 2012 -0800
@@ -453,7 +453,9 @@
      JDK_Version::current().to_string(buf, sizeof(buf));
      const char* runtime_name = JDK_Version::runtime_name() != NULL ?
                                   JDK_Version::runtime_name() : "";
-     st->print_cr("# JRE version: %s (%s)", runtime_name, buf);
+     const char* runtime_version = JDK_Version::runtime_version() != NULL ?
+                                  JDK_Version::runtime_version() : "";
+     st->print_cr("# JRE version: %s (%s) (build %s)", runtime_name, buf, runtime_version);
      st->print_cr("# Java VM: %s (%s %s %s %s)",
                    Abstract_VM_Version::vm_name(),
                    Abstract_VM_Version::vm_release(),
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hotspot/test/compiler/8002069/Test8002069.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/**
+ * @test
+ * @bug 8002069
+ * @summary Assert failed in C2: assert(field->edge_count() > 0) failed: sanity
+ *
+ * @run main/othervm -Xmx32m -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:CompileCommand=exclude,Test8002069.dummy Test8002069
+ */
+
+abstract class O {
+  int f;
+  public O() { f = 5; }
+  abstract void put(int i);
+  public int foo(int i) {
+    put(i);
+    return i;
+  }
+};
+
+class A extends O {
+  int[] a;
+  public A(int s) {
+    a = new int[s];
+  }
+  public void put(int i) {
+    a[i%a.length] = i;
+  }
+}
+
+class B extends O {
+  int sz;
+  int[] a;
+  public B(int s) {
+    sz = s;
+    a = new int[s];
+  }
+  public void put(int i) {
+    a[i%sz] = i;
+  }
+}
+
+public class Test8002069 {
+  public static void main(String args[]) {
+    int sum = 0;
+    for (int i=0; i<8000; i++) {
+      sum += test1(i);
+    }
+    for (int i=0; i<100000; i++) {
+      sum += test2(i);
+    }
+    System.out.println("PASSED. sum = " + sum);
+  }
+
+  private O o;
+
+  private int foo(int i) {
+    return o.foo(i);
+  }
+  static int test1(int i) {
+    Test8002069 t = new Test8002069();
+    t.o = new A(5);
+    return t.foo(i);
+  }
+  static int test2(int i) {
+    Test8002069 t = new Test8002069();
+    t.o = new B(5);
+    dummy(i);
+    return t.foo(i);
+  }
+
+  static int dummy(int i) {
+    return i*2;
+  }
+}
+
--- a/jaxp/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/jaxp/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -184,3 +184,5 @@
 2d1dff5310daaf226421a8c92823cb8afcf35f31 jdk8-b60
 6b1db0b41d2f6e2a7b3bdbc8a8db823b47752906 jdk8-b61
 5d0fa0108d028c05753a47bcf2a598357dabf0c0 jdk8-b62
+192d8a244bc36427757866e9fb3a08938c0e674c jdk8-b63
+27ab79568c34abf80958d5fa8c04fd1740d243da jdk8-b64
--- a/jaxws/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/jaxws/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -184,3 +184,5 @@
 5c5a65ad5291b7cefcdc308f627cf2b195cf2b69 jdk8-b60
 97e5e74e2a341d9142ce28043912a3c255e28e03 jdk8-b61
 d265b9b4c0f55c23a1c9fda02a8052fd9df2eec5 jdk8-b62
+86989f702267debe16d13720d5ae7ae9839796f4 jdk8-b63
+5ded18a14bcc80b2a253f2b84da0073a0ecac665 jdk8-b64
--- a/jdk/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -185,3 +185,4 @@
 61ddb3fd000a09ab05bff1940b0ac211661e94cf jdk8-b61
 50b8b17449d200c66bfd68fb4f3a9197432c9e2b jdk8-b62
 f117a3e06f78a258074674ad17601f99bcb1ce0d jdk8-b63
+26dbd73fb7662a29b3e47179fdc88a0bfa4e231e jdk8-b64
--- a/jdk/make/common/Defs-linux.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/make/common/Defs-linux.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -111,21 +111,18 @@
 # since objcopy is optional, we set ZIP_DEBUGINFO_FILES later
 
 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
-  # Default OBJCOPY comes from GNU Binutils on Linux:
-  DEF_OBJCOPY=/usr/bin/objcopy
-  ifdef CROSS_COMPILE_ARCH
-    # don't try to generate .debuginfo files when cross compiling
-    _JUNK_ := $(shell \
-      echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
-        "skipping .debuginfo generation.")
-    OBJCOPY=
+  ifndef CROSS_COMPILE_ARCH
+    # Default OBJCOPY comes from GNU Binutils on Linux:
+    DEF_OBJCOPY=/usr/bin/objcopy
   else
-    OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
-    ifneq ($(ALT_OBJCOPY),)
-      _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
-      # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
-      OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
-    endif
+    # Assume objcopy is part of the cross-compilation toolkit
+    DEF_OBJCOPY=$(COMPILER_PATH)/objcopy
+  endif
+  OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
+  ifneq ($(ALT_OBJCOPY),)
+    _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
+    # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
+    OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
   endif
 
   # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the
@@ -137,7 +134,7 @@
 
   ifeq ($(OBJCOPY),)
     _JUNK_ := $(shell \
-      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
+      echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files. You may need to set ALT_OBJCOPY.")
     ENABLE_FULL_DEBUG_SYMBOLS=0
   else
     _JUNK_ := $(shell \
--- a/jdk/makefiles/CompileJavaClasses.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/CompileJavaClasses.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -407,12 +407,11 @@
 		INCLUDES := com/apple/jobjc,\
                 EXCLUDES := tests/java/com/apple/jobjc,\
 		BIN:=$(JDK_OUTPUTDIR)/jobjc_classes_headers,\
-		JAR:=$(JDK_OUTPUTDIR)/jobjc_classes_headers/dummy.jar, \
-		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
+		HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers_jobjc))
 
 $(BUILD_JOBJC_HEADERS_JAR) : $(BUILD_JDK)
 
-JARS += $(JDK_OUTPUTDIR)/jobjc_classes_headers/dummy.jar
+JARS += $(BUILD_JOBJC_HEADERS_JAR)
 
 endif
 
--- a/jdk/makefiles/CompileNativeLibraries.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/CompileNativeLibraries.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -300,6 +300,7 @@
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX:=$(BUILD_LIBMLIB_LDLIBS) \
 				$(LDFLAGS_JDKLIB_SUFFIX),\
+		LDFLAGS_SUFFIX_solaris:=-lc, \
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=mlib_image.dll" \
@@ -428,6 +429,7 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
                          $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libmlib_image_v))
 
 $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
@@ -710,7 +712,7 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_solaris:=-R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR),\
 		LDFLAGS_SUFFIX_linux:=-ljvm $(LIBM) $(LIBDL) -ljava,\
-		LDFLAGS_SUFFIX_solaris:=-ljvm $(LIBM) $(LIBDL) -ljava,\
+		LDFLAGS_SUFFIX_solaris:=-ljvm $(LIBM) $(LIBDL) -ljava -lc,\
 		LDFLAGS_SUFFIX_macosx:=-lmlib_image -ljvm $(LIBM) \
 				       -framework Cocoa \
 				       -framework OpenGL \
@@ -966,7 +968,7 @@
                                 -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
                                 $(WIN_JAVA_LIB),\
 		LDFLAGS_SUFFIX_linux:=-ljvm -ljava $(LIBZ),\
-		LDFLAGS_SUFFIX_solaris:=-ljvm -ljava $(LIBZ),\
+		LDFLAGS_SUFFIX_solaris:=-ljvm -ljava $(LIBZ) -lc,\
 		LDFLAGS_SUFFIX_macosx:=$(LIBZ) -ljava -ljvm,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
@@ -1078,7 +1080,7 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN), \
 		LDFLAGS_SUFFIX_linux:=-lpthread,\
-		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket,\
+		LDFLAGS_SUFFIX_solaris:=-lnsl -lsocket -lc,\
 		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
@@ -1144,9 +1146,8 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
-		LDFLAGS_SUFFIX_solaris:=$(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=$(LIBDL) -lc,\
 		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		LDFLAGS_SUFFIX:=,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=jdwp.dll" \
@@ -1186,7 +1187,7 @@
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_windows:=netapi32.lib user32.lib mpr.lib advapi32.lib,\
 		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX),\
-		LDFLAGS_SUFFIX:=,\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		EXCLUDE_FILES:=$(LIBJAAS_EXCLUDE_FILES),\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS) \
@@ -1217,7 +1218,7 @@
 		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
 		LDFLAGS_SUFFIX_windows:=$(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL),\
 		LDFLAGS_SUFFIX_macosx:=                         $(LIBDL),\
-		LDFLAGS_SUFFIX:=,\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=jsdt.dll" \
@@ -1242,7 +1243,7 @@
 		INCLUDE_FILES:=cmscam02.c cmscgats.c cmscnvrt.c cmserr.c \
 			       cmsgamma.c cmsgmt.c cmsintrp.c cmsio0.c \
 			       cmsio1.c cmslut.c cmsmd5.c cmsmtrx.c \
-			       cmsnamed.c cmsopt.c cmspack.c cmspcs.c \
+			       cmsnamed.c cmsopt.c cmshalf.c cmspack.c cmspcs.c \
 			       cmsplugin.c cmsps2.c cmssamp.c cmssm.c \
 			       cmstypes.c cmsvirt.c cmswtpnt.c cmsxform.c \
 			       LCMS.c,\
@@ -1259,7 +1260,7 @@
                          $(call SET_SHARED_LIBRARY_ORIGIN), \
 		LDFLAGS_solaris:=/usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2,\
 		LDFLAGS_windows:=$(WIN_AWT_LIB) $(WIN_JAVA_LIB),\
-		LDFLAGS_SUFFIX_solaris:=-lawt -ljava -ljvm,\
+		LDFLAGS_SUFFIX_solaris:=-lawt -ljava -ljvm -lc,\
 		LDFLAGS_SUFFIX_macosx:=$(LIBM) -lawt -ljava -ljvm,\
 		LDFLAGS_SUFFIX_linux:=-lm -lawt -ljava -ljvm,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
@@ -1626,7 +1627,7 @@
 				-framework Cocoa -framework Security -framework ApplicationServices,\
 		LDFLAGS_SUFFIX:=$(LIBINSTRUMENT_LDFLAGS_SUFFIX),\
 		LDFLAGS_SUFFIX_macosx:=-liconv $(LIBZ),\
-		LDFLAGS_SUFFIX_solaris:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc,\
 		LDFLAGS_SUFFIX_linux:=$(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL),\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
@@ -1716,10 +1717,6 @@
 
 BUILD_LIBHPROF_LDFLAGS:=
 
-ifeq ($(OPENJDK_TARGET_OS),solaris)
-     BUILD_LIBHPROF_LDFLAGS += -lsocket -lnsl
-endif
-
 LIBHPROF_OPTIMIZATION:=HIGHEST
 ifneq ($(findstring $(OPENJDK_TARGET_OS),solaris linux),)
     ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
@@ -1727,10 +1724,6 @@
     endif
 endif
 
-ifneq ($(OPENJDK_TARGET_OS),windows)
-     BUILD_LIBHPROF_LDFLAGS += $(LIBDL)
-endif
-
 $(eval $(call SetupNativeCompilation,BUILD_LIBHPROF,\
 		LIBRARY:=hprof, \
                 OUTPUT_DIR:=$(INSTALL_LIBRARIES_HERE),\
@@ -1744,7 +1737,9 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_windows:=wsock32.lib winmm.lib advapi32.lib,\
-		LDFLAGS_SUFFIX:=$(BUILD_LIBHPROF_LDFLAGS),\
+		LDFLAGS_SUFFIX_linux:=$(LIBDL),\
+		LDFLAGS_SUFFIX_macosx:=$(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=-lsocket -lnsl $(LIBDL) -lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=hprof.dll" \
@@ -1768,6 +1763,7 @@
 		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=java_crw_demo.dll" \
@@ -1794,6 +1790,7 @@
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_macosx:=-liconv,\
 		LDFLAGS_SUFFIX_windows:=-export:nptInitialize -export:nptTerminate,\
+		LDFLAGS_SUFFIX_solaris:=-lc, \
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=npt.dll" \
@@ -1849,7 +1846,7 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX_macosx:=-ljvm -ljava,\
-		LDFLAGS_SUFFIX_solaris:=-ljvm -ljava -lnsl -lsocket $(LIBDL) ,\
+		LDFLAGS_SUFFIX_solaris:=-ljvm -ljava -lnsl -lsocket $(LIBDL) -lc ,\
 		LDFLAGS_SUFFIX_linux:=$(LIBDL) -ljvm -lpthread -ljava,\
 		LDFLAGS_SUFFIX_windows:=ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \
 					delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \
@@ -2035,7 +2032,7 @@
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX_linux:=-lpthread $(LIBDL) -ljava -ljvm,\
 		LDFLAGS_SUFFIX_posix:=-lnio -lnet,\
-		LDFLAGS_SUFFIX_solaris:=-lsocket -ljava -ljvm,\
+		LDFLAGS_SUFFIX_solaris:=-lsocket -ljava -ljvm -lc,\
 		LDFLAGS_SUFFIX_macosx:=-ljava -ljvm,\
 		INCLUDE_FILES:=SctpNet.c SctpChannelImpl.c SctpServerChannelImpl.c,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libsctp))
@@ -2391,7 +2388,7 @@
 		LANG:=C,\
 		OPTIMIZATION:=LOW, \
 		CFLAGS:=$(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS),\
-		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers, \
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers,\
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_ORIGIN,/..),\
@@ -2401,8 +2398,8 @@
 		LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_ORIGIN).,\
 		REORDER:=$(LIBAWT_HEADLESS_REORDER), \
 		LDFLAGS_SUFFIX_linux:=-ljvm -lawt -lm $(LIBDL) -ljava,\
-		LDFLAGS_SUFFIX_solaris:=$(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX), \
-		LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava, \
+		LDFLAGS_SUFFIX_solaris:=$(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc,\
+		LDFLAGS_SUFFIX_macosx:=-ljvm $(LIBCXX) -lawt $(LIBDL) -ljava,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libawt_headless))
 
 $(BUILD_LIBAWT_HEADLESS) : $(BUILD_LIBAWT)
@@ -2571,6 +2568,7 @@
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX:=$(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ),\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=splashscreen.dll" \
@@ -2646,6 +2644,7 @@
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
 		LDFLAGS_SUFFIX_posix:=$(LIBDL), \
 		LDFLAGS_SUFFIX_windows:=winscard.lib,\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=j2pcsc.dll" \
@@ -2672,7 +2671,8 @@
 		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_SUFFIX:=$(LIBDL), \
+		LDFLAGS_SUFFIX:=$(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/libj2gss))
 
 BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
@@ -2766,7 +2766,8 @@
 		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \
 		LDFLAGS:=$(LDFLAGS_JDKLIB) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN),\
-		LDFLAGS_SUFFIX_posix:=$(LIBDL), \
+		LDFLAGS_SUFFIX_posix:=$(LIBDL),\
+		LDFLAGS_SUFFIX_solaris:=-lc,\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  -D "JDK_FNAME=j2pkcs11.dll" \
@@ -3404,7 +3405,7 @@
 		CFLAGS:=-fpascal-strings \
                         -fobjc-gc \
                         -gdwarf-2 \
-                        $(CFLAGS_JDKLIB) \
+                        $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
 			-m32,\
 		LDFLAGS:=$(LDFLAGS_JDKLIB)\
@@ -3425,7 +3426,7 @@
 		CFLAGS:=-fpascal-strings \
                         -fobjc-gc \
                         -gdwarf-2 \
-                        $(CFLAGS_JDKLIB) \
+                        $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
                         -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
 			, \
 		LDFLAGS:=-fpascal-strings \
--- a/jdk/makefiles/CreateJars.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/CreateJars.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -162,15 +162,7 @@
 	sun/tools/serialver \
 	sun/tools/tree \
 	sun/tools/util \
-	sun/security/tools/jarsigner/JarBASE64Encoder.class \
-	sun/security/tools/jarsigner/Main.class \
-	sun/security/tools/jarsigner/JarSignerParameters.class \
-	sun/security/tools/jarsigner/Resources.class \
-	sun/security/tools/jarsigner/Resources_ja.class \
-	sun/security/tools/jarsigner/Resources_zh_CN.class \
-	sun/security/tools/jarsigner/SignatureFile\$$$$Block.class \
-	sun/security/tools/jarsigner/SignatureFile.class \
-	sun/security/tools/jarsigner/TimestampedSigner.class \
+	sun/security/tools/jarsigner \
 	sun/security/provider/Sun.class \
 	sun/security/rsa/SunRsaSign.class \
 	sun/security/ssl \
@@ -279,7 +271,7 @@
 
 ifeq ($(OPENJDK_TARGET_OS), macosx)
         RT_JAR_EXCLUDES += com/sun/nio/sctp \
-                           sun/nio/ch/sctp \
+                           sun/nio/ch/sctp
 endif
 
 # Find all files in the classes dir to use as dependencies. This could be more fine granular.
@@ -701,14 +693,7 @@
 	sun/tools/serialver	\
 	sun/tools/tree		\
 	sun/tools/util		\
-	sun/security/tools/JarBASE64Encoder.class \
-	sun/security/tools/JarSigner.class \
-	sun/security/tools/JarSignerParameters.class \
-	sun/security/tools/JarSignerResources.class \
-	sun/security/tools/JarSignerResources_ja.class \
-	sun/security/tools/JarSignerResources_zh_CN.class \
-	sun/security/tools/SignatureFile* \
-	sun/security/tools/TimestampedSigner.class \
+	sun/security/tools/jarsigner \
 	sun/rmi/rmic		\
 	sun/applet		\
 	sun/jvmstat		\
--- a/jdk/makefiles/GensrcIcons.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/GensrcIcons.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -109,13 +109,17 @@
 
 ifeq ($(OPENJDK_TARGET_OS),macosx)
 
-  GENSRC_OSX_ICONS      = $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
-  GENSRC_OSX_ICONS_SRC  =
-  GENSRC_OSX_ICONS_TMP  = $(JDK_OUTPUTDIR)/gensrc
-  GENSRC_OSX_ICONS_DST  = $(GENSRC_OSX_ICONS_TMP)/sun/osxapp
-  
-$(GENSRC_OSX_ICONS_DST)/AWTIconData.h: \
-    $(JDK_TOPDIR)/src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns 
+  GENSRC_OSX_ICONS_TMP  := $(JDK_OUTPUTDIR)/gensrc
+  GENSRC_OSX_ICONS_DST  := $(GENSRC_OSX_ICONS_TMP)/sun/osxapp
+  GENSRC_OSX_ICONS      := $(GENSRC_OSX_ICONS_DST)/AWTIconData.h
+
+  ifdef OPENJDK
+    GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
+  else
+    GENSRC_OSX_ICONS_SRC := $(JDK_TOPDIR)/src/closed/macosx/native/sun/osxapp/resource/icons/JavaApp.icns
+  endif
+
+$(GENSRC_OSX_ICONS_DST)/AWTIconData.h: $(GENSRC_OSX_ICONS_SRC)
 	$(RM) $@ $@.tmp
 	$(MKDIR) -p $(dir $@)
 	$(ECHO) "static unsigned char sAWTIconData[] = { " >> $@.tmp
--- a/jdk/makefiles/GensrcJObjC.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/GensrcJObjC.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -41,7 +41,6 @@
 		DISABLE_SJAVAC:=true,\
 		INCLUDES:=core/java \
                           com/apple,\
-                HEADERS:=$(JOBJC_DST)/jni_headers/core ,\
 		SRC:=$(JOBJC_SRC)/src \
                      $(JOBJC_SRC)/src/generator/java, \
 		BIN:=$(JOBJC_TMP)/bin))
@@ -97,10 +96,8 @@
 # Run generator
 #    Now we use bootclasspath to run java again, with the bridge support to
 #    generate more source.
-#    Note the use of the | (order-only) on the BRIDGESUPPORT, should serialize
-#    them just in case GBM run in parallel has issues.
 #
-$(JOBJC_TMP)/_the.generator : $(JOBJC_TMP)/_the.generator_bootclasspath | $(BRIDGESUPPORT)
+$(JOBJC_TMP)/_the.generator : $(JOBJC_TMP)/_the.generator_bootclasspath $(BRIDGESUPPORT)
 	$(RM) $@
 	$(JAVA) $(LOG_INFO) -d64 -Xbootclasspath:`$(CAT) $(JOBJC_TMP)/_the.generator_bootclasspath` -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator dst=$(JOBJC_DST) frameworks=$(JOBJC_TMP)/bridge
 	$(TOUCH) $@
--- a/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/GensrcLocaleDataMetaInfo.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -68,8 +68,9 @@
     ALL_US_LOCALES += $$($1_US_LOCALES)
     ALL_NON_US_LOCALES += $$($1_NON_US_LOCALES)
 
-    SED_ARGS+= -e 's/$$(HASH)$1_USLocales$$(HASH)/ $$($1_US_LOCALES)/g'
-    SED_ARGS+= -e 's/$$(HASH)$1_NonUSLocales$$(HASH)/ $$($1_NON_US_LOCALES)/g'
+    # Don't sed in a space if there are no locales.
+    SED_ARGS+= -e 's/$$(HASH)$1_USLocales$$(HASH)/$$(if $$($1_US_LOCALES),$$(SPACE)$$($1_US_LOCALES),)/g'
+    SED_ARGS+= -e 's/$$(HASH)$1_NonUSLocales$$(HASH)/$$(if $$($1_NON_US_LOCALES),$$(SPACE)$$($1_NON_US_LOCALES),)/g'
 endef
 
 #sun.text.resources.FormatData
--- a/jdk/makefiles/Import.gmk	Tue Nov 13 20:02:39 2012 -0800
+++ b/jdk/makefiles/Import.gmk	Wed Nov 14 16:41:12 2012 -0800
@@ -121,7 +121,7 @@
 endif
 
 define CopyDir
-        $1_SRC_FILES := $(shell $(FIND) $2 -type f -a ! -name "wb.jar")
+        $1_SRC_FILES := $(shell $(FIND) $2 -type f -a \( -name DUMMY $(addprefix -o$(SPACE)-name$(SPACE),$4) \))
         $1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES))
         IMPORT_TARGET_FILES += $$($1_DST_FILES)
 $3/% : $2/%
@@ -134,9 +134,10 @@
 #
 # Import hotspot
 #
-
-$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE)))
-$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib))
+HOTSPOT_IMPORT_FILES:=$(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* sawindbg.* jvm_db.* jvm_dtrace.*) \
+                      Xusage.txt sa-jdi.jar
+$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
+$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
 
 JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
                   $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
--- a/langtools/.hgtags	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/.hgtags	Wed Nov 14 16:41:12 2012 -0800
@@ -184,3 +184,5 @@
 3d2b98ffcb534b0e5be87bb1f9f68d1518ad7729 jdk8-b60
 26020b247ad3806dbca33e029ee12e1b191f59f9 jdk8-b61
 b47bb81ba962ef80bb6f0b863c33a0afcfb0b49e jdk8-b62
+92e6f2190ca0567c857f85c3fb7a2be5adf079d0 jdk8-b63
+e6ee43b3e2473798b17a556e9f11eebe25ab81d4 jdk8-b64
--- a/langtools/make/tools/genstubs/GenStubs.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/make/tools/genstubs/GenStubs.java	Wed Nov 14 16:41:12 2012 -0800
@@ -35,7 +35,7 @@
 import com.sun.source.util.JavacTask;
 import com.sun.tools.javac.api.JavacTool;
 import com.sun.tools.javac.code.Flags;
-import com.sun.tools.javac.code.TypeTags;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;
 import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
@@ -244,23 +244,23 @@
                 else {
                     String t = tree.vartype.toString();
                     if (t.equals("boolean"))
-                        tree.init = new JCLiteral(TypeTags.BOOLEAN, 0) { };
+                        tree.init = new JCLiteral(TypeTag.BOOLEAN, 0) { };
                     else if (t.equals("byte"))
-                        tree.init = new JCLiteral(TypeTags.BYTE, 0) { };
+                        tree.init = new JCLiteral(TypeTag.BYTE, 0) { };
                     else if (t.equals("char"))
-                        tree.init = new JCLiteral(TypeTags.CHAR, 0) { };
+                        tree.init = new JCLiteral(TypeTag.CHAR, 0) { };
                     else if (t.equals("double"))
-                        tree.init = new JCLiteral(TypeTags.DOUBLE, 0.d) { };
+                        tree.init = new JCLiteral(TypeTag.DOUBLE, 0.d) { };
                     else if (t.equals("float"))
-                        tree.init = new JCLiteral(TypeTags.FLOAT, 0.f) { };
+                        tree.init = new JCLiteral(TypeTag.FLOAT, 0.f) { };
                     else if (t.equals("int"))
-                        tree.init = new JCLiteral(TypeTags.INT, 0) { };
+                        tree.init = new JCLiteral(TypeTag.INT, 0) { };
                     else if (t.equals("long"))
-                        tree.init = new JCLiteral(TypeTags.LONG, 0) { };
+                        tree.init = new JCLiteral(TypeTag.LONG, 0) { };
                     else if (t.equals("short"))
-                        tree.init = new JCLiteral(TypeTags.SHORT, 0) { };
+                        tree.init = new JCLiteral(TypeTag.SHORT, 0) { };
                     else
-                        tree.init = new JCLiteral(TypeTags.BOT, null) { };
+                        tree.init = new JCLiteral(TypeTag.BOT, null) { };
                 }
             }
             result = tree;
--- a/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -46,7 +46,7 @@
 public interface SerialFieldTag extends Tag, Comparable<Object> {
 
     /**
-     * Return the serialziable field name.
+     * Return the serializable field name.
      */
     public String fieldName();
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -56,32 +56,18 @@
     protected IndexBuilder indexbuilder;
 
     /**
-     * This constructor will be used by {@link SplitIndexWriter}. Initialises
+     * This constructor will be used by {@link SplitIndexWriter}. Initializes
      * path to this file and relative path from this file.
      *
+     * @param configuration  The current configuration
      * @param path       Path to the file which is getting generated.
-     * @param filename   Name of the file which is getting genrated.
-     * @param relpath    Relative path from this file to the current directory.
      * @param indexbuilder Unicode based Index from {@link IndexBuilder}
      */
     protected AbstractIndexWriter(ConfigurationImpl configuration,
-                                  String path, String filename,
-                                  String relpath, IndexBuilder indexbuilder)
+                                  DocPath path,
+                                  IndexBuilder indexbuilder)
                                   throws IOException {
-        super(configuration, path, filename, relpath);
-        this.indexbuilder = indexbuilder;
-    }
-
-    /**
-     * This Constructor will be used by {@link SingleIndexWriter}.
-     *
-     * @param filename   Name of the file which is getting genrated.
-     * @param indexbuilder Unicode based Index form {@link IndexBuilder}
-     */
-    protected AbstractIndexWriter(ConfigurationImpl configuration,
-                                  String filename, IndexBuilder indexbuilder)
-                                  throws IOException {
-        super(configuration, filename);
+        super(configuration, path);
         this.indexbuilder = indexbuilder;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -27,9 +27,11 @@
 
 import java.io.*;
 import java.util.*;
+
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.DocPath;
 
 /**
  * Abstract class to generate the overview files in
@@ -52,14 +54,14 @@
     protected PackageDoc[] packages;
 
     /**
-     * Constructor. Also initialises the packages variable.
+     * Constructor. Also initializes the packages variable.
      *
+     * @param configuration  The current configuration
      * @param filename Name of the package index file to be generated.
      */
     public AbstractPackageIndexWriter(ConfigurationImpl configuration,
-                                      String filename) throws IOException {
+                                      DocPath filename) throws IOException {
         super(configuration, filename);
-        this.relativepathNoSlash = ".";
         packages = configuration.packages;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -56,46 +56,23 @@
     private static final String LI_CIRCLE  = "circle";
 
     /**
-     * Constructor initilises classtree variable. This constructor will be used
+     * Constructor initializes classtree variable. This constructor will be used
      * while generating global tree file "overview-tree.html".
      *
+     * @param configuration  The current configuration
      * @param filename   File to be generated.
      * @param classtree  Tree built by {@link ClassTree}.
      * @throws IOException
      * @throws DocletAbortException
      */
     protected AbstractTreeWriter(ConfigurationImpl configuration,
-                                 String filename, ClassTree classtree)
+                                 DocPath filename, ClassTree classtree)
                                  throws IOException {
         super(configuration, filename);
         this.classtree = classtree;
     }
 
     /**
-     * Create appropriate directory for the package and also initilise the
-     * relative path from this generated file to the current or
-     * the destination directory. This constructor will be used while
-     * generating "package tree" file.
-     *
-     * @param path Directories in this path will be created if they are not
-     * already there.
-     * @param filename Name of the package tree file to be generated.
-     * @param classtree The tree built using {@link ClassTree}.
-     * for the package pkg.
-     * @param pkg PackageDoc for which tree file will be generated.
-     * @throws IOException
-     * @throws DocletAbortException
-     */
-    protected AbstractTreeWriter(ConfigurationImpl configuration,
-                                 String path, String filename,
-                                 ClassTree classtree, PackageDoc pkg)
-                                 throws IOException {
-        super(configuration,
-              path, filename, DirectoryManager.getRelativePath(pkg.name()));
-        this.classtree = classtree;
-    }
-
-    /**
      * Add each level of the class tree. For each sub-class or
      * sub-interface indents the next level information.
      * Recurses itself to add subclasses info.
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -51,16 +51,6 @@
 public class AllClassesFrameWriter extends HtmlDocletWriter {
 
     /**
-     * The name of the output file with frames
-     */
-    public static final String OUTPUT_FILE_NAME_FRAMES = "allclasses-frame.html";
-
-    /**
-     * The name of the output file without frames
-     */
-    public static final String OUTPUT_FILE_NAME_NOFRAMES = "allclasses-noframe.html";
-
-    /**
      * Index of all the classes.
      */
     protected IndexBuilder indexbuilder;
@@ -71,13 +61,16 @@
     final HtmlTree BR = new HtmlTree(HtmlTag.BR);
 
     /**
-     * Construct AllClassesFrameWriter object. Also initilises the indexbuilder
+     * Construct AllClassesFrameWriter object. Also initializes the indexbuilder
      * variable in this class.
+     * @param configuration  The current configuration
+     * @param filename       Path to the file which is getting generated.
+     * @param indexbuilder   Unicode based Index from {@link IndexBuilder}
      * @throws IOException
      * @throws DocletAbortException
      */
     public AllClassesFrameWriter(ConfigurationImpl configuration,
-                                 String filename, IndexBuilder indexbuilder)
+                                 DocPath filename, IndexBuilder indexbuilder)
                               throws IOException {
         super(configuration, filename);
         this.indexbuilder = indexbuilder;
@@ -94,13 +87,13 @@
     public static void generate(ConfigurationImpl configuration,
                                 IndexBuilder indexbuilder) {
         AllClassesFrameWriter allclassgen;
-        String filename = OUTPUT_FILE_NAME_FRAMES;
+        DocPath filename = DocPaths.ALLCLASSES_FRAME;
         try {
             allclassgen = new AllClassesFrameWriter(configuration,
                                                     filename, indexbuilder);
             allclassgen.buildAllClassesFile(true);
             allclassgen.close();
-            filename = OUTPUT_FILE_NAME_NOFRAMES;
+            filename = DocPaths.ALLCLASSES_NOFRAME;
             allclassgen = new AllClassesFrameWriter(configuration,
                                                     filename, indexbuilder);
             allclassgen.buildAllClassesFile(false);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -141,7 +141,7 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", "annotation_type_optional_element_summary",
+            return writer.getHyperLink("annotation_type_optional_element_summary",
                     writer.getResource("doclet.navAnnotationTypeOptionalMember"));
         } else {
             return writer.getResource("doclet.navAnnotationTypeOptionalMember");
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -260,7 +260,7 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", "annotation_type_required_element_summary",
+            return writer.getHyperLink("annotation_type_required_element_summary",
                     writer.getResource("doclet.navAnnotationTypeRequiredMember"));
         } else {
             return writer.getResource("doclet.navAnnotationTypeRequiredMember");
@@ -272,7 +272,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(writer.getHyperLink("", "annotation_type_element_detail",
+            liNav.addContent(writer.getHyperLink("annotation_type_element_detail",
                     writer.getResource("doclet.navAnnotationTypeMember")));
         } else {
             liNav.addContent(writer.getResource("doclet.navAnnotationTypeMember"));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -65,13 +65,10 @@
      * @param prevType the previous class that was documented.
      * @param nextType the next class being documented.
      */
-    public AnnotationTypeWriterImpl (AnnotationTypeDoc annotationType,
+    public AnnotationTypeWriterImpl(AnnotationTypeDoc annotationType,
             Type prevType, Type nextType)
-    throws Exception {
-        super(ConfigurationImpl.getInstance(),
-              DirectoryManager.getDirectoryPath(annotationType.containingPackage()),
-              annotationType.name() + ".html",
-              DirectoryManager.getRelativePath(annotationType.containingPackage().name()));
+            throws Exception {
+        super(ConfigurationImpl.getInstance(), DocPath.forClass(annotationType));
         this.annotationType = annotationType;
         configuration.currentcd = annotationType.asClassDoc();
         this.prev = prevType;
@@ -84,7 +81,7 @@
      * @return a content tree for the package link
      */
     protected Content getNavLinkPackage() {
-        Content linkContent = getHyperLink("package-summary.html", "",
+        Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
                 packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -106,7 +103,7 @@
      * @return a content tree for the class use link
      */
     protected Content getNavLinkClassUse() {
-        Content linkContent = getHyperLink("class-use/" + filename, "", useLabel);
+        Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -289,8 +286,8 @@
      * {@inheritDoc}
      */
     protected Content getNavLinkTree() {
-        Content treeLinkContent = getHyperLink("package-tree.html",
-                "", treeLabel, "", "");
+        Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
+                treeLabel, "", "");
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -82,7 +82,6 @@
     final String methodUseTableSummary;
     final String constructorUseTableSummary;
 
-
     /**
      * Constructor.
      *
@@ -91,10 +90,9 @@
      * @throws DocletAbortException
      */
     public ClassUseWriter(ConfigurationImpl configuration,
-                          ClassUseMapper mapper, String path,
-                          String filename, String relpath,
+                          ClassUseMapper mapper, DocPath filename,
                           ClassDoc classdoc) throws IOException {
-        super(configuration, path, filename, relpath);
+        super(configuration, filename);
         this.classdoc = classdoc;
         if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
                 pkgToPackageAnnotations = new HashSet<PackageDoc>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
@@ -199,23 +197,19 @@
     public static void generate(ConfigurationImpl configuration,
                                 ClassUseMapper mapper, ClassDoc classdoc) {
         ClassUseWriter clsgen;
-        String path = DirectoryManager.getDirectoryPath(classdoc.
-                                                            containingPackage());
-        path += "class-use" + DirectoryManager.URL_FILE_SEPARATOR;
-        String filename = classdoc.name() + ".html";
-        String pkgname = classdoc.containingPackage().name();
-        pkgname += (pkgname.length() > 0)? ".class-use": "class-use";
-        String relpath = DirectoryManager.getRelativePath(pkgname);
+        DocPath path = DocPath.forPackage(classdoc)
+                .resolve(DocPaths.CLASS_USE)
+                .resolve(DocPath.forName(classdoc));
         try {
             clsgen = new ClassUseWriter(configuration,
-                                        mapper, path, filename,
-                                        relpath, classdoc);
+                                        mapper, path,
+                                        classdoc);
             clsgen.generateClassUseFile();
             clsgen.close();
         } catch (IOException exc) {
             configuration.standardmessage.
                 error("doclet.exception_encountered",
-                      exc.toString(), filename);
+                      exc.toString(), path.getPath());
             throw new DocletAbortException();
         }
     }
@@ -359,7 +353,7 @@
      */
     protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
         Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
-                getHyperLink("", pkg.name(), new StringContent(Util.getPackageName(pkg))));
+                getHyperLink(pkg.name(), new StringContent(Util.getPackageName(pkg))));
         contentTree.addContent(tdFirst);
         HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
         tdLast.addStyle(HtmlStyle.colLast);
@@ -470,8 +464,8 @@
      * @return a content tree for the package link
      */
     protected Content getNavLinkPackage() {
-        Content linkContent = getHyperLink("../package-summary.html", "",
-                packageLabel);
+        Content linkContent =
+                getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_SUMMARY), packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -506,8 +500,8 @@
      */
     protected Content getNavLinkTree() {
         Content linkContent = classdoc.containingPackage().isIncluded() ?
-            getHyperLink("../package-tree.html", "", treeLabel) :
-            getHyperLink(relativePath + "overview-tree.html", "", treeLabel);
+            getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel) :
+            getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -72,11 +72,8 @@
      */
     public ClassWriterImpl (ClassDoc classDoc,
             ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree)
-    throws Exception {
-        super(ConfigurationImpl.getInstance(),
-              DirectoryManager.getDirectoryPath(classDoc.containingPackage()),
-              classDoc.name() + ".html",
-              DirectoryManager.getRelativePath(classDoc.containingPackage().name()));
+            throws Exception {
+        super(ConfigurationImpl.getInstance(), DocPath.forClass(classDoc));
         this.classDoc = classDoc;
         configuration.currentcd = classDoc;
         this.classtree = classTree;
@@ -90,7 +87,7 @@
      * @return a content tree for the package link
      */
     protected Content getNavLinkPackage() {
-        Content linkContent = getHyperLink("package-summary.html", "",
+        Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
                 packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -112,7 +109,7 @@
      * @return a content tree for the class use link
      */
     protected Content getNavLinkClassUse() {
-        Content linkContent = getHyperLink("class-use/" + filename, "", useLabel);
+        Content linkContent = getHyperLink(DocPaths.CLASS_USE.resolve(filename), useLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -567,8 +564,8 @@
      * {@inheritDoc}
      */
     protected Content getNavLinkTree() {
-        Content treeLinkContent = getHyperLink("package-tree.html",
-                "", treeLabel, "", "");
+        Content treeLinkContent = getHyperLink(DocPaths.PACKAGE_TREE,
+                treeLabel, "", "");
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -25,7 +25,6 @@
 
 package com.sun.tools.doclets.formats.html;
 
-import java.io.*;
 import java.net.*;
 import java.util.*;
 
@@ -46,6 +45,11 @@
  * use "-helpfile" option when already "-nohelp" option is used.
  * </p>
  *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ *
  * @author Robert Field.
  * @author Atul Dambalkar.
  * @author Jamie Ho
@@ -62,11 +66,6 @@
     public static final String BUILD_DATE = System.getProperty("java.version");
 
     /**
-     * The name of the constant values file.
-     */
-    public static final String CONSTANTS_FILE_NAME = "constant-values.html";
-
-    /**
      * Argument for command line option "-header".
      */
     public String header = "";
@@ -179,7 +178,7 @@
      * First file to appear in the right-hand frame in the generated
      * documentation.
      */
-    public String topFile = "";
+    public DocPath topFile = DocPath.empty;
 
     /**
      * The classdoc for the class file getting generated.
@@ -367,7 +366,7 @@
                         "-helpfile"));
                     return false;
                 }
-                File help = new File(os[1]);
+                DocFile help = DocFile.createFileForInput(this, os[1]);
                 if (!help.exists()) {
                     reporter.printError(getText("doclet.File_not_found", os[1]));
                     return false;
@@ -447,18 +446,17 @@
             return;
         }
         if (createoverview) {
-            topFile = "overview-summary.html";
+            topFile = DocPaths.OVERVIEW_SUMMARY;
         } else {
             if (packages.length == 1 && packages[0].name().equals("")) {
                 if (root.classes().length > 0) {
                     ClassDoc[] classarr = root.classes();
                     Arrays.sort(classarr);
                     ClassDoc cd = getValidClass(classarr);
-                    topFile = DirectoryManager.getPathToClass(cd);
+                    topFile = DocPath.forClass(cd);
                 }
             } else {
-                topFile = DirectoryManager.getPathToPackage(packages[0],
-                                                            "package-summary.html");
+                topFile = DocPath.forPackage(packages[0]).resolve(DocPaths.PACKAGE_SUMMARY);
             }
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -69,7 +69,7 @@
      */
     public ConstantsSummaryWriterImpl(ConfigurationImpl configuration)
             throws IOException {
-        super(configuration, ConfigurationImpl.CONSTANTS_FILE_NAME);
+        super(configuration, DocPaths.CONSTANT_VALUES);
         this.configuration = configuration;
         constantsTableSummary = configuration.getText("doclet.Constants_Table_Summary",
                 configuration.getText("doclet.Constants_Summary"));
@@ -107,13 +107,13 @@
         //add link to summary
         Content link;
         if (packageName.length() == 0) {
-            link = getHyperLink("#" + DocletConstants.UNNAMED_PACKAGE_ANCHOR,
-                    "", defaultPackageLabel, "", "");
+            link = getHyperLink(DocLink.fragment(DocletConstants.UNNAMED_PACKAGE_ANCHOR),
+                    defaultPackageLabel, "", "");
         } else {
             Content packageNameContent = getPackageLabel(parsedPackageName);
             packageNameContent.addContent(".*");
-            link = getHyperLink("#" + parsedPackageName,
-                    "", packageNameContent, "", "");
+            link = getHyperLink(DocLink.fragment(parsedPackageName),
+                    packageNameContent, "", "");
             printedPackageHeaders.add(parsedPackageName);
         }
         contentListTree.addContent(HtmlTree.LI(link));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -280,7 +280,7 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", "constructor_summary",
+            return writer.getHyperLink("constructor_summary",
                     writer.getResource("doclet.navConstructor"));
         } else {
             return writer.getResource("doclet.navConstructor");
@@ -292,7 +292,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(writer.getHyperLink("", "constructor_detail",
+            liNav.addContent(writer.getHyperLink("constructor_detail",
                     writer.getResource("doclet.navConstructor")));
         } else {
             liNav.addContent(writer.getResource("doclet.navConstructor"));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -95,7 +95,7 @@
      * @param filename the file to be generated.
      */
     public DeprecatedListWriter(ConfigurationImpl configuration,
-                                String filename) throws IOException {
+                                DocPath filename) throws IOException {
         super(configuration, filename);
         this.configuration = configuration;
         NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
@@ -116,7 +116,7 @@
      * @param configuration the current configuration of the doclet.
      */
     public static void generate(ConfigurationImpl configuration) {
-        String filename = "deprecated-list.html";
+        DocPath filename = DocPaths.DEPRECATED_LIST;
         try {
             DeprecatedListWriter depr =
                    new DeprecatedListWriter(configuration, filename);
@@ -180,7 +180,7 @@
     private void addIndexLink(DeprecatedAPIListBuilder builder,
             int type, Content contentTree) {
         if (builder.hasDocumentation(type)) {
-            Content li = HtmlTree.LI(getHyperLink("#" + ANCHORS[type],
+            Content li = HtmlTree.LI(getHyperLink(ANCHORS[type],
                     getResource(HEADING_KEYS[type])));
             contentTree.addContent(li);
         }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -263,7 +263,7 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", (cd == null)?
+            return writer.getHyperLink((cd == null)?
                 "enum_constant_summary":
                 "enum_constants_inherited_from_class_" +
                 configuration().getClassName(cd),
@@ -278,7 +278,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(writer.getHyperLink("", "enum_constant_detail",
+            liNav.addContent(writer.getHyperLink("enum_constant_detail",
                     writer.getResource("doclet.navEnum")));
         } else {
             liNav.addContent(writer.getResource("doclet.navEnum"));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -293,7 +293,7 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", (cd == null)?
+            return writer.getHyperLink((cd == null)?
                 "field_summary":
                 "fields_inherited_from_class_" +
                 configuration().getClassName(cd),
@@ -308,7 +308,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(writer.getHyperLink("", "field_detail",
+            liNav.addContent(writer.getHyperLink("field_detail",
                     writer.getResource("doclet.navField")));
         } else {
             liNav.addContent(writer.getResource("doclet.navField"));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -63,7 +63,7 @@
      * @param filename File to be generated.
      */
     public FrameOutputWriter(ConfigurationImpl configuration,
-                             String filename) throws IOException {
+                             DocPath filename) throws IOException {
         super(configuration, filename);
     noOfPackages = configuration.packages.length;
     }
@@ -77,9 +77,9 @@
      */
     public static void generate(ConfigurationImpl configuration) {
         FrameOutputWriter framegen;
-        String filename = "";
+        DocPath filename = DocPath.empty;
         try {
-            filename = "index.html";
+            filename = DocPaths.INDEX;
             framegen = new FrameOutputWriter(configuration, filename);
             framegen.generateFrameFile();
             framegen.close();
@@ -92,7 +92,7 @@
     }
 
     /**
-     * Generate the contants in the "index.html" file. Print the frame details
+     * Generate the constants in the "index.html" file. Print the frame details
      * as well as warning if browser is not supporting the Html frames.
      */
     protected void generateFrameFile() throws IOException {
@@ -155,8 +155,8 @@
      * @param contentTree the content tree to which the information will be added
      */
     private void addAllPackagesFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME("overview-frame.html", "packageListFrame",
-                configuration.getText("doclet.All_Packages"));
+        HtmlTree frame = HtmlTree.FRAME(DocPaths.OVERVIEW_FRAME.getPath(),
+                "packageListFrame", configuration.getText("doclet.All_Packages"));
         contentTree.addContent(frame);
     }
 
@@ -166,8 +166,8 @@
      * @param contentTree the content tree to which the information will be added
      */
     private void addAllClassesFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME("allclasses-frame.html", "packageFrame",
-                configuration.getText("doclet.All_classes_and_interfaces"));
+        HtmlTree frame = HtmlTree.FRAME(DocPaths.ALLCLASSES_FRAME.getPath(),
+                "packageFrame", configuration.getText("doclet.All_classes_and_interfaces"));
         contentTree.addContent(frame);
     }
 
@@ -177,7 +177,7 @@
      * @param contentTree the content tree to which the information will be added
      */
     private void addClassFrameTag(Content contentTree) {
-        HtmlTree frame = HtmlTree.FRAME(configuration.topFile, "classFrame",
+        HtmlTree frame = HtmlTree.FRAME(configuration.topFile.getPath(), "classFrame",
                 configuration.getText("doclet.Package_class_and_interface_descriptions"),
                 SCROLL_YES);
         contentTree.addContent(frame);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -49,7 +49,7 @@
      * @param filename File to be generated.
      */
     public HelpWriter(ConfigurationImpl configuration,
-                      String filename) throws IOException {
+                      DocPath filename) throws IOException {
         super(configuration, filename);
     }
 
@@ -62,9 +62,9 @@
      */
     public static void generate(ConfigurationImpl configuration) {
         HelpWriter helpgen;
-        String filename = "";
+        DocPath filename = DocPath.empty;
         try {
-            filename = "help-doc.html";
+            filename = DocPaths.HELP_DOC;
             helpgen = new HelpWriter(configuration, filename);
             helpgen.generateHelpFile();
             helpgen.close();
@@ -113,7 +113,7 @@
                 getResource("doclet.Overview"));
             Content liOverview = HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
             Content line3 = getResource("doclet.Help_line_3",
-                    getHyperLinkString("overview-summary.html",
+                    getHyperLinkString(DocPaths.OVERVIEW_SUMMARY,
                     configuration.getText("doclet.Overview")));
             Content overviewPara = HtmlTree.P(line3);
             liOverview.addContent(overviewPara);
@@ -234,7 +234,7 @@
                     getResource("doclet.Help_line_16"));
             Content liTree = HtmlTree.LI(HtmlStyle.blockList, treeHead);
             Content line17 = getResource("doclet.Help_line_17_with_tree_link",
-                    getHyperLinkString("overview-tree.html",
+                    getHyperLinkString(DocPaths.OVERVIEW_TREE,
                     configuration.getText("doclet.Class_Hierarchy")));
             Content treePara = HtmlTree.P(line17);
             liTree.addContent(treePara);
@@ -252,7 +252,7 @@
                     getResource("doclet.Deprecated_API"));
             Content liDeprecated = HtmlTree.LI(HtmlStyle.blockList, dHead);
             Content line20 = getResource("doclet.Help_line_20_with_deprecated_api_link",
-                    getHyperLinkString("deprecated-list.html",
+                    getHyperLinkString(DocPaths.DEPRECATED_LIST,
                     configuration.getText("doclet.Deprecated_API")));
             Content dPara = HtmlTree.P(line20);
             liDeprecated.addContent(dPara);
@@ -261,10 +261,10 @@
         if (configuration.createindex) {
             String indexlink;
             if (configuration.splitindex) {
-                indexlink = getHyperLinkString("index-files/index-1.html",
+                indexlink = getHyperLinkString(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)),
                         configuration.getText("doclet.Index"));
             } else {
-                indexlink = getHyperLinkString("index-all.html",
+                indexlink = getHyperLinkString(DocPaths.INDEX_ALL,
                         configuration.getText("doclet.Index"));
             }
             Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
@@ -293,7 +293,7 @@
                 getResource("doclet.All_Classes"));
         Content liAllClasses = HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
         Content line27 = getResource("doclet.Help_line_27",
-                getHyperLinkString("allclasses-noframe.html",
+                getHyperLinkString(DocPaths.ALLCLASSES_NOFRAME,
                 configuration.getText("doclet.All_Classes")));
         Content allclassesPara = HtmlTree.P(line27);
         liAllClasses.addContent(allclassesPara);
@@ -309,7 +309,7 @@
                 getResource("doclet.Constants_Summary"));
         Content liConst = HtmlTree.LI(HtmlStyle.blockList, constHead);
         Content line29 = getResource("doclet.Help_line_29",
-                getHyperLinkString("constant-values.html",
+                getHyperLinkString(DocPaths.CONSTANT_VALUES,
                 configuration.getText("doclet.Constants_Summary")));
         Content constPara = HtmlTree.P(line29);
         liConst.addContent(constPara);
@@ -325,6 +325,7 @@
      *
      * @return a content tree for the help label
      */
+    @Override
     protected Content getNavLinkHelp() {
         Content li = HtmlTree.LI(HtmlStyle.navBarCell1Rev, helpLabel);
         return li;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java	Wed Nov 14 16:41:12 2012 -0800
@@ -94,31 +94,22 @@
             throws Exception {
         super.generateOtherFiles(root, classtree);
         if (configuration.linksource) {
-            if (configuration.destDirName.length() > 0) {
-                SourceToHTMLConverter.convertRoot(configuration,
-                    root, configuration.destDirName + File.separator
-                    + DocletConstants.SOURCE_OUTPUT_DIR_NAME);
-            } else {
-                SourceToHTMLConverter.convertRoot(configuration,
-                    root, DocletConstants.SOURCE_OUTPUT_DIR_NAME);
-            }
+            SourceToHTMLConverter.convertRoot(configuration,
+                root, DocPaths.SOURCE_OUTPUT);
         }
 
-        if (configuration.topFile.length() == 0) {
+        if (configuration.topFile.isEmpty()) {
             configuration.standardmessage.
                 error("doclet.No_Non_Deprecated_Classes_To_Document");
             return;
         }
         boolean nodeprecated = configuration.nodeprecated;
-        String configdestdir = configuration.destDirName;
-        String confighelpfile = configuration.helpfile;
-        String configstylefile = configuration.stylesheetfile;
-        performCopy(configdestdir, confighelpfile);
-        performCopy(configdestdir, configstylefile);
-        Util.copyResourceFile(configuration, "background.gif", false);
-        Util.copyResourceFile(configuration, "tab.gif", false);
-        Util.copyResourceFile(configuration, "titlebar.gif", false);
-        Util.copyResourceFile(configuration, "titlebar_end.gif", false);
+        performCopy(configuration.helpfile);
+        performCopy(configuration.stylesheetfile);
+        copyResourceFile("background.gif");
+        copyResourceFile("tab.gif");
+        copyResourceFile("titlebar.gif");
+        copyResourceFile("titlebar_end.gif");
         // do early to reduce memory footprint
         if (configuration.classuse) {
             ClassUseWriter.generate(configuration, classtree);
@@ -155,9 +146,8 @@
         // If a stylesheet file is not specified, copy the default stylesheet
         // and replace newline with platform-specific newline.
         if (configuration.stylesheetfile.length() == 0) {
-            Util.copyFile(configuration, "stylesheet.css", Util.RESOURCESDIR,
-                    (configdestdir.isEmpty()) ?
-                        System.getProperty("user.dir") : configdestdir, false, true);
+            DocFile f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET);
+            f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.STYLESHEET), false, true);
         }
     }
 
@@ -258,29 +248,33 @@
         return (ConfigurationImpl.getInstance()).validOptions(options, reporter);
     }
 
-    private void performCopy(String configdestdir, String filename) {
+    /**
+     * Copy a file in the resources directory to the destination directory.
+     * @param resource   The name of the resource file to copy
+     */
+    private void copyResourceFile(String resource) {
+        DocPath p = DocPaths.RESOURCES.resolve(resource);
+        DocFile f = DocFile.createFileForOutput(configuration, p);
+        f.copyResource(p, false, false);
+    }
+
+    private void performCopy(String filename) {
+        if (filename.isEmpty())
+            return;
+
         try {
-            String destdir = (configdestdir.length() > 0) ?
-                configdestdir + File.separatorChar: "";
-            if (filename.length() > 0) {
-                File helpstylefile = new File(filename);
-                String parent = helpstylefile.getParent();
-                String helpstylefilename = (parent == null)?
-                    filename:
-                    filename.substring(parent.length() + 1);
-                File desthelpfile = new File(destdir + helpstylefilename);
-                if (!desthelpfile.getCanonicalPath().equals(
-                        helpstylefile.getCanonicalPath())) {
-                    configuration.message.
-                        notice((SourcePosition) null,
-                            "doclet.Copying_File_0_To_File_1",
-                            helpstylefile.toString(), desthelpfile.toString());
-                    Util.copyFile(desthelpfile, helpstylefile);
-                }
-            }
+            DocFile fromfile = DocFile.createFileForInput(configuration, filename);
+            DocPath path = DocPath.create(fromfile.getName());
+            DocFile toFile = DocFile.createFileForOutput(configuration, path);
+            if (toFile.isSameFile(fromfile))
+                return;
+
+            configuration.message.notice((SourcePosition) null,
+                    "doclet.Copying_File_0_To_File_1",
+                    fromfile.toString(), path.getPath());
+            toFile.copyFile(fromfile);
         } catch (IOException exc) {
-            configuration.message.
-                error((SourcePosition) null,
+            configuration.message.error((SourcePosition) null,
                     "doclet.perform_copy_exception_encountered",
                     exc.toString());
             throw new DocletAbortException();
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -55,32 +55,24 @@
     /**
      * Relative path from the file getting generated to the destination
      * directory. For example, if the file getting generated is
-     * "java/lang/Object.html", then the relative path string is "../../".
+     * "java/lang/Object.html", then the path to the root is "../..".
      * This string can be empty if the file getting generated is in
      * the destination directory.
      */
-    public String relativePath = "";
+    public final DocPath pathToRoot;
 
     /**
-     * Same as relativepath, but normalized to never be empty or
-     * end with a slash.
-     */
-    public String relativepathNoSlash = "";
-
-    /**
-     * Platform-dependent directory path from the current or the
+     * Platform-independent path from the current or the
      * destination directory to the file getting generated.
      * Used when creating the file.
-     * For example, if the file getting generated is
-     * "java/lang/Object.html", then the path string is "java/lang".
      */
-    public String path = "";
+    public final DocPath path;
 
     /**
      * Name of the file getting generated. If the file getting generated is
      * "java/lang/Object.html", then the filename is "Object.html".
      */
-    public String filename = "";
+    public final DocPath filename;
 
     /**
      * The display length used for indentation while generating the class page.
@@ -100,33 +92,15 @@
     /**
      * Constructor to construct the HtmlStandardWriter object.
      *
-     * @param filename File to be generated.
+     * @param path File to be generated.
      */
-    public HtmlDocletWriter(ConfigurationImpl configuration,
-                              String filename) throws IOException {
-        super(configuration, filename);
-        this.configuration = configuration;
-        this.filename = filename;
-    }
-
-    /**
-     * Constructor to construct the HtmlStandardWriter object.
-     *
-     * @param path         Platform-dependent {@link #path} used when
-     *                     creating file.
-     * @param filename     Name of file to be generated.
-     * @param relativePath Value for the variable {@link #relativePath}.
-     */
-    public HtmlDocletWriter(ConfigurationImpl configuration,
-                              String path, String filename,
-                              String relativePath) throws IOException {
-        super(configuration, path, filename);
+    public HtmlDocletWriter(ConfigurationImpl configuration, DocPath path)
+            throws IOException {
+        super(configuration, path);
         this.configuration = configuration;
         this.path = path;
-        this.relativePath = relativePath;
-        this.relativepathNoSlash =
-            DirectoryManager.getPathNoTrailingSlash(this.relativePath);
-        this.filename = filename;
+        this.pathToRoot = path.parent().invert();
+        this.filename = path.basename();
     }
 
     /**
@@ -165,8 +139,9 @@
         int previndex = 0;
         while (true) {
             if (configuration.docrootparent.length() > 0) {
+                final String docroot_parent = "{@docroot}/..";
                 // Search for lowercase version of {@docRoot}/..
-                index = lowerHtml.indexOf("{@docroot}/..", previndex);
+                index = lowerHtml.indexOf(docroot_parent, previndex);
                 // If next {@docRoot}/.. pattern not found, append rest of htmlstr and exit loop
                 if (index < 0) {
                     buf.append(htmlstr.substring(previndex));
@@ -174,17 +149,18 @@
                 }
                 // If next {@docroot}/.. pattern found, append htmlstr up to start of tag
                 buf.append(htmlstr.substring(previndex, index));
-                previndex = index + 13;  // length for {@docroot}/.. string
+                previndex = index + docroot_parent.length();
                 // Insert docrootparent absolute path where {@docRoot}/.. was located
 
                 buf.append(configuration.docrootparent);
                 // Append slash if next character is not a slash
                 if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
-                    buf.append(DirectoryManager.URL_FILE_SEPARATOR);
+                    buf.append('/');
                 }
             } else {
+                final String docroot = "{@docroot}";
                 // Search for lowercase version of {@docRoot}
-                index = lowerHtml.indexOf("{@docroot}", previndex);
+                index = lowerHtml.indexOf(docroot, previndex);
                 // If next {@docRoot} tag not found, append rest of htmlstr and exit loop
                 if (index < 0) {
                     buf.append(htmlstr.substring(previndex));
@@ -192,13 +168,12 @@
                 }
                 // If next {@docroot} tag found, append htmlstr up to start of tag
                 buf.append(htmlstr.substring(previndex, index));
-                previndex = index + 10;  // length for {@docroot} string
+                previndex = index + docroot.length();
                 // Insert relative path where {@docRoot} was located
-                buf.append(relativepathNoSlash);
+                buf.append(pathToRoot.isEmpty() ? "." : pathToRoot.getPath());
                 // Append slash if next character is not a slash
-                if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length() &&
-                        htmlstr.charAt(previndex) != '/') {
-                    buf.append(DirectoryManager.URL_FILE_SEPARATOR);
+                if (previndex < htmlstr.length() && htmlstr.charAt(previndex) != '/') {
+                    buf.append('/');
                 }
             }
         }
@@ -312,7 +287,7 @@
      */
     public Content getTargetPackageLink(PackageDoc pd, String target,
             Content label) {
-        return getHyperLink(pathString(pd, "package-summary.html"), "", label, "", target);
+        return getHyperLink(pathString(pd, DocPaths.PACKAGE_SUMMARY), label, "", target);
     }
 
     /**
@@ -432,9 +407,10 @@
                 allClassesId += "navbar_top";
                 Content a = getMarkerAnchor("navbar_top");
                 navDiv.addContent(a);
-                Content skipLinkContent = getHyperLink("",
-                        "skip-navbar_top", HtmlTree.EMPTY, configuration.getText(
-                        "doclet.Skip_navigation_links"), "");
+                Content skipLinkContent = getHyperLink(DocLink.fragment("skip-navbar_top"),
+                        HtmlTree.EMPTY,
+                        configuration.getText("doclet.Skip_navigation_links"),
+                        "");
                 navDiv.addContent(skipLinkContent);
             } else {
                 body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
@@ -442,9 +418,10 @@
                 allClassesId += "navbar_bottom";
                 Content a = getMarkerAnchor("navbar_bottom");
                 navDiv.addContent(a);
-                Content skipLinkContent = getHyperLink("",
-                        "skip-navbar_bottom", HtmlTree.EMPTY, configuration.getText(
-                        "doclet.Skip_navigation_links"), "");
+                Content skipLinkContent = getHyperLink(DocLink.fragment("skip-navbar_bottom"),
+                        HtmlTree.EMPTY,
+                        configuration.getText("doclet.Skip_navigation_links"),
+                        "");
                 navDiv.addContent(skipLinkContent);
             }
             if (header) {
@@ -539,8 +516,8 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkContents() {
-        Content linkContent = getHyperLink(relativePath +
-                "overview-summary.html", "", overviewLabel, "", "");
+        Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_SUMMARY),
+                overviewLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -584,10 +561,10 @@
      * @param prev File name for the prev link
      * @return a content tree for the link
      */
-    public Content getNavLinkPrevious(String prev) {
+    public Content getNavLinkPrevious(DocPath prev) {
         Content li;
         if (prev != null) {
-            li = HtmlTree.LI(getHyperLink(prev, "", prevLabel, "", ""));
+            li = HtmlTree.LI(getHyperLink(prev, prevLabel, "", ""));
         }
         else
             li = HtmlTree.LI(prevLabel);
@@ -601,10 +578,10 @@
      * @param next File name for the next link
      * @return a content tree for the link
      */
-    public Content getNavLinkNext(String next) {
+    public Content getNavLinkNext(DocPath next) {
         Content li;
         if (next != null) {
-            li = HtmlTree.LI(getHyperLink(next, "", nextLabel, "", ""));
+            li = HtmlTree.LI(getHyperLink(next, nextLabel, "", ""));
         }
         else
             li = HtmlTree.LI(nextLabel);
@@ -617,9 +594,9 @@
      * @param link File to be linked, "index.html"
      * @return a content tree for the link
      */
-    protected Content getNavShowLists(String link) {
-        Content framesContent = getHyperLink(link + "?" + path +
-                filename, "", framesLabel, "", "_top");
+    protected Content getNavShowLists(DocPath link) {
+        DocLink dl = new DocLink(link, path.getPath(), null);
+        Content framesContent = getHyperLink(dl, framesLabel, "", "_top");
         Content li = HtmlTree.LI(framesContent);
         return li;
     }
@@ -630,7 +607,7 @@
      * @return a content tree for the link
      */
     protected Content getNavShowLists() {
-        return getNavShowLists(relativePath + "index.html");
+        return getNavShowLists(pathToRoot.resolve(DocPaths.INDEX));
     }
 
     /**
@@ -639,8 +616,8 @@
      * @param link File to be linked
      * @return a content tree for the link
      */
-    protected Content getNavHideLists(String link) {
-        Content noFramesContent = getHyperLink(link, "", noframesLabel, "", "_top");
+    protected Content getNavHideLists(DocPath link) {
+        Content noFramesContent = getHyperLink(link, noframesLabel, "", "_top");
         Content li = HtmlTree.LI(noFramesContent);
         return li;
     }
@@ -658,11 +635,11 @@
         PackageDoc[] packages = configuration.root.specifiedPackages();
         if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) {
             treeLinkContent = getHyperLink(pathString(packages[0],
-                    "package-tree.html"), "", treeLabel,
+                    DocPaths.PACKAGE_TREE), treeLabel,
                     "", "");
         } else {
-            treeLinkContent = getHyperLink(relativePath + "overview-tree.html",
-                    "", treeLabel, "", "");
+            treeLinkContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
+                    treeLabel, "", "");
         }
         Content li = HtmlTree.LI(treeLinkContent);
         return li;
@@ -675,7 +652,7 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkMainTree(String label) {
-        Content mainTreeContent = getHyperLink(relativePath + "overview-tree.html",
+        Content mainTreeContent = getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE),
                 new StringContent(label));
         Content li = HtmlTree.LI(mainTreeContent);
         return li;
@@ -697,8 +674,8 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkDeprecated() {
-        Content linkContent = getHyperLink(relativePath +
-                "deprecated-list.html", "", deprecatedLabel, "", "");
+        Content linkContent = getHyperLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST),
+                deprecatedLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
     }
@@ -711,8 +688,8 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkClassIndex() {
-        Content allClassesContent = getHyperLink(relativePath +
-                AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, "",
+        Content allClassesContent = getHyperLink(pathToRoot.resolve(
+                DocPaths.ALLCLASSES_NOFRAME),
                 allclassesLabel, "", "");
         Content li = HtmlTree.LI(allClassesContent);
         return li;
@@ -724,9 +701,10 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkIndex() {
-        Content linkContent = getHyperLink(relativePath +(configuration.splitindex?
-            DirectoryManager.getPath("index-files") + fileseparator: "") +
-            (configuration.splitindex?"index-1.html" : "index-all.html"), "",
+        Content linkContent = getHyperLink(pathToRoot.resolve(
+                (configuration.splitindex
+                    ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1))
+                    : DocPaths.INDEX_ALL)),
             indexLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -740,16 +718,15 @@
      * @return a content tree for the link
      */
     protected Content getNavLinkHelp() {
-        String helpfilenm = configuration.helpfile;
-        if (helpfilenm.equals("")) {
-            helpfilenm = "help-doc.html";
+        String helpfile = configuration.helpfile;
+        DocPath helpfilenm;
+        if (helpfile.isEmpty()) {
+            helpfilenm = DocPaths.HELP_DOC;
         } else {
-            int lastsep;
-            if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) {
-                helpfilenm = helpfilenm.substring(lastsep + 1);
-            }
+            DocFile file = DocFile.createFileForInput(configuration, helpfile);
+            helpfilenm = DocPath.create(file.getName());
         }
-        Content linkContent = getHyperLink(relativePath + helpfilenm, "",
+        Content linkContent = getHyperLink(pathToRoot.resolve(helpfilenm),
                 helpLabel, "", "");
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -884,25 +861,12 @@
     }
 
     /**
-     * Return path to the class page for a classdoc. For example, the class
-     * name is "java.lang.Object" and if the current file getting generated is
-     * "java/io/File.html", then the path string to the class, returned is
-     * "../../java/lang.Object.html".
-     *
-     * @param cd Class to which the path is requested.
-     */
-    protected String pathToClass(ClassDoc cd) {
-        return pathString(cd.containingPackage(), cd.name() + ".html");
-    }
-
-    /**
-     * Return the path to the class page for a classdoc. Works same as
-     * {@link #pathToClass(ClassDoc)}.
+     * Return the path to the class page for a classdoc.
      *
      * @param cd   Class to which the path is requested.
      * @param name Name of the file(doesn't include path).
      */
-    protected String pathString(ClassDoc cd, String name) {
+    protected DocPath pathString(ClassDoc cd, DocPath name) {
         return pathString(cd.containingPackage(), name);
     }
 
@@ -915,10 +879,8 @@
      * @param pd Package in which the file name is assumed to be.
      * @param name File name, to which path string is.
      */
-    protected String pathString(PackageDoc pd, String name) {
-        StringBuilder buf = new StringBuilder(relativePath);
-        buf.append(DirectoryManager.getPathToPackage(pd, name));
-        return buf.toString();
+    protected DocPath pathString(PackageDoc pd, DocPath name) {
+        return pathToRoot.resolve(DocPath.forPackage(pd).resolve(name));
     }
 
     /**
@@ -956,12 +918,12 @@
             }
         }
         if (included || pkg == null) {
-            return getHyperLinkString(pathString(pkg, "package-summary.html"),
-                                "", label, isStrong, style);
+            return getHyperLinkString(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
+                                label, isStrong, style);
         } else {
-            String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
+            DocLink crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
             if (crossPkgLink != null) {
-                return getHyperLinkString(crossPkgLink, "", label, isStrong, style);
+                return getHyperLinkString(crossPkgLink, label, isStrong, style);
             } else {
                 return label;
             }
@@ -987,12 +949,12 @@
             }
         }
         if (included || pkg == null) {
-            return getHyperLink(pathString(pkg, "package-summary.html"),
-                                "", label);
+            return getHyperLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
+                    label);
         } else {
-            String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
+            DocLink crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg));
             if (crossPkgLink != null) {
-                return getHyperLink(crossPkgLink, "", label);
+                return getHyperLink(crossPkgLink, label);
             } else {
                 return label;
             }
@@ -1020,10 +982,10 @@
             //d must be a class doc since in has no containing class.
             cd = (ClassDoc) doc;
         }
-        String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME
-                + DirectoryManager.getDirectoryPath(cd.containingPackage())
-                + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(doc);
-        Content linkContent = getHyperLink(href, "", label, "", "");
+        DocPath href = pathToRoot
+                .resolve(DocPaths.SOURCE_OUTPUT)
+                .resolve(DocPath.forClass(cd));
+        Content linkContent = getHyperLink(href.fragment(SourceToHTMLConverter.getAnchorName(doc)), label, "", "");
         htmltree.addContent(linkContent);
     }
 
@@ -1036,7 +998,7 @@
      */
     public String getLink(LinkInfoImpl linkInfo) {
         LinkFactoryImpl factory = new LinkFactoryImpl(this);
-        String link = ((LinkOutputImpl) factory.getLinkOutput(linkInfo)).toString();
+        String link = factory.getLinkOutput(linkInfo).toString();
         displayLength += linkInfo.displayLength;
         return link;
     }
@@ -1049,8 +1011,7 @@
      */
     public String getTypeParameterLinks(LinkInfoImpl linkInfo) {
         LinkFactoryImpl factory = new LinkFactoryImpl(this);
-        return ((LinkOutputImpl)
-            factory.getTypeParameterLinks(linkInfo, false)).toString();
+        return factory.getTypeParameterLinks(linkInfo, false).toString();
     }
 
     /*************************************************************
@@ -1070,10 +1031,10 @@
     public String getCrossClassLink(String qualifiedClassName, String refMemName,
                                     String label, boolean strong, String style,
                                     boolean code) {
-        String className = "",
-            packageName = qualifiedClassName == null ? "" : qualifiedClassName;
+        String className = "";
+        String packageName = qualifiedClassName == null ? "" : qualifiedClassName;
         int periodIndex;
-        while((periodIndex = packageName.lastIndexOf('.')) != -1) {
+        while ((periodIndex = packageName.lastIndexOf('.')) != -1) {
             className = packageName.substring(periodIndex + 1, packageName.length()) +
                 (className.length() > 0 ? "." + className : "");
             String defaultLabel = code ? codeText(className) : className;
@@ -1084,11 +1045,12 @@
                 //the -link option.  There are ways to determine if an external package
                 //exists, but no way to determine if the external class exists.  We just
                 //have to assume that it does.
-                return getHyperLinkString(
-                    configuration.extern.getExternalLink(packageName, relativePath,
-                                className + ".html?is-external=true"),
-                    refMemName == null ? "" : refMemName,
-                    label == null || label.length() == 0 ? defaultLabel : label,
+                DocLink link = configuration.extern.getExternalLink(packageName, pathToRoot,
+                                className + ".html", refMemName);
+                return getHyperLinkString(link,
+                    (label == null) || label.length() == 0 ? defaultLabel : label,
+
+
                     strong, style,
                     configuration.getText("doclet.Href_Class_Or_Interface_Title", packageName),
                     "");
@@ -1104,9 +1066,9 @@
         return configuration.extern.isExternal(cd);
     }
 
-    public String getCrossPackageLink(String pkgName) {
-        return configuration.extern.getExternalLink(pkgName, relativePath,
-            "package-summary.html?is-external=true");
+    public DocLink getCrossPackageLink(String pkgName) {
+        return configuration.extern.getExternalLink(pkgName, pathToRoot,
+            DocPaths.PACKAGE_SUMMARY.getPath());
     }
 
     /**
@@ -1134,7 +1096,7 @@
 
     /**
      * Retrieve the class link with the package portion of the label in
-     * plain text.  If the qualifier is excluded, it willnot be included in the
+     * plain text.  If the qualifier is excluded, it will not be included in the
      * link label.
      *
      * @param cd the class to link to.
@@ -1318,10 +1280,11 @@
                 return getPackageLinkString(refPackage, label, false);
             } else {
                 //@see is not referencing an included class or package.  Check for cross links.
-                String classCrossLink, packageCrossLink = getCrossPackageLink(refClassName);
+                String classCrossLink;
+                DocLink packageCrossLink = getCrossPackageLink(refClassName);
                 if (packageCrossLink != null) {
                     //Package cross link found
-                    return getHyperLinkString(packageCrossLink, "",
+                    return getHyperLinkString(packageCrossLink,
                         (label.isEmpty() ? text : label), false);
                 } else if ((classCrossLink = getCrossClassLink(refClassName,
                         refMemName, label, false, "", !plain)) != null) {
@@ -1450,7 +1413,7 @@
      * @param doc the doc for which the comment tags will be generated
      * @param tags the first sentence tags for the doc
      * @param depr true if it is deprecated
-     * @param first true if the first sentenge tags should be added
+     * @param first true if the first sentence tags should be added
      * @param htmltree the documentation tree to which the comment tags will be added
      */
     private void addCommentTags(Doc doc, Tag[] tags, boolean depr,
@@ -1561,7 +1524,7 @@
 
     /**
      * Suppose a piece of documentation has a relative link.  When you copy
-     * that documetation to another place such as the index or class-use page,
+     * that documentation to another place such as the index or class-use page,
      * that relative link will no longer work.  We should redirect those links
      * so that they will work again.
      * <p>
@@ -1587,21 +1550,17 @@
             return text;
         }
 
-        String redirectPathFromRoot;
+        DocPath redirectPathFromRoot;
         if (doc instanceof ClassDoc) {
-            redirectPathFromRoot = DirectoryManager.getDirectoryPath(((ClassDoc) doc).containingPackage());
+            redirectPathFromRoot = DocPath.forPackage(((ClassDoc) doc).containingPackage());
         } else if (doc instanceof MemberDoc) {
-            redirectPathFromRoot = DirectoryManager.getDirectoryPath(((MemberDoc) doc).containingPackage());
+            redirectPathFromRoot = DocPath.forPackage(((MemberDoc) doc).containingPackage());
         } else if (doc instanceof PackageDoc) {
-            redirectPathFromRoot = DirectoryManager.getDirectoryPath((PackageDoc) doc);
+            redirectPathFromRoot = DocPath.forPackage((PackageDoc) doc);
         } else {
             return text;
         }
 
-        if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPARATOR)) {
-            redirectPathFromRoot += DirectoryManager.URL_FILE_SEPARATOR;
-        }
-
         //Redirect all relative links.
         int end, begin = text.toLowerCase().indexOf("<a");
         if(begin >= 0){
@@ -1627,22 +1586,21 @@
                     //might be missing '>' character because the href has an inline tag.
                     break;
                 }
-                if(textBuff.substring(begin, end).indexOf("\"") != -1){
+                if (textBuff.substring(begin, end).indexOf("\"") != -1){
                     begin = textBuff.indexOf("\"", begin) + 1;
                     end = textBuff.indexOf("\"", begin +1);
-                    if(begin == 0 || end == -1){
+                    if (begin == 0 || end == -1){
                         //Link is missing a quote.
                         break;
                     }
                 }
                 String relativeLink = textBuff.substring(begin, end);
-                if(!(relativeLink.toLowerCase().startsWith("mailto:") ||
-                     relativeLink.toLowerCase().startsWith("http:") ||
-                     relativeLink.toLowerCase().startsWith("https:") ||
-                     relativeLink.toLowerCase().startsWith("file:"))){
-                     relativeLink = "{@"+(new DocRootTaglet()).getName() + "}"
-                        + redirectPathFromRoot
-                        + relativeLink;
+                if (!(relativeLink.toLowerCase().startsWith("mailto:") ||
+                        relativeLink.toLowerCase().startsWith("http:") ||
+                        relativeLink.toLowerCase().startsWith("https:") ||
+                        relativeLink.toLowerCase().startsWith("file:"))) {
+                    relativeLink = "{@"+(new DocRootTaglet()).getName() + "}/"
+                        + redirectPathFromRoot.resolve(relativeLink).getPath();
                     textBuff.replace(begin, end, relativeLink);
                 }
                 begin = textBuff.toString().toLowerCase().indexOf("<a", begin + 1);
@@ -1714,18 +1672,17 @@
      * @return an HtmlTree for the lINK tag which provides the stylesheet location
      */
     public HtmlTree getStyleSheetProperties() {
-        String filename = configuration.stylesheetfile;
-        if (filename.length() > 0) {
-            File stylefile = new File(filename);
-            String parent = stylefile.getParent();
-            filename = (parent == null)?
-                filename:
-                filename.substring(parent.length() + 1);
+        String stylesheetfile = configuration.stylesheetfile;
+        DocPath stylesheet;
+        if (stylesheetfile.isEmpty()) {
+            stylesheet = DocPaths.STYLESHEET;
         } else {
-            filename = "stylesheet.css";
+            DocFile file = DocFile.createFileForInput(configuration, stylesheetfile);
+            stylesheet = DocPath.create(file.getName());
         }
-        filename = relativePath + filename;
-        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style");
+        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css",
+                pathToRoot.resolve(stylesheet).getPath(),
+                "Style");
         return link;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -78,11 +78,12 @@
         LinkOutputImpl linkOutput = new LinkOutputImpl();
         if (classDoc.isIncluded()) {
             if (configuration.isGeneratedDoc(classDoc)) {
-                String filename = pathString(classLinkInfo);
+                DocPath filename = getPath(classLinkInfo);
                 if (linkInfo.linkToSelf ||
-                                !(linkInfo.classDoc.name() + ".html").equals(m_writer.filename)) {
-                        linkOutput.append(m_writer.getHyperLinkString(filename,
-                            classLinkInfo.where, label.toString(),
+                                !(DocPath.forName(classDoc)).equals(m_writer.filename)) {
+                        linkOutput.append(m_writer.getHyperLinkString(
+                                filename.fragment(classLinkInfo.where),
+                            label.toString(),
                             classLinkInfo.isStrong, classLinkInfo.styleName,
                             title, classLinkInfo.target));
                         if (noLabel && !classLinkInfo.excludeTypeParameterLinks) {
@@ -161,16 +162,12 @@
      *
      * @param linkInfo the information about the link.
      */
-    private String pathString(LinkInfoImpl linkInfo) {
+    private DocPath getPath(LinkInfoImpl linkInfo) {
         if (linkInfo.context == LinkInfoImpl.PACKAGE_FRAME) {
             //Not really necessary to do this but we want to be consistent
             //with 1.4.2 output.
-            return linkInfo.classDoc.name() + ".html";
+            return DocPath.forName(linkInfo.classDoc);
         }
-        StringBuilder buf = new StringBuilder(m_writer.relativePath);
-        buf.append(DirectoryManager.getPathToPackage(
-            linkInfo.classDoc.containingPackage(),
-            linkInfo.classDoc.name() + ".html"));
-        return buf.toString();
+        return m_writer.pathToRoot.resolve(DocPath.forClass(linkInfo.classDoc));
     }
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -400,7 +400,7 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", (cd == null)?
+            return writer.getHyperLink((cd == null)?
                 "method_summary":
                 "methods_inherited_from_class_" +
                 configuration().getClassName(cd),
@@ -415,7 +415,7 @@
      */
     protected void addNavDetailLink(boolean link, Content liNav) {
         if (link) {
-            liNav.addContent(writer.getHyperLink("", "method_detail",
+            liNav.addContent(writer.getHyperLink("method_detail",
                     writer.getResource("doclet.navMethod")));
         } else {
             liNav.addContent(writer.getResource("doclet.navMethod"));
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -203,9 +203,8 @@
      */
     protected Content getNavSummaryLink(ClassDoc cd, boolean link) {
         if (link) {
-            return writer.getHyperLink("", (cd == null) ? "nested_class_summary":
-                "nested_classes_inherited_from_class_" +
-                cd.qualifiedName(),
+            return writer.getHyperLink((cd == null) ? "nested_class_summary":
+                "nested_classes_inherited_from_class_" + cd.qualifiedName(),
                 writer.getResource("doclet.navNested"));
         } else {
             return writer.getResource("doclet.navNested");
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -60,17 +60,12 @@
     private Set<ClassDoc> documentedClasses;
 
     /**
-     * The name of the output file.
-     */
-    public static final String OUTPUT_FILE_NAME = "package-frame.html";
-
-    /**
      * Constructor to construct PackageFrameWriter object and to generate
      * "package-frame.html" file in the respective package directory.
      * For example for package "java.lang" this will generate file
      * "package-frame.html" file in the "java/lang" directory. It will also
      * create "java/lang" directory in the current or the destination directory
-     * if it doesen't exist.
+     * if it doesn't exist.
      *
      * @param configuration the configuration of the doclet.
      * @param packageDoc PackageDoc under consideration.
@@ -78,7 +73,7 @@
     public PackageFrameWriter(ConfigurationImpl configuration,
                               PackageDoc packageDoc)
                               throws IOException {
-        super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc));
+        super(configuration, DocPath.forPackage(packageDoc).resolve(DocPaths.PACKAGE_FRAME));
         this.packageDoc = packageDoc;
         if (configuration.root.specifiedPackages().length == 0) {
             documentedClasses = new HashSet<ClassDoc>(Arrays.asList(configuration.root.classes()));
@@ -113,7 +108,7 @@
         } catch (IOException exc) {
             configuration.standardmessage.error(
                     "doclet.exception_encountered",
-                    exc.toString(), OUTPUT_FILE_NAME);
+                    exc.toString(), DocPaths.PACKAGE_FRAME.getPath());
             throw new DocletAbortException();
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -52,7 +52,7 @@
      * @param filename Name of the package index file to be generated.
      */
     public PackageIndexFrameWriter(ConfigurationImpl configuration,
-                                   String filename) throws IOException {
+                                   DocPath filename) throws IOException {
         super(configuration, filename);
     }
 
@@ -62,7 +62,7 @@
      */
     public static void generate(ConfigurationImpl configuration) {
         PackageIndexFrameWriter packgen;
-        String filename = "overview-frame.html";
+        DocPath filename = DocPaths.OVERVIEW_FRAME;
         try {
             packgen = new PackageIndexFrameWriter(configuration, filename);
             packgen.buildPackageIndexFile("doclet.Window_Overview", false);
@@ -109,12 +109,12 @@
         if (pd.name().length() > 0) {
             packageLabel = getPackageLabel(pd.name());
             packageLinkContent = getHyperLink(pathString(pd,
-                    "package-frame.html"), "", packageLabel, "",
+                     DocPaths.PACKAGE_FRAME), packageLabel, "",
                     "packageFrame");
         } else {
             packageLabel = new RawHtml("&lt;unnamed package&gt;");
-            packageLinkContent = getHyperLink("package-frame.html",
-                    "", packageLabel, "", "packageFrame");
+            packageLinkContent = getHyperLink(DocPaths.PACKAGE_FRAME,
+                    packageLabel, "", "packageFrame");
         }
         Content li = HtmlTree.LI(packageLinkContent);
         return li;
@@ -148,7 +148,7 @@
      * @param body the Content object to which the all classes link should be added
      */
     protected void addAllClassesLink(Content body) {
-        Content linkContent = getHyperLink("allclasses-frame.html", "",
+        Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
                 allclassesLabel, "", "packageFrame");
         Content div = HtmlTree.DIV(HtmlStyle.indexHeader, linkContent);
         body.addContent(div);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -36,7 +36,7 @@
 /**
  * Generate the package index page "overview-summary.html" for the right-hand
  * frame. A click on the package name on this page will update the same frame
- * with the "pacakge-summary.html" file for the clicked package.
+ * with the "package-summary.html" file for the clicked package.
  *
  *  <p><b>This is NOT part of any supported API.
  *  If you write code that depends on this, you do so at your own risk.
@@ -73,7 +73,7 @@
      * @see Group
      */
     public PackageIndexWriter(ConfigurationImpl configuration,
-                              String filename)
+                              DocPath filename)
                        throws IOException {
         super(configuration, filename);
         this.root = configuration.root;
@@ -88,7 +88,7 @@
      */
     public static void generate(ConfigurationImpl configuration) {
         PackageIndexWriter packgen;
-        String filename = "overview-summary.html";
+        DocPath filename = DocPaths.OVERVIEW_SUMMARY;
         try {
             packgen = new PackageIndexWriter(configuration, filename);
             packgen.buildPackageIndexFile("doclet.Window_Overview_Summary", true);
@@ -178,7 +178,7 @@
             Content see = seeLabel;
             see.addContent(" ");
             Content descPara = HtmlTree.P(see);
-            Content descLink = getHyperLink("", "overview_description",
+            Content descLink = getHyperLink(DocLink.fragment("overview_description"),
                 descriptionLabel, "", "");
             descPara.addContent(descLink);
             div.addContent(descPara);
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -67,15 +67,14 @@
      * @throws DocletAbortException
      */
     public PackageTreeWriter(ConfigurationImpl configuration,
-                             String path, String filename,
+                             DocPath path,
                              PackageDoc packagedoc,
                              PackageDoc prev, PackageDoc next)
                       throws IOException {
-        super(configuration, path, filename,
+        super(configuration, path,
               new ClassTree(
                 configuration.classDocCatalog.allClasses(packagedoc),
-                configuration),
-              packagedoc);
+                configuration));
         this.packagedoc = packagedoc;
         this.prev = prev;
         this.next = next;
@@ -96,17 +95,16 @@
                                 PackageDoc pkg, PackageDoc prev,
                                 PackageDoc next, boolean noDeprecated) {
         PackageTreeWriter packgen;
-        String path = DirectoryManager.getDirectoryPath(pkg);
-        String filename = "package-tree.html";
+        DocPath path = DocPath.forPackage(pkg).resolve(DocPaths.PACKAGE_TREE);
         try {
-            packgen = new PackageTreeWriter(configuration, path, filename, pkg,
+            packgen = new PackageTreeWriter(configuration, path, pkg,
                 prev, next);
             packgen.generatePackageTreeFile();
             packgen.close();
         } catch (IOException exc) {
             configuration.standardmessage.error(
                         "doclet.exception_encountered",
-                        exc.toString(), filename);
+                        exc.toString(), path.getPath());
             throw new DocletAbortException();
         }
     }
@@ -175,9 +173,8 @@
         if (prev == null) {
             return getNavLinkPrevious(null);
         } else {
-            String path = DirectoryManager.getRelativePath(packagedoc.name(),
-                    prev.name());
-            return getNavLinkPrevious(path + "package-tree.html");
+            DocPath path = DocPath.relativePath(packagedoc, prev);
+            return getNavLinkPrevious(path.resolve(DocPaths.PACKAGE_TREE));
         }
     }
 
@@ -190,9 +187,8 @@
         if (next == null) {
             return getNavLinkNext(null);
         } else {
-            String path = DirectoryManager.getRelativePath(packagedoc.name(),
-                    next.name());
-            return getNavLinkNext(path + "package-tree.html");
+            DocPath path = DocPath.relativePath(packagedoc, next);
+            return getNavLinkNext(path.resolve(DocPaths.PACKAGE_TREE));
         }
     }
 
@@ -202,7 +198,7 @@
      * @return a content tree for the package link
      */
     protected Content getNavLinkPackage() {
-        Content linkContent = getHyperLink("package-summary.html", "",
+        Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
                 packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -57,11 +57,9 @@
      * @throws DocletAbortException
      */
     public PackageUseWriter(ConfigurationImpl configuration,
-                            ClassUseMapper mapper, String filename,
+                            ClassUseMapper mapper, DocPath filename,
                             PackageDoc pkgdoc) throws IOException {
-        super(configuration, DirectoryManager.getDirectoryPath(pkgdoc),
-              filename,
-              DirectoryManager.getRelativePath(pkgdoc.name()));
+        super(configuration, DocPath.forPackage(pkgdoc).resolve(filename));
         this.pkgdoc = pkgdoc;
 
         // by examining all classes in this package, find what packages
@@ -98,7 +96,7 @@
     public static void generate(ConfigurationImpl configuration,
                                 ClassUseMapper mapper, PackageDoc pkgdoc) {
         PackageUseWriter pkgusegen;
-        String filename = "package-use.html";
+        DocPath filename = DocPaths.PACKAGE_USE;
         try {
             pkgusegen = new PackageUseWriter(configuration,
                                              mapper, filename, pkgdoc);
@@ -232,10 +230,10 @@
      */
     protected void addClassRow(ClassDoc usedClass, String packageName,
             Content contentTree) {
-        String path = pathString(usedClass,
-                "class-use/" + usedClass.name() + ".html");
+        DocPath dp = pathString(usedClass,
+                DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass)));
         Content td = HtmlTree.TD(HtmlStyle.colOne,
-                getHyperLink(path, packageName, new StringContent(usedClass.name())));
+                getHyperLink(dp.fragment(packageName), new StringContent(usedClass.name())));
         addIndexComment(usedClass, td);
         contentTree.addContent(td);
     }
@@ -248,7 +246,7 @@
      */
     protected void addPackageUse(PackageDoc pkg, Content contentTree) throws IOException {
         Content tdFirst = HtmlTree.TD(HtmlStyle.colFirst,
-                getHyperLink("", Util.getPackageName(pkg),
+                getHyperLink(Util.getPackageName(pkg),
                 new RawHtml(Util.getPackageName(pkg))));
         contentTree.addContent(tdFirst);
         HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
@@ -288,7 +286,7 @@
      * @return a content tree for the package link
      */
     protected Content getNavLinkPackage() {
-        Content linkContent = getHyperLink("package-summary.html", "",
+        Content linkContent = getHyperLink(DocPaths.PACKAGE_SUMMARY,
                 packageLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
@@ -310,7 +308,7 @@
      * @return a content tree for the tree link
      */
     protected Content getNavLinkTree() {
-        Content linkContent = getHyperLink("package-tree.html", "",
+        Content linkContent = getHyperLink(DocPaths.PACKAGE_TREE,
                 treeLabel);
         Content li = HtmlTree.LI(linkContent);
         return li;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -65,17 +65,12 @@
     protected PackageDoc packageDoc;
 
     /**
-     * The name of the output file.
-     */
-    private static final String OUTPUT_FILE_NAME = "package-summary.html";
-
-    /**
      * Constructor to construct PackageWriter object and to generate
      * "package-summary.html" file in the respective package directory.
      * For example for package "java.lang" this will generate file
      * "package-summary.html" file in the "java/lang" directory. It will also
      * create "java/lang" directory in the current or the destination directory
-     * if it doesen't exist.
+     * if it doesn't exist.
      *
      * @param configuration the configuration of the doclet.
      * @param packageDoc    PackageDoc under consideration.
@@ -83,25 +78,15 @@
      * @param next            Next package in the sorted array.
      */
     public PackageWriterImpl(ConfigurationImpl configuration,
-        PackageDoc packageDoc, PackageDoc prev, PackageDoc next)
-    throws IOException {
-        super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME,
-             DirectoryManager.getRelativePath(packageDoc.name()));
+            PackageDoc packageDoc, PackageDoc prev, PackageDoc next)
+            throws IOException {
+        super(configuration, DocPath.forPackage(packageDoc).resolve(DocPaths.PACKAGE_SUMMARY));
         this.prev = prev;
         this.next = next;
         this.packageDoc = packageDoc;
     }
 
     /**
-     * Return the name of the output file.
-     *
-     * @return the name of the output file.
-     */
-    public String getOutputFileName() {
-        return OUTPUT_FILE_NAME;
-    }
-
-    /**
      * {@inheritDoc}
      */
     public Content getPackageHeader(String heading) {
@@ -127,7 +112,7 @@
             addSummaryComment(packageDoc, docSummaryDiv);
             div.addContent(docSummaryDiv);
             Content space = getSpace();
-            Content descLink = getHyperLink("", "package_description",
+            Content descLink = getHyperLink(DocLink.fragment("package_description"),
                     descriptionLabel, "", "");
             Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink);
             div.addContent(descPara);
@@ -265,7 +250,7 @@
      * @return a content tree for the class use link
      */
     protected Content getNavLinkClassUse() {
-        Content useLink = getHyperLink("package-use.html", "",
+        Content useLink = getHyperLink(DocPaths.PACKAGE_USE,
                 useLabel, "", "");
         Content li = HtmlTree.LI(useLink);
         return li;
@@ -281,9 +266,8 @@
         if (prev == null) {
             li = HtmlTree.LI(prevpackageLabel);
         } else {
-            String path = DirectoryManager.getRelativePath(packageDoc.name(),
-                                                           prev.name());
-            li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "",
+            DocPath path = DocPath.relativePath(packageDoc, prev);
+            li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY),
                 prevpackageLabel, "", ""));
         }
         return li;
@@ -299,9 +283,8 @@
         if (next == null) {
             li = HtmlTree.LI(nextpackageLabel);
         } else {
-            String path = DirectoryManager.getRelativePath(packageDoc.name(),
-                                                           next.name());
-            li = HtmlTree.LI(getHyperLink(path + "package-summary.html", "",
+            DocPath path = DocPath.relativePath(packageDoc, next);
+            li = HtmlTree.LI(getHyperLink(path.resolve(DocPaths.PACKAGE_SUMMARY),
                 nextpackageLabel, "", ""));
         }
         return li;
@@ -314,7 +297,7 @@
      * @return a content tree for the tree link
      */
     protected Content getNavLinkTree() {
-        Content useLink = getHyperLink("package-tree.html", "",
+        Content useLink = getHyperLink(DocPaths.PACKAGE_TREE,
                 treeLabel, "", "");
         Content li = HtmlTree.LI(useLink);
         return li;
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -29,6 +29,7 @@
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.DocPaths;
 import com.sun.tools.doclets.internal.toolkit.util.DocletAbortException;
 
 /**
@@ -44,14 +45,12 @@
 public class SerializedFormWriterImpl extends SubWriterHolderWriter
     implements SerializedFormWriter {
 
-    private static final String FILE_NAME = "serialized-form.html";
-
     /**
      * @throws IOException
      * @throws DocletAbortException
      */
     public SerializedFormWriterImpl() throws IOException {
-        super(ConfigurationImpl.getInstance(), FILE_NAME);
+        super(ConfigurationImpl.getInstance(), DocPaths.SERIALIZED_FORM);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -55,11 +55,9 @@
      * @param indexbuilder Unicode based Index from {@link IndexBuilder}
      */
     public SingleIndexWriter(ConfigurationImpl configuration,
-                             String filename,
+                             DocPath filename,
                              IndexBuilder indexbuilder) throws IOException {
         super(configuration, filename, indexbuilder);
-        relativepathNoSlash = ".";
-        relativePath = "./";
     }
 
     /**
@@ -71,7 +69,7 @@
     public static void generate(ConfigurationImpl configuration,
                                 IndexBuilder indexbuilder) {
         SingleIndexWriter indexgen;
-        String filename = "index-all.html";
+        DocPath filename = DocPaths.INDEX_ALL;
         try {
             indexgen = new SingleIndexWriter(configuration,
                                              filename, indexbuilder);
@@ -117,7 +115,7 @@
         for (int i = 0; i < indexbuilder.elements().length; i++) {
             String unicode = (indexbuilder.elements())[i].toString();
             contentTree.addContent(
-                    getHyperLink("#_" + unicode + "_", new StringContent(unicode)));
+                    getHyperLink("_" + unicode + "_", new StringContent(unicode)));
             contentTree.addContent(getSpace());
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -26,11 +26,13 @@
 package com.sun.tools.doclets.formats.html;
 
 import java.io.*;
+
 import javax.tools.FileObject;
+
 import com.sun.javadoc.*;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
-import com.sun.tools.doclets.formats.html.markup.*;
 
 /**
  * Converts Java Source Code to HTML.
@@ -62,7 +64,7 @@
      * Relative path from the documentation root to the file that is being
      * generated.
      */
-    private static String relativePath = "";
+    private static DocPath relativePath = DocPath.empty;
 
     /**
      * Source is converted to HTML using static methods below.
@@ -77,7 +79,7 @@
      * @param outputdir the name of the directory to output to.
      */
     public static void convertRoot(ConfigurationImpl configuration, RootDoc rd,
-            String outputdir) {
+            DocPath outputdir) {
         if (rd == null || outputdir == null) {
             return;
         }
@@ -95,8 +97,7 @@
             // package files to HTML.
             if (!(configuration.nodeprecated &&
                     (Util.isDeprecated(cds[i]) || Util.isDeprecated(cds[i].containingPackage()))))
-                convertClass(configuration, cds[i],
-                        getPackageOutputDir(outputdir, cds[i].containingPackage()));
+                convertClass(configuration, cds[i], outputdir);
         }
     }
 
@@ -108,11 +109,10 @@
      * @param outputdir the name of the directory to output to.
      */
     public static void convertPackage(ConfigurationImpl configuration, PackageDoc pd,
-            String outputdir) {
-        if (pd == null || outputdir == null) {
+            DocPath outputdir) {
+        if (pd == null) {
             return;
         }
-        String classOutputdir = getPackageOutputDir(outputdir, pd);
         ClassDoc[] cds = pd.allClasses();
         for (int i = 0; i < cds.length; i++) {
             // If -nodeprecated option is set and the class is marked as deprecated,
@@ -120,23 +120,11 @@
             // containing package deprecation since it is already check in
             // the calling method above.
             if (!(configuration.nodeprecated && Util.isDeprecated(cds[i])))
-                convertClass(configuration, cds[i], classOutputdir);
+                convertClass(configuration, cds[i], outputdir);
         }
     }
 
     /**
-     * Return the directory write output to for the given package.
-     *
-     * @param outputDir the directory to output to.
-     * @param pd the Package to generate output for.
-     * @return the package output directory as a String.
-     */
-    private static String getPackageOutputDir(String outputDir, PackageDoc pd) {
-        return outputDir + File.separator +
-            DirectoryManager.getDirectoryPath(pd) + File.separator;
-    }
-
-    /**
      * Convert the given Class to an HTML.
      *
      * @param configuration the configuration.
@@ -144,8 +132,8 @@
      * @param outputdir the name of the directory to output to.
      */
     public static void convertClass(ConfigurationImpl configuration, ClassDoc cd,
-            String outputdir) {
-        if (cd == null || outputdir == null) {
+            DocPath outputdir) {
+        if (cd == null) {
             return;
         }
         try {
@@ -168,8 +156,9 @@
             LineNumberReader reader = new LineNumberReader(r);
             int lineno = 1;
             String line;
-            relativePath = DirectoryManager.getRelativePath(DocletConstants.SOURCE_OUTPUT_DIR_NAME) +
-                    DirectoryManager.getRelativePath(cd.containingPackage());
+            relativePath = DocPaths.SOURCE_OUTPUT
+                    .resolve(DocPath.forPackage(cd))
+                    .invert();
             Content body = getHeader();
             Content pre = new HtmlTree(HtmlTag.PRE);
             try {
@@ -184,8 +173,8 @@
             addBlankLines(pre);
             Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
             body.addContent(div);
-            writeToFile(body, outputdir, cd.name(), configuration);
-        } catch (Exception e){
+            writeToFile(body, outputdir.resolve(DocPath.forClass(cd)), configuration);
+        } catch (IOException e) {
             e.printStackTrace();
         }
     }
@@ -194,12 +183,11 @@
      * Write the output to the file.
      *
      * @param body the documentation content to be written to the file.
-     * @param outputDir the directory to output to.
-     * @param className the name of the class that I am converting to HTML.
+     * @param path the path for the file.
      * @param configuration the Doclet configuration to pass notices to.
      */
-    private static void writeToFile(Content body, String outputDir,
-            String className, ConfigurationImpl configuration) throws IOException {
+    private static void writeToFile(Content body, DocPath path,
+            ConfigurationImpl configuration) throws IOException {
         Content htmlDocType = DocType.Transitional();
         Content head = new HtmlTree(HtmlTag.HEAD);
         head.addContent(HtmlTree.TITLE(new StringContent(
@@ -208,15 +196,15 @@
         Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(),
                 head, body);
         Content htmlDocument = new HtmlDocument(htmlDocType, htmlTree);
-        File dir = new File(outputDir);
-        dir.mkdirs();
-        File newFile = new File(dir, className + ".html");
-        configuration.message.notice("doclet.Generating_0", newFile.getPath());
-        FileOutputStream fout = new FileOutputStream(newFile);
-        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(fout));
-        bw.write(htmlDocument.toString());
-        bw.close();
-        fout.close();
+        configuration.message.notice("doclet.Generating_0", path.getPath());
+        DocFile df = DocFile.createFileForOutput(configuration, path);
+        Writer w = df.openWriter();
+        try {
+            htmlDocument.write(w, true);
+        } finally {
+            w.close();
+        }
+
     }
 
     /**
@@ -227,17 +215,15 @@
      */
     public static HtmlTree getStyleSheetProperties(ConfigurationImpl configuration) {
         String filename = configuration.stylesheetfile;
+        DocPath stylesheet;
         if (filename.length() > 0) {
-            File stylefile = new File(filename);
-            String parent = stylefile.getParent();
-            filename = (parent == null)?
-                filename:
-                filename.substring(parent.length() + 1);
+            DocFile file = DocFile.createFileForInput(configuration, filename);
+            stylesheet = DocPath.create(file.getName());
         } else {
-            filename = "stylesheet.css";
+            stylesheet = DocPaths.STYLESHEET;
         }
-        filename = relativePath + filename;
-        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", filename, "Style");
+        DocPath p = relativePath.resolve(stylesheet);
+        HtmlTree link = HtmlTree.LINK("stylesheet", "text/css", p.getPath(), "Style");
         return link;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -62,15 +62,13 @@
      * from this file.
      *
      * @param path       Path to the file which is getting generated.
-     * @param filename   Name of the file which is getting genrated.
-     * @param relpath    Relative path from this file to the current directory.
      * @param indexbuilder Unicode based Index from {@link IndexBuilder}
      */
     public SplitIndexWriter(ConfigurationImpl configuration,
-                            String path, String filename,
-                            String relpath, IndexBuilder indexbuilder,
+                            DocPath path,
+                            IndexBuilder indexbuilder,
                             int prev, int next) throws IOException {
-        super(configuration, path, filename, relpath, indexbuilder);
+        super(configuration, path, indexbuilder);
         this.prev = prev;
         this.next = next;
     }
@@ -85,17 +83,16 @@
     public static void generate(ConfigurationImpl configuration,
                                 IndexBuilder indexbuilder) {
         SplitIndexWriter indexgen;
-        String filename = "";
-        String path = DirectoryManager.getPath("index-files");
-        String relpath = DirectoryManager.getRelativePath("index-files");
+        DocPath filename = DocPath.empty;
+        DocPath path = DocPaths.INDEX_FILES;
         try {
             for (int i = 0; i < indexbuilder.elements().length; i++) {
                 int j = i + 1;
                 int prev = (j == 1)? -1: i;
                 int next = (j == indexbuilder.elements().length)? -1: j + 1;
-                filename = "index-" + j +".html";
+                filename = DocPaths.indexN(j);
                 indexgen = new SplitIndexWriter(configuration,
-                                                path, filename, relpath,
+                                                path.resolve(filename),
                                                 indexbuilder, prev, next);
                 indexgen.generateIndexFile((Character)indexbuilder.
                                                                  elements()[i]);
@@ -104,7 +101,7 @@
         } catch (IOException exc) {
             configuration.standardmessage.error(
                         "doclet.exception_encountered",
-                        exc.toString(), filename);
+                        exc.toString(), filename.getPath());
             throw new DocletAbortException();
         }
     }
@@ -142,7 +139,7 @@
         Object[] unicodeChars = indexbuilder.elements();
         for (int i = 0; i < unicodeChars.length; i++) {
             int j = i + 1;
-            contentTree.addContent(getHyperLink("index-" + j + ".html",
+            contentTree.addContent(getHyperLink(DocPaths.indexN(j),
                     new StringContent(unicodeChars[i].toString())));
             contentTree.addContent(getSpace());
         }
@@ -159,7 +156,7 @@
             return HtmlTree.LI(prevletterLabel);
         }
         else {
-            Content prevLink = getHyperLink("index-" + prev + ".html", "",
+            Content prevLink = getHyperLink(DocPaths.indexN(prev),
                     prevletterLabel);
             return HtmlTree.LI(prevLink);
         }
@@ -176,7 +173,7 @@
             return HtmlTree.LI(nextletterLabel);
         }
         else {
-            Content nextLink = getHyperLink("index-" + next + ".html","",
+            Content nextLink = getHyperLink(DocPaths.indexN(next),
                     nextletterLabel);
             return HtmlTree.LI(nextLink);
         }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -54,18 +54,11 @@
  */
 public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
 
-    public SubWriterHolderWriter(ConfigurationImpl configuration,
-                                 String filename) throws IOException {
+    public SubWriterHolderWriter(ConfigurationImpl configuration, DocPath filename)
+            throws IOException {
         super(configuration, filename);
     }
 
-
-    public SubWriterHolderWriter(ConfigurationImpl configuration,
-                                 String path, String filename, String relpath)
-                                 throws IOException {
-        super(configuration, path, filename, relpath);
-    }
-
     /**
      * Add the summary header.
      *
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -66,8 +66,10 @@
     public TagletOutput getDocRootOutput() {
         if (htmlWriter.configuration.docrootparent.length() > 0)
             return new TagletOutputImpl(htmlWriter.configuration.docrootparent);
+        else if (htmlWriter.pathToRoot.isEmpty())
+            return new TagletOutputImpl(".");
         else
-            return new TagletOutputImpl(htmlWriter.relativepathNoSlash);
+            return new TagletOutputImpl(htmlWriter.pathToRoot.getPath());
     }
 
     /**
@@ -170,19 +172,24 @@
                 htmlWriter instanceof ClassWriterImpl) {
             //Automatically add link to constant values page for constant fields.
             result = addSeeHeader(result);
-            result += htmlWriter.getHyperLinkString(htmlWriter.relativePath +
-                ConfigurationImpl.CONSTANTS_FILE_NAME
-                + "#" + ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName()
-                + "." + ((FieldDoc) holder).name(),
-                htmlWriter.configuration.getText("doclet.Constants_Summary"));
+            DocPath constantsPath =
+                    htmlWriter.pathToRoot.resolve(DocPaths.CONSTANT_VALUES);
+            String whichConstant =
+                    ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName() + "." + ((FieldDoc) holder).name();
+            DocLink link = constantsPath.fragment(whichConstant);
+            result += htmlWriter.getHyperLinkString(link,
+                    htmlWriter.configuration.getText("doclet.Constants_Summary"),
+                    false);
         }
         if (holder.isClass() && ((ClassDoc)holder).isSerializable()) {
             //Automatically add link to serialized form page for serializable classes.
             if ((SerializedFormBuilder.serialInclude(holder) &&
                       SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) {
                 result = addSeeHeader(result);
-                result += htmlWriter.getHyperLinkString(htmlWriter.relativePath + "serialized-form.html",
-                        ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
+                DocPath serialPath = htmlWriter.pathToRoot.resolve(DocPaths.SERIALIZED_FORM);
+                DocLink link = serialPath.fragment(((ClassDoc)holder).qualifiedName());
+                result += htmlWriter.getHyperLinkString(link,
+                        htmlWriter.configuration.getText("doclet.Serialized_Form"), false);
             }
         }
         return result.equals("") ? null : new TagletOutputImpl(result + "</dd>");
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -67,7 +67,7 @@
      * @param classtree the tree being built.
      */
     public TreeWriter(ConfigurationImpl configuration,
-            String filename, ClassTree classtree)
+            DocPath filename, ClassTree classtree)
     throws IOException {
         super(configuration, filename, classtree);
         packages = configuration.packages;
@@ -84,7 +84,7 @@
     public static void generate(ConfigurationImpl configuration,
                                 ClassTree classtree) {
         TreeWriter treegen;
-        String filename = "overview-tree.html";
+        DocPath filename = DocPaths.OVERVIEW_TREE;
         try {
             treegen = new TreeWriter(configuration, filename, classtree);
             treegen.generateTreeFile();
@@ -144,9 +144,9 @@
                         (configuration.nodeprecated && Util.isDeprecated(packages[i]))) {
                     continue;
                 }
-                String link = pathString(packages[i], "package-tree.html");
+                DocPath link = pathString(packages[i], DocPaths.PACKAGE_TREE);
                 Content li = HtmlTree.LI(getHyperLink(
-                        link, "", new StringContent(packages[i].name())));
+                        link, new StringContent(packages[i].name())));
                 if (i < packages.length - 1) {
                     li.addContent(", ");
                 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -31,6 +31,9 @@
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.formats.html.ConfigurationImpl;
 import com.sun.tools.doclets.internal.toolkit.*;
+import com.sun.tools.doclets.internal.toolkit.util.DocLink;
+import com.sun.tools.doclets.internal.toolkit.util.DocPath;
+import com.sun.tools.doclets.internal.toolkit.util.DocPaths;
 
 
 /**
@@ -56,25 +59,11 @@
      *
      * @param filename String file name.
      */
-    public HtmlDocWriter(Configuration configuration,
-                         String filename) throws IOException {
-        super(configuration,
-              null, configuration.destDirName + filename,
-              configuration.docencoding);
-        // use File to normalize file separators
+    public HtmlDocWriter(Configuration configuration, DocPath filename)
+            throws IOException {
+        super(configuration, filename);
         configuration.message.notice("doclet.Generating_0",
-            new File(configuration.destDirName, filename));
-    }
-
-    public HtmlDocWriter(Configuration configuration,
-                         String path, String filename) throws IOException {
-        super(configuration,
-              configuration.destDirName + path, filename,
-              configuration.docencoding);
-        // use File to normalize file separators
-        configuration.message.notice("doclet.Generating_0",
-            new File(configuration.destDirName,
-                    ((path.length() > 0)? path + File.separator: "") + filename));
+            filename.resolveAgainst(configuration.destDirName));
     }
 
     /**
@@ -86,77 +75,99 @@
      * Return Html Hyper Link string.
      *
      * @param link       String name of the file.
-     * @param where      Position of the link in the file. Character '#' is not
-     * needed.
      * @param label      Tag for the link.
      * @param strong       Boolean that sets label to strong.
      * @return String    Hyper Link.
      */
-    public String getHyperLinkString(String link, String where,
+    public String getHyperLinkString(DocPath link,
                                String label, boolean strong) {
-        return getHyperLinkString(link, where, label, strong, "", "", "");
+        return getHyperLinkString(link, label, strong, "", "", "");
     }
 
-    /**
-     * Get Html Hyper Link string.
-     *
-     * @param link       String name of the file.
-     * @param where      Position of the link in the file. Character '#' is not
-     *                   needed.
-     * @param label      Tag for the link.
-     * @param strong       Boolean that sets label to strong.
-     * @param stylename  String style of text defined in style sheet.
-     * @return String    Hyper Link.
-     */
-    public String getHyperLinkString(String link, String where,
-                               String label, boolean strong,
-                               String stylename) {
-        return getHyperLinkString(link, where, label, strong, stylename, "", "");
+    public String getHyperLinkString(DocLink link,
+                               String label, boolean strong) {
+        return getHyperLinkString(link, label, strong, "", "", "");
     }
 
     /**
      * Get Html Hyper Link string.
      *
      * @param link       String name of the file.
+     * @param label      Tag for the link.
+     * @param strong       Boolean that sets label to strong.
+     * @param stylename  String style of text defined in style sheet.
+     * @return String    Hyper Link.
+     */
+    public String getHyperLinkString(DocPath link,
+                               String label, boolean strong,
+                               String stylename) {
+        return getHyperLinkString(link, label, strong, stylename, "", "");
+    }
+
+    public String getHyperLinkString(DocLink link,
+                               String label, boolean strong,
+                               String stylename) {
+        return getHyperLinkString(link, label, strong, stylename, "", "");
+    }
+
+    /**
+     * Get Html Hyper Link string.
+     *
      * @param where      Position of the link in the file. Character '#' is not
      *                   needed.
      * @param label      Tag for the link.
      * @return a content tree for the hyper link
      */
-    public Content getHyperLink(String link, String where,
+    public Content getHyperLink(String where,
                                Content label) {
-        return getHyperLink(link, where, label, "", "");
+        return getHyperLink(DocLink.fragment(where), label, "", "");
     }
 
     /**
      * Get Html Hyper Link string.
      *
      * @param link       String name of the file.
-     * @param where      Position of the link in the file. Character '#' is not
-     *                   needed.
+     * @param label      Tag for the link.
+     * @return a content tree for the hyper link
+     */
+    public Content getHyperLink(DocPath link,
+                               Content label) {
+        return getHyperLink(link, label, "", "");
+    }
+
+    public Content getHyperLink(DocLink link,
+                               Content label) {
+        return getHyperLink(link, label, "", "");
+    }
+
+    /**
+     * Get Html Hyper Link string.
+     *
+     * @param link       String name of the file.
      * @param label      Tag for the link.
      * @param strong       Boolean that sets label to strong.
      * @param stylename  String style of text defined in style sheet.
-     * @param title      String that describes the link's content for accessibility.
+     * @param title      String that describes the links content for accessibility.
      * @param target     Target frame.
      * @return String    Hyper Link.
      */
-    public String getHyperLinkString(String link, String where,
+    public String getHyperLinkString(DocPath link,
+                               String label, boolean strong,
+                               String stylename, String title, String target) {
+        return getHyperLinkString(new DocLink(link), label, strong,
+                stylename, title, target);
+    }
+
+    public String getHyperLinkString(DocLink link,
                                String label, boolean strong,
                                String stylename, String title, String target) {
         StringBuilder retlink = new StringBuilder();
-        retlink.append("<a href=\"");
-        retlink.append(link);
-        if (where != null && where.length() != 0) {
-            retlink.append("#");
-            retlink.append(where);
-        }
-        retlink.append("\"");
+        retlink.append("<a href=\"").append(link).append('"');
         if (title != null && title.length() != 0) {
-            retlink.append(" title=\"").append(title).append("\"");
+            retlink.append(" title=\"").append(title).append('"');
         }
         if (target != null && target.length() != 0) {
-            retlink.append(" target=\"").append(target).append("\"");
+            retlink.append(" target=\"").append(target).append('"');
         }
         retlink.append(">");
         if (stylename != null && stylename.length() != 0) {
@@ -182,19 +193,19 @@
      * Get Html Hyper Link.
      *
      * @param link       String name of the file.
-     * @param where      Position of the link in the file. Character '#' is not
-     *                   needed.
      * @param label      Tag for the link.
      * @param title      String that describes the link's content for accessibility.
      * @param target     Target frame.
      * @return a content tree for the hyper link.
      */
-    public Content getHyperLink(String link, String where,
+    public Content getHyperLink(DocPath link,
             Content label, String title, String target) {
-        if (where != null && where.length() != 0) {
-            link += "#" + where;
-        }
-        HtmlTree anchor = HtmlTree.A(link, label);
+        return getHyperLink(new DocLink(link), label, title, target);
+    }
+
+    public Content getHyperLink(DocLink link,
+            Content label, String title, String target) {
+        HtmlTree anchor = HtmlTree.A(link.toString(), label);
         if (title != null && title.length() != 0) {
             anchor.addAttr(HtmlAttr.TITLE, title);
         }
@@ -205,25 +216,14 @@
     }
 
     /**
-     * Get a hyperlink to a file.
-     *
-     * @param link String name of the file
-     * @param label Label for the link
-     * @return a content for the hyperlink to the file
-     */
-    public Content getHyperLink(String link, Content label) {
-        return getHyperLink(link, "", label);
-    }
-
-    /**
      * Get link string without positioning in the file.
      *
      * @param link       String name of the file.
      * @param label      Tag for the link.
      * @return Strign    Hyper link.
      */
-    public String getHyperLinkString(String link, String label) {
-        return getHyperLinkString(link, "", label, false);
+    public String getHyperLinkString(DocPath link, String label) {
+        return getHyperLinkString(link, label, false);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -47,22 +47,11 @@
 public class HtmlWriter {
 
     /**
-     * Name of the file, to which this writer is writing to.
-     */
-    protected final String htmlFilename;
-
-    /**
      * The window title of this file
      */
     protected String winTitle;
 
     /**
-     * URL file separator string("/").
-     */
-    public static final String fileseparator =
-         DirectoryManager.URL_FILE_SEPARATOR;
-
-    /**
      * The configuration
      */
     protected Configuration configuration;
@@ -160,20 +149,15 @@
      *
      * @param path The directory path to be created for this file
      *             or null if none to be created.
-     * @param filename File Name to which the PrintWriter will
-     *                 do the Output.
-     * @param docencoding Encoding to be used for this file.
      * @exception IOException Exception raised by the FileWriter is passed on
      * to next level.
      * @exception UnsupportedEncodingException Exception raised by the
      * OutputStreamWriter is passed on to next level.
      */
-    public HtmlWriter(Configuration configuration,
-                      String path, String filename, String docencoding)
-                      throws IOException, UnsupportedEncodingException {
-        writer = Util.genWriter(configuration, path, filename, docencoding);
+    public HtmlWriter(Configuration configuration, DocPath path)
+            throws IOException, UnsupportedEncodingException {
+        writer = DocFile.createFileForOutput(configuration, path).openWriter();
         this.configuration = configuration;
-        htmlFilename = filename;
         this.memberDetailsListPrinted = false;
         packageTableHeader = new String[] {
             configuration.getText("doclet.Package"),
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Wed Nov 14 16:41:12 2012 -0800
@@ -41,32 +41,21 @@
 doclet.Help=Help
 doclet.Skip_navigation_links=Skip navigation links
 doclet.New_Page=NewPage
-doclet.None=None
-doclet.Factory_Method_Detail=Static Factory Method Detail
 doclet.navDeprecated=Deprecated
-doclet.Deprecated_List=Deprecated List
 doclet.Window_Deprecated_List=Deprecated List
-doclet.Note_0_is_deprecated=Note: {0} is deprecated.
 doclet.Overrides=Overrides:
 doclet.in_class=in class
-doclet.0_Fields_and_Methods=&quot;{0}&quot; Fields and Methods
-doclet.Index_of_Fields_and_Methods=Index of Fields and Methods
 doclet.Static_variable_in=Static variable in {0}
 doclet.Variable_in=Variable in {0}
 doclet.Constructor_for=Constructor for {0}
 doclet.Static_method_in=Static method in {0}
 doclet.Method_in=Method in {0}
-doclet.throws=throws
 doclet.package=package
 doclet.MalformedURL=Malformed URL: {0}
 doclet.File_error=Error reading file: {0}
 doclet.URL_error=Error fetching URL: {0}
-doclet.No_Package_Comment_File=For Package {0} Package.Comment file not found
-doclet.No_Source_For_Class=Source information for class {0} not available.
 doclet.see.class_or_package_not_found=Tag {0}: reference not found: {1}
 doclet.see.class_or_package_not_accessible=Tag {0}: reference not accessible: {1}
-doclet.see.malformed_tag=Tag {0}: Malformed: {1}
-doclet.Inherited_API_Summary=Inherited API Summary
 doclet.Deprecated_API=Deprecated API
 doclet.Deprecated_Packages=Deprecated Packages
 doclet.Deprecated_Classes=Deprecated Classes
@@ -92,10 +81,7 @@
 doclet.deprecated_methods=deprecated methods
 doclet.deprecated_enum_constants=deprecated enum constants
 doclet.deprecated_annotation_type_members=deprecated annotation type elements
-doclet.Frame_Output=Frame Output
-doclet.Docs_generated_by_Javadoc=Documentation generated by Javadoc.
 doclet.Generated_Docs_Untitled=Generated Documentation (Untitled)
-doclet.Blank=Blank
 doclet.Other_Packages=Other Packages
 doclet.Package_Description=Package {0} Description
 doclet.Description=Description
@@ -105,32 +91,22 @@
 doclet.Subinterfaces=All Known Subinterfaces:
 doclet.Implementing_Classes=All Known Implementing Classes:
 doclet.also=also
-doclet.Option=Option
-doclet.Or=Or
 doclet.Frames=Frames
 doclet.No_Frames=No Frames
 doclet.Package_Hierarchies=Package Hierarchies:
 doclet.Hierarchy_For_Package=Hierarchy For Package {0}
-doclet.Source_Code=Source Code:
 doclet.Hierarchy_For_All_Packages=Hierarchy For All Packages
-doclet.Cannot_handle_no_packages=Cannot handle no packages.
 doclet.Frame_Alert=Frame Alert
-doclet.Overview-Member-Frame=Overview Member Frame
 doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to {0}.
 doclet.No_Script_Message=JavaScript is disabled on your browser.
 doclet.Non_Frame_Version=Non-frame version
-doclet.Frame_Version=Frame version
-doclet.Following_From_Class=Following copied from class: {0}
-doclet.Following_From_Interface=Following copied from interface: {0}
 doclet.Description_From_Interface=Description copied from interface:
 doclet.Description_From_Class=Description copied from class:
-doclet.Standard_doclet_invoked=Standard doclet invoked...
 doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document.
 doclet.Interfaces_Italic=Interfaces (italic)
 doclet.Enclosing_Class=Enclosing class:
 doclet.Enclosing_Interface=Enclosing interface:
 doclet.Window_Source_title=Source code
-doclet.Help_title=API Help
 doclet.Window_Help_title=API Help
 doclet.Help_line_1=How This API Document Is Organized
 doclet.Help_line_2=This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
@@ -168,19 +144,6 @@
 doclet.Help_annotation_type_line_1=Each annotation type has its own separate page with the following sections:
 doclet.Help_annotation_type_line_2=Annotation Type declaration
 doclet.Help_annotation_type_line_3=Annotation Type description
-doclet.Style_line_1=Javadoc style sheet
-doclet.Style_line_2=Define colors, fonts and other style attributes here to override the defaults
-doclet.Style_line_3=Page background color
-doclet.Style_Headings=Headings
-doclet.Style_line_4=Table colors
-doclet.Style_line_5=Dark mauve
-doclet.Style_line_6=Light mauve
-doclet.Style_line_7=White
-doclet.Style_line_8=Font used in left-hand frame lists
-doclet.Style_line_9=Example of smaller, sans-serif font in frames
-doclet.Style_line_10=Navigation bar fonts and colors
-doclet.Style_line_11=Dark Blue
-doclet.Style_line_12=Table caption style
 doclet.ClassUse_Packages.that.use.0=Packages that use {0}
 doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1}
 doclet.ClassUse_Classes.in.0.used.by.1=Classes in {0} used by {1}
@@ -210,12 +173,9 @@
 doclet.Window_ClassUse_Header=Uses of {0} {1}
 doclet.ClassUse_Title=Uses of {0}<br>{1}
 doclet.navClassUse=Use
-doclet.link_option_twice=Extern URL link option (link or linkoffline) used twice.
 doclet.Error_in_packagelist=Error in using -group option: {0} {1}
 doclet.Groupname_already_used=In -group option, groupname already used: {0}
 doclet.Same_package_name_used=Package name format used twice: {0}
-doclet.Serialization.Excluded_Class=Non-transient field {1} uses excluded class {0}.
-doclet.Serialization.Nonexcluded_Class=Non-transient field {1} uses hidden, non-included class {0}.
 doclet.exception_encountered=Exception encountered while processing {1}\n{0}
 doclet.usage=Provided by Standard doclet:\n\
   -d <directory>                    Destination directory for output files\n\
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java	Wed Nov 14 16:41:12 2012 -0800
@@ -106,7 +106,7 @@
 
     /**
      * Start the generation of files. Call generate methods in the individual
-     * writers, which will in turn genrate the documentation files. Call the
+     * writers, which will in turn generate the documentation files. Call the
      * TreeWriter generation first to ensure the Class Hierarchy is built
      * first and then can be used in the later generation.
      *
@@ -124,17 +124,7 @@
         ClassTree classtree = new ClassTree(configuration, configuration.nodeprecated);
 
         generateClassFiles(root, classtree);
-        if (configuration.sourcepath != null && configuration.sourcepath.length() > 0) {
-            StringTokenizer pathTokens = new StringTokenizer(configuration.sourcepath,
-                String.valueOf(File.pathSeparatorChar));
-            boolean first = true;
-            while(pathTokens.hasMoreTokens()){
-                Util.copyDocFiles(configuration,
-                    pathTokens.nextToken() + File.separator,
-                    DocletConstants.DOC_FILES_DIR_NAME, first);
-                first = false;
-            }
-        }
+        Util.copyDocFiles(configuration, DocPaths.DOC_FILES);
 
         PackageListWriter.generate(configuration);
         generatePackageFiles(classtree);
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java	Wed Nov 14 16:41:12 2012 -0800
@@ -408,11 +408,11 @@
                 group.checkPackageGroups(os[1], os[2]);
             } else if (opt.equals("-link")) {
                 String url = os[1];
-                extern.url(url, url, root, false);
+                extern.link(url, url, root, false);
             } else if (opt.equals("-linkoffline")) {
                 String url = os[1];
                 String pkglisturl = os[2];
-                extern.url(url, pkglisturl, root, true);
+                extern.link(url, pkglisturl, root, true);
             }
         }
         if (sourcepath.length() == 0) {
@@ -456,7 +456,7 @@
                 tagletManager.addCustomTag(args[1], tagletpath);
                 continue;
             }
-            String[] tokens = Util.tokenize(args[1],
+            String[] tokens = tokenize(args[1],
                 TagletManager.SIMPLE_TAGLET_OPT_SEPERATOR, 3);
             if (tokens.length == 1) {
                 String tagName = args[1];
@@ -480,6 +480,47 @@
         }
     }
 
+    /**
+     * Given a string, return an array of tokens.  The separator can be escaped
+     * with the '\' character.  The '\' character may also be escaped by the
+     * '\' character.
+     *
+     * @param s         the string to tokenize.
+     * @param separator the separator char.
+     * @param maxTokens the maximum number of tokens returned.  If the
+     *                  max is reached, the remaining part of s is appended
+     *                  to the end of the last token.
+     *
+     * @return an array of tokens.
+     */
+    private String[] tokenize(String s, char separator, int maxTokens) {
+        List<String> tokens = new ArrayList<String>();
+        StringBuilder  token = new StringBuilder ();
+        boolean prevIsEscapeChar = false;
+        for (int i = 0; i < s.length(); i += Character.charCount(i)) {
+            int currentChar = s.codePointAt(i);
+            if (prevIsEscapeChar) {
+                // Case 1:  escaped character
+                token.appendCodePoint(currentChar);
+                prevIsEscapeChar = false;
+            } else if (currentChar == separator && tokens.size() < maxTokens-1) {
+                // Case 2:  separator
+                tokens.add(token.toString());
+                token = new StringBuilder();
+            } else if (currentChar == '\\') {
+                // Case 3:  escape character
+                prevIsEscapeChar = true;
+            } else {
+                // Case 4:  regular character
+                token.appendCodePoint(currentChar);
+            }
+        }
+        if (token.length() > 0) {
+            tokens.add(token.toString());
+        }
+        return tokens.toArray(new String[] {});
+    }
+
     private void addToSet(Set<String> s, String str){
         StringTokenizer st = new StringTokenizer(str, ":");
         String current;
@@ -532,12 +573,12 @@
             String opt = os[0].toLowerCase();
             if (opt.equals("-d")) {
                 String destdirname = addTrailingFileSep(os[1]);
-                File destDir = new File(destdirname);
+                DocFile destDir = DocFile.createFileForDirectory(this, destdirname);
                 if (!destDir.exists()) {
                     //Create the output directory (in case it doesn't exist yet)
                     reporter.printNotice(getText("doclet.dest_dir_create",
                         destdirname));
-                    (new File(destdirname)).mkdirs();
+                    destDir.mkdirs();
                 } else if (!destDir.isDirectory()) {
                     reporter.printError(getText(
                         "doclet.destination_directory_not_directory_0",
@@ -711,7 +752,7 @@
     public InputStream getBuilderXML() throws FileNotFoundException {
         return builderXMLPath == null ?
             Configuration.class.getResourceAsStream(DEFAULT_BUILDER_XML) :
-            new FileInputStream(new File(builderXMLPath));
+            DocFile.createFileForInput(this, builderXMLPath).openInputStream();
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -45,13 +45,6 @@
 public interface PackageSummaryWriter {
 
     /**
-     * Return the name of the output file.
-     *
-     * @return the name of the output file.
-     */
-    public abstract String getOutputFileName();
-
-    /**
      * Get the header for the summary.
      *
      * @param heading Package name.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Wed Nov 14 16:41:12 2012 -0800
@@ -140,12 +140,7 @@
             //Only copy doc files dir if the containing package is not
             //documented AND if we have not documented a class from the same
             //package already. Otherwise, we are making duplicate copies.
-            Util.copyDocFiles(configuration,
-                Util.getPackageSourcePath(configuration,
-                    annotationTypeDoc.containingPackage()) +
-                DirectoryManager.getDirectoryPath(
-                    annotationTypeDoc.containingPackage())
-                    + File.separator, DocletConstants.DOC_FILES_DIR_NAME, true);
+            Util.copyDocFiles(configuration, containingPackage);
             containingPackagesSeen.add(containingPackage.name());
         }
      }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Wed Nov 14 16:41:12 2012 -0800
@@ -266,11 +266,7 @@
             //Only copy doc files dir if the containing package is not
             //documented AND if we have not documented a class from the same
             //package already. Otherwise, we are making duplicate copies.
-            Util.copyDocFiles(configuration,
-                    Util.getPackageSourcePath(configuration,
-                    classDoc.containingPackage()) +
-                    DirectoryManager.getDirectoryPath(classDoc.containingPackage())
-                    + File.separator, DocletConstants.DOC_FILES_DIR_NAME, true);
+            Util.copyDocFiles(configuration, containingPackage);
             containingPackagesSeen.add(containingPackage.name());
         }
      }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Wed Nov 14 16:41:12 2012 -0800
@@ -119,13 +119,7 @@
         packageWriter.addPackageFooter(contentTree);
         packageWriter.printDocument(contentTree);
         packageWriter.close();
-        Util.copyDocFiles(
-                configuration,
-                Util.getPackageSourcePath(configuration, packageDoc),
-                DirectoryManager.getDirectoryPath(packageDoc)
-                        + File.separator
-                        + DocletConstants.DOC_FILES_DIR_NAME,
-                true);
+        Util.copyDocFiles(configuration, packageDoc);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Wed Nov 14 16:41:12 2012 -0800
@@ -474,6 +474,8 @@
         Arrays.sort(tags);
         int tagsLength = tags.length;
         for (int i = 0; i < tagsLength; i++) {
+            if (tags[i].fieldName() == null || tags[i].fieldType() == null) // ignore malformed @serialField tags
+                continue;
             Content fieldsContentTree = fieldWriter.getFieldsContentHeader(
                     (i == tagsLength - 1));
             fieldWriter.addMemberHeader(tags[i].fieldTypeDoc(),
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties	Wed Nov 14 16:41:12 2012 -0800
@@ -21,10 +21,8 @@
 doclet.Copying_File_0_To_File_1=Copying file {0} to file {1}...
 doclet.No_Public_Classes_To_Document=No public or protected classes found to document.
 doclet.Unable_to_create_directory_0=Unable to create directory {0}
-doclet.destination_directory_not_found_0=Destination directory not found {0}
 doclet.destination_directory_not_directory_0=Destination directory is not a directory {0}
 doclet.destination_directory_not_writable_0=Destination directory not writable {0}
-doclet.Error_creating_tmp_file=Error creating temporary file, using default platform encoding.
 doclet.Encoding_not_supported=Encoding not supported: {0}
 doclet.Building_Tree=Building tree for all the packages and classes...
 doclet.Building_Index=Building index for all the packages and classes...
@@ -74,7 +72,6 @@
 doclet.Enum_Constant_Summary=Enum Constant Summary
 doclet.Constructor_Summary=Constructor Summary
 doclet.Method_Summary=Method Summary
-doclet.Factory_Method_Summary=Static Factory Method Summary
 doclet.Interfaces=Interfaces
 doclet.Enums=Enums
 doclet.AnnotationTypes=Annotation Types
@@ -88,7 +85,6 @@
 doclet.All_Implemented_Interfaces=All Implemented Interfaces:
 doclet.All_classes_and_interfaces=All classes and interfaces (except non-static nested types)
 doclet.Package_class_and_interface_descriptions=Package, class and interface descriptions
-doclet.Members=Members
 doclet.Interface=Interface
 doclet.Class=Class
 doclet.AnnotationType=Annotation Type
@@ -107,18 +103,13 @@
 doclet.Exception=Exception
 doclet.exception=exception
 doclet.exceptions=exceptions
-doclet.extended_by=extended by
-doclet.extends=extends
 doclet.Package_private=(package private)
-doclet.implements=implementsdoclet.Same_package_name_used=Package name format used twice: {0}
 doclet.Nested_Classes_Interfaces_Inherited_From_Class=Nested classes/interfaces inherited from class
 doclet.Nested_Classes_Interface_Inherited_From_Interface=Nested classes/interfaces inherited from interface
 doclet.Methods_Inherited_From_Class=Methods inherited from class
 doclet.Methods_Inherited_From_Interface=Methods inherited from interface
 doclet.Fields_Inherited_From_Class=Fields inherited from class
 doclet.Fields_Inherited_From_Interface=Fields inherited from interface
-doclet.Serializable=Serializable
-doclet.Externalizable=Externalizable
 doclet.Annotation_Type_Member_Detail=Element Detail
 doclet.Enum_Constant_Detail=Enum Constant Detail
 doclet.Constants_Summary=Constant Field Values
@@ -126,7 +117,6 @@
 doclet.Method_Detail=Method Detail
 doclet.Constructor_Detail=Constructor Detail
 doclet.Deprecated=Deprecated.
-doclet.Deprecated_class=This class is deprecated.
 doclet.Groupname_already_used=In -group option, groupname already used: {0}
 doclet.value_tag_invalid_reference={0} (referenced by @value tag) is an unknown reference.
 doclet.value_tag_invalid_constant=@value tag (which references {0}) can only be used in constants.
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java	Wed Nov 14 16:41:12 2012 -0800
@@ -161,7 +161,7 @@
      * @param message the message retriever to print warnings.
      */
     public TagletManager(boolean nosince, boolean showversion,
-                         boolean showauthor, MessageRetriever message){
+                         boolean showauthor, MessageRetriever message) {
         overridenStandardTags = new HashSet<String>();
         potentiallyConflictingTags = new HashSet<String>();
         standardTags = new HashSet<String>();
@@ -253,47 +253,17 @@
      * @param path the search path string
      * @return the resulting array of directory and JAR file URLs
      */
-    private static URL[] pathToURLs(String path) {
-        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
-        URL[] urls = new URL[st.countTokens()];
-        int count = 0;
-        while (st.hasMoreTokens()) {
-            URL url = fileToURL(new File(st.nextToken()));
-            if (url != null) {
-                urls[count++] = url;
+    private URL[] pathToURLs(String path) {
+        Set<URL> urls = new LinkedHashSet<URL>();
+        for (String s: path.split(File.pathSeparator)) {
+            if (s.isEmpty()) continue;
+            try {
+                urls.add(new File(s).getAbsoluteFile().toURI().toURL());
+            } catch (MalformedURLException e) {
+                message.error("doclet.MalformedURL", s);
             }
         }
-        urls = Arrays.copyOf(urls, count);
-        return urls;
-    }
-
-    /**
-     * Returns the directory or JAR file URL corresponding to the specified
-     * local file name.
-     *
-     * @param file the File object
-     * @return the resulting directory or JAR file URL, or null if unknown
-     */
-    private static URL fileToURL(File file) {
-        String name;
-        try {
-            name = file.getCanonicalPath();
-        } catch (IOException e) {
-            name = file.getAbsolutePath();
-        }
-        name = name.replace(File.separatorChar, '/');
-        if (!name.startsWith("/")) {
-            name = "/" + name;
-        }
-        // If the file does not exist, then assume that it's a directory
-        if (!file.isFile()) {
-            name = name + "/";
-        }
-        try {
-            return new URL("file", "", name);
-        } catch (MalformedURLException e) {
-            throw new IllegalArgumentException("file");
-        }
+        return urls.toArray(new URL[urls.size()]);
     }
 
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java	Tue Nov 13 20:02:39 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-/*
- * Copyright (c) 1998, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.doclets.internal.toolkit.util;
-
-import com.sun.tools.doclets.internal.toolkit.*;
-import com.sun.javadoc.*;
-import java.io.*;
-
-
-/**
- * Handle the directory creations and the path string generations.
- * All static - never instaniated.
- *
- * This code is not part of an API.
- * It is implementation that is subject to change.
- * Do not use it as an API
- *
- * @since 1.2
- * @author Atul M Dambalkar
- */
-public class DirectoryManager {
-
-    /**
-     * The file separator string, "/", used in the formation of the URL path.
-     */
-    public static final String URL_FILE_SEPARATOR = "/";
-
-    /**
-     * Never instaniated.
-     */
-    private DirectoryManager() {
-    }
-
-    /**
-     * Given a PackageDoc, return its URL path string.
-     *
-     * @param pd PackageDoc
-     * @see #getPath(String)
-     */
-    public static String createPathString(PackageDoc pd) {
-        if (pd == null) {
-            return "";
-        }
-        return getPath(pd.name());
-    }
-
-    /**
-     * Given a ClassDoc, return its URL path string.
-     *
-     * @param cd ClassDoc
-     * @see #getPath(String)
-     */
-    public static String createPathString(ClassDoc cd) {
-        if (cd == null) {
-            return "";
-        }
-        PackageDoc pd = cd.containingPackage();
-        return (pd == null)? "": getPath(pd.name());
-    }
-
-    /**
-     * Given a PackageDoc, return the corresponding directory name
-     * with the platform-dependent file separator between subdirectory names.
-     * For example, if name of the package is "java.lang" , then it
-     * returns "java/lang" on Unix and "java\lang" on Windows.
-     * If name of the package contains no dot, then the value
-     * will be returned unchanged.  Because package names cannot
-     * end in a dot, the return value will never end with a slash.
-     * <p>
-     * Also see getPath for the URL separator version of this method
-     * that takes a string instead of a PackageDoc.
-     *
-     * @param  pd    the PackageDoc
-     * @return       the platform-dependent directory path for the package
-     */
-    public static String getDirectoryPath(PackageDoc pd) {
-        return pd == null || pd.name().length() == 0 ? "" : getDirectoryPath(pd.name());
-    }
-
-    /**
-     * Given a package name, return the corresponding directory name
-     * with the platform-dependent file separator between subdirectory names.
-     * For example, if name of the package is "java.lang" , then it
-     * returns "java/lang" on Unix and "java\lang" on Windows.
-     * If name of the package contains no dot, then the value
-     * will be returned unchanged.  Because package names cannot
-     * end in a dot, the return value will never end with a slash.
-     * <p>
-     * Also see getPath for the URL separator version of this method
-     * that takes a string instead of a PackageDoc.
-     *
-     * @param  packageName    the name of the package
-     * @return       the platform-dependent directory path for the package
-     */
-    public static String getDirectoryPath(String packageName) {
-        if (packageName == null || packageName.length() == 0) {
-            return "";
-        }
-        StringBuilder pathstr = new StringBuilder();
-        for (int i = 0; i < packageName.length(); i++) {
-            char ch = packageName.charAt(i);
-            if (ch == '.') {
-                pathstr.append(URL_FILE_SEPARATOR);
-            } else {
-                pathstr.append(ch);
-            }
-        }
-        if (pathstr.length() > 0 && ! pathstr.toString().endsWith(URL_FILE_SEPARATOR)) {
-            pathstr.append(URL_FILE_SEPARATOR);
-        }
-        return pathstr.toString();
-    }
-
-    /**
-     * Given a package name (a string), return the path string,
-     * with the URL separator "/" separating the subdirectory names.
-     * If name of the package contains no dot, then the value
-     * will be returned unchanged.  Because package names cannot
-     * end in a dot, the return value will never end with a slash.
-     * <p>
-     * For example if the string is "com.sun.javadoc" then the URL
-     * path string will be "com/sun/javadoc".
-     *
-     * @param name   the package name as a String
-     * @return       the String URL path
-     */
-    public static String getPath(String name) {
-        if (name == null || name.length() == 0) {
-            return "";
-        }
-        StringBuilder pathstr = new StringBuilder();
-        for (int i = 0; i < name.length(); i++) {
-            char ch = name.charAt(i);
-            if (ch == '.') {
-                pathstr.append(URL_FILE_SEPARATOR);
-            } else {
-                pathstr.append(ch);
-            }
-        }
-        return pathstr.toString();
-    }
-
-    /**
-     * Given two package names as strings, return the relative path
-     * from the package directory corresponding to the first string
-     * to the package directory corresponding to the second string,
-     * with the URL file separator "/" separating subdirectory names.
-     * <p>
-     * For example, if the parameter "from" is "java.lang"
-     * and parameter "to" is "java.applet", return string
-     * "../../java/applet".
-     *
-     * @param from   the package name from which path is calculated
-     * @param to     the package name to which path is calculated
-     * @return       relative path between "from" and "to" with URL
-     *               separators
-     * @see          #getRelativePath(String)
-     * @see          #getPath(String)
-     */
-    public static String getRelativePath(String from, String to) {
-        StringBuilder pathstr = new StringBuilder();
-        pathstr.append(getRelativePath(from));
-        pathstr.append(getPath(to));
-        pathstr.append(URL_FILE_SEPARATOR);
-        return pathstr.toString();
-    }
-
-    /**
-     * Given a package name as a string, return relative path string
-     * from the corresponding package directory to the root of
-     * the documentation, using the URL separator "/" between
-     * subdirectory names.
-     * <p>
-     * For example, if the string "from" is "java.lang",
-     * return "../../"
-     *
-     * @param from    the package
-     * @return        String relative path from "from".
-     * @see           #getRelativePath(String, String)
-     */
-    public static String getRelativePath(PackageDoc from) {
-        return from == null || from.name().length() == 0 ? "" : getRelativePath(from.name());
-    }
-
-    /**
-     * Given a package name as a string, return relative path string
-     * from the corresponding package directory to the root of
-     * the documentation, using the URL separator "/" between
-     * subdirectory names.
-     * <p>
-     * For example, if the string "from" is "java.lang",
-     * return "../../"
-     *
-     * @param from    the package name
-     * @return        String relative path from "from".
-     * @see           #getRelativePath(String, String)
-     */
-    public static String getRelativePath(String from) {
-        if (from == null || from.length() == 0) {
-            return "";
-        }
-        StringBuilder pathstr = new StringBuilder();
-        for (int i = 0; i < from.length(); i++) {
-            char ch = from.charAt(i);
-            if (ch == '.') {
-                pathstr.append(".." + URL_FILE_SEPARATOR);
-            }
-        }
-        pathstr.append(".." + URL_FILE_SEPARATOR);
-        return pathstr.toString();
-    }
-
-    /**
-     * Given a relative or absolute path that might be empty,
-     * convert it to a path that does not end with a
-     * URL separator "/".  Used for converting
-     * HtmlStandardWriter.relativepath when replacing {@docRoot}.
-     *
-     * @param path   the path to convert.  An empty path represents
-     *               the current directory.
-     */
-    public static String getPathNoTrailingSlash(String path) {
-        if ( path.equals("") ) {
-            return ".";
-        }
-        if ( path.equals("/") ) {
-            return "/.";
-        }
-        if ( path.endsWith("/") ) {
-            // Remove trailing slash
-            path = path.substring(0, path.length() -1);
-        }
-        return path;
-    }
-
-    /**
-     * Given a path string create all the directories in the path. For example,
-     * if the path string is "java/applet", the method will create directory
-     * "java" and then "java/applet" if they don't exist. The file separator
-     * string "/" is platform dependent system property.
-     *
-     * @param path Directory path string.
-     */
-    public static void createDirectory(Configuration configuration,
-                                       String path) {
-        if (path == null || path.length() == 0) {
-            return;
-        }
-        File dir = new File(path);
-        if (dir.exists()) {
-            return;
-        } else {
-            if (dir.mkdirs()) {
-                return;
-            } else {
-                configuration.message.error(
-                       "doclet.Unable_to_create_directory_0", path);
-                throw new DocletAbortException();
-            }
-        }
-    }
-
-    /**
-     * Given a package name and a file name, return the full path to that file.
-     * For example, if PackageDoc passed is for "java.lang" and the filename
-     * passed is "package-summary.html", then the string returned is
-     * "java/lang/package-summary.html".
-     *
-     * @param pd         PackageDoc.
-     * @param filename   File name to be appended to the path of the package.
-     */
-    public static String getPathToPackage(PackageDoc pd, String filename) {
-        StringBuilder buf = new StringBuilder();
-        String pathstr = createPathString(pd);
-        if (pathstr.length() > 0) {
-            buf.append(pathstr);
-            buf.append(URL_FILE_SEPARATOR);
-        }
-        buf.append(filename);
-        return buf.toString();
-    }
-
-    /**
-     * Given a class name return the full path to the class file.
-     * For example, if ClassDoc passed is for "java.lang.Object" then the
-     * string returned is "java/lang/Object.html".
-     *
-     * @param cd   ClassDoc.
-     */
-    public static String getPathToClass(ClassDoc cd) {
-        return getPathToPackage(cd.containingPackage(), cd.name() + ".html");
-    }
-
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFile.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 1998, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit.util;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.tools.JavaFileManager.Location;
+import javax.tools.StandardLocation;
+
+import com.sun.tools.doclets.internal.toolkit.Configuration;
+
+/**
+ * Abstraction for handling files, which may be specified directly
+ * (e.g. via a path on the command line) or relative to a Location.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ *
+ * @since 8
+ */
+public class DocFile {
+
+    /**
+     * The doclet configuration.
+     * Provides access to options such as docencoding, output directory, etc.
+     */
+    private final Configuration configuration;
+
+    /**
+     * The location for this file. Maybe null if the file was created without
+     * a location or path.
+     */
+    private final Location location;
+
+    /**
+     * The path relative to the (output) location. Maybe null if the file was
+     * created without a location or path.
+     */
+    private final DocPath path;
+
+    /**
+     * The file object itself.
+     * This is temporary, until we create different subtypes of DocFile.
+     */
+    private final File file;
+
+    /** Create a DocFile for a directory. */
+    public static DocFile createFileForDirectory(Configuration configuration, String file) {
+        return new DocFile(configuration, new File(file));
+    }
+
+    /** Create a DocFile for a file that will be opened for reading. */
+    public static DocFile createFileForInput(Configuration configuration, String file) {
+        return new DocFile(configuration, new File(file));
+    }
+
+    /** Create a DocFile for a file that will be opened for writing. */
+    public static DocFile createFileForOutput(Configuration configuration, DocPath path) {
+        return new DocFile(configuration, StandardLocation.CLASS_OUTPUT, path);
+    }
+
+    /**
+     * List the directories and files found in subdirectories along the
+     * elements of the given location.
+     * @param configuration the doclet configuration
+     * @param location currently, only {@link StandardLocation#SOURCE_PATH} is supported.
+     * @param path the subdirectory of the directories of the location for which to
+     *  list files
+     */
+    public static Iterable<DocFile> list(Configuration configuration, Location location, DocPath path) {
+        if (location != StandardLocation.SOURCE_PATH)
+            throw new IllegalArgumentException();
+
+        Set<DocFile> files = new LinkedHashSet<DocFile>();
+        for (String s : configuration.sourcepath.split(File.pathSeparator)) {
+            if (s.isEmpty())
+                continue;
+            File f = new File(s);
+            if (f.isDirectory()) {
+                f = new File(f, path.getPath());
+                if (f.exists())
+                    files.add(new DocFile(configuration, f));
+            }
+        }
+        return files;
+    }
+
+    /** Create a DocFile for a given file. */
+    private DocFile(Configuration configuration, File file) {
+        this.configuration = configuration;
+        this.location = null;
+        this.path = null;
+        this.file = file;
+    }
+
+    /** Create a DocFile for a given location and relative path. */
+    private DocFile(Configuration configuration, Location location, DocPath path) {
+        this.configuration = configuration;
+        this.location = location;
+        this.path = path;
+        this.file = path.resolveAgainst(configuration.destDirName);
+    }
+
+    /** Open an input stream for the file. */
+    public InputStream openInputStream() throws FileNotFoundException {
+        return new BufferedInputStream(new FileInputStream(file));
+    }
+
+    /**
+     * Open an output stream for the file.
+     * The file must have been created with a location of
+     * {@link StandardLocation#CLASS_OUTPUT} and a corresponding relative path.
+     */
+    public OutputStream openOutputStream() throws IOException, UnsupportedEncodingException {
+        if (location != StandardLocation.CLASS_OUTPUT)
+            throw new IllegalStateException();
+
+        createDirectoryForFile(file);
+        return new BufferedOutputStream(new FileOutputStream(file));
+    }
+
+    /**
+     * Open an writer for the file, using the encoding (if any) given in the
+     * doclet configuration.
+     * The file must have been created with a location of
+     * {@link StandardLocation#CLASS_OUTPUT} and a corresponding relative path.
+     */
+    public Writer openWriter() throws IOException, UnsupportedEncodingException {
+        if (location != StandardLocation.CLASS_OUTPUT)
+            throw new IllegalStateException();
+
+        createDirectoryForFile(file);
+        FileOutputStream fos = new FileOutputStream(file);
+        if (configuration.docencoding == null) {
+            return new BufferedWriter(new OutputStreamWriter(fos));
+        } else {
+            return new BufferedWriter(new OutputStreamWriter(fos, configuration.docencoding));
+        }
+    }
+
+    /**
+     * Copy the contents of another file directly to this file.
+     */
+    public void copyFile(DocFile fromFile) throws IOException {
+        if (location != StandardLocation.CLASS_OUTPUT)
+            throw new IllegalStateException();
+
+        createDirectoryForFile(file);
+
+        InputStream input = fromFile.openInputStream();
+        OutputStream output = openOutputStream();
+        try {
+            byte[] bytearr = new byte[1024];
+            int len;
+            while ((len = input.read(bytearr)) != -1) {
+                output.write(bytearr, 0, len);
+            }
+        } catch (FileNotFoundException exc) {
+        } catch (SecurityException exc) {
+        } finally {
+            input.close();
+            output.close();
+        }
+    }
+
+    /**
+     * Copy the contents of a resource file to this file.
+     * @param resource the path of the resource, relative to the package of this class
+     * @param overwrite whether or not to overwrite the file if it already exists
+     * @param replaceNewLine if false, the file is copied as a binary file;
+     *     if true, the file is written line by line, using the platform line
+     *     separator
+     */
+    public void copyResource(DocPath resource, boolean overwrite, boolean replaceNewLine) {
+        if (location != StandardLocation.CLASS_OUTPUT)
+            throw new IllegalStateException();
+
+        if (file.exists() && !overwrite)
+            return;
+
+        createDirectoryForFile(file);
+
+        try {
+            InputStream in = Configuration.class.getResourceAsStream(resource.getPath());
+            if (in == null)
+                return;
+
+            OutputStream out = new FileOutputStream(file);
+            try {
+                if (!replaceNewLine) {
+                    byte[] buf = new byte[2048];
+                    int n;
+                    while((n = in.read(buf))>0) out.write(buf,0,n);
+                } else {
+                    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+                    BufferedWriter writer;
+                    if (configuration.docencoding == null) {
+                        writer = new BufferedWriter(new OutputStreamWriter(out));
+                    } else {
+                        writer = new BufferedWriter(new OutputStreamWriter(out,
+                                configuration.docencoding));
+                    }
+                    try {
+                        String line;
+                        while ((line = reader.readLine()) != null) {
+                            writer.write(line);
+                            writer.write(DocletConstants.NL);
+                        }
+                    } finally {
+                        reader.close();
+                        writer.close();
+                    }
+                }
+            } finally {
+                in.close();
+                out.close();
+            }
+        } catch (IOException e) {
+            e.printStackTrace(System.err);
+            throw new DocletAbortException();
+        }
+    }
+
+    /** Return true if the file can be read. */
+    public boolean canRead() {
+        return file.canRead();
+    }
+
+    /** Return true if the file can be written. */
+    public boolean canWrite() {
+        return file.canRead();
+    }
+
+    /** Return true if the file exists. */
+    public boolean exists() {
+        return file.exists();
+    }
+
+    /** Return the base name (last component) of the file name. */
+    public String getName() {
+        return file.getName();
+    }
+
+    /** Return the file system path for this file. */
+    public String getPath() {
+        return file.getPath();
+    }
+
+    /** Return true is file has an absolute path name. */
+    boolean isAbsolute() {
+        return file.isAbsolute();
+    }
+
+    /** Return true is file identifies a directory. */
+    public boolean isDirectory() {
+        return file.isDirectory();
+    }
+
+    /** Return true is file identifies a file. */
+    public boolean isFile() {
+        return file.isFile();
+    }
+
+    /** Return true if this file is the same as another. */
+    public boolean isSameFile(DocFile other) {
+        try {
+            return file.exists()
+                    && file.getCanonicalFile().equals(other.file.getCanonicalFile());
+        } catch (IOException e) {
+            return false;
+        }
+    }
+
+    /** If the file is a directory, list its contents. */
+    public Iterable<DocFile> list() {
+        List<DocFile> files = new ArrayList<DocFile>();
+        for (File f: file.listFiles()) {
+            files.add(new DocFile(configuration, f));
+        }
+        return files;
+    }
+
+    /** Create the file as a directory, including any parent directories. */
+    public boolean mkdirs() {
+        return file.mkdirs();
+    }
+
+    /**
+     * Derive a new file by resolving a relative path against this file.
+     * The new file will inherit the configuration and location of this file
+     * If this file has a path set, the new file will have a corresponding
+     * new path.
+     */
+    public DocFile resolve(DocPath p) {
+        return resolve(p.getPath());
+    }
+
+    /**
+     * Derive a new file by resolving a relative path against this file.
+     * The new file will inherit the configuration and location of this file
+     * If this file has a path set, the new file will have a corresponding
+     * new path.
+     */
+    public DocFile resolve(String p) {
+        if (location == null && path == null) {
+            return new DocFile(configuration, new File(file, p));
+        } else {
+            return new DocFile(configuration, location, path.resolve(p));
+        }
+    }
+
+    /**
+     * Resolve a relative file against the given output location.
+     * @param locn Currently, only SOURCE_OUTPUT is supported.
+     */
+    public DocFile resolveAgainst(StandardLocation locn) {
+        if (locn != StandardLocation.CLASS_OUTPUT)
+            throw new IllegalArgumentException();
+        return new DocFile(configuration,
+                new File(configuration.destDirName, file.getPath()));
+    }
+
+    /**
+     * Given a path string create all the directories in the path. For example,
+     * if the path string is "java/applet", the method will create directory
+     * "java" and then "java/applet" if they don't exist. The file separator
+     * string "/" is platform dependent system property.
+     *
+     * @param path Directory path string.
+     */
+    private void createDirectoryForFile(File file) {
+        File dir = file.getParentFile();
+        if (dir == null || dir.exists() || dir.mkdirs())
+            return;
+
+        configuration.message.error(
+               "doclet.Unable_to_create_directory_0", dir.getPath());
+        throw new DocletAbortException();
+    }
+
+    /** Return a string to identify the contents of this object,
+     * for debugging purposes.
+     */
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("DocFile[");
+        if (location != null)
+            sb.append("locn:").append(location).append(",");
+        if (path != null)
+            sb.append("path:").append(path.getPath()).append(",");
+        sb.append("file:").append(file);
+        sb.append("]");
+        return sb.toString();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocLink.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit.util;
+
+/**
+ * Abstraction for simple relative URIs, consisting of a path,
+ * an optional query, and an optional fragment. DocLink objects can
+ * be created by the constructors below or from a DocPath using the
+ * convenience methods, {@link DocPath#fragment fragment} and
+ * {@link DocPath#query query}.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ *
+ */
+public class DocLink {
+    final String path;
+    final String query;
+    final String fragment;
+
+    /** Create a DocLink representing the URI {@code #fragment}. */
+    public static DocLink fragment(String fragment) {
+        return new DocLink((String) null, (String) null, fragment);
+    }
+
+    /** Create a DocLink representing the URI {@code path}. */
+    public DocLink(DocPath path) {
+        this(path.getPath(), null, null);
+    }
+
+    /**
+     * Create a DocLink representing the URI {@code path?query#fragment}.
+     * query and fragment may be null.
+     */
+    public DocLink(DocPath path, String query, String fragment) {
+        this(path.getPath(), query, fragment);
+    }
+
+    /**
+     * Create a DocLink representing the URI {@code path?query#fragment}.
+     * Any of the component parts may be null.
+     */
+    public DocLink(String path, String query, String fragment) {
+        this.path = path;
+        this.query = query;
+        this.fragment = fragment;
+    }
+
+    /**
+     * Return the link in the form "path?query#fragment", omitting any empty
+     * components.
+     */
+    @Override
+    public String toString() {
+        // common fast path
+        if (path != null && isEmpty(query) && isEmpty(fragment))
+            return path;
+
+        StringBuilder sb = new StringBuilder();
+        if (path != null)
+            sb.append(path);
+        if (!isEmpty(query))
+            sb.append("?").append(query);
+        if (!isEmpty(fragment))
+            sb.append("#").append(fragment);
+        return sb.toString();
+    }
+
+    private static boolean isEmpty(String s) {
+        return (s == null) || s.isEmpty();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPath.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 1998, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit.util;
+
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.PackageDoc;
+import java.io.File;
+
+/**
+ * Abstraction for immutable relative paths.
+ * Paths always use '/' as a separator, and never begin or end with '/'.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class DocPath {
+    private final String path;
+
+    /** The empty path. */
+    public static final DocPath empty = new DocPath("");
+
+    /** The empty path. */
+    public static final DocPath parent = new DocPath("..");
+
+    /**
+     * Create a path from a string.
+     */
+    public static DocPath create(String p) {
+        return (p == null) || p.isEmpty() ? empty : new DocPath(p);
+    }
+
+    /**
+     * Return the path for a class.
+     * For example, if the class is java.lang.Object,
+     * the path is java/lang/Object.html.
+     */
+    public static DocPath forClass(ClassDoc cd) {
+        return (cd == null) ? empty :
+                forPackage(cd.containingPackage()).resolve(forName(cd));
+    }
+
+    /**
+     * Return the path for the simple name of the class.
+     * For example, if the class is java.lang.Object,
+     * the path is Object.html.
+     */
+    public static DocPath forName(ClassDoc cd) {
+        return (cd == null) ? empty : new DocPath(cd.name() + ".html");
+    }
+
+    /**
+     * Return the path for the package of a class.
+     * For example, if the class is java.lang.Object,
+     * the path is java/lang.
+     */
+    public static DocPath forPackage(ClassDoc cd) {
+        return (cd == null) ? empty : forPackage(cd.containingPackage());
+    }
+
+    /**
+     * Return the path for a package.
+     * For example, if the package is java.lang,
+     * the path is java/lang.
+     */
+    public static DocPath forPackage(PackageDoc pd) {
+        return (pd == null) ? empty : DocPath.create(pd.name().replace('.', '/'));
+    }
+
+    /**
+     * Return the inverse path for a package.
+     * For example, if the package is java.lang,
+     * the inverse path is ../...
+     */
+    public static DocPath forRoot(PackageDoc pd) {
+        String name = (pd == null) ? "" : pd.name();
+        if (name.isEmpty())
+            return empty;
+        return new DocPath(name.replace('.', '/').replaceAll("[^/]+", ".."));
+    }
+
+    /**
+     * Return the relative path from one package to another.
+     */
+    public static DocPath relativePath(PackageDoc from, PackageDoc to) {
+        return forRoot(from).resolve(forPackage(to));
+    }
+
+    protected DocPath(String p) {
+        path = (p.endsWith("/") ? p.substring(0, p.length() - 1) : p);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public boolean equals(Object other) {
+        return (other instanceof DocPath) && path.equals(((DocPath)other).path);
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public int hashCode() {
+        return path.hashCode();
+    }
+
+    public DocPath basename() {
+        int sep = path.lastIndexOf("/");
+        return (sep == -1) ? this : new DocPath(path.substring(sep + 1));
+    }
+
+    public DocPath parent() {
+        int sep = path.lastIndexOf("/");
+        return (sep == -1) ? empty : new DocPath(path.substring(0, sep));
+    }
+
+    /**
+     * Return the path formed by appending the specified string to the current path.
+     */
+    public DocPath resolve(String p) {
+        if (p == null || p.isEmpty())
+            return this;
+        if (path.isEmpty())
+            return new DocPath(p);
+        return new DocPath(path + "/" + p);
+    }
+
+    /**
+     * Return the path by appending the specified path to the current path.
+     */
+    public DocPath resolve(DocPath p) {
+        if (p == null || p.isEmpty())
+            return this;
+        if (path.isEmpty())
+            return p;
+        return new DocPath(path + "/" + p.getPath());
+    }
+
+    /**
+     * Get the file created by evaluating the path against a specified directory.
+     */
+    // Temporary: this signature should not use String for dir.
+    // Eventually, this should involve javax.tools.Location.
+    public File resolveAgainst(String dir) {
+        return dir.isEmpty() ? new File(path) : new File(dir, path);
+    }
+
+    /**
+     * Return the inverse path for this path.
+     * For example, if the path is a/b/c, the inverse path is ../../..
+     */
+    public DocPath invert() {
+        return new DocPath(path.replaceAll("[^/]+", ".."));
+    }
+
+    /**
+     * Return true if this path is empty.
+     */
+    public boolean isEmpty() {
+        return path.isEmpty();
+    }
+
+    public DocLink fragment(String fragment) {
+        return new DocLink(path, null, fragment);
+    }
+
+    public DocLink query(String query) {
+        return new DocLink(path, query, null);
+    }
+
+    /**
+     * Return this path as a string.
+     */
+    // This is provided instead of using toString() to help catch
+    // unintended use of toString() in string concatenation sequences.
+    public String getPath() {
+        return path;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocPaths.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 1998, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.doclets.internal.toolkit.util;
+
+/**
+ * Standard DocPath objects.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ *
+ * @since 8
+ */
+public class DocPaths {
+
+    /** The name of the file for all classes, using frames. */
+    public static final DocPath ALLCLASSES_FRAME = DocPath.create("allclasses-frame.html");
+
+    /** The name of the file for all classes, without using frames. */
+    public static final DocPath ALLCLASSES_NOFRAME = DocPath.create("allclasses-noframe.html");
+
+    /** The name of the sub-directory for storing class usage info. */
+    public static final DocPath CLASS_USE = DocPath.create("class-use");
+
+    /** The name of the file for constant values. */
+    public static final DocPath CONSTANT_VALUES = DocPath.create("constant-values.html");
+
+    /** The name of the fie for deprecated elements. */
+    public static final DocPath DEPRECATED_LIST = DocPath.create("deprecated-list.html");
+
+    /** The name of the subdirectory for user-provided additional documentation files. */
+    public static final DocPath DOC_FILES = DocPath.create("doc-files");
+
+    /** The name of the file for help info. */
+    public static final DocPath HELP_DOC = DocPath.create("help-doc.html");
+
+    /** The name of the main index file. */
+    public static final DocPath INDEX = DocPath.create("index.html");
+
+    /** The name of the single index file for all classes. */
+    public static final DocPath INDEX_ALL = DocPath.create("index-all.html");
+
+    /** The name of the directory for the split index files. */
+    public static final DocPath INDEX_FILES = DocPath.create("index-files");
+
+    /** Generate the name of one of the files in the split index. */
+    public static final DocPath indexN(int n) {
+        return DocPath.create("index-" + n + ".html");
+    }
+
+    /** The name of the file for the overview frame. */
+    public static final DocPath OVERVIEW_FRAME = DocPath.create("overview-frame.html");
+
+    /** The name of the file for the overview summary. */
+    public static final DocPath OVERVIEW_SUMMARY = DocPath.create("overview-summary.html");
+
+    /** The name of the file for the overview tree. */
+    public static final DocPath OVERVIEW_TREE = DocPath.create("overview-tree.html");
+
+    /** The name of the file for the package frame. */
+    public static final DocPath PACKAGE_FRAME = DocPath.create("package-frame.html");
+
+    /** The name of the file for the package list. */
+    public static final DocPath PACKAGE_LIST = DocPath.create("package-list");
+
+    /** The name of the file for the package summary. */
+    public static final DocPath PACKAGE_SUMMARY = DocPath.create("package-summary.html");
+
+    /** The name of the file for the package tree. */
+    public static final DocPath PACKAGE_TREE = DocPath.create("package-tree.html");
+
+    /** The name of the file for the package usage info. */
+    public static final DocPath PACKAGE_USE = DocPath.create("package-use.html");
+
+    /** The name of the directory in which resources are generated.
+     *  Also the name of the sub-package from which resources are read.
+     */
+    public static final DocPath RESOURCES = DocPath.create("resources");
+
+    /** The name of the file for the serialized form info. */
+    public static final DocPath SERIALIZED_FORM = DocPath.create("serialized-form.html");
+
+    /** The name of the directory in which HTML versions of the source code
+     *  are generated.
+     */
+    public static final DocPath SOURCE_OUTPUT = DocPath.create("src-html");
+
+    /** The name of the default stylesheet. */
+    public static final DocPath STYLESHEET = DocPath.create("stylesheet.css");
+
+}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletConstants.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletConstants.java	Wed Nov 14 16:41:12 2012 -0800
@@ -40,6 +40,16 @@
 public class DocletConstants {
 
     /**
+     * The default amount of space between tab stops.
+     */
+    public static final int DEFAULT_TAB_STOP_LENGTH = 8;
+
+    /**
+     * The line separator for the current operating system.
+     */
+    public static final String NL = System.getProperty("line.separator");
+
+    /**
      * The default package name.
      */
     public static final String DEFAULT_PACKAGE_NAME = "&lt;Unnamed&gt;";
@@ -53,34 +63,4 @@
      * The anchor for the default package.
      */
     public static final String UNNAMED_PACKAGE_ANCHOR = "unnamed_package";
-
-    /**
-     * The name of the doc files directory.
-     */
-    public static final String DOC_FILES_DIR_NAME = "doc-files";
-
-    /**
-     * The default amount of space between tab stops.
-     */
-    public static final int DEFAULT_TAB_STOP_LENGTH = 8;
-
-    /**
-     * The name of the directory where we will copy resource files to.
-     */
-    public static final String RESOURE_DIR_NAME = "resources";
-
-    /**
-     * The source output directory name
-     */
-    public static final String SOURCE_OUTPUT_DIR_NAME = "src-html/";
-
-    /**
-     * The name of the package list file.
-     */
-    public static final String PACKAGE_LIST_FILE_NAME = "package-list";
-
-    /**
-     * The line seperator for the current operating system.
-     */
-    public static final String NL = System.getProperty("line.separator");
 }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java	Wed Nov 14 16:41:12 2012 -0800
@@ -30,6 +30,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.tools.StandardLocation;
+
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 
@@ -138,21 +140,25 @@
      *
      * @param pkgName The package name.
      * @param relativepath    The relative path.
-     * @param link    The link to convert.
+     * @param filename    The link to convert.
      * @return if external return converted link else return null
      */
-    public String getExternalLink(String pkgName,
-                                  String relativepath, String link) {
+    public DocLink getExternalLink(String pkgName,
+                                  DocPath relativepath, String filename) {
+        return getExternalLink(pkgName, relativepath, filename, null);
+    }
+
+    public DocLink getExternalLink(String pkgName,
+                                  DocPath relativepath, String filename, String memberName) {
         Item fnd = findPackageItem(pkgName);
-        if (fnd != null) {
-            String externlink = fnd.path + link;
-            if (fnd.relative) {  // it's a relative path.
-                return relativepath + externlink;
-            } else {
-                return externlink;
-            }
-        }
-        return null;
+        if (fnd == null)
+            return null;
+
+        DocPath p = fnd.relative ?
+                relativepath.resolve(fnd.path).resolve(filename) :
+                DocPath.create(fnd.path).resolve(filename);
+
+        return new DocLink(p, "is-external=true", memberName);
     }
 
     /**
@@ -163,17 +169,38 @@
      * @param pkglisturl This can be another URL for "package-list" or ordinary
      *                   file.
      * @param reporter   The <code>DocErrorReporter</code> used to report errors.
-     * @param linkoffline True if -linkoffline isused and false if -link is used.
+     * @param linkoffline True if -linkoffline is used and false if -link is used.
      */
-    public boolean url(String url, String pkglisturl,
+    public boolean link(String url, String pkglisturl,
                               DocErrorReporter reporter, boolean linkoffline) {
         this.linkoffline = linkoffline;
-        String errMsg = composeExternPackageList(url, pkglisturl);
-        if (errMsg != null) {
-            reporter.printWarning(errMsg);
+        try {
+            url = adjustEndFileSeparator(url);
+            if (isUrl(pkglisturl)) {
+                readPackageListFromURL(url, toURL(pkglisturl));
+            } else {
+                readPackageListFromFile(url, DocFile.createFileForInput(configuration, pkglisturl));
+            }
+            return true;
+        } catch (Fault f) {
+            reporter.printWarning(f.getMessage());
             return false;
-        } else {
-            return true;
+        }
+    }
+
+    private URL toURL(String url) throws Fault {
+        try {
+            return new URL(url);
+        } catch (MalformedURLException e) {
+            throw new Fault(configuration.getText("doclet.MalformedURL", url), e);
+        }
+    }
+
+    private class Fault extends Exception {
+        private static final long serialVersionUID = 0;
+
+        Fault(String msg, Exception cause) {
+            super(msg, cause);
         }
     }
 
@@ -190,31 +217,10 @@
     }
 
     /**
-     * Adjusts the end file separator if it is missing from the URL or the
-     * directory path and depending upon the URL or file path, fetch or
-     * read the "package-list" file.
-     *
-     * @param urlOrDirPath        URL or the directory path.
-     * @param pkgListUrlOrDirPath URL or directory path for the "package-list" file or the "package-list"
-     * file itself.
-     */
-    private String composeExternPackageList(String urlOrDirPath, String pkgListUrlOrDirPath) {
-        urlOrDirPath = adjustEndFileSeparator(urlOrDirPath);
-        pkgListUrlOrDirPath = adjustEndFileSeparator(pkgListUrlOrDirPath);
-        return isUrl(pkgListUrlOrDirPath) ?
-            fetchURLComposeExternPackageList(urlOrDirPath, pkgListUrlOrDirPath) :
-            readFileComposeExternPackageList(urlOrDirPath, pkgListUrlOrDirPath);
-    }
-
-    /**
      * If the URL or Directory path is missing end file separator, add that.
      */
     private String adjustEndFileSeparator(String url) {
-        String filesep = "/";
-        if (!url.endsWith(filesep)) {
-            url += filesep;
-        }
-        return url;
+        return url.endsWith("/") ? url : url + '/';
     }
 
     /**
@@ -223,17 +229,18 @@
      * @param urlpath        Path to the packages.
      * @param pkglisturlpath URL or the path to the "package-list" file.
      */
-    private String fetchURLComposeExternPackageList(String urlpath,
-                                                   String pkglisturlpath) {
-        String link = pkglisturlpath + "package-list";
+    private void readPackageListFromURL(String urlpath, URL pkglisturlpath)
+            throws Fault {
         try {
-            readPackageList((new URL(link)).openStream(), urlpath, false);
+            URL link = pkglisturlpath.toURI().resolve(DocPaths.PACKAGE_LIST.getPath()).toURL();
+            readPackageList(link.openStream(), urlpath, false);
+        } catch (URISyntaxException exc) {
+            throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc);
         } catch (MalformedURLException exc) {
-            return configuration.getText("doclet.MalformedURL", link);
+            throw new Fault(configuration.getText("doclet.MalformedURL", pkglisturlpath.toString()), exc);
         } catch (IOException exc) {
-            return configuration.getText("doclet.URL_error", link);
+            throw new Fault(configuration.getText("doclet.URL_error", pkglisturlpath.toString()), exc);
         }
-        return null;
     }
 
     /**
@@ -242,27 +249,24 @@
      * @param path URL or directory path to the packages.
      * @param pkgListPath Path to the local "package-list" file.
      */
-    private String readFileComposeExternPackageList(String path,
-                                                   String pkgListPath) {
-
-        String link = pkgListPath + "package-list";
-        if (! ((new File(pkgListPath)).isAbsolute() || linkoffline)){
-            link = configuration.destDirName + link;
+    private void readPackageListFromFile(String path, DocFile pkgListPath)
+            throws Fault {
+        DocFile file = pkgListPath.resolve(DocPaths.PACKAGE_LIST);
+        if (! (file.isAbsolute() || linkoffline)){
+            file = file.resolveAgainst(StandardLocation.CLASS_OUTPUT);
         }
         try {
-            File file = new File(link);
             if (file.exists() && file.canRead()) {
-                readPackageList(new FileInputStream(file), path,
-                    ! ((new File(path)).isAbsolute() || isUrl(path)));
+                boolean pathIsRelative =
+                        !DocFile.createFileForInput(configuration, path).isAbsolute()
+                        && !isUrl(path);
+                readPackageList(file.openInputStream(), path, pathIsRelative);
             } else {
-                return configuration.getText("doclet.File_error", link);
+                throw new Fault(configuration.getText("doclet.File_error", file.getPath()), null);
             }
-        } catch (FileNotFoundException exc) {
-            return configuration.getText("doclet.File_error", link);
         } catch (IOException exc) {
-            return configuration.getText("doclet.File_error", link);
+           throw new Fault(configuration.getText("doclet.File_error", file.getPath()), exc);
         }
-        return null;
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -52,8 +52,7 @@
      * @param configuration the current configuration of the doclet.
      */
     public PackageListWriter(Configuration configuration) throws IOException {
-        super(Util.genWriter(configuration, configuration.destDirName,
-            DocletConstants.PACKAGE_LIST_FILE_NAME, configuration.docencoding));
+        super(DocFile.createFileForOutput(configuration, DocPaths.PACKAGE_LIST).openWriter());
         this.configuration = configuration;
     }
 
@@ -71,7 +70,7 @@
             packgen.close();
         } catch (IOException exc) {
             configuration.message.error("doclet.exception_encountered",
-                exc.toString(), DocletConstants.PACKAGE_LIST_FILE_NAME);
+                exc.toString(), DocPaths.PACKAGE_LIST);
             throw new DocletAbortException();
         }
     }
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourcePath.java	Tue Nov 13 20:02:39 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 1998, 2003, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.doclets.internal.toolkit.util;
-
-import java.io.File;
-
-/**
- * This class is used to represent a source path which can contain only
- * directories no zip files. If a zip file is specified in the command line it
- * will not get reflected in the SourcePath.
- *
- * This code is not part of an API.
- * It is implementation that is subject to change.
- * Do not use it as an API
- *
- * @author Atul M Dambalkar
- */
-public
-    class SourcePath {
-    private final char dirSeparator = File.pathSeparatorChar;
-
-    /**
-     * The original class path string
-     */
-    private String pathstr;
-
-    /**
-     * List of source path entries. Each entry is a directory.
-     */
-    private File[] sourcePath;
-
-
-    /**
-     * Build a source path from the specified path string on the command line.
-     */
-    public SourcePath(String pathstr) {
-        init(pathstr);
-    }
-
-    /**
-     * Build a default source path from the path strings specified by
-     * the properties env.class.path.
-     */
-    public SourcePath() {
-        init(System.getProperty("env.class.path"));
-    }
-
-    /**
-     * Initialize the SourcePath File array, which will contain only the
-     * directory names from the given path string.
-     *
-     * @param pathstr Path String.
-     */
-    private void init(String pathstr) {
-        if (pathstr == null ||  pathstr.length() == 0) {
-            pathstr = ".";
-        }
-
-        int noOfFileSep = 0;
-        int index = 0;
-        this.pathstr = pathstr; // Save original class path string
-
-        // Count the number of path separators
-        while ((index = pathstr.indexOf(dirSeparator, index)) != -1) {
-            noOfFileSep++;
-            index++;
-        }
-        // Build the source path
-        File[] tempPath = new File[noOfFileSep + 1];
-        int tempPathIndex = 0;
-        int len = pathstr.length();
-        int sepPos = 0;
-        for (index = 0; index < len; index = sepPos + 1) {
-            sepPos = pathstr.indexOf(dirSeparator, index);
-            if (sepPos < 0) {
-                sepPos = len;
-            }
-            File file = new File(pathstr.substring(index, sepPos));
-            if (file.isDirectory()) {
-                tempPath[tempPathIndex++] = file;
-            } // if it is really a file, ignore it.
-        }
-        sourcePath = new File[tempPathIndex];
-        System.arraycopy((Object)tempPath, 0, (Object)sourcePath,
-                         0, tempPathIndex);
-    }
-
-    /**
-     * Find the specified directory in the source path.
-     *
-     * @param name Name of the directory to be searched for in the source path.
-     * @return File Return the directory if found else return null.
-     */
-    public File getDirectory(String name) {
-        for (int i = 0; i < sourcePath.length; i++) {
-            File directoryNeeded = new File(sourcePath[i], name);
-            if (directoryNeeded.isDirectory()) {
-                return directoryNeeded;
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Return original source path string.
-     */
-    public String toString() {
-        return pathstr;
-    }
-}
--- a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java	Wed Nov 14 16:41:12 2012 -0800
@@ -30,6 +30,7 @@
 
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.internal.toolkit.*;
+import javax.tools.StandardLocation;
 
 /**
  * Utilities Class for Doclets.
@@ -52,11 +53,6 @@
     {{"&", "&amp;"}, {"<", "&lt;"}, {">", "&gt;"}};
 
     /**
-     * Name of the resource directory.
-     */
-    public static final String RESOURCESDIR = "resources";
-
-    /**
      * Return array of class members whose documentation is to be generated.
      * If the member is deprecated do not include such a member in the
      * returned array.
@@ -197,32 +193,6 @@
     }
 
     /**
-     * Copy source file to destination file.
-     *
-     * @throws SecurityException
-     * @throws IOException
-     */
-    public static void copyFile(File destfile, File srcfile)
-        throws IOException {
-        byte[] bytearr = new byte[512];
-        int len = 0;
-        FileInputStream input = new FileInputStream(srcfile);
-        File destDir = destfile.getParentFile();
-        destDir.mkdirs();
-        FileOutputStream output = new FileOutputStream(destfile);
-        try {
-            while ((len = input.read(bytearr)) != -1) {
-                output.write(bytearr, 0, len);
-                }
-        } catch (FileNotFoundException exc) {
-        } catch (SecurityException exc) {
-            } finally {
-            input.close();
-            output.close();
-            }
-        }
-
-    /**
      * Copy the given directory contents from the source package directory
      * to the generated documentation directory. For example for a package
      * java.lang this method find out the source location of the package using
@@ -235,45 +205,45 @@
      * @param dir The original directory name to copy from.
      * @param overwrite Overwrite files if true.
      */
-    public static void copyDocFiles(Configuration configuration,
-            String path, String dir, boolean overwrite) {
-        if (checkCopyDocFilesErrors(configuration, path, dir)) {
-            return;
-        }
-        String destname = configuration.docFileDestDirName;
-        File srcdir = new File(path + dir);
-        if (destname.length() > 0 && !destname.endsWith(
-               DirectoryManager.URL_FILE_SEPARATOR)) {
-            destname += DirectoryManager.URL_FILE_SEPARATOR;
-        }
-        String dest = destname + dir;
+    public static void copyDocFiles(Configuration configuration, PackageDoc pd) {
+        copyDocFiles(configuration, DocPath.forPackage(pd).resolve(DocPaths.DOC_FILES));
+    }
+
+    public static void copyDocFiles(Configuration configuration, DocPath dir) {
         try {
-            File destdir = new File(dest);
-            DirectoryManager.createDirectory(configuration, dest);
-            String[] files = srcdir.list();
-            for (int i = 0; i < files.length; i++) {
-                File srcfile = new File(srcdir, files[i]);
-                File destfile = new File(destdir, files[i]);
-                if (srcfile.isFile()) {
-                    if(destfile.exists() && ! overwrite) {
-                        configuration.message.warning((SourcePosition) null,
-                                "doclet.Copy_Overwrite_warning",
-                                srcfile.toString(), destdir.toString());
-                    } else {
-                        configuration.message.notice(
-                            "doclet.Copying_File_0_To_Dir_1",
-                            srcfile.toString(), destdir.toString());
-                        Util.copyFile(destfile, srcfile);
-                    }
-                } else if(srcfile.isDirectory()) {
-                    if(configuration.copydocfilesubdirs
-                        && ! configuration.shouldExcludeDocFileDir(
-                          srcfile.getName())){
-                        copyDocFiles(configuration, path, dir +
-                                    DirectoryManager.URL_FILE_SEPARATOR + srcfile.getName(),
-                                overwrite);
+            boolean first = true;
+            for (DocFile f : DocFile.list(configuration, StandardLocation.SOURCE_PATH, dir)) {
+                if (!f.isDirectory()) {
+                    continue;
+                }
+                DocFile srcdir = f;
+                DocFile destdir = DocFile.createFileForOutput(configuration, dir);
+                if (srcdir.isSameFile(destdir)) {
+                    continue;
+                }
+
+                for (DocFile srcfile: srcdir.list()) {
+                    DocFile destfile = destdir.resolve(srcfile.getName());
+                    if (srcfile.isFile()) {
+                        if (destfile.exists() && !first) {
+                            configuration.message.warning((SourcePosition) null,
+                                    "doclet.Copy_Overwrite_warning",
+                                    srcfile.getPath(), destdir.getPath());
+                        } else {
+                            configuration.message.notice(
+                                    "doclet.Copying_File_0_To_Dir_1",
+                                    srcfile.getPath(), destdir.getPath());
+                            destfile.copyFile(srcfile);
+                        }
+                    } else if (srcfile.isDirectory()) {
+                        if (configuration.copydocfilesubdirs
+                                && !configuration.shouldExcludeDocFileDir(srcfile.getName())) {
+                            copyDocFiles(configuration, dir.resolve(srcfile.getName()));
+                        }
                     }
                 }
+
+                first = false;
             }
         } catch (SecurityException exc) {
             throw new DocletAbortException();
@@ -283,142 +253,6 @@
     }
 
     /**
-     * Given the parameters for copying doc-files, check for errors.
-     *
-     * @param configuration The configuration of the current doclet.
-     * @param path The relative path to the directory to be copied.
-     * @param dirName The original directory name to copy from.
-     */
-    private static boolean checkCopyDocFilesErrors (Configuration configuration,
-            String path, String dirName) {
-        if ((configuration.sourcepath == null || configuration.sourcepath.length() == 0) &&
-               (configuration.destDirName == null || configuration.destDirName.length() == 0)) {
-            //The destination path and source path are definitely equal.
-            return true;
-        }
-        File sourcePath, destPath = new File(configuration.destDirName);
-        StringTokenizer pathTokens = new StringTokenizer(
-            configuration.sourcepath == null ? "" : configuration.sourcepath,
-            File.pathSeparator);
-        //Check if the destination path is equal to the source path.  If yes,
-        //do not copy doc-file directories.
-        while(pathTokens.hasMoreTokens()){
-            sourcePath = new File(pathTokens.nextToken());
-            if(destPath.equals(sourcePath)){
-                return true;
-            }
-        }
-        //Make sure the doc-file being copied exists.
-        File srcdir = new File(path + dirName);
-        if (! srcdir.exists()) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * Copy a file in the resources directory to the destination
-     * directory (if it is not there already).  If
-     * <code>overwrite</code> is true and the destination file
-     * already exists, overwrite it.
-     *
-     * @param configuration  Holds the destination directory and error message
-     * @param resourcefile   The name of the resource file to copy
-     * @param overwrite      A flag to indicate whether the file in the
-     *                       destination directory will be overwritten if
-     *                       it already exists.
-     */
-    public static void copyResourceFile(Configuration configuration,
-            String resourcefile, boolean overwrite) {
-        String destresourcesdir = configuration.destDirName + RESOURCESDIR;
-        copyFile(configuration, resourcefile, RESOURCESDIR, destresourcesdir,
-                overwrite, false);
-    }
-
-    /**
-     * Copy a file from a source directory to a destination directory
-     * (if it is not there already). If <code>overwrite</code> is true and
-     * the destination file already exists, overwrite it.
-     *
-     * @param configuration Holds the error message
-     * @param file The name of the file to copy
-     * @param source The source directory
-     * @param destination The destination directory where the file needs to be copied
-     * @param overwrite A flag to indicate whether the file in the
-     *                  destination directory will be overwritten if
-     *                  it already exists.
-     * @param replaceNewLine true if the newline needs to be replaced with platform-
-     *                  specific newline.
-     */
-    public static void copyFile(Configuration configuration, String file, String source,
-            String destination, boolean overwrite, boolean replaceNewLine) {
-        DirectoryManager.createDirectory(configuration, destination);
-        File destfile = new File(destination, file);
-        if(destfile.exists() && (! overwrite)) return;
-        try {
-            InputStream in = Configuration.class.getResourceAsStream(
-                    source + DirectoryManager.URL_FILE_SEPARATOR + file);
-            if(in==null) return;
-            OutputStream out = new FileOutputStream(destfile);
-            try {
-                if (!replaceNewLine) {
-                    byte[] buf = new byte[2048];
-                    int n;
-                    while((n = in.read(buf))>0) out.write(buf,0,n);
-                } else {
-                    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-                    BufferedWriter writer;
-                    if (configuration.docencoding == null) {
-                        writer = new BufferedWriter(new OutputStreamWriter(out));
-                    } else {
-                        writer = new BufferedWriter(new OutputStreamWriter(out,
-                            configuration.docencoding));
-                    }
-                    try {
-                        String line;
-                        while ((line = reader.readLine()) != null) {
-                            writer.write(line);
-                            writer.write(DocletConstants.NL);
-                        }
-                    } finally {
-                        reader.close();
-                        writer.close();
-                    }
-                }
-            } finally {
-                in.close();
-                out.close();
-            }
-        } catch (IOException ie) {
-            ie.printStackTrace(System.err);
-            throw new DocletAbortException();
-        }
-    }
-
-    /**
-     * Given a PackageDoc, return the source path for that package.
-     * @param configuration The Configuration for the current Doclet.
-     * @param pkgDoc The package to seach the path for.
-     * @return A string representing the path to the given package.
-     */
-    public static String getPackageSourcePath(Configuration configuration,
-            PackageDoc pkgDoc){
-        try{
-            String pkgPath = DirectoryManager.getDirectoryPath(pkgDoc);
-            String completePath = new SourcePath(configuration.sourcepath).
-                getDirectory(pkgPath) + DirectoryManager.URL_FILE_SEPARATOR;
-            //Make sure that both paths are using the same separators.
-            completePath = Util.replaceText(completePath, File.separator,
-                    DirectoryManager.URL_FILE_SEPARATOR);
-            pkgPath = Util.replaceText(pkgPath, File.separator,
-                    DirectoryManager.URL_FILE_SEPARATOR);
-            return completePath.substring(0, completePath.lastIndexOf(pkgPath));
-        } catch (Exception e){
-            return "";
-        }
-    }
-
-    /**
      * We want the list of types in alphabetical order.  However, types are not
      * comparable.  We need a comparator for now.
      */
@@ -552,7 +386,7 @@
     }
 
     /**
-     * Given a package, return it's name.
+     * Given a package, return its name.
      * @param packageDoc the package to check.
      * @return the name of the given package.
      */
@@ -562,7 +396,7 @@
     }
 
     /**
-     * Given a package, return it's file name without the extension.
+     * Given a package, return its file name without the extension.
      * @param packageDoc the package to check.
      * @return the file name of the given package.
      */
@@ -572,7 +406,7 @@
     }
 
     /**
-     * Given a string, replace all occurraces of 'newStr' with 'oldStr'.
+     * Given a string, replace all occurrences of 'newStr' with 'oldStr'.
      * @param originalStr the string to modify.
      * @param oldStr the string to replace.
      * @param newStr the string to insert in place of the old string.
@@ -623,40 +457,6 @@
     }
 
     /**
-     * Create the directory path for the file to be generated, construct
-     * FileOutputStream and OutputStreamWriter depending upon docencoding.
-     *
-     * @param path The directory path to be created for this file.
-     * @param filename File Name to which the PrintWriter will do the Output.
-     * @param docencoding Encoding to be used for this file.
-     * @exception IOException Exception raised by the FileWriter is passed on
-     * to next level.
-     * @exception UnsupportedEncodingException Exception raised by the
-     * OutputStreamWriter is passed on to next level.
-     * @return Writer Writer for the file getting generated.
-     * @see java.io.FileOutputStream
-     * @see java.io.OutputStreamWriter
-     */
-    public static Writer genWriter(Configuration configuration,
-            String path, String filename,
-            String docencoding)
-        throws IOException, UnsupportedEncodingException {
-        FileOutputStream fos;
-        if (path != null) {
-            DirectoryManager.createDirectory(configuration, path);
-            fos = new FileOutputStream(((path.length() > 0)?
-                                                  path + File.separator: "") + filename);
-        } else {
-            fos = new FileOutputStream(filename);
-        }
-        if (docencoding == null) {
-            return new BufferedWriter(new OutputStreamWriter(fos));
-        } else {
-            return new BufferedWriter(new OutputStreamWriter(fos, docencoding));
-        }
-    }
-
-    /**
      * Given an annotation, return true if it should be documented and false
      * otherwise.
      *
@@ -676,47 +476,6 @@
     }
 
     /**
-     * Given a string, return an array of tokens.  The separator can be escaped
-     * with the '\' character.  The '\' character may also be escaped by the
-     * '\' character.
-     *
-     * @param s         the string to tokenize.
-     * @param separator the separator char.
-     * @param maxTokens the maxmimum number of tokens returned.  If the
-     *                  max is reached, the remaining part of s is appended
-     *                  to the end of the last token.
-     *
-     * @return an array of tokens.
-     */
-    public static String[] tokenize(String s, char separator, int maxTokens) {
-        List<String> tokens = new ArrayList<String>();
-        StringBuilder  token = new StringBuilder ();
-        boolean prevIsEscapeChar = false;
-        for (int i = 0; i < s.length(); i += Character.charCount(i)) {
-            int currentChar = s.codePointAt(i);
-            if (prevIsEscapeChar) {
-                // Case 1:  escaped character
-                token.appendCodePoint(currentChar);
-                prevIsEscapeChar = false;
-            } else if (currentChar == separator && tokens.size() < maxTokens-1) {
-                // Case 2:  separator
-                tokens.add(token.toString());
-                token = new StringBuilder();
-            } else if (currentChar == '\\') {
-                // Case 3:  escape character
-                prevIsEscapeChar = true;
-            } else {
-                // Case 4:  regular character
-                token.appendCodePoint(currentChar);
-            }
-        }
-        if (token.length() > 0) {
-            tokens.add(token.toString());
-        }
-        return tokens.toArray(new String[] {});
-    }
-
-    /**
      * Return true if this class is linkable and false if we can't link to the
      * desired class.
      * <br>
@@ -796,7 +555,7 @@
      *
      * @param cd the ClassDoc to check.
      * @param lowerCaseOnly true if you want the name returned in lower case.
-     *                      If false, the first letter of the name is capatilized.
+     *                      If false, the first letter of the name is capitalized.
      * @return
      */
     public static String getTypeName(Configuration config,
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java	Wed Nov 14 16:41:12 2012 -0800
@@ -34,8 +34,6 @@
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.util.*;
 
-import static com.sun.tools.javac.code.TypeTags.*;
-
 /** An annotation value.
  *
  *  <p><b>This is NOT part of any supported API.
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java	Wed Nov 14 16:41:12 2012 -0800
@@ -67,7 +67,6 @@
         if ((mask&NATIVE) != 0) flags.add(Flag.NATIVE);
         if ((mask&INTERFACE) != 0) flags.add(Flag.INTERFACE);
         if ((mask&ABSTRACT) != 0) flags.add(Flag.ABSTRACT);
-        if ((mask&DEFAULT) != 0) flags.add(Flag.DEFAULT);
         if ((mask&STRICTFP) != 0) flags.add(Flag.STRICTFP);
         if ((mask&BRIDGE) != 0) flags.add(Flag.BRIDGE);
         if ((mask&SYNTHETIC) != 0) flags.add(Flag.SYNTHETIC);
@@ -258,6 +257,12 @@
      */
     public static final long DEFAULT = 1L<<43;
 
+    /**
+     * Flag that marks class as auxiliary, ie a non-public class following
+     * the public class in a source file, that could block implicit compilation.
+     */
+    public static final long AUXILIARY = 1L<<43;
+
     /** Modifier masks.
      */
     public static final int
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java	Wed Nov 14 16:41:12 2012 -0800
@@ -32,7 +32,9 @@
 import com.sun.tools.javac.api.Formattable;
 import com.sun.tools.javac.api.Messages;
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+import static com.sun.tools.javac.code.TypeTag.PACKAGE;
+import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 
 /** Internal symbol kinds, which distinguish between elements of
  *  different subclasses of Symbol. Symbol kinds are organized so they can be
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Lint.java	Wed Nov 14 16:41:12 2012 -0800
@@ -129,6 +129,13 @@
      */
     public enum LintCategory {
         /**
+         * Warn when code refers to a auxiliary class that is hidden in a source file (ie source file name is
+         * different from the class name, and the type is not properly nested) and the referring code
+         * is not located in the same source file.
+         */
+        AUXILIARYCLASS("auxiliaryclass"),
+
+        /**
          * Warn about use of unnecessary casts.
          */
         CAST("cast"),
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Printer.java	Wed Nov 14 16:41:12 2012 -0800
@@ -32,9 +32,12 @@
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.util.ListBuffer;
+
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.ARRAY;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+import static com.sun.tools.javac.code.TypeTag.FORALL;
 
 /**
  * A combined type/symbol visitor for generating non-trivial localized string
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Source.java	Wed Nov 14 16:41:12 2012 -0800
@@ -206,6 +206,9 @@
     public boolean allowDefaultMethods() {
         return compareTo(JDK1_8) >= 0;
     }
+    public boolean allowStrictMethodClashCheck() {
+        return compareTo(JDK1_8) >= 0;
+    }
     public boolean allowEffectivelyFinalInInnerClasses() {
         return compareTo(JDK1_8) >= 0;
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java	Wed Nov 14 16:41:12 2012 -0800
@@ -42,7 +42,9 @@
 import com.sun.tools.javac.util.Name;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+import static com.sun.tools.javac.code.TypeTag.FORALL;
+import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 
 /** Root class for Java symbols. It contains subclasses
  *  for specific sorts of symbols, such as variables, methods and operators,
@@ -161,7 +163,7 @@
         if (owner.name == null || owner.name.isEmpty()) {
             return location();
         }
-        if (owner.type.tag == CLASS) {
+        if (owner.type.hasTag(CLASS)) {
             Type ownertype = types.asOuterSuper(site, owner);
             if (ownertype != null) return ownertype.tsym;
         }
@@ -256,7 +258,7 @@
     /** A class is an inner class if it it has an enclosing instance class.
      */
     public boolean isInner() {
-        return type.getEnclosingType().tag == CLASS;
+        return type.getEnclosingType().hasTag(CLASS);
     }
 
     /** An inner class has an outer instance if it is not an interface
@@ -269,7 +271,7 @@
      */
     public boolean hasOuterInstance() {
         return
-            type.getEnclosingType().tag == CLASS && (flags() & (INTERFACE | NOOUTERTHIS)) == 0;
+            type.getEnclosingType().hasTag(CLASS) && (flags() & (INTERFACE | NOOUTERTHIS)) == 0;
     }
 
     /** The closest enclosing class of this symbol's declaration.
@@ -277,7 +279,7 @@
     public ClassSymbol enclClass() {
         Symbol c = this;
         while (c != null &&
-               ((c.kind & TYP) == 0 || c.type.tag != CLASS)) {
+               ((c.kind & TYP) == 0 || !c.type.hasTag(CLASS))) {
             c = c.owner;
         }
         return (ClassSymbol)c;
@@ -346,7 +348,7 @@
                 e = e.next();
             }
             Type superType = types.supertype(clazz.type);
-            if (superType.tag != TypeTags.CLASS) return false;
+            if (!superType.hasTag(CLASS)) return false;
             clazz = (ClassSymbol)superType.tsym;
         }
     }
@@ -373,7 +375,7 @@
             for (Symbol sup = clazz;
                  sup != null && sup != this.owner;
                  sup = types.supertype(sup.type).tsym) {
-                while (sup.type.tag == TYPEVAR)
+                while (sup.type.hasTag(TYPEVAR))
                     sup = sup.type.getUpperBound().tsym;
                 if (sup.type.isErroneous())
                     return true; // error recovery
@@ -520,7 +522,7 @@
             if (owner == null) return name;
             if (((owner.kind != ERR)) &&
                 ((owner.kind & (VAR | MTH)) != 0
-                 || (owner.kind == TYP && owner.type.tag == TYPEVAR)
+                 || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
                  )) return name;
             Name prefix = owner.getQualifiedName();
             if (prefix == null || prefix == prefix.table.names.empty)
@@ -534,7 +536,7 @@
         static public Name formFlatName(Name name, Symbol owner) {
             if (owner == null ||
                 (owner.kind & (VAR | MTH)) != 0
-                || (owner.kind == TYP && owner.type.tag == TYPEVAR)
+                || (owner.kind == TYP && owner.type.hasTag(TYPEVAR))
                 ) return name;
             char sep = owner.kind == TYP ? '$' : '.';
             Name prefix = owner.flatName();
@@ -553,16 +555,16 @@
             if (this == that)
                 return false;
             if (this.type.tag == that.type.tag) {
-                if (this.type.tag == CLASS) {
+                if (this.type.hasTag(CLASS)) {
                     return
                         types.rank(that.type) < types.rank(this.type) ||
                         types.rank(that.type) == types.rank(this.type) &&
                         that.getQualifiedName().compareTo(this.getQualifiedName()) < 0;
-                } else if (this.type.tag == TYPEVAR) {
+                } else if (this.type.hasTag(TYPEVAR)) {
                     return types.isSubtype(this.type, that.type);
                 }
             }
-            return this.type.tag == TYPEVAR;
+            return this.type.hasTag(TYPEVAR);
         }
 
         // For type params; overridden in subclasses.
@@ -572,7 +574,7 @@
 
         public java.util.List<Symbol> getEnclosedElements() {
             List<Symbol> list = List.nil();
-            if (kind == TYP && type.tag == TYPEVAR) {
+            if (kind == TYP && type.hasTag(TYPEVAR)) {
                 return list;
             }
             for (Scope.Entry e = members().elems; e != null; e = e.sibling) {
@@ -591,7 +593,7 @@
         }
 
         public <R, P> R accept(ElementVisitor<R, P> v, P p) {
-            Assert.check(type.tag == TYPEVAR); // else override will be invoked
+            Assert.check(type.hasTag(TYPEVAR)); // else override will be invoked
             return v.visitTypeParameter(this, p);
         }
 
@@ -798,13 +800,13 @@
             if (this == base) {
                 return true;
             } else if ((base.flags() & INTERFACE) != 0) {
-                for (Type t = type; t.tag == CLASS; t = types.supertype(t))
+                for (Type t = type; t.hasTag(CLASS); t = types.supertype(t))
                     for (List<Type> is = types.interfaces(t);
                          is.nonEmpty();
                          is = is.tail)
                         if (is.head.tsym.isSubClass(base, types)) return true;
             } else {
-                for (Type t = type; t.tag == CLASS; t = types.supertype(t))
+                for (Type t = type; t.hasTag(CLASS); t = types.supertype(t))
                     if (t.tsym == base) return true;
             }
             return false;
@@ -1048,7 +1050,7 @@
          */
         public MethodSymbol(long flags, Name name, Type type, Symbol owner) {
             super(MTH, flags, name, type, owner);
-            if (owner.type.tag == TYPEVAR) Assert.error(owner + "." + name);
+            if (owner.type.hasTag(TYPEVAR)) Assert.error(owner + "." + name);
         }
 
         /** Clone this symbol with new owner.
@@ -1074,7 +1076,7 @@
                     ? owner.name.toString()
                     : name.toString();
                 if (type != null) {
-                    if (type.tag == FORALL)
+                    if (type.hasTag(FORALL))
                         s = "<" + ((ForAll)type).getTypeArguments() + ">" + s;
                     s += "(" + type.argtypes((flags() & VARARGS) != 0) + ")";
                 }
@@ -1190,9 +1192,9 @@
 
             // check for an inherited implementation
             if ((flags() & ABSTRACT) != 0 ||
-                (other.flags() & ABSTRACT) == 0 ||
-                !other.isOverridableIn(origin) ||
-                !this.isMemberOf(origin, types))
+                    (other.flags() & ABSTRACT) == 0 ||
+                    !other.isOverridableIn(origin) ||
+                    !this.isMemberOf(origin, types))
                 return false;
 
             // assert types.asSuper(origin.type, other.owner) != null;
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java	Wed Nov 14 16:41:12 2012 -0800
@@ -37,6 +37,7 @@
 import com.sun.tools.javac.util.List;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 
 /** A class that defines all predefined constants and operators
  *  as well as special classes such as java.lang.Object, which need
@@ -64,16 +65,16 @@
 
     /** Builtin types.
      */
-    public final Type byteType = new Type(TypeTags.BYTE, null);
-    public final Type charType = new Type(TypeTags.CHAR, null);
-    public final Type shortType = new Type(TypeTags.SHORT, null);
-    public final Type intType = new Type(TypeTags.INT, null);
-    public final Type longType = new Type(TypeTags.LONG, null);
-    public final Type floatType = new Type(TypeTags.FLOAT, null);
-    public final Type doubleType = new Type(TypeTags.DOUBLE, null);
-    public final Type booleanType = new Type(TypeTags.BOOLEAN, null);
+    public final Type byteType = new Type(BYTE, null);
+    public final Type charType = new Type(CHAR, null);
+    public final Type shortType = new Type(SHORT, null);
+    public final Type intType = new Type(INT, null);
+    public final Type longType = new Type(LONG, null);
+    public final Type floatType = new Type(FLOAT, null);
+    public final Type doubleType = new Type(DOUBLE, null);
+    public final Type booleanType = new Type(BOOLEAN, null);
     public final Type botType = new BottomType();
-    public final JCNoType voidType = new JCNoType(TypeTags.VOID);
+    public final JCNoType voidType = new JCNoType(VOID);
 
     private final Names names;
     private final ClassReader reader;
@@ -126,6 +127,7 @@
     public final Type cloneableType;
     public final Type serializableType;
     public final Type methodHandleType;
+    public final Type methodHandleLookupType;
     public final Type methodTypeType;
     public final Type nativeHeaderType;
     public final Type throwableType;
@@ -157,6 +159,7 @@
     public final Type systemType;
     public final Type autoCloseableType;
     public final Type trustMeType;
+    public final Type lambdaMetafactory;
     public final Type containedByType;
     public final Type containerForType;
     public final Type documentedType;
@@ -177,11 +180,11 @@
 
     /** The predefined type that belongs to a tag.
      */
-    public final Type[] typeOfTag = new Type[TypeTags.TypeTagCount];
+    public final Type[] typeOfTag = new Type[TypeTag.getTypeTagCount()];
 
     /** The name of the class that belongs to a basix type tag.
      */
-    public final Name[] boxedName = new Name[TypeTags.TypeTagCount];
+    public final Name[] boxedName = new Name[TypeTag.getTypeTagCount()];
 
     /** A set containing all operator names.
      */
@@ -202,7 +205,7 @@
 
     public void initType(Type type, ClassSymbol c) {
         type.tsym = c;
-        typeOfTag[type.tag] = type;
+        typeOfTag[type.tag.ordinal()] = type;
     }
 
     public void initType(Type type, String name) {
@@ -214,7 +217,7 @@
 
     public void initType(Type type, String name, String bname) {
         initType(type, name);
-            boxedName[type.tag] = names.fromString("java.lang." + bname);
+            boxedName[type.tag.ordinal()] = names.fromString("java.lang." + bname);
     }
 
     /** The class symbol that owns all predefined symbols.
@@ -324,7 +327,7 @@
     }
 
     public void synthesizeBoxTypeIfMissing(final Type type) {
-        ClassSymbol sym = reader.enterClass(boxedName[type.tag]);
+        ClassSymbol sym = reader.enterClass(boxedName[type.tag.ordinal()]);
         final Completer completer = sym.completer;
         if (completer != null) {
             sym.completer = new Completer() {
@@ -366,7 +369,7 @@
         target = Target.instance(context);
 
         // Create the unknown type
-        unknownType = new Type(TypeTags.UNKNOWN, null) {
+        unknownType = new Type(UNKNOWN, null) {
             @Override
             public <R, P> R accept(TypeVisitor<R, P> v, P p) {
                 return v.visitUnknown(this, p);
@@ -455,6 +458,7 @@
         throwableType = enterClass("java.lang.Throwable");
         serializableType = enterClass("java.io.Serializable");
         methodHandleType = enterClass("java.lang.invoke.MethodHandle");
+        methodHandleLookupType = enterClass("java.lang.invoke.MethodHandles$Lookup");
         methodTypeType = enterClass("java.lang.invoke.MethodType");
         errorType = enterClass("java.lang.Error");
         illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
@@ -502,10 +506,12 @@
                              autoCloseableType.tsym);
         trustMeType = enterClass("java.lang.SafeVarargs");
         nativeHeaderType = enterClass("javax.tools.annotation.GenerateNativeHeader");
+        lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory");
 
         synthesizeEmptyInterfaceIfMissing(autoCloseableType);
         synthesizeEmptyInterfaceIfMissing(cloneableType);
         synthesizeEmptyInterfaceIfMissing(serializableType);
+        synthesizeEmptyInterfaceIfMissing(lambdaMetafactory);
         synthesizeBoxTypeIfMissing(doubleType);
         synthesizeBoxTypeIfMissing(floatType);
         synthesizeBoxTypeIfMissing(voidType);
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Type.java	Wed Nov 14 16:41:12 2012 -0800
@@ -38,7 +38,7 @@
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 
 /** This class represents Java types. The class itself defines the behavior of
  *  the following types:
@@ -66,7 +66,7 @@
  *  This code and its internal interfaces are subject to change or
  *  deletion without notice.</b>
  *
- *  @see TypeTags
+ *  @see TypeTag
  */
 public class Type implements PrimitiveType {
 
@@ -83,15 +83,77 @@
 
     /** The tag of this type.
      *
-     *  @see TypeTags
+     *  @see TypeTag
      */
-    public int tag;
+    protected TypeTag tag;
 
     /** The defining class / interface / package / type variable
      */
     public TypeSymbol tsym;
 
     /**
+     * Checks if the current type tag is equal to the given tag.
+     * @return true if tag is equal to the current type tag.
+     */
+    public boolean hasTag(TypeTag tag) {
+        return this.tag == tag;
+    }
+
+    /**
+     * Returns the current type tag.
+     * @return the value of the current type tag.
+     */
+    public TypeTag getTag() {
+        return tag;
+    }
+
+    public boolean isNumeric() {
+        switch (tag) {
+            case BYTE: case CHAR:
+            case SHORT:
+            case INT: case LONG:
+            case FLOAT: case DOUBLE:
+                return true;
+            default:
+                return false;
+        }
+    }
+
+    public boolean isPrimitive() {
+        return (isNumeric() || tag == BOOLEAN);
+    }
+
+    public boolean isPrimitiveOrVoid() {
+        return (isPrimitive() || tag == VOID);
+    }
+
+    public boolean isReference() {
+        switch (tag) {
+        case CLASS:
+        case ARRAY:
+        case TYPEVAR:
+        case WILDCARD:
+        case ERROR:
+            return true;
+        default:
+            return false;
+        }
+    }
+
+    public boolean isNullOrReference() {
+        return (tag == BOT || isReference());
+    }
+
+    public boolean isPartial() {
+        switch(tag) {
+            case ERROR: case UNKNOWN: case UNDETVAR:
+                return true;
+            default:
+                return false;
+        }
+    }
+
+    /**
      * The constant value of this type, null if this type does not
      * have a constant value attribute. Only primitive types and
      * strings (ClassType) can have a constant value attribute.
@@ -121,7 +183,7 @@
 
     /** Define a type given its tag and type symbol
      */
-    public Type(int tag, TypeSymbol tsym) {
+    public Type(TypeTag tag, TypeSymbol tsym) {
         this.tag = tag;
         this.tsym = tsym;
     }
@@ -162,7 +224,7 @@
      */
     public Type constType(Object constValue) {
         final Object value = constValue;
-        Assert.check(tag <= BOOLEAN);
+        Assert.check(isPrimitive());
         return new Type(tag, tsym) {
                 @Override
                 public Object constValue() {
@@ -352,10 +414,6 @@
         return (tsym.flags() & FINAL) != 0;
     }
 
-    public boolean isPrimitive() {
-        return tag < VOID;
-    }
-
     /**
      * Does this type contain occurrences of type t?
      */
@@ -808,7 +866,7 @@
         }
 
         public int hashCode() {
-            return (ARRAY << 5) + elemtype.hashCode();
+            return (ARRAY.ordinal() << 5) + elemtype.hashCode();
         }
 
         public boolean isVarargs() {
@@ -915,7 +973,7 @@
         }
 
         public int hashCode() {
-            int h = METHOD;
+            int h = METHOD.ordinal();
             for (List<Type> thisargs = this.argtypes;
                  thisargs.tail != null; /*inlined: thisargs.nonEmpty()*/
                  thisargs = thisargs.tail)
@@ -1099,7 +1157,7 @@
 
     public static abstract class DelegatedType extends Type {
         public Type qtype;
-        public DelegatedType(int tag, Type qtype) {
+        public DelegatedType(TypeTag tag, Type qtype) {
             super(tag, qtype.tsym);
             this.qtype = qtype;
         }
@@ -1285,7 +1343,7 @@
     /** Represents VOID or NONE.
      */
     static class JCNoType extends Type implements NoType {
-        public JCNoType(int tag) {
+        public JCNoType(TypeTag tag) {
             super(tag, null);
         }
 
@@ -1307,7 +1365,7 @@
 
     static class BottomType extends Type implements NullType {
         public BottomType() {
-            super(TypeTags.BOT, null);
+            super(BOT, null);
         }
 
         @Override
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeTag.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,226 @@
+/*
+ * Copyright (c) 1999, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.tools.javac.code;
+
+import com.sun.source.tree.Tree.Kind;
+
+import javax.lang.model.type.TypeKind;
+
+/** An interface for type tag values, which distinguish between different
+ *  sorts of types.
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public enum TypeTag {
+    /** The tag of the basic type `byte'.
+     */
+    BYTE(1),
+
+    /** The tag of the basic type `char'.
+     */
+    CHAR(2),
+
+    /** The tag of the basic type `short'.
+     */
+    SHORT(3),
+
+    /** The tag of the basic type `int'.
+     */
+    INT(4),
+
+    /** The tag of the basic type `long'.
+     */
+    LONG(5),
+
+    /** The tag of the basic type `float'.
+     */
+    FLOAT(6),
+
+    /** The tag of the basic type `double'.
+     */
+    DOUBLE(7),
+
+    /** The tag of the basic type `boolean'.
+     */
+    BOOLEAN,
+
+    /** The tag of the type `void'.
+     */
+    VOID,
+
+    /** The tag of all class and interface types.
+     */
+    CLASS,
+
+    /** The tag of all array types.
+     */
+    ARRAY,
+
+    /** The tag of all (monomorphic) method types.
+     */
+    METHOD,
+
+    /** The tag of all package "types".
+     */
+    PACKAGE,
+
+    /** The tag of all (source-level) type variables.
+     */
+    TYPEVAR,
+
+    /** The tag of all type arguments.
+     */
+    WILDCARD,
+
+    /** The tag of all polymorphic (method-) types.
+     */
+    FORALL,
+
+    /** The tag of deferred expression types in method context
+     */
+    DEFERRED,
+
+    /** The tag of the bottom type {@code <null>}.
+     */
+    BOT,
+
+    /** The tag of a missing type.
+     */
+    NONE,
+
+    /** The tag of the error type.
+     */
+    ERROR,
+
+    /** The tag of an unknown type
+     */
+    UNKNOWN,
+
+    /** The tag of all instantiatable type variables.
+     */
+    UNDETVAR,
+
+    /** Pseudo-types, these are special tags
+     */
+    UNINITIALIZED_THIS,
+
+    UNINITIALIZED_OBJECT;
+
+    /** This field will only be used for tags related with numeric types for
+     *  optimization reasons.
+     */
+    private int order = 0;
+
+    private TypeTag() {}
+
+    private TypeTag(int order) {
+        this.order = order;
+    }
+
+    private static final int MIN_NUMERIC_TAG_ORDER = 1;
+    private static final int MAX_NUMERIC_TAG_ORDER = 7;
+
+    /** Returns the number of type tags.
+     */
+    public static int getTypeTagCount() {
+        // last two tags are not included in the total as long as they are pseudo-types
+        return (UNDETVAR.ordinal() + 1);
+    }
+
+    public boolean isSubRangeOf(TypeTag range) {
+        return (this == range) || isStrictSubRangeOf(range);
+    }
+
+    public boolean isStrictSubRangeOf(TypeTag range) {
+        if (this.order >= MIN_NUMERIC_TAG_ORDER && this.order <= MAX_NUMERIC_TAG_ORDER &&
+            range.order >= MIN_NUMERIC_TAG_ORDER && this.order <= MAX_NUMERIC_TAG_ORDER) {
+            if (this == range)
+                return false;
+            switch (this) {
+                case BYTE:
+                    return true;
+                case CHAR: case SHORT: case INT:
+                case LONG: case FLOAT:
+                    return this.order < range.order && range.order <= MAX_NUMERIC_TAG_ORDER;
+                default:
+                    return false;
+            }
+        }
+        else
+            return false;
+    }
+
+    public Kind getKindLiteral() {
+        switch (this) {
+        case INT:
+            return Kind.INT_LITERAL;
+        case LONG:
+            return Kind.LONG_LITERAL;
+        case FLOAT:
+            return Kind.FLOAT_LITERAL;
+        case DOUBLE:
+            return Kind.DOUBLE_LITERAL;
+        case BOOLEAN:
+            return Kind.BOOLEAN_LITERAL;
+        case CHAR:
+            return Kind.CHAR_LITERAL;
+        case CLASS:
+            return Kind.STRING_LITERAL;
+        case BOT:
+            return Kind.NULL_LITERAL;
+        default:
+            throw new AssertionError("unknown literal kind " + this);
+        }
+    }
+
+    public TypeKind getPrimitiveTypeKind() {
+        switch (this) {
+        case BOOLEAN:
+            return TypeKind.BOOLEAN;
+        case BYTE:
+            return TypeKind.BYTE;
+        case SHORT:
+            return TypeKind.SHORT;
+        case INT:
+            return TypeKind.INT;
+        case LONG:
+            return TypeKind.LONG;
+        case CHAR:
+            return TypeKind.CHAR;
+        case FLOAT:
+            return TypeKind.FLOAT;
+        case DOUBLE:
+            return TypeKind.DOUBLE;
+        case VOID:
+            return TypeKind.VOID;
+        default:
+            throw new AssertionError("unknown primitive type " + this);
+        }
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeTags.java	Tue Nov 13 20:02:39 2012 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 1999, 2012, 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.javac.code;
-
-
-/** An interface for type tag values, which distinguish between different
- *  sorts of types.
- *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
- */
-public class TypeTags {
-
-    private TypeTags() {} // uninstantiable
-
-    /** The tag of the basic type `byte'.
-     */
-    public static final int BYTE = 1;
-
-    /** The tag of the basic type `char'.
-     */
-    public static final int CHAR = BYTE+1;
-
-    /** The tag of the basic type `short'.
-     */
-    public static final int SHORT = CHAR+1;
-
-    /** The tag of the basic type `int'.
-     */
-    public static final int INT = SHORT+1;
-
-    /** The tag of the basic type `long'.
-     */
-    public static final int LONG = INT+1;
-
-    /** The tag of the basic type `float'.
-     */
-    public static final int FLOAT = LONG+1;
-
-    /** The tag of the basic type `double'.
-     */
-    public static final int DOUBLE = FLOAT+1;
-
-    /** The tag of the basic type `boolean'.
-     */
-    public static final int BOOLEAN = DOUBLE+1;
-
-    /** The tag of the type `void'.
-     */
-    public static final int VOID = BOOLEAN+1;
-
-    /** The tag of all class and interface types.
-     */
-    public static final int CLASS = VOID+1;
-
-    /** The tag of all array types.
-     */
-    public static final int ARRAY = CLASS+1;
-
-    /** The tag of all (monomorphic) method types.
-     */
-    public static final int METHOD = ARRAY+1;
-
-    /** The tag of all package "types".
-     */
-    public static final int PACKAGE = METHOD+1;
-
-    /** The tag of all (source-level) type variables.
-     */
-    public static final int TYPEVAR = PACKAGE+1;
-
-    /** The tag of all type arguments.
-     */
-    public static final int WILDCARD = TYPEVAR+1;
-
-    /** The tag of all polymorphic (method-) types.
-     */
-    public static final int FORALL = WILDCARD+1;
-
-    /** The tag of deferred expression types in method context
-     */
-    public static final int DEFERRED = FORALL+1;
-
-    /** The tag of the bottom type {@code <null>}.
-     */
-    public static final int BOT = DEFERRED+1;
-
-    /** The tag of a missing type.
-     */
-    public static final int NONE = BOT+1;
-
-    /** The tag of the error type.
-     */
-    public static final int ERROR = NONE+1;
-
-    /** The tag of an unknown type
-     */
-    public static final int UNKNOWN = ERROR+1;
-
-    /** The tag of all instantiatable type variables.
-     */
-    public static final int UNDETVAR = UNKNOWN+1;
-
-    /** The number of type tags.
-     */
-    public static final int TypeTagCount = UNDETVAR+1;
-
-    /** The maximum tag of a basic type.
-     */
-    public static final int lastBaseTag = BOOLEAN;
-
-    /** The minimum tag of a partial type
-     */
-    public static final int firstPartialTag = ERROR;
-}
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java	Wed Nov 14 16:41:12 2012 -0800
@@ -40,7 +40,7 @@
 import static com.sun.tools.javac.code.Scope.*;
 import static com.sun.tools.javac.code.Symbol.*;
 import static com.sun.tools.javac.code.Type.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.util.ListBuffer.lb;
 
 /**
@@ -75,6 +75,7 @@
     final boolean allowBoxing;
     final boolean allowCovariantReturns;
     final boolean allowObjectToPrimitiveCast;
+    final boolean allowDefaultMethods;
     final ClassReader reader;
     final Check chk;
     JCDiagnostic.Factory diags;
@@ -98,6 +99,7 @@
         allowBoxing = source.allowBoxing();
         allowCovariantReturns = source.allowCovariantReturns();
         allowObjectToPrimitiveCast = source.allowObjectToPrimitiveCast();
+        allowDefaultMethods = source.allowDefaultMethods();
         reader = ClassReader.instance(context);
         chk = Check.instance(context);
         capturedName = names.fromString("<captured wildcard>");
@@ -605,8 +607,8 @@
     }
     //where
         private boolean isSubtypeUncheckedInternal(Type t, Type s, Warner warn) {
-            if (t.tag == ARRAY && s.tag == ARRAY) {
-                if (((ArrayType)t).elemtype.tag <= lastBaseTag) {
+            if (t.hasTag(ARRAY) && s.hasTag(ARRAY)) {
+                if (((ArrayType)t).elemtype.isPrimitive()) {
                     return isSameType(elemtype(t), elemtype(s));
                 } else {
                     return isSubtypeUnchecked(elemtype(t), elemtype(s), warn);
@@ -664,7 +666,7 @@
         if (t == s)
             return true;
 
-        if (s.tag >= firstPartialTag)
+        if (s.isPartial())
             return isSuperType(s, t);
 
         if (s.isCompound()) {
@@ -686,25 +688,27 @@
         {
             public Boolean visitType(Type t, Type s) {
                 switch (t.tag) {
-                case BYTE: case CHAR:
-                    return (t.tag == s.tag ||
-                              t.tag + 2 <= s.tag && s.tag <= DOUBLE);
-                case SHORT: case INT: case LONG: case FLOAT: case DOUBLE:
-                    return t.tag <= s.tag && s.tag <= DOUBLE;
-                case BOOLEAN: case VOID:
-                    return t.tag == s.tag;
-                case TYPEVAR:
-                    return isSubtypeNoCapture(t.getUpperBound(), s);
-                case BOT:
-                    return
-                        s.tag == BOT || s.tag == CLASS ||
-                        s.tag == ARRAY || s.tag == TYPEVAR;
-                case WILDCARD: //we shouldn't be here - avoids crash (see 7034495)
-                case NONE:
-                    return false;
-                default:
-                    throw new AssertionError("isSubtype " + t.tag);
-                }
+                 case BYTE:
+                     return (!s.hasTag(CHAR) && t.getTag().isSubRangeOf(s.getTag()));
+                 case CHAR:
+                     return (!s.hasTag(SHORT) && t.getTag().isSubRangeOf(s.getTag()));
+                 case SHORT: case INT: case LONG:
+                 case FLOAT: case DOUBLE:
+                     return t.getTag().isSubRangeOf(s.getTag());
+                 case BOOLEAN: case VOID:
+                     return t.hasTag(s.getTag());
+                 case TYPEVAR:
+                     return isSubtypeNoCapture(t.getUpperBound(), s);
+                 case BOT:
+                     return
+                         s.hasTag(BOT) || s.hasTag(CLASS) ||
+                         s.hasTag(ARRAY) || s.hasTag(TYPEVAR);
+                 case WILDCARD: //we shouldn't be here - avoids crash (see 7034495)
+                 case NONE:
+                     return false;
+                 default:
+                     throw new AssertionError("isSubtype " + t.tag);
+                 }
             }
 
             private Set<TypePair> cache = new HashSet<TypePair>();
@@ -774,7 +778,7 @@
             @Override
             public Boolean visitArrayType(ArrayType t, Type s) {
                 if (s.tag == ARRAY) {
-                    if (t.elemtype.tag <= lastBaseTag)
+                    if (t.elemtype.isPrimitive())
                         return isSameType(t.elemtype, elemtype(s));
                     else
                         return isSubtypeNoCapture(t.elemtype, elemtype(s));
@@ -907,7 +911,7 @@
                 if (t == s)
                     return true;
 
-                if (s.tag >= firstPartialTag)
+                if (s.isPartial())
                     return visit(s, t);
 
                 switch (t.tag) {
@@ -936,7 +940,7 @@
 
             @Override
             public Boolean visitWildcardType(WildcardType t, Type s) {
-                if (s.tag >= firstPartialTag)
+                if (s.isPartial())
                     return visit(s, t);
                 else
                     return false;
@@ -947,7 +951,7 @@
                 if (t == s)
                     return true;
 
-                if (s.tag >= firstPartialTag)
+                if (s.isPartial())
                     return visit(s, t);
 
                 if (s.isSuperBound() && !s.isExtendsBound())
@@ -976,10 +980,10 @@
                 if (t == s)
                     return true;
 
-                if (s.tag >= firstPartialTag)
+                if (s.isPartial())
                     return visit(s, t);
 
-                return s.tag == ARRAY
+                return s.hasTag(ARRAY)
                     && containsTypeEquivalent(t.elemtype, elemtype(s));
             }
 
@@ -1120,7 +1124,7 @@
             }
 
             public Boolean visitType(Type t, Type s) {
-                if (s.tag >= firstPartialTag)
+                if (s.isPartial())
                     return containedBy(s, t);
                 else
                     return isSameType(t, s);
@@ -1142,7 +1146,7 @@
 
             @Override
             public Boolean visitWildcardType(WildcardType t, Type s) {
-                if (s.tag >= firstPartialTag)
+                if (s.isPartial())
                     return containedBy(s, t);
                 else {
 //                    debugContainsType(t, s);
@@ -1232,7 +1236,7 @@
                 switch (t.tag) {
                 case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
                 case DOUBLE:
-                    return s.tag <= DOUBLE;
+                    return s.isNumeric();
                 case BOOLEAN:
                     return s.tag == BOOLEAN;
                 case VOID:
@@ -1373,8 +1377,7 @@
                 case CLASS:
                     return isSubtype(t, s);
                 case ARRAY:
-                    if (elemtype(t).tag <= lastBaseTag ||
-                            elemtype(s).tag <= lastBaseTag) {
+                    if (elemtype(t).isPrimitive() || elemtype(s).isPrimitive()) {
                         return elemtype(t).tag == elemtype(s).tag;
                     } else {
                         return visit(elemtype(t), elemtype(s));
@@ -1648,8 +1651,8 @@
      */
     public ArrayType makeArrayType(Type t) {
         if (t.tag == VOID ||
-            t.tag >= PACKAGE) {
-            Assert.error("Type t must not be a a VOID or PACKAGE type, " + t.toString());
+            t.tag == PACKAGE) {
+            Assert.error("Type t must not be a VOID or PACKAGE type, " + t.toString());
         }
         return new ArrayType(t, syms.arrayClass);
     }
@@ -1847,7 +1850,7 @@
     public boolean isAssignable(Type t, Type s, Warner warn) {
         if (t.tag == ERROR)
             return true;
-        if (t.tag <= INT && t.constValue() != null) {
+        if (t.tag.isSubRangeOf(INT) && t.constValue() != null) {
             int value = ((Number)t.constValue()).intValue();
             switch (s.tag) {
             case BYTE:
@@ -1891,11 +1894,11 @@
         // We don't want to erase primitive types and String type as that
         // operation is idempotent. Also, erasing these could result in loss
         // of information such as constant values attached to such types.
-        return (t.tag <= lastBaseTag) || (syms.stringType.tsym == t.tsym);
+        return (t.isPrimitive()) || (syms.stringType.tsym == t.tsym);
     }
 
     private Type erasure(Type t, boolean recurse) {
-        if (t.tag <= lastBaseTag)
+        if (t.isPrimitive())
             return t; /* fast special case */
         else
             return erasure.visit(t, recurse);
@@ -1903,7 +1906,7 @@
     // where
         private SimpleVisitor<Type, Boolean> erasure = new SimpleVisitor<Type, Boolean>() {
             public Type visitType(Type t, Boolean recurse) {
-                if (t.tag <= lastBaseTag)
+                if (t.isPrimitive())
                     return t; /*fast special case*/
                 else
                     return t.map(recurse ? erasureRecFun : erasureFun);
@@ -2145,6 +2148,13 @@
                 return List.nil();
             }
         };
+
+    public boolean isDirectSuperInterface(Type t, TypeSymbol tsym) {
+        for (Type t2 : interfaces(tsym.type)) {
+            if (isSameType(t, t2)) return true;
+        }
+        return false;
+    }
     // </editor-fold>
 
     // <editor-fold defaultstate="collapsed" desc="isDerivedRaw">
@@ -2309,6 +2319,10 @@
         return false;
     }
 
+    public boolean overridesObjectMethod(Symbol msym) {
+        return ((MethodSymbol)msym).implementation(syms.objectType.tsym, this, true) != null;
+    }
+
     // <editor-fold defaultstate="collapsed" desc="Determining method implementation in given site">
     class ImplementationCache {
 
@@ -2454,6 +2468,70 @@
     }
     // </editor-fold>
 
+
+    //where
+    public List<MethodSymbol> interfaceCandidates(Type site, MethodSymbol ms) {
+        return interfaceCandidates(site, ms, false);
+    }
+
+    public List<MethodSymbol> interfaceCandidates(Type site, MethodSymbol ms, boolean intfOnly) {
+        Filter<Symbol> filter = new MethodFilter(ms, site, intfOnly);
+        List<MethodSymbol> candidates = List.nil();
+        for (Symbol s : membersClosure(site, false).getElements(filter)) {
+            if (!site.tsym.isInterface() && !s.owner.isInterface()) {
+                return List.of((MethodSymbol)s);
+            } else if (!candidates.contains(s)) {
+                candidates = candidates.prepend((MethodSymbol)s);
+            }
+        }
+        return prune(candidates, ownerComparator);
+    }
+
+    public List<MethodSymbol> prune(List<MethodSymbol> methods, Comparator<MethodSymbol> cmp) {
+        ListBuffer<MethodSymbol> methodsMin = ListBuffer.lb();
+        for (MethodSymbol m1 : methods) {
+            boolean isMin_m1 = true;
+            for (MethodSymbol m2 : methods) {
+                if (m1 == m2) continue;
+                if (cmp.compare(m2, m1) < 0) {
+                    isMin_m1 = false;
+                    break;
+                }
+            }
+            if (isMin_m1)
+                methodsMin.append(m1);
+        }
+        return methodsMin.toList();
+    }
+
+    Comparator<MethodSymbol> ownerComparator = new Comparator<MethodSymbol>() {
+        public int compare(MethodSymbol s1, MethodSymbol s2) {
+            return s1.owner.isSubClass(s2.owner, Types.this) ? -1 : 1;
+        }
+    };
+    // where
+            private class MethodFilter implements Filter<Symbol> {
+
+                Symbol msym;
+                Type site;
+                boolean intfOnly;
+
+                MethodFilter(Symbol msym, Type site, boolean intfOnly) {
+                    this.msym = msym;
+                    this.site = site;
+                    this.intfOnly = intfOnly;
+                }
+
+                public boolean accepts(Symbol s) {
+                    return s.kind == Kinds.MTH &&
+                            (!intfOnly || s.owner.isInterface()) &&
+                            s.name == msym.name &&
+                            s.isInheritedIn(site.tsym, Types.this) &&
+                            overrideEquivalent(memberType(site, s), memberType(site, msym));
+                }
+            };
+    // </editor-fold>
+
     /**
      * Does t have the same arguments as s?  It is assumed that both
      * types are (possibly polymorphic) method types.  Monomorphic
@@ -3314,7 +3392,7 @@
         private static final UnaryVisitor<Integer> hashCode = new UnaryVisitor<Integer>() {
 
             public Integer visitType(Type t, Void ignored) {
-                return t.tag;
+                return t.tag.ordinal();
             }
 
             @Override
@@ -3430,7 +3508,7 @@
      * Return the class that boxes the given primitive.
      */
     public ClassSymbol boxedClass(Type t) {
-        return reader.enterClass(syms.boxedName[t.tag]);
+        return reader.enterClass(syms.boxedName[t.tag.ordinal()]);
     }
 
     /**
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java	Wed Nov 14 16:41:12 2012 -0800
@@ -34,6 +34,8 @@
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
 
+import static com.sun.tools.javac.code.TypeTag.ARRAY;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /** Enter annotations on symbols.  Annotations accumulate in a queue,
@@ -289,7 +291,7 @@
             }
             return enterAnnotation((JCAnnotation)tree, expected, env);
         }
-        if (expected.tag == TypeTags.ARRAY) { // should really be isArray()
+        if (expected.hasTag(ARRAY)) { // should really be isArray()
             if (!tree.hasTag(NEWARRAY)) {
                 tree = make.at(tree.pos).
                     NewArray(null, List.<JCExpression>nil(), List.of(tree));
@@ -309,7 +311,7 @@
             return new Attribute.
                 Array(expected, buf.toArray(new Attribute[buf.length()]));
         }
-        if (expected.tag == TypeTags.CLASS &&
+        if (expected.hasTag(CLASS) &&
             (expected.tsym.flags() & Flags.ENUM) != 0) {
             attr.attribExpr(tree, env, expected);
             Symbol sym = TreeInfo.symbol(tree);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Wed Nov 14 16:41:12 2012 -0800
@@ -56,8 +56,8 @@
 import static com.sun.tools.javac.code.Flags.BLOCK;
 import static com.sun.tools.javac.code.Kinds.*;
 import static com.sun.tools.javac.code.Kinds.ERRONEOUS;
-import static com.sun.tools.javac.code.TypeTags.*;
-import static com.sun.tools.javac.code.TypeTags.WILDCARD;
+import static com.sun.tools.javac.code.TypeTag.*;
+import static com.sun.tools.javac.code.TypeTag.WILDCARD;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /** This is the main context-dependent analysis phase in GJC. It
@@ -135,6 +135,7 @@
         allowStringsInSwitch = source.allowStringsInSwitch();
         allowPoly = source.allowPoly() && options.isSet("allowPoly");
         allowLambda = source.allowLambda();
+        allowDefaultMethods = source.allowDefaultMethods();
         sourceName = source.name;
         relax = (options.isSet("-retrofit") ||
                  options.isSet("-relax"));
@@ -178,6 +179,10 @@
      */
     boolean allowCovariantReturns;
 
+    /** Switch: support default methods ?
+     */
+    boolean allowDefaultMethods;
+
     /** Switch: support lambda expressions ?
      */
     boolean allowLambda;
@@ -227,14 +232,13 @@
      *  are correct.
      *
      *  @param tree     The tree whose kind and type is checked
-     *  @param owntype  The computed type of the tree
      *  @param ownkind  The computed kind of the tree
      *  @param resultInfo  The expected result of the tree
      */
     Type check(final JCTree tree, final Type found, final int ownkind, final ResultInfo resultInfo) {
         InferenceContext inferenceContext = resultInfo.checkContext.inferenceContext();
         Type owntype = found;
-        if (owntype.tag != ERROR && resultInfo.pt.tag != METHOD && resultInfo.pt.tag != FORALL) {
+        if (!owntype.hasTag(ERROR) && !resultInfo.pt.hasTag(METHOD) && !resultInfo.pt.hasTag(FORALL)) {
             if (inferenceContext.free(found)) {
                 inferenceContext.addFreeTypeListener(List.of(found, resultInfo.pt), new FreeTypeListener() {
                     @Override
@@ -606,7 +610,7 @@
     /** Derived visitor method: attribute an expression tree.
      */
     public Type attribExpr(JCTree tree, Env<AttrContext> env, Type pt) {
-        return attribTree(tree, env, new ResultInfo(VAL, pt.tag != ERROR ? pt : Type.noType));
+        return attribTree(tree, env, new ResultInfo(VAL, !pt.hasTag(ERROR) ? pt : Type.noType));
     }
 
     /** Derived visitor method: attribute an expression tree with
@@ -806,7 +810,7 @@
                    boolean checkExtensible) {
         if (t.isErroneous())
             return t;
-        if (t.tag == TYPEVAR && !classExpected && !interfaceExpected) {
+        if (t.hasTag(TYPEVAR) && !classExpected && !interfaceExpected) {
             // check that type variable is already visible
             if (t.getUpperBound() == null) {
                 log.error(tree.pos(), "illegal.forward.ref");
@@ -899,6 +903,10 @@
 
             localEnv.info.lint = lint;
 
+            if (isDefaultMethod && types.overridesObjectMethod(m)) {
+                log.error(tree, "default.overrides.object.member", m.name, Kinds.kindName(m.location()), m.location());
+            }
+
             // Enter all type parameters into the local method scope.
             for (List<JCTypeParameter> l = tree.typarams; l.nonEmpty(); l = l.tail)
                 localEnv.info.scope.enterIfAbsent(l.head.type.tsym);
@@ -962,10 +970,12 @@
                         log.error(tree.pos(),
                                   "default.allowed.in.intf.annotation.member");
                 }
-            } else if ((owner.flags() & INTERFACE) != 0 && !isDefaultMethod) {
-                log.error(tree.body.pos(), "intf.meth.cant.have.body");
-            } else if ((tree.mods.flags & ABSTRACT) != 0) {
-                log.error(tree.pos(), "abstract.meth.cant.have.body");
+            } else if ((tree.sym.flags() & ABSTRACT) != 0 && !isDefaultMethod) {
+                if ((owner.flags() & INTERFACE) != 0) {
+                    log.error(tree.body.pos(), "intf.meth.cant.have.body");
+                } else {
+                    log.error(tree.pos(), "abstract.meth.cant.have.body");
+                }
             } else if ((tree.mods.flags & NATIVE) != 0) {
                 log.error(tree.pos(), "native.meth.cant.have.body");
             } else {
@@ -1208,7 +1218,7 @@
                             }
                         } else {
                             Type pattype = attribExpr(c.pat, switchEnv, seltype);
-                            if (pattype.tag != ERROR) {
+                            if (!pattype.hasTag(ERROR)) {
                                 if (pattype.constValue() == null) {
                                     log.error(c.pat.pos(),
                                               (stringSwitch ? "string.const.req" : "const.expr.req"));
@@ -1379,10 +1389,10 @@
         Type condtype = attribExpr(tree.cond, env, syms.booleanType);
 
         boolean standaloneConditional = !allowPoly ||
-                pt().tag == NONE && pt() != Type.recoveryType ||
+                pt().hasTag(NONE) && pt() != Type.recoveryType ||
                 isBooleanOrNumeric(env, tree);
 
-        if (!standaloneConditional && resultInfo.pt.tag == VOID) {
+        if (!standaloneConditional && resultInfo.pt.hasTag(VOID)) {
             //cannot get here (i.e. it means we are returning from void method - which is already an error)
             result = tree.type = types.createErrorType(resultInfo.pt);
             return;
@@ -1416,7 +1426,8 @@
         @SuppressWarnings("fallthrough")
         private boolean isBooleanOrNumeric(Env<AttrContext> env, JCExpression tree) {
             switch (tree.getTag()) {
-                case LITERAL: return ((JCLiteral)tree).typetag < CLASS;
+                case LITERAL: return ((JCLiteral)tree).typetag.isSubRangeOf(DOUBLE) ||
+                              ((JCLiteral)tree).typetag == BOOLEAN;
                 case LAMBDA: case REFERENCE: return false;
                 case PARENS: return isBooleanOrNumeric(env, ((JCParens)tree).expr);
                 case CONDEXPR:
@@ -1426,7 +1437,7 @@
                 default:
                     Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo).type;
                     speculativeType = types.unboxedTypeOrType(speculativeType);
-                    return speculativeType.tag <= BOOLEAN;
+                    return speculativeType.isPrimitive();
             }
         }
 
@@ -1459,16 +1470,19 @@
                 // If one arm has an integer subrange type (i.e., byte,
                 // short, or char), and the other is an integer constant
                 // that fits into the subrange, return the subrange type.
-                if (thenUnboxed.tag < INT && elseUnboxed.tag == INT &&
+                if (thenUnboxed.getTag().isStrictSubRangeOf(INT) && elseUnboxed.hasTag(INT) &&
                     types.isAssignable(elseUnboxed, thenUnboxed))
                     return thenUnboxed.baseType();
-                if (elseUnboxed.tag < INT && thenUnboxed.tag == INT &&
+                if (elseUnboxed.getTag().isStrictSubRangeOf(INT) && thenUnboxed.hasTag(INT) &&
                     types.isAssignable(thenUnboxed, elseUnboxed))
                     return elseUnboxed.baseType();
 
-                for (int i = BYTE; i < VOID; i++) {
-                    Type candidate = syms.typeOfTag[i];
-                    if (types.isSubtype(thenUnboxed, candidate) &&
+                for (TypeTag tag : TypeTag.values()) {
+                    if (tag.ordinal() >= TypeTag.getTypeTagCount()) break;
+                    Type candidate = syms.typeOfTag[tag.ordinal()];
+                    if (candidate != null &&
+                        candidate.isPrimitive() &&
+                        types.isSubtype(thenUnboxed, candidate) &&
                         types.isSubtype(elseUnboxed, candidate))
                         return candidate;
                 }
@@ -1487,7 +1501,7 @@
             if (types.isSubtype(elsetype, thentype))
                 return thentype.baseType();
 
-            if (!allowBoxing || thentype.tag == VOID || elsetype.tag == VOID) {
+            if (!allowBoxing || thentype.hasTag(VOID) || elsetype.hasTag(VOID)) {
                 log.error(pos, "neither.conditional.subtype",
                           thentype, elsetype);
                 return thentype.baseType();
@@ -1601,12 +1615,12 @@
             // Attribute return expression, if it exists, and check that
             // it conforms to result type of enclosing method.
             if (tree.expr != null) {
-                if (env.info.returnResult.pt.tag == VOID) {
+                if (env.info.returnResult.pt.hasTag(VOID)) {
                     log.error(tree.expr.pos(),
                               "cant.ret.val.from.meth.decl.void");
                 }
                 attribTree(tree.expr, env, env.info.returnResult);
-            } else if (env.info.returnResult.pt.tag != VOID) {
+            } else if (!env.info.returnResult.pt.hasTag(VOID)) {
                 log.error(tree.pos(), "missing.ret.val");
             }
         }
@@ -1671,11 +1685,11 @@
                     }
                 }
 
-                if (site.tag == CLASS) {
+                if (site.hasTag(CLASS)) {
                     Type encl = site.getEnclosingType();
-                    while (encl != null && encl.tag == TYPEVAR)
+                    while (encl != null && encl.hasTag(TYPEVAR))
                         encl = encl.getUpperBound();
-                    if (encl.tag == CLASS) {
+                    if (encl.hasTag(CLASS)) {
                         // we are calling a nested class
 
                         if (tree.meth.hasTag(SELECT)) {
@@ -1740,7 +1754,7 @@
 
             // Compute the result type.
             Type restype = mtype.getReturnType();
-            if (restype.tag == WILDCARD)
+            if (restype.hasTag(WILDCARD))
                 throw new AssertionError(mtype);
 
             Type qualifier = (tree.meth.hasTag(SELECT))
@@ -1870,7 +1884,7 @@
                 }
             }
         } else if (!clazztype.tsym.isInterface() &&
-                   clazztype.getEnclosingType().tag == CLASS) {
+                   clazztype.getEnclosingType().hasTag(CLASS)) {
             // Check for the existence of an apropos outer instance
             rs.resolveImplicitThis(tree.pos(), env, clazztype);
         }
@@ -1880,7 +1894,7 @@
         List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
 
         // If we have made no mistakes in the class type...
-        if (clazztype.tag == CLASS) {
+        if (clazztype.hasTag(CLASS)) {
             // Enums may not be instantiated except implicitly
             if (allowEnums &&
                 (clazztype.tsym.flags_field&Flags.ENUM) != 0 &&
@@ -2058,7 +2072,7 @@
                             resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
                     Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
                     if (!inferred.isErroneous() &&
-                        types.isAssignable(inferred, pt().tag == NONE ? syms.objectType : pt(), Warner.noWarnings)) {
+                        types.isAssignable(inferred, pt().hasTag(NONE) ? syms.objectType : pt(), Warner.noWarnings)) {
                         String key = types.isSameType(clazztype, inferred) ?
                             "diamond.redundant.args" :
                             "diamond.redundant.args.1";
@@ -2073,8 +2087,8 @@
             private void checkLambdaCandidate(JCNewClass tree, ClassSymbol csym, Type clazztype) {
                 if (allowLambda &&
                         identifyLambdaCandidate &&
-                        clazztype.tag == CLASS &&
-                        pt().tag != NONE &&
+                        clazztype.hasTag(CLASS) &&
+                        !pt().hasTag(NONE) &&
                         types.isFunctionalInterface(clazztype.tsym)) {
                     Symbol descriptor = types.findDescriptorSymbol(clazztype.tsym);
                     int count = 0;
@@ -2125,10 +2139,10 @@
         } else {
             // we are seeing an untyped aggregate { ... }
             // this is allowed only if the prototype is an array
-            if (pt().tag == ARRAY) {
+            if (pt().hasTag(ARRAY)) {
                 elemtype = types.elemtype(pt());
             } else {
-                if (pt().tag != ERROR) {
+                if (!pt().hasTag(ERROR)) {
                     log.error(tree.pos(), "illegal.initializer.for.type",
                               pt());
                 }
@@ -2152,8 +2166,8 @@
      */
     @Override
     public void visitLambda(final JCLambda that) {
-        if (pt().isErroneous() || (pt().tag == NONE && pt() != Type.recoveryType)) {
-            if (pt().tag == NONE) {
+        if (pt().isErroneous() || (pt().hasTag(NONE) && pt() != Type.recoveryType)) {
+            if (pt().hasTag(NONE)) {
                 //lambda only allowed in assignment or method invocation/cast context
                 log.error(that.pos(), "unexpected.lambda");
             }
@@ -2328,7 +2342,7 @@
             //this amounts at checking that, if a lambda body can complete normally,
             //the descriptor's return type must be void
             if (tree.getBodyKind() == JCLambda.BodyKind.STATEMENT && tree.canCompleteNormally &&
-                    returnType.tag != VOID && returnType != Type.recoveryType) {
+                    !returnType.hasTag(VOID) && returnType != Type.recoveryType) {
                 checkContext.report(tree, diags.fragment("incompatible.ret.type.in.lambda",
                         diags.fragment("missing.ret.val", returnType)));
             }
@@ -2363,8 +2377,8 @@
 
     @Override
     public void visitReference(final JCMemberReference that) {
-        if (pt().isErroneous() || (pt().tag == NONE && pt() != Type.recoveryType)) {
-            if (pt().tag == NONE) {
+        if (pt().isErroneous() || (pt().hasTag(NONE) && pt() != Type.recoveryType)) {
+            if (pt().hasTag(NONE)) {
                 //method reference only allowed in assignment or method invocation/cast context
                 log.error(that.pos(), "unexpected.mref");
             }
@@ -2465,7 +2479,7 @@
 
             ResultInfo checkInfo =
                     resultInfo.dup(newMethodTemplate(
-                        desc.getReturnType().tag == VOID ? Type.noType : desc.getReturnType(),
+                        desc.getReturnType().hasTag(VOID) ? Type.noType : desc.getReturnType(),
                         lookupHelper.argtypes,
                         typeargtypes));
 
@@ -2510,11 +2524,11 @@
 
         Type incompatibleReturnType = resType;
 
-        if (returnType.tag == VOID) {
+        if (returnType.hasTag(VOID)) {
             incompatibleReturnType = null;
         }
 
-        if (returnType.tag != VOID && resType.tag != VOID) {
+        if (!returnType.hasTag(VOID) && !resType.hasTag(VOID)) {
             if (resType.isErroneous() ||
                     new LambdaReturnContext(checkContext).compatible(resType, returnType, Warner.noWarnings)) {
                 incompatibleReturnType = null;
@@ -2711,7 +2725,7 @@
         attribExpr(tree.index, env, syms.intType);
         if (types.isArray(atype))
             owntype = types.elemtype(atype);
-        else if (atype.tag != ERROR)
+        else if (!atype.hasTag(ERROR))
             log.error(tree.pos(), "array.req.but.found", atype);
         if ((pkind() & VAR) == 0) owntype = capture(owntype);
         result = check(tree, owntype, VAR, resultInfo);
@@ -2721,7 +2735,7 @@
         Symbol sym;
 
         // Find symbol
-        if (pt().tag == METHOD || pt().tag == FORALL) {
+        if (pt().hasTag(METHOD) || pt().hasTag(FORALL)) {
             // If we are looking for a method, the prototype `pt' will be a
             // method type with the type of the call's arguments as parameters.
             env.info.pendingResolutionPhase = null;
@@ -2811,9 +2825,9 @@
         // don't allow T.class T[].class, etc
         if (skind == TYP) {
             Type elt = site;
-            while (elt.tag == ARRAY)
+            while (elt.hasTag(ARRAY))
                 elt = ((ArrayType)elt).elemtype;
-            if (elt.tag == TYPEVAR) {
+            if (elt.hasTag(TYPEVAR)) {
                 log.error(tree.pos(), "type.var.cant.be.deref");
                 result = types.createErrorType(tree.type);
                 return;
@@ -2839,8 +2853,8 @@
         boolean varArgs = env.info.lastResolveVarargs();
         tree.sym = sym;
 
-        if (site.tag == TYPEVAR && !isType(sym) && sym.kind != ERR) {
-            while (site.tag == TYPEVAR) site = site.getUpperBound();
+        if (site.hasTag(TYPEVAR) && !isType(sym) && sym.kind != ERR) {
+            while (site.hasTag(TYPEVAR)) site = site.getUpperBound();
             site = capture(site);
         }
 
@@ -2929,14 +2943,14 @@
                                  ResultInfo resultInfo) {
             DiagnosticPosition pos = tree.pos();
             Name name = tree.name;
-            switch (site.tag) {
+            switch (site.getTag()) {
             case PACKAGE:
                 return rs.accessBase(
                     rs.findIdentInPackage(env, site.tsym, name, resultInfo.pkind),
                     pos, location, site, name, true);
             case ARRAY:
             case CLASS:
-                if (resultInfo.pt.tag == METHOD || resultInfo.pt.tag == FORALL) {
+                if (resultInfo.pt.hasTag(METHOD) || resultInfo.pt.hasTag(FORALL)) {
                     return rs.resolveQualifiedMethod(
                         pos, env, location, site, name, resultInfo.pt.getParameterTypes(), resultInfo.pt.getTypeArguments());
                 } else if (name == names._this || name == names._super) {
@@ -3029,7 +3043,7 @@
                      Symbol sym,
                      Env<AttrContext> env,
                      ResultInfo resultInfo) {
-            Type pt = resultInfo.pt.tag == FORALL || resultInfo.pt.tag == METHOD ?
+            Type pt = resultInfo.pt.hasTag(FORALL) || resultInfo.pt.hasTag(METHOD) ?
                     resultInfo.pt.map(deferredAttr.new DeferredTypeMap(AttrMode.SPECULATIVE, sym, env.info.pendingResolutionPhase)) :
                     resultInfo.pt;
 
@@ -3046,7 +3060,8 @@
                 // For types, the computed type equals the symbol's type,
                 // except for two situations:
                 owntype = sym.type;
-                if (owntype.tag == CLASS) {
+                if (owntype.hasTag(CLASS)) {
+                    chk.checkForBadAuxiliaryClassAccess(tree.pos(), env, (ClassSymbol)sym);
                     Type ownOuter = owntype.getEnclosingType();
 
                     // (a) If the symbol's type is parameterized, erase it
@@ -3066,9 +3081,9 @@
                     //
                     // Then the type of the last expression above is
                     // Tree<Point>.Visitor.
-                    else if (ownOuter.tag == CLASS && site != ownOuter) {
+                    else if (ownOuter.hasTag(CLASS) && site != ownOuter) {
                         Type normOuter = site;
-                        if (normOuter.tag == CLASS)
+                        if (normOuter.hasTag(CLASS))
                             normOuter = types.asEnclosingSuper(site, ownOuter.tsym);
                         if (normOuter == null) // perhaps from an import
                             normOuter = types.erasure(ownOuter);
@@ -3087,7 +3102,7 @@
                     resultInfo.pkind == VAR &&
                     v.owner.kind == TYP &&
                     (v.flags() & STATIC) == 0 &&
-                    (site.tag == CLASS || site.tag == TYPEVAR)) {
+                    (site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
                     Type s = types.asOuterSuper(site, v.owner);
                     if (s != null &&
                         s.isRaw() &&
@@ -3266,7 +3281,7 @@
         // an unchecked warning if its argument types change under erasure.
         if (allowGenerics &&
             (sym.flags() & STATIC) == 0 &&
-            (site.tag == CLASS || site.tag == TYPEVAR)) {
+            (site.hasTag(CLASS) || site.hasTag(TYPEVAR))) {
             Type s = types.asOuterSuper(site, sym.owner);
             if (s != null && s.isRaw() &&
                 !types.isSameTypes(sym.type.getParameterTypes(),
@@ -3277,6 +3292,23 @@
             }
         }
 
+        if (env.info.defaultSuperCallSite != null &&
+                !types.interfaceCandidates(env.enclClass.type, (MethodSymbol)sym, true).contains(sym)) {
+            Symbol ovSym = null;
+            for (MethodSymbol msym : types.interfaceCandidates(env.enclClass.type, (MethodSymbol)sym, true)) {
+                if (msym.overrides(sym, msym.enclClass(), types, true)) {
+                    for (Type i : types.interfaces(env.enclClass.type)) {
+                        if (i.tsym.isSubClass(msym.owner, types)) {
+                            ovSym = i.tsym;
+                            break;
+                        }
+                    }
+                }
+            }
+            log.error(env.tree.pos(), "illegal.default.super.call", env.info.defaultSuperCallSite,
+                    diags.fragment("overridden.default", sym, ovSym));
+        }
+
         // Compute the identifier's instantiated type.
         // For methods, we need to compute the instance type by
         // Resolve.instantiate from the symbol's type as well as
@@ -3312,12 +3344,12 @@
     //where
     /** Return the type of a literal with given type tag.
      */
-    Type litType(int tag) {
-        return (tag == TypeTags.CLASS) ? syms.stringType : syms.typeOfTag[tag];
+    Type litType(TypeTag tag) {
+        return (tag == CLASS) ? syms.stringType : syms.typeOfTag[tag.ordinal()];
     }
 
     public void visitTypeIdent(JCPrimitiveTypeTree tree) {
-        result = check(tree, syms.typeOfTag[tree.typetag], TYP, resultInfo);
+        result = check(tree, syms.typeOfTag[tree.typetag.ordinal()], TYP, resultInfo);
     }
 
     public void visitTypeArray(JCArrayTypeTree tree) {
@@ -3339,7 +3371,7 @@
         // Attribute type parameters
         List<Type> actuals = attribTypes(tree.arguments, env);
 
-        if (clazztype.tag == CLASS) {
+        if (clazztype.hasTag(CLASS)) {
             List<Type> formals = clazztype.tsym.type.getTypeArguments();
             if (actuals.isEmpty()) //diamond
                 actuals = formals;
@@ -3354,7 +3386,7 @@
                 }
                 // Compute the proper generic outer
                 Type clazzOuter = clazztype.getEnclosingType();
-                if (clazzOuter.tag == CLASS) {
+                if (clazzOuter.hasTag(CLASS)) {
                     Type site;
                     JCExpression clazz = TreeInfo.typeIn(tree.clazz);
                     if (clazz.hasTag(IDENT)) {
@@ -3362,8 +3394,8 @@
                     } else if (clazz.hasTag(SELECT)) {
                         site = ((JCFieldAccess) clazz).selected.type;
                     } else throw new AssertionError(""+tree);
-                    if (clazzOuter.tag == CLASS && site != clazzOuter) {
-                        if (site.tag == CLASS)
+                    if (clazzOuter.hasTag(CLASS) && site != clazzOuter) {
+                        if (site.hasTag(CLASS))
                             site = types.asOuterSuper(site, clazzOuter.tsym);
                         if (site == null)
                             site = types.erasure(clazzOuter);
@@ -3419,7 +3451,7 @@
             }
         }
         Type t = check(tree, types.lub(multicatchTypes.toList()), TYP, resultInfo);
-        if (t.tag == CLASS) {
+        if (t.hasTag(CLASS)) {
             List<Type> alternatives =
                 ((all_multicatchTypes == null) ? multicatchTypes : all_multicatchTypes).toList();
             t = new UnionClassType((ClassType) t, alternatives);
@@ -3440,7 +3472,7 @@
             if (b.isErroneous()) {
                 a.bound = b;
             }
-            else if (b.tag == TYPEVAR) {
+            else if (b.hasTag(TYPEVAR)) {
                 // if first bound was a typevar, do not accept further bounds.
                 if (tree.bounds.tail.nonEmpty()) {
                     log.error(tree.bounds.tail.head.pos(),
@@ -3456,7 +3488,7 @@
                     Type i = checkBase(bs.head, bound, env, false, true, false);
                     if (i.isErroneous())
                         a.bound = i;
-                    else if (i.tag == CLASS)
+                    else if (i.hasTag(CLASS))
                         chk.checkNotRepeated(bound.pos(), types.erasure(i), boundSet);
                 }
             }
@@ -3568,7 +3600,7 @@
      *  @param c   The class symbol whose definition will be attributed.
      */
     void attribClass(ClassSymbol c) throws CompletionFailure {
-        if (c.type.tag == ERROR) return;
+        if (c.type.hasTag(ERROR)) return;
 
         // Check for cycles in the inheritance graph, which can arise from
         // ill-formed class files.
@@ -3577,11 +3609,11 @@
         Type st = types.supertype(c.type);
         if ((c.flags_field & Flags.COMPOUND) == 0) {
             // First, attribute superclass.
-            if (st.tag == CLASS)
+            if (st.hasTag(CLASS))
                 attribClass((ClassSymbol)st.tsym);
 
             // Next attribute owner, if it is a class.
-            if (c.owner.kind == TYP && c.owner.type.tag == CLASS)
+            if (c.owner.kind == TYP && c.owner.type.hasTag(CLASS))
                 attribClass((ClassSymbol)c.owner);
         }
 
@@ -3696,6 +3728,9 @@
             // are compatible (i.e. no two define methods with same arguments
             // yet different return types).  (JLS 8.4.6.3)
             chk.checkCompatibleSupertypes(tree.pos(), c.type);
+            if (allowDefaultMethods) {
+                chk.checkDefaultMethodClashes(tree.pos(), c.type);
+            }
         }
 
         // Check that class does not import the same parameterized interface
@@ -3793,7 +3828,7 @@
                         TreeInfo.diagnosticPositionFor(svuid, tree), "improper.SVUID", c);
 
             // check that it is long
-            else if (svuid.type.tag != TypeTags.LONG)
+            else if (!svuid.type.hasTag(LONG))
                 log.warning(LintCategory.SERIAL,
                         TreeInfo.diagnosticPositionFor(svuid, tree), "long.SVUID", c);
 
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java	Wed Nov 14 16:41:12 2012 -0800
@@ -72,6 +72,10 @@
      */
     Attr.ResultInfo returnResult = null;
 
+    /** Symbol corresponding to the site of a qualified default super call
+     */
+    Type defaultSuperCallSite = null;
+
     /** Duplicate this context, replacing scope field and copying all others.
      */
     AttrContext dup(Scope scope) {
@@ -84,6 +88,7 @@
         info.lint = lint;
         info.enclVar = enclVar;
         info.returnResult = returnResult;
+        info.defaultSuperCallSite = defaultSuperCallSite;
         return info;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java	Wed Nov 14 16:41:12 2012 -0800
@@ -27,6 +27,7 @@
 
 import java.util.*;
 import java.util.Set;
+import javax.tools.JavaFileManager;
 
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.jvm.*;
@@ -48,8 +49,8 @@
 import static com.sun.tools.javac.code.Flags.ANNOTATION;
 import static com.sun.tools.javac.code.Flags.SYNCHRONIZED;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
-import static com.sun.tools.javac.code.TypeTags.WILDCARD;
+import static com.sun.tools.javac.code.TypeTag.*;
+import static com.sun.tools.javac.code.TypeTag.WILDCARD;
 
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -77,6 +78,7 @@
     private boolean suppressAbortOnBadClassFile;
     private boolean enableSunApiLintControl;
     private final TreeInfo treeinfo;
+    private final JavaFileManager fileManager;
 
     // The set of lint options currently in effect. It is initialized
     // from the context, and then is set/reset as needed by Attr as it
@@ -109,6 +111,7 @@
         Options options = Options.instance(context);
         lint = Lint.instance(context);
         treeinfo = TreeInfo.instance(context);
+        fileManager = context.get(JavaFileManager.class);
 
         Source source = Source.instance(context);
         allowGenerics = source.allowGenerics();
@@ -116,6 +119,9 @@
         allowAnnotations = source.allowAnnotations();
         allowCovariantReturns = source.allowCovariantReturns();
         allowSimplifiedVarargs = source.allowSimplifiedVarargs();
+        allowDefaultMethods = source.allowDefaultMethods();
+        allowStrictMethodClashCheck = source.allowStrictMethodClashCheck() &&
+                options.isSet("strictMethodClashCheck"); //pre-lambda guard
         complexInference = options.isSet("complexinference");
         warnOnSyntheticConflicts = options.isSet("warnOnSyntheticConflicts");
         suppressAbortOnBadClassFile = options.isSet("suppressAbortOnBadClassFile");
@@ -159,6 +165,14 @@
      */
     boolean allowSimplifiedVarargs;
 
+    /** Switch: default methods enabled?
+     */
+    boolean allowDefaultMethods;
+
+    /** Switch: should unrelated return types trigger a method clash?
+     */
+    boolean allowStrictMethodClashCheck;
+
     /** Switch: -complexinference option set?
      */
     boolean complexInference;
@@ -280,7 +294,7 @@
     Type typeTagError(DiagnosticPosition pos, Object required, Object found) {
         // this error used to be raised by the parser,
         // but has been delayed to this point:
-        if (found instanceof Type && ((Type)found).tag == VOID) {
+        if (found instanceof Type && ((Type)found).hasTag(VOID)) {
             log.error(pos, "illegal.start.of.type");
             return syms.errType;
         }
@@ -358,7 +372,7 @@
             for (Scope.Entry e = s.next.lookup(c.name);
                  e.scope != null && e.sym.owner == c.owner;
                  e = e.next()) {
-                if (e.sym.kind == TYP && e.sym.type.tag != TYPEVAR &&
+                if (e.sym.kind == TYP && !e.sym.type.hasTag(TYPEVAR) &&
                     (e.sym.owner.kind & (VAR | MTH)) != 0 &&
                     c.name != names.error) {
                     duplicateError(pos, e.sym);
@@ -527,14 +541,14 @@
                 }
             });
         }
-        if (req.tag == ERROR)
+        if (req.hasTag(ERROR))
             return req;
-        if (req.tag == NONE)
+        if (req.hasTag(NONE))
             return found;
         if (checkContext.compatible(found, req, checkContext.checkWarner(pos, found, req))) {
             return found;
         } else {
-            if (found.tag <= DOUBLE && req.tag <= DOUBLE) {
+            if (found.getTag().isSubRangeOf(DOUBLE) && req.getTag().isSubRangeOf(DOUBLE)) {
                 checkContext.report(pos, diags.fragment("possible.loss.of.precision", found, req));
                 return types.createErrorType(found);
             }
@@ -594,7 +608,7 @@
          *  type variables?
          */
         boolean isTypeVar(Type t) {
-            return t.tag == TYPEVAR || t.tag == ARRAY && isTypeVar(types.elemtype(t));
+            return t.hasTag(TYPEVAR) || t.hasTag(ARRAY) && isTypeVar(types.elemtype(t));
         }
 
     /** Check that a type is within some bounds.
@@ -607,7 +621,7 @@
     private boolean checkExtends(Type a, Type bound) {
          if (a.isUnbound()) {
              return true;
-         } else if (a.tag != WILDCARD) {
+         } else if (!a.hasTag(WILDCARD)) {
              a = types.upperBound(a);
              return types.isSubtype(a, bound);
          } else if (a.isExtendsBound()) {
@@ -623,7 +637,7 @@
      *  @param t             The type to be checked.
      */
     Type checkNonVoid(DiagnosticPosition pos, Type t) {
-        if (t.tag == VOID) {
+        if (t.hasTag(VOID)) {
             log.error(pos, "void.not.allowed.here");
             return types.createErrorType(t);
         } else {
@@ -636,10 +650,10 @@
      *  @param t             The type to be checked.
      */
     Type checkClassType(DiagnosticPosition pos, Type t) {
-        if (t.tag != CLASS && t.tag != ERROR)
+        if (!t.hasTag(CLASS) && !t.hasTag(ERROR))
             return typeTagError(pos,
                                 diags.fragment("type.req.class"),
-                                (t.tag == TYPEVAR)
+                                (t.hasTag(TYPEVAR))
                                 ? diags.fragment("type.parameter", t)
                                 : t);
         else
@@ -650,7 +664,7 @@
      */
     Type checkConstructorRefType(DiagnosticPosition pos, Type t) {
         t = checkClassType(pos, t);
-        if (t.tag == CLASS) {
+        if (t.hasTag(CLASS)) {
             if ((t.tsym.flags() & (ABSTRACT | INTERFACE)) != 0) {
                 log.error(pos, "abstract.cant.be.instantiated");
                 t = types.createErrorType(t);
@@ -672,7 +686,7 @@
         if (noBounds && t.isParameterized()) {
             List<Type> args = t.getTypeArguments();
             while (args.nonEmpty()) {
-                if (args.head.tag == WILDCARD)
+                if (args.head.hasTag(WILDCARD))
                     return typeTagError(pos,
                                         diags.fragment("type.req.exact"),
                                         args.head);
@@ -687,7 +701,7 @@
      *  @param t             The type to be checked.
      */
     Type checkReifiableReferenceType(DiagnosticPosition pos, Type t) {
-        if (t.tag != CLASS && t.tag != ARRAY && t.tag != ERROR) {
+        if (!t.hasTag(CLASS) && !t.hasTag(ARRAY) && !t.hasTag(ERROR)) {
             return typeTagError(pos,
                                 diags.fragment("type.req.class.array"),
                                 t);
@@ -705,18 +719,12 @@
      *  @param t             The type to be checked.
      */
     Type checkRefType(DiagnosticPosition pos, Type t) {
-        switch (t.tag) {
-        case CLASS:
-        case ARRAY:
-        case TYPEVAR:
-        case WILDCARD:
-        case ERROR:
+        if (t.isReference())
             return t;
-        default:
+        else
             return typeTagError(pos,
                                 diags.fragment("type.req.ref"),
                                 t);
-        }
     }
 
     /** Check that each type is a reference type, i.e. a class, interface or array type
@@ -738,19 +746,12 @@
      *  @param t             The type to be checked.
      */
     Type checkNullOrRefType(DiagnosticPosition pos, Type t) {
-        switch (t.tag) {
-        case CLASS:
-        case ARRAY:
-        case TYPEVAR:
-        case WILDCARD:
-        case BOT:
-        case ERROR:
+        if (t.isNullOrReference())
             return t;
-        default:
+        else
             return typeTagError(pos,
                                 diags.fragment("type.req.ref"),
                                 t);
-        }
     }
 
     /** Check that flag set does not contain elements of two conflicting sets. s
@@ -1054,7 +1055,7 @@
             bounds = bounds_buf.toList();
 
             for (Type arg : types.capture(type).getTypeArguments()) {
-                if (arg.tag == TYPEVAR &&
+                if (arg.hasTag(TYPEVAR) &&
                         arg.getUpperBound().isErroneous() &&
                         !bounds.head.isErroneous() &&
                         !isTypeArgErroneous(args.head)) {
@@ -1124,7 +1125,7 @@
             }  else if ((sym.owner.flags_field & INTERFACE) != 0) {
                 if ((flags & DEFAULT) != 0) {
                     mask = InterfaceDefaultMethodMask;
-                    implicit = PUBLIC;
+                    implicit = PUBLIC | ABSTRACT;
                 } else {
                     mask = implicit = InterfaceMethodFlags;
                 }
@@ -1309,7 +1310,7 @@
 
         @Override
         public void visitTypeApply(JCTypeApply tree) {
-            if (tree.type.tag == CLASS) {
+            if (tree.type.hasTag(CLASS)) {
                 List<JCExpression> args = tree.arguments;
                 List<Type> forms = tree.type.tsym.type.getTypeArguments();
 
@@ -1360,7 +1361,7 @@
 
         @Override
         public void visitSelect(JCFieldAccess tree) {
-            if (tree.type.tag == CLASS) {
+            if (tree.type.hasTag(CLASS)) {
                 visitSelectInternal(tree);
 
                 // Check that this type is either fully parameterized, or
@@ -1409,7 +1410,7 @@
 
         void checkRaw(JCTree tree, Env<AttrContext> env) {
             if (lint.isEnabled(LintCategory.RAW) &&
-                tree.type.tag == CLASS &&
+                tree.type.hasTag(CLASS) &&
                 !TreeInfo.isDiamond(tree) &&
                 !withinAnonConstr(env) &&
                 tree.type.isRaw()) {
@@ -1511,9 +1512,9 @@
      */
     boolean isUnchecked(Type exc) {
         return
-            (exc.tag == TYPEVAR) ? isUnchecked(types.supertype(exc)) :
-            (exc.tag == CLASS) ? isUnchecked((ClassSymbol)exc.tsym) :
-            exc.tag == BOT;
+            (exc.hasTag(TYPEVAR)) ? isUnchecked(types.supertype(exc)) :
+            (exc.hasTag(CLASS)) ? isUnchecked((ClassSymbol)exc.tsym) :
+            exc.hasTag(BOT);
     }
 
     /** Same, but handling completion failures.
@@ -1759,7 +1760,7 @@
             // case, we will have dealt with when examining the supertype classes
             ClassSymbol mc = m.enclClass();
             Type st = types.supertype(origin.type);
-            if (st.tag != CLASS)
+            if (!st.hasTag(CLASS))
                 return true;
             MethodSymbol stimpl = m.implementation((ClassSymbol)st.tsym, types, false);
 
@@ -1782,7 +1783,7 @@
      */
     public void checkCompatibleConcretes(DiagnosticPosition pos, Type site) {
         Type sup = types.supertype(site);
-        if (sup.tag != CLASS) return;
+        if (!sup.hasTag(CLASS)) return;
 
         for (Type t1 = sup;
              t1.tsym.type.isParameterized();
@@ -1803,7 +1804,7 @@
                 if (st1 == s1.type) continue;
 
                 for (Type t2 = sup;
-                     t2.tag == CLASS;
+                     t2.hasTag(CLASS);
                      t2 = types.supertype(t2)) {
                     for (Scope.Entry e2 = t2.tsym.members().lookup(s1.name);
                          e2.scope != null;
@@ -1876,7 +1877,7 @@
 
     /** Compute all the supertypes of t, indexed by type symbol. */
     private void closure(Type t, Map<TypeSymbol,Type> typeMap) {
-        if (t.tag != CLASS) return;
+        if (!t.hasTag(CLASS)) return;
         if (typeMap.put(t.tsym, t) == null) {
             closure(types.supertype(t), typeMap);
             for (Type i : types.interfaces(t))
@@ -1886,7 +1887,7 @@
 
     /** Compute all the supertypes of t, indexed by type symbol (except thise in typesSkip). */
     private void closure(Type t, Map<TypeSymbol,Type> typesSkip, Map<TypeSymbol,Type> typeMap) {
-        if (t.tag != CLASS) return;
+        if (!t.hasTag(CLASS)) return;
         if (typesSkip.get(t.tsym) != null) return;
         if (typeMap.put(t.tsym, t) == null) {
             closure(types.supertype(t), typesSkip, typeMap);
@@ -1916,7 +1917,8 @@
                     Type rt2 = types.subst(st2.getReturnType(), tvars2, tvars1);
                     boolean compat =
                         types.isSameType(rt1, rt2) ||
-                        rt1.tag >= CLASS && rt2.tag >= CLASS &&
+                        !rt1.isPrimitiveOrVoid() &&
+                        !rt2.isPrimitiveOrVoid() &&
                         (types.covariantReturnType(rt1, rt2, Warner.noWarnings) ||
                          types.covariantReturnType(rt2, rt1, Warner.noWarnings)) ||
                          checkCommonOverriderIn(s1,s2,site);
@@ -1961,7 +1963,8 @@
                     Type rt13 = types.subst(st3.getReturnType(), tvars3, tvars1);
                     Type rt23 = types.subst(st3.getReturnType(), tvars3, tvars2);
                     boolean compat =
-                        rt13.tag >= CLASS && rt23.tag >= CLASS &&
+                        !rt13.isPrimitiveOrVoid() &&
+                        !rt23.isPrimitiveOrVoid() &&
                         (types.covariantReturnType(rt13, rt1, Warner.noWarnings) &&
                          types.covariantReturnType(rt23, rt2, Warner.noWarnings));
                     if (compat)
@@ -1984,7 +1987,7 @@
                 log.error(tree.pos(), "enum.no.finalize");
                 return;
             }
-        for (Type t = origin.type; t.tag == CLASS;
+        for (Type t = origin.type; t.hasTag(CLASS);
              t = types.supertype(t)) {
             if (t != origin.type) {
                 checkOverride(tree, t, origin, m);
@@ -2055,16 +2058,26 @@
                      undef == null && e != null;
                      e = e.sibling) {
                     if (e.sym.kind == MTH &&
-                        (e.sym.flags() & (ABSTRACT|IPROXY)) == ABSTRACT) {
+                        (e.sym.flags() & (ABSTRACT|IPROXY|DEFAULT)) == ABSTRACT) {
                         MethodSymbol absmeth = (MethodSymbol)e.sym;
                         MethodSymbol implmeth = absmeth.implementation(impl, types, true);
-                        if (implmeth == null || implmeth == absmeth)
+                        if (implmeth == null || implmeth == absmeth) {
+                            //look for default implementations
+                            if (allowDefaultMethods) {
+                                MethodSymbol prov = types.interfaceCandidates(impl.type, absmeth).head;
+                                if (prov != null && prov.overrides(absmeth, impl, types, true)) {
+                                    implmeth = prov;
+                                }
+                            }
+                        }
+                        if (implmeth == null || implmeth == absmeth) {
                             undef = absmeth;
+                        }
                     }
                 }
                 if (undef == null) {
                     Type st = types.supertype(c.type);
-                    if (st.tag == CLASS)
+                    if (st.hasTag(CLASS))
                         undef = firstUndef(impl, (ClassSymbol)st.tsym);
                 }
                 for (List<Type> l = types.interfaces(c.type);
@@ -2155,7 +2168,7 @@
             } else if (!c.type.isErroneous()) {
                 try {
                     seenClasses = seenClasses.prepend(c);
-                    if (c.type.tag == CLASS) {
+                    if (c.type.hasTag(CLASS)) {
                         if (supertypes.nonEmpty()) {
                             scan(supertypes);
                         }
@@ -2200,13 +2213,13 @@
 
     private void checkNonCyclic1(DiagnosticPosition pos, Type t, List<TypeVar> seen) {
         final TypeVar tv;
-        if  (t.tag == TYPEVAR && (t.tsym.flags() & UNATTRIBUTED) != 0)
+        if  (t.hasTag(TYPEVAR) && (t.tsym.flags() & UNATTRIBUTED) != 0)
             return;
         if (seen.contains(t)) {
             tv = (TypeVar)t;
             tv.bound = types.createErrorType(t);
             log.error(pos, "cyclic.inheritance", t);
-        } else if (t.tag == TYPEVAR) {
+        } else if (t.hasTag(TYPEVAR)) {
             tv = (TypeVar)t;
             seen = seen.prepend(tv);
             for (Type b : types.getBounds(tv))
@@ -2232,14 +2245,14 @@
         } else if (!c.type.isErroneous()) {
             try {
                 c.flags_field |= LOCKED;
-                if (c.type.tag == CLASS) {
+                if (c.type.hasTag(CLASS)) {
                     ClassType clazz = (ClassType)c.type;
                     if (clazz.interfaces_field != null)
                         for (List<Type> l=clazz.interfaces_field; l.nonEmpty(); l=l.tail)
                             complete &= checkNonCyclicInternal(pos, l.head);
                     if (clazz.supertype_field != null) {
                         Type st = clazz.supertype_field;
-                        if (st != null && st.tag == CLASS)
+                        if (st != null && st.hasTag(CLASS))
                             complete &= checkNonCyclicInternal(pos, st);
                     }
                     if (c.owner.kind == TYP)
@@ -2261,7 +2274,7 @@
         for (List<Type> l=types.interfaces(c.type); l.nonEmpty(); l=l.tail)
             l.head = types.createErrorType((ClassSymbol)l.head.tsym, Type.noType);
         Type st = types.supertype(c.type);
-        if (st.tag == CLASS)
+        if (st.hasTag(CLASS))
             ((ClassType)c.type).supertype_field = types.createErrorType((ClassSymbol)st.tsym, Type.noType);
         c.type = types.createErrorType(c, c.type);
         c.flags_field |= ACYCLIC;
@@ -2313,7 +2326,7 @@
     void checkCompatibleSupertypes(DiagnosticPosition pos, Type c) {
         List<Type> supertypes = types.interfaces(c);
         Type supertype = types.supertype(c);
-        if (supertype.tag == CLASS &&
+        if (supertype.hasTag(CLASS) &&
             (supertype.tsym.flags() & ABSTRACT) != 0)
             supertypes = supertypes.prepend(supertype);
         for (List<Type> l = supertypes; l.nonEmpty(); l = l.tail) {
@@ -2362,7 +2375,7 @@
                 if (m2 == m1) continue;
                 //if (i) the signature of 'sym' is not a subsignature of m1 (seen as
                 //a member of 'site') and (ii) m1 has the same erasure as m2, issue an error
-                if (!types.isSubSignature(sym.type, types.memberType(site, m2), false) &&
+                if (!types.isSubSignature(sym.type, types.memberType(site, m2), allowStrictMethodClashCheck) &&
                         types.hasSameArgs(m2.erasure(types), m1.erasure(types))) {
                     sym.flags_field |= CLASH;
                     String key = m1 == sym ?
@@ -2394,7 +2407,7 @@
         for (Symbol s : types.membersClosure(site, true).getElementsByName(sym.name, cf)) {
             //if (i) the signature of 'sym' is not a subsignature of m1 (seen as
             //a member of 'site') and (ii) 'sym' has the same erasure as m1, issue an error
-            if (!types.isSubSignature(sym.type, types.memberType(site, s), false) &&
+            if (!types.isSubSignature(sym.type, types.memberType(site, s), allowStrictMethodClashCheck) &&
                     types.hasSameArgs(s.erasure(types), sym.erasure(types))) {
                 log.error(pos,
                         "name.clash.same.erasure.no.hide",
@@ -2428,6 +2441,62 @@
          }
      }
 
+    void checkDefaultMethodClashes(DiagnosticPosition pos, Type site) {
+        DefaultMethodClashFilter dcf = new DefaultMethodClashFilter(site);
+        for (Symbol m : types.membersClosure(site, false).getElements(dcf)) {
+            Assert.check(m.kind == MTH);
+            List<MethodSymbol> prov = types.interfaceCandidates(site, (MethodSymbol)m);
+            if (prov.size() > 1) {
+                ListBuffer<Symbol> abstracts = ListBuffer.lb();
+                ListBuffer<Symbol> defaults = ListBuffer.lb();
+                for (MethodSymbol provSym : prov) {
+                    if ((provSym.flags() & DEFAULT) != 0) {
+                        defaults = defaults.append(provSym);
+                    } else if ((provSym.flags() & ABSTRACT) != 0) {
+                        abstracts = abstracts.append(provSym);
+                    }
+                    if (defaults.nonEmpty() && defaults.size() + abstracts.size() >= 2) {
+                        //strong semantics - issue an error if two sibling interfaces
+                        //have two override-equivalent defaults - or if one is abstract
+                        //and the other is default
+                        String errKey;
+                        Symbol s1 = defaults.first();
+                        Symbol s2;
+                        if (defaults.size() > 1) {
+                            errKey = "types.incompatible.unrelated.defaults";
+                            s2 = defaults.toList().tail.head;
+                        } else {
+                            errKey = "types.incompatible.abstract.default";
+                            s2 = abstracts.first();
+                        }
+                        log.error(pos, errKey,
+                                Kinds.kindName(site.tsym), site,
+                                m.name, types.memberType(site, m).getParameterTypes(),
+                                s1.location(), s2.location());
+                        break;
+                    }
+                }
+            }
+        }
+    }
+
+    //where
+     private class DefaultMethodClashFilter implements Filter<Symbol> {
+
+         Type site;
+
+         DefaultMethodClashFilter(Type site) {
+             this.site = site;
+         }
+
+         public boolean accepts(Symbol s) {
+             return s.kind == MTH &&
+                     (s.flags() & DEFAULT) != 0 &&
+                     s.isInheritedIn(site.tsym, types) &&
+                     !s.isConstructor();
+         }
+     }
+
     /** Report a conflict between a user symbol and a synthetic symbol.
      */
     private void syntheticError(DiagnosticPosition pos, Symbol sym) {
@@ -2542,7 +2611,7 @@
      * @jls 9.6 Annotation Types
      */
     void validateAnnotationMethod(DiagnosticPosition pos, MethodSymbol m) {
-        for (Type sup = syms.annotationType; sup.tag == CLASS; sup = types.supertype(sup)) {
+        for (Type sup = syms.annotationType; sup.hasTag(CLASS); sup = types.supertype(sup)) {
             Scope s = sup.tsym.members();
             for (Scope.Entry e = s.lookup(m.name); e.scope != null; e = e.next()) {
                 if (e.sym.kind == MTH &&
@@ -2855,7 +2924,7 @@
                 { if (s.kind == TYP ||
                       s.kind == VAR ||
                       (s.kind == MTH && !s.isConstructor() &&
-                       s.type.getReturnType().tag != VOID))
+                       !s.type.getReturnType().hasTag(VOID)))
                     return true;
                 }
             else
@@ -3016,12 +3085,12 @@
     }
 
     void checkAnnotationResType(DiagnosticPosition pos, Type type) {
-        switch (type.tag) {
-        case TypeTags.CLASS:
+        switch (type.getTag()) {
+        case CLASS:
             if ((type.tsym.flags() & ANNOTATION) != 0)
                 checkNonCyclicElementsInternal(pos, type.tsym);
             break;
-        case TypeTags.ARRAY:
+        case ARRAY:
             checkAnnotationResType(pos, types.elemtype(type));
             break;
         default:
@@ -3114,7 +3183,7 @@
     void checkDivZero(DiagnosticPosition pos, Symbol operator, Type operand) {
         if (operand.constValue() != null
             && lint.isEnabled(LintCategory.DIVZERO)
-            && operand.tag <= LONG
+            && (operand.getTag().isSubRangeOf(LONG))
             && ((Number) (operand.constValue())).longValue() == 0) {
             int opc = ((OperatorSymbol)operator).opcode;
             if (opc == ByteCodes.idiv || opc == ByteCodes.imod
@@ -3241,6 +3310,19 @@
             return true;
         }
 
+    /** Check that an auxiliary class is not accessed from any other file than its own.
+     */
+    void checkForBadAuxiliaryClassAccess(DiagnosticPosition pos, Env<AttrContext> env, ClassSymbol c) {
+        if (lint.isEnabled(Lint.LintCategory.AUXILIARYCLASS) &&
+            (c.flags() & AUXILIARY) != 0 &&
+            rs.isAccessible(env, c) &&
+            !fileManager.isSameFile(c.sourcefile, env.toplevel.sourcefile))
+        {
+            log.warning(pos, "auxiliary.class.accessed.from.outside.of.its.source.file",
+                        c, c.sourcefile);
+        }
+    }
+
     private class ConversionWarner extends Warner {
         final String uncheckedKey;
         final Type found;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, 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
@@ -31,7 +31,8 @@
 
 import com.sun.tools.javac.code.Type.*;
 
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.BOOLEAN;
+
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 
 /** Helper class for constant folding, used by the attribution phase.
@@ -176,19 +177,19 @@
                 case imod:
                     return syms.intType.constType(intValue(l) % intValue(r));
                 case iand:
-                    return (left.tag == BOOLEAN
+                    return (left.hasTag(BOOLEAN)
                       ? syms.booleanType : syms.intType)
                       .constType(intValue(l) & intValue(r));
                 case bool_and:
                     return syms.booleanType.constType(b2i((intValue(l) & intValue(r)) != 0));
                 case ior:
-                    return (left.tag == BOOLEAN
+                    return (left.hasTag(BOOLEAN)
                       ? syms.booleanType : syms.intType)
                       .constType(intValue(l) | intValue(r));
                 case bool_or:
                     return syms.booleanType.constType(b2i((intValue(l) | intValue(r)) != 0));
                 case ixor:
-                    return (left.tag == BOOLEAN
+                    return (left.hasTag(BOOLEAN)
                       ? syms.booleanType : syms.intType)
                       .constType(intValue(l) ^ intValue(r));
                 case ishl: case ishll:
@@ -326,7 +327,7 @@
 
     /** Coerce constant type to target type.
      *  @param etype      The source type of the coercion,
-     *                    which is assumed to be a constant type compatble with
+     *                    which is assumed to be a constant type compatible with
      *                    ttype.
      *  @param ttype      The target type of the coercion.
      */
@@ -334,9 +335,9 @@
          // WAS if (etype.baseType() == ttype.baseType())
          if (etype.tsym.type == ttype.tsym.type)
              return etype;
-         if (etype.tag <= DOUBLE) {
+         if (etype.isNumeric()) {
              Object n = etype.constValue();
-             switch (ttype.tag) {
+             switch (ttype.getTag()) {
              case BYTE:
                  return syms.byteType.constType(0 + (byte)intValue(n));
              case CHAR:
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Wed Nov 14 16:41:12 2012 -0800
@@ -44,7 +44,8 @@
 import java.util.Set;
 import java.util.WeakHashMap;
 
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.DEFERRED;
+import static com.sun.tools.javac.code.TypeTag.NONE;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /**
@@ -203,7 +204,7 @@
                         case SPECULATIVE:
                             Assert.check(mode == null ||
                                     (mode == AttrMode.SPECULATIVE &&
-                                    speculativeType(deferredAttrContext.msym, deferredAttrContext.phase).tag == NONE));
+                                    speculativeType(deferredAttrContext.msym, deferredAttrContext.phase).hasTag(NONE)));
                             JCTree speculativeTree = attribSpeculative(tree, env, resultInfo);
                             speculativeCache.put(deferredAttrContext.msym, speculativeTree, deferredAttrContext.phase);
                             return speculativeTree.type;
@@ -442,7 +443,7 @@
 
         @Override
         public Type apply(Type t) {
-            if (t.tag != DEFERRED) {
+            if (!t.hasTag(DEFERRED)) {
                 return t.map(this);
             } else {
                 DeferredType dt = (DeferredType)t;
@@ -479,7 +480,7 @@
         @Override
         protected Type typeOf(DeferredType dt) {
             Type owntype = super.typeOf(dt);
-            return owntype.tag == NONE ?
+            return owntype.hasTag(NONE) ?
                         recover(dt) : owntype;
         }
 
@@ -516,7 +517,7 @@
      */
     @SuppressWarnings("fallthrough")
     List<Type> stuckVars(JCTree tree, ResultInfo resultInfo) {
-        if (resultInfo.pt.tag == NONE || resultInfo.pt.isErroneous()) {
+        if (resultInfo.pt.hasTag(NONE) || resultInfo.pt.isErroneous()) {
             return List.nil();
         } else {
             StuckChecker sc = new StuckChecker(resultInfo);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -49,7 +49,7 @@
  *  the symbol table. The pass consists of two phases, organized as
  *  follows:
  *
- *  <p>In the first phase, all class symbols are intered into their
+ *  <p>In the first phase, all class symbols are entered into their
  *  enclosing scope, descending recursively down the tree for classes
  *  which are members of other classes. The class symbols are given a
  *  MemberEnter object as completer.
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java	Wed Nov 14 16:41:12 2012 -0800
@@ -40,7 +40,8 @@
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.BLOCK;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.BOOLEAN;
+import static com.sun.tools.javac.code.TypeTag.VOID;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /** This pass implements dataflow analysis for Java programs though
@@ -473,7 +474,7 @@
                 alive = true;
                 scanStat(tree.body);
 
-                if (alive && tree.sym.type.getReturnType().tag != VOID)
+                if (alive && !tree.sym.type.getReturnType().hasTag(VOID))
                     log.error(TreeInfo.diagEndPos(tree.body), "missing.ret.stmt");
 
                 List<PendingExit> exits = pendingExits.toList();
@@ -1976,8 +1977,8 @@
             Bits uninitsBeforeElse = uninitsWhenFalse;
             inits = initsWhenTrue;
             uninits = uninitsWhenTrue;
-            if (tree.truepart.type.tag == BOOLEAN &&
-                tree.falsepart.type.tag == BOOLEAN) {
+            if (tree.truepart.type.hasTag(BOOLEAN) &&
+                tree.falsepart.type.hasTag(BOOLEAN)) {
                 // if b and c are boolean valued, then
                 // v is (un)assigned after a?b:c when true iff
                 //    v is (un)assigned after b when true and
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java	Wed Nov 14 16:41:12 2012 -0800
@@ -42,7 +42,7 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 
 /** Helper class for type parameter inference, used by the attribution phase.
  *
@@ -145,7 +145,7 @@
     private Filter<Type> boundFilter = new Filter<Type>() {
         @Override
         public boolean accepts(Type t) {
-            return !t.isErroneous() && t.tag != BOT;
+            return !t.isErroneous() && !t.hasTag(BOT);
         }
     };
 
@@ -163,7 +163,7 @@
             else {
                 that.inst = types.lub(lobounds);
             }
-            if (that.inst == null || that.inst.tag == ERROR)
+            if (that.inst == null || that.inst.hasTag(ERROR))
                     throw inferenceException
                         .setMessage("no.unique.minimal.instance.exists",
                                     that.qtype, lobounds);
@@ -189,13 +189,13 @@
             Attr.ResultInfo resultInfo,
             Warner warn) throws InferenceException {
         Type to = resultInfo.pt;
-        if (to.tag == NONE || resultInfo.checkContext.inferenceContext().free(resultInfo.pt)) {
-            to = mtype.getReturnType().tag <= VOID ?
+        if (to.hasTag(NONE) || resultInfo.checkContext.inferenceContext().free(resultInfo.pt)) {
+            to = mtype.getReturnType().isPrimitiveOrVoid() ?
                     mtype.getReturnType() : syms.objectType;
         }
         Type qtype1 = inferenceContext.asFree(mtype.getReturnType(), types);
         if (!types.isSubtype(qtype1,
-                qtype1.tag == UNDETVAR ? types.boxedTypeOrType(to) : to)) {
+                qtype1.hasTag(UNDETVAR) ? types.boxedTypeOrType(to) : to)) {
             throw inferenceException
                     .setMessage("infer.no.conforming.instance.exists",
                     inferenceContext.restvars(), mtype.getReturnType(), to);
@@ -515,7 +515,7 @@
             //for remaining uninferred type-vars in the functional interface type,
             //simply replace the wildcards with its bound
             for (Type t : formalInterface.getTypeArguments()) {
-                if (actualTypeargs.head.tag == WILDCARD) {
+                if (actualTypeargs.head.hasTag(WILDCARD)) {
                     WildcardType wt = (WildcardType)actualTypeargs.head;
                     typeargs.append(wt.type);
                 } else {
@@ -592,7 +592,7 @@
 
             public Type apply(Type t) {
                 t = types.erasure(super.apply(t));
-                if (t.tag == BOT)
+                if (t.hasTag(BOT))
                     // nulls type as the marker type Null (which has no instances)
                     // infer as java.lang.Void for now
                     t = types.boxedClass(syms.voidType).type;
@@ -614,7 +614,7 @@
         }
 
         public Type apply(Type t) {
-            if (t.tag == TYPEVAR) return new UndetVar((TypeVar)t, types, includeBounds);
+            if (t.hasTag(TYPEVAR)) return new UndetVar((TypeVar)t, types, includeBounds);
             else return t.map(this);
         }
     };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,1398 @@
+/*
+ * Copyright (c) 2010, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.tools.javac.comp;
+
+import com.sun.tools.javac.tree.*;
+import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.*;
+import com.sun.tools.javac.tree.JCTree.JCMemberReference.ReferenceKind;
+import com.sun.tools.javac.tree.TreeMaker;
+import com.sun.tools.javac.tree.TreeScanner;
+import com.sun.tools.javac.tree.TreeTranslator;
+import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.code.Kinds;
+import com.sun.tools.javac.code.Symbol;
+import com.sun.tools.javac.code.Symbol.ClassSymbol;
+import com.sun.tools.javac.code.Symbol.DynamicMethodSymbol;
+import com.sun.tools.javac.code.Symbol.MethodSymbol;
+import com.sun.tools.javac.code.Symbol.VarSymbol;
+import com.sun.tools.javac.code.Symtab;
+import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.Type.ClassType;
+import com.sun.tools.javac.code.Type.MethodType;
+import com.sun.tools.javac.code.Types;
+import com.sun.tools.javac.comp.LambdaToMethod.LambdaAnalyzer.*;
+import com.sun.tools.javac.jvm.*;
+import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.List;
+import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
+import com.sun.source.tree.MemberReferenceTree.ReferenceMode;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import static com.sun.tools.javac.comp.LambdaToMethod.LambdaSymbolKind.*;
+import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.TypeTag.BOT;
+import static com.sun.tools.javac.code.TypeTag.NONE;
+import static com.sun.tools.javac.code.TypeTag.VOID;
+import static com.sun.tools.javac.tree.JCTree.Tag.*;
+
+/**
+ * This pass desugars lambda expressions into static methods
+ *
+ *  <p><b>This is NOT part of any supported API.
+ *  If you write code that depends on this, you do so at your own risk.
+ *  This code and its internal interfaces are subject to change or
+ *  deletion without notice.</b>
+ */
+public class LambdaToMethod extends TreeTranslator {
+
+    private Names names;
+    private Symtab syms;
+    private Resolve rs;
+    private TreeMaker make;
+    private Types types;
+    private TransTypes transTypes;
+    private Env<AttrContext> attrEnv;
+
+    /** the analyzer scanner */
+    private LambdaAnalyzer analyzer;
+
+    /** map from lambda trees to translation contexts */
+    private Map<JCTree, TranslationContext<?>> contextMap;
+
+    /** current translation context (visitor argument) */
+    private TranslationContext<?> context;
+
+    /** list of translated methods
+     **/
+    private ListBuffer<JCTree> translatedMethodList;
+
+    // <editor-fold defaultstate="collapsed" desc="Instantiating">
+    private static final Context.Key<LambdaToMethod> unlambdaKey =
+            new Context.Key<LambdaToMethod>();
+
+    public static LambdaToMethod instance(Context context) {
+        LambdaToMethod instance = context.get(unlambdaKey);
+        if (instance == null) {
+            instance = new LambdaToMethod(context);
+        }
+        return instance;
+    }
+
+    private LambdaToMethod(Context context) {
+        names = Names.instance(context);
+        syms = Symtab.instance(context);
+        rs = Resolve.instance(context);
+        make = TreeMaker.instance(context);
+        types = Types.instance(context);
+        transTypes = TransTypes.instance(context);
+        this.analyzer = makeAnalyzer();
+    }
+
+    private LambdaAnalyzer makeAnalyzer() {
+        return new LambdaAnalyzer();
+    }
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="translate methods">
+    @Override
+    public <T extends JCTree> T translate(T tree) {
+        TranslationContext<?> newContext = contextMap.get(tree);
+        return translate(tree, newContext != null ? newContext : context);
+    }
+
+    public <T extends JCTree> T translate(T tree, TranslationContext<?> newContext) {
+        TranslationContext<?> prevContext = context;
+        try {
+            context = newContext;
+            return super.translate(tree);
+        }
+        finally {
+            context = prevContext;
+        }
+    }
+
+    public <T extends JCTree> List<T> translate(List<T> trees, TranslationContext<?> newContext) {
+        ListBuffer<T> buf = ListBuffer.lb();
+        for (T tree : trees) {
+            buf.append(translate(tree, newContext));
+        }
+        return buf.toList();
+    }
+
+    public JCTree translateTopLevelClass(Env<AttrContext> env, JCTree cdef, TreeMaker make) {
+        this.make = make;
+        this.attrEnv = env;
+        this.context = null;
+        this.contextMap = new HashMap<JCTree, TranslationContext<?>>();
+        return translate(cdef);
+    }
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="visitor methods">
+    /**
+     * Visit a class.
+     * Maintain the translatedMethodList across nested classes.
+     * Append the translatedMethodList to the class after it is translated.
+     * @param tree
+     */
+    @Override
+    public void visitClassDef(JCClassDecl tree) {
+        if (tree.sym.owner.kind == PCK) {
+            //analyze class
+            analyzer.analyzeClass(tree);
+        }
+        ListBuffer<JCTree> prevTranslated = translatedMethodList;
+        try {
+            translatedMethodList = ListBuffer.lb();
+            super.visitClassDef(tree);
+            //add all translated instance methods here
+            tree.defs = tree.defs.appendList(translatedMethodList.toList());
+            for (JCTree lambda : translatedMethodList) {
+                tree.sym.members().enter(((JCMethodDecl)lambda).sym);
+            }
+            result = tree;
+        } finally {
+            translatedMethodList = prevTranslated;
+        }
+    }
+
+    /**
+     * Translate a lambda into a method to be inserted into the class.
+     * Then replace the lambda site with an invokedynamic call of to lambda
+     * meta-factory, which will use the lambda method.
+     * @param tree
+     */
+    @Override
+    public void visitLambda(JCLambda tree) {
+        LambdaTranslationContext localContext = (LambdaTranslationContext)context;
+        MethodSymbol sym = (MethodSymbol)localContext.translatedSym;
+        MethodType lambdaType = (MethodType) sym.type;
+
+        //create the method declaration hoisting the lambda body
+        JCMethodDecl lambdaDecl = make.MethodDef(make.Modifiers(sym.flags_field),
+                sym.name,
+                make.QualIdent(lambdaType.getReturnType().tsym),
+                List.<JCTypeParameter>nil(),
+                localContext.syntheticParams,
+                lambdaType.getThrownTypes() == null ?
+                    List.<JCExpression>nil() :
+                    make.Types(lambdaType.getThrownTypes()),
+                null,
+                null);
+        lambdaDecl.sym = sym;
+        lambdaDecl.type = lambdaType;
+
+        //translate lambda body
+        //As the lambda body is translated, all references to lambda locals,
+        //captured variables, enclosing members are adjusted accordingly
+        //to refer to the static method parameters (rather than i.e. acessing to
+        //captured members directly).
+        lambdaDecl.body = translate(makeLambdaBody(tree, lambdaDecl));
+
+        //Add the method to the list of methods to be added to this class.
+        translatedMethodList = translatedMethodList.prepend(lambdaDecl);
+
+        //now that we have generated a method for the lambda expression,
+        //we can translate the lambda into a method reference pointing to the newly
+        //created method.
+        //
+        //Note that we need to adjust the method handle so that it will match the
+        //signature of the SAM descriptor - this means that the method reference
+        //should be added the following synthetic arguments:
+        //
+        // * the "this" argument if it is an instance method
+        // * enclosing locals captured by the lambda expression
+
+        ListBuffer<JCExpression> syntheticInits = ListBuffer.lb();
+
+        if (!sym.isStatic()) {
+            syntheticInits.append(makeThis(
+                    sym.owner.asType(),
+                    localContext.owner.enclClass()));
+        }
+
+        //add captured locals
+        for (Symbol fv : localContext.getSymbolMap(CAPTURED_VAR).keySet()) {
+            if (fv != localContext.self) {
+                JCTree captured_local = make.Ident(fv).setType(fv.type);
+                syntheticInits.append((JCExpression) captured_local);
+            }
+        }
+
+        //then, determine the arguments to the indy call
+        List<JCExpression> indy_args = translate(syntheticInits.toList(), localContext.prev);
+
+        //build a sam instance using an indy call to the meta-factory
+        int refKind = referenceKind(sym);
+
+        //convert to an invokedynamic call
+        result = makeMetaFactoryIndyCall(tree, tree.targetType, refKind, sym, indy_args);
+    }
+
+    private JCIdent makeThis(Type type, Symbol owner) {
+        VarSymbol _this = new VarSymbol(PARAMETER | FINAL | SYNTHETIC,
+                names._this,
+                type,
+                owner);
+        return make.Ident(_this);
+    }
+
+    /**
+     * Translate a method reference into an invokedynamic call to the
+     * meta-factory.
+     * @param tree
+     */
+    @Override
+    public void visitReference(JCMemberReference tree) {
+        ReferenceTranslationContext localContext = (ReferenceTranslationContext)context;
+
+        //first determine the method symbol to be used to generate the sam instance
+        //this is either the method reference symbol, or the bridged reference symbol
+        Symbol refSym = localContext.needsBridge() ?
+            localContext.bridgeSym :
+            tree.sym;
+
+        //build the bridge method, if needed
+        if (localContext.needsBridge()) {
+            bridgeMemberReference(tree, localContext);
+        }
+
+        //the qualifying expression is treated as a special captured arg
+        JCExpression init;
+        switch(tree.kind) {
+
+            case IMPLICIT_INNER:    /** Inner # new */
+            case SUPER:             /** super # instMethod */
+                init = makeThis(
+                    localContext.owner.owner.asType(),
+                    localContext.owner);
+                break;
+
+            case BOUND:             /** Expr # instMethod */
+                init = tree.getQualifierExpression();
+                break;
+
+            case STATIC_EVAL:       /** Expr # staticMethod */
+            case UNBOUND:           /** Type # instMethod */
+            case STATIC:            /** Type # staticMethod */
+            case TOPLEVEL:          /** Top level # new */
+                init = null;
+                break;
+
+            default:
+                throw new InternalError("Should not have an invalid kind");
+        }
+
+        List<JCExpression> indy_args = init==null? List.<JCExpression>nil() : translate(List.of(init), localContext.prev);
+
+
+        //build a sam instance using an indy call to the meta-factory
+        result = makeMetaFactoryIndyCall(tree, tree.targetType, localContext.referenceKind(), refSym, indy_args);
+
+        //if we had a static reference with non-static qualifier, add a let
+        //expression to force the evaluation of the qualifier expr
+        if (tree.hasKind(ReferenceKind.STATIC_EVAL)) {
+            VarSymbol rec = new VarSymbol(0, names.fromString("rec$"), tree.getQualifierExpression().type, localContext.owner);
+            JCVariableDecl recDef = make.VarDef(rec, tree.getQualifierExpression());
+            result = make.LetExpr(recDef, result).setType(tree.type);
+        }
+    }
+
+    /**
+     * Translate identifiers within a lambda to the mapped identifier
+     * @param tree
+     */
+    @Override
+    public void visitIdent(JCIdent tree) {
+        if (context == null || !analyzer.lambdaIdentSymbolFilter(tree.sym)) {
+            super.visitIdent(tree);
+        } else {
+            LambdaTranslationContext lambdaContext = (LambdaTranslationContext) context;
+            if (lambdaContext.getSymbolMap(PARAM).containsKey(tree.sym)) {
+                Symbol translatedSym = lambdaContext.getSymbolMap(PARAM).get(tree.sym);
+                result = make.Ident(translatedSym).setType(tree.type);
+            } else if (lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
+                Symbol translatedSym = lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym);
+                result = make.Ident(translatedSym).setType(tree.type);
+            } else if (lambdaContext.getSymbolMap(CAPTURED_VAR).containsKey(tree.sym)) {
+                Symbol translatedSym = lambdaContext.getSymbolMap(CAPTURED_VAR).get(tree.sym);
+                result = make.Ident(translatedSym).setType(tree.type);
+            } else {
+                if (tree.sym.owner.kind == Kinds.TYP) {
+                    for (Map.Entry<Symbol, Symbol> encl_entry : lambdaContext.getSymbolMap(CAPTURED_THIS).entrySet()) {
+                        if (tree.sym.isMemberOf((ClassSymbol) encl_entry.getKey(), types)) {
+                            JCExpression enclRef = make.Ident(encl_entry.getValue());
+                            result = tree.sym.name == names._this
+                                    ? enclRef.setType(tree.type)
+                                    : make.Select(enclRef, tree.sym).setType(tree.type);
+                            result = tree;
+                            return;
+                        }
+                    }
+                }
+                //access to untranslated symbols (i.e. compile-time constants,
+                //members defined inside the lambda body, etc.) )
+                super.visitIdent(tree);
+            }
+        }
+    }
+
+    @Override
+    public void visitVarDef(JCVariableDecl tree) {
+        LambdaTranslationContext lambdaContext = (LambdaTranslationContext)context;
+        if (context != null && lambdaContext.getSymbolMap(LOCAL_VAR).containsKey(tree.sym)) {
+            JCExpression init = translate(tree.init);
+            result = make.VarDef((VarSymbol)lambdaContext.getSymbolMap(LOCAL_VAR).get(tree.sym), init);
+        } else {
+            super.visitVarDef(tree);
+        }
+    }
+
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="Translation helper methods">
+
+    private JCBlock makeLambdaBody(JCLambda tree, JCMethodDecl lambdaMethodDecl) {
+        return tree.getBodyKind() == JCLambda.BodyKind.EXPRESSION ?
+                makeLambdaExpressionBody((JCExpression)tree.body, lambdaMethodDecl) :
+                makeLambdaStatementBody((JCBlock)tree.body, lambdaMethodDecl, tree.canCompleteNormally);
+    }
+
+    private JCBlock makeLambdaExpressionBody(JCExpression expr, JCMethodDecl lambdaMethodDecl) {
+        Type restype = lambdaMethodDecl.type.getReturnType();
+        boolean isLambda_void = expr.type.hasTag(VOID);
+        boolean isTarget_void = restype.hasTag(VOID);
+        boolean isTarget_Void = types.isSameType(restype, types.boxedClass(syms.voidType).type);
+        if (isTarget_void) {
+            //target is void:
+            // BODY;
+            JCStatement stat = make.Exec(expr);
+            return make.Block(0, List.<JCStatement>of(stat));
+        } else if (isLambda_void && isTarget_Void) {
+            //void to Void conversion:
+            // BODY; return null;
+            ListBuffer<JCStatement> stats = ListBuffer.lb();
+            stats.append(make.Exec(expr));
+            stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
+            return make.Block(0, stats.toList());
+        } else {
+            //non-void to non-void conversion:
+            // return (TYPE)BODY;
+            JCExpression retExpr = transTypes.coerce(attrEnv, expr, restype);
+            return make.Block(0, List.<JCStatement>of(make.Return(retExpr)));
+        }
+    }
+
+    private JCBlock makeLambdaStatementBody(JCBlock block, final JCMethodDecl lambdaMethodDecl, boolean completeNormally) {
+        final Type restype = lambdaMethodDecl.type.getReturnType();
+        final boolean isTarget_void = restype.hasTag(VOID);
+        boolean isTarget_Void = types.isSameType(restype, types.boxedClass(syms.voidType).type);
+
+        class LambdaBodyTranslator extends TreeTranslator {
+
+            @Override
+            public void visitClassDef(JCClassDecl tree) {
+                //do NOT recurse on any inner classes
+                result = tree;
+            }
+
+            @Override
+            public void visitLambda(JCLambda tree) {
+                //do NOT recurse on any nested lambdas
+                result = tree;
+            }
+
+            @Override
+            public void visitReturn(JCReturn tree) {
+                boolean isLambda_void = tree.expr == null;
+                if (isTarget_void && !isLambda_void) {
+                    //Void to void conversion:
+                    // { TYPE $loc = RET-EXPR; return; }
+                    VarSymbol loc = makeSyntheticVar(0, names.fromString("$loc"), tree.expr.type, lambdaMethodDecl.sym);
+                    JCVariableDecl varDef = make.VarDef(loc, tree.expr);
+                    result = make.Block(0, List.<JCStatement>of(varDef, make.Return(null)));
+                } else if (!isTarget_void || !isLambda_void) {
+                    //non-void to non-void conversion:
+                    // return (TYPE)RET-EXPR;
+                    tree.expr = transTypes.coerce(attrEnv, tree.expr, restype);
+                    result = tree;
+                } else {
+                    result = tree;
+                }
+
+            }
+        }
+
+        JCBlock trans_block = new LambdaBodyTranslator().translate(block);
+        if (completeNormally && isTarget_Void) {
+            //there's no return statement and the lambda (possibly inferred)
+            //return type is java.lang.Void; emit a synthetic return statement
+            trans_block.stats = trans_block.stats.append(make.Return(make.Literal(BOT, null).setType(syms.botType)));
+        }
+        return trans_block;
+    }
+
+    /**
+     * Create new synthetic method with given flags, name, type, owner
+     */
+    private MethodSymbol makeSyntheticMethod(long flags, Name name, Type type, Symbol owner) {
+        return new MethodSymbol(flags | SYNTHETIC, name, type, owner);
+    }
+
+    /**
+     * Create new synthetic variable with given flags, name, type, owner
+     */
+    private VarSymbol makeSyntheticVar(long flags, String name, Type type, Symbol owner) {
+        return makeSyntheticVar(flags, names.fromString(name), type, owner);
+    }
+
+    /**
+     * Create new synthetic variable with given flags, name, type, owner
+     */
+    private VarSymbol makeSyntheticVar(long flags, Name name, Type type, Symbol owner) {
+        return new VarSymbol(flags | SYNTHETIC, name, type, owner);
+    }
+
+    /**
+     * Set varargsElement field on a given tree (must be either a new class tree
+     * or a method call tree)
+     */
+    private void setVarargsIfNeeded(JCTree tree, Type varargsElement) {
+        if (varargsElement != null) {
+            switch (tree.getTag()) {
+                case APPLY: ((JCMethodInvocation)tree).varargsElement = varargsElement; break;
+                case NEWCLASS: ((JCNewClass)tree).varargsElement = varargsElement; break;
+                default: throw new AssertionError();
+            }
+        }
+    }
+
+    /**
+     * Convert method/constructor arguments by inserting appropriate cast
+     * as required by type-erasure - this is needed when bridging a lambda/method
+     * reference, as the bridged signature might require downcast to be compatible
+     * with the generated signature.
+     */
+    private List<JCExpression> convertArgs(Symbol meth, List<JCExpression> args, Type varargsElement) {
+       Assert.check(meth.kind == Kinds.MTH);
+       List<Type> formals = types.erasure(meth.type).getParameterTypes();
+       if (varargsElement != null) {
+           Assert.check((meth.flags() & VARARGS) != 0);
+       }
+       return transTypes.translateArgs(args, formals, varargsElement, attrEnv);
+    }
+
+    // </editor-fold>
+
+    private MethodSymbol makeSamDescriptor(Type targetType) {
+        return (MethodSymbol)types.findDescriptorSymbol(targetType.tsym);
+    }
+
+    private Type makeFunctionalDescriptorType(Type targetType, MethodSymbol samDescriptor, boolean erased) {
+        Type descType = types.memberType(targetType, samDescriptor);
+        return erased ? types.erasure(descType) : descType;
+    }
+
+    private Type makeFunctionalDescriptorType(Type targetType, boolean erased) {
+        return makeFunctionalDescriptorType(targetType, makeSamDescriptor(targetType), erased);
+    }
+
+    /**
+     * Generate an adapter method "bridge" for a method reference which cannot
+     * be used directly.
+     */
+    private class MemberReferenceBridger {
+
+        private final JCMemberReference tree;
+        private final ReferenceTranslationContext localContext;
+        private final ListBuffer<JCExpression> args = ListBuffer.lb();
+        private final ListBuffer<JCVariableDecl> params = ListBuffer.lb();
+
+        MemberReferenceBridger(JCMemberReference tree, ReferenceTranslationContext localContext) {
+            this.tree = tree;
+            this.localContext = localContext;
+        }
+
+        /**
+         * Generate the bridge
+         */
+        JCMethodDecl bridge() {
+            int prevPos = make.pos;
+            try {
+                make.at(tree);
+                Type samDesc = localContext.bridgedRefSig();
+                List<Type> samPTypes = samDesc.getParameterTypes();
+
+                //an extra argument is prepended to the signature of the bridge in case
+                //the member reference is an instance method reference (in which case
+                //the receiver expression is passed to the bridge itself).
+                Type recType = null;
+                switch (tree.kind) {
+                    case IMPLICIT_INNER:
+                        recType = tree.sym.owner.type.getEnclosingType();
+                        break;
+                    case BOUND:
+                        recType = tree.getQualifierExpression().type;
+                        break;
+                    case UNBOUND:
+                        recType = samPTypes.head;
+                        samPTypes = samPTypes.tail;
+                        break;
+                }
+
+                //generate the parameter list for the bridged member reference - the
+                //bridge signature will match the signature of the target sam descriptor
+
+                VarSymbol rcvr = (recType == null)
+                        ? null
+                        : addParameter("rec$", recType, false);
+
+                List<Type> refPTypes = tree.sym.type.getParameterTypes();
+                int refSize = refPTypes.size();
+                int samSize = samPTypes.size();
+                int last = localContext.needsVarArgsConversion() ? refSize - 1 : refSize;   // Last parameter to copy from referenced method
+
+                List<Type> l = refPTypes;
+                // Use parameter types of the referenced method, excluding final var args
+                for (int i = 0; l.nonEmpty() && i < last; ++i) {
+                    addParameter("x$" + i, l.head, true);
+                    l = l.tail;
+                }
+                // Flatten out the var args
+                for (int i = last; i < samSize; ++i) {
+                    addParameter("xva$" + i, tree.varargsElement, true);
+                }
+
+                //generate the bridge method declaration
+                JCMethodDecl bridgeDecl = make.MethodDef(make.Modifiers(localContext.bridgeSym.flags()),
+                        localContext.bridgeSym.name,
+                        make.QualIdent(samDesc.getReturnType().tsym),
+                        List.<JCTypeParameter>nil(),
+                        params.toList(),
+                        tree.sym.type.getThrownTypes() == null
+                        ? List.<JCExpression>nil()
+                        : make.Types(tree.sym.type.getThrownTypes()),
+                        null,
+                        null);
+                bridgeDecl.sym = (MethodSymbol) localContext.bridgeSym;
+                bridgeDecl.type = localContext.bridgeSym.type = types.createMethodTypeWithParameters(samDesc, TreeInfo.types(params.toList()));
+
+                //bridge method body generation - this can be either a method call or a
+                //new instance creation expression, depending on the member reference kind
+                JCExpression bridgeExpr = (tree.getMode() == ReferenceMode.INVOKE)
+                        ? bridgeExpressionInvoke(rcvr)
+                        : bridgeExpressionNew();
+
+                //the body is either a return expression containing a method call,
+                //or the method call itself, depending on whether the return type of
+                //the bridge is non-void/void.
+                bridgeDecl.body = makeLambdaExpressionBody(bridgeExpr, bridgeDecl);
+
+                return bridgeDecl;
+            } finally {
+                make.at(prevPos);
+            }
+        }
+
+        /**
+         * determine the receiver of the bridged method call - the receiver can
+         * be either the synthetic receiver parameter or a type qualifier; the
+         * original qualifier expression is never used here, as it might refer
+         * to symbols not available in the static context of the bridge
+         */
+        private JCExpression bridgeExpressionInvoke(VarSymbol rcvr) {
+            JCExpression qualifier =
+                    tree.sym.isStatic() ?
+                        make.Type(tree.sym.owner.type) :
+                        (rcvr != null) ?
+                            make.Ident(rcvr) :
+                            tree.getQualifierExpression();
+
+            //create the qualifier expression
+            JCFieldAccess select = make.Select(qualifier, tree.sym.name);
+            select.sym = tree.sym;
+            select.type = tree.sym.erasure(types);
+
+            //create the method call expression
+            JCExpression apply = make.Apply(List.<JCExpression>nil(), select,
+                    convertArgs(tree.sym, args.toList(), tree.varargsElement)).setType(tree.sym.erasure(types).getReturnType());
+
+            apply = transTypes.coerce(apply, localContext.generatedRefSig().getReturnType());
+            setVarargsIfNeeded(apply, tree.varargsElement);
+            return apply;
+        }
+
+        /**
+         * the enclosing expression is either 'null' (no enclosing type) or set
+         * to the first bridge synthetic parameter
+         */
+        private JCExpression bridgeExpressionNew() {
+            JCExpression encl = null;
+            switch (tree.kind) {
+                case UNBOUND:
+                case IMPLICIT_INNER:
+                    encl = make.Ident(params.first());
+            }
+
+            //create the instance creation expression
+            JCNewClass newClass = make.NewClass(encl,
+                    List.<JCExpression>nil(),
+                    make.Type(tree.getQualifierExpression().type),
+                    convertArgs(tree.sym, args.toList(), tree.varargsElement),
+                    null);
+            newClass.constructor = tree.sym;
+            newClass.constructorType = tree.sym.erasure(types);
+            newClass.type = tree.getQualifierExpression().type;
+            setVarargsIfNeeded(newClass, tree.varargsElement);
+            return newClass;
+        }
+
+        private VarSymbol addParameter(String name, Type p, boolean genArg) {
+            VarSymbol vsym = new VarSymbol(0, names.fromString(name), p, localContext.bridgeSym);
+            params.append(make.VarDef(vsym, null));
+            if (genArg) {
+                args.append(make.Ident(vsym));
+            }
+            return vsym;
+        }
+    }
+
+    /**
+     * Bridges a member reference - this is needed when:
+     * * Var args in the referenced method need to be flattened away
+     * * super is used
+     */
+    private void bridgeMemberReference(JCMemberReference tree, ReferenceTranslationContext localContext) {
+        JCMethodDecl bridgeDecl = (new MemberReferenceBridger(tree, localContext).bridge());
+        translatedMethodList = translatedMethodList.prepend(bridgeDecl);
+    }
+
+    /**
+     * Generate an indy method call to the meta factory
+     */
+    private JCExpression makeMetaFactoryIndyCall(JCExpression tree, Type targetType, int refKind, Symbol refSym, List<JCExpression> indy_args) {
+        //determine the static bsm args
+        Type mtype = makeFunctionalDescriptorType(targetType, true);
+        List<Object> staticArgs = List.<Object>of(
+                new Pool.MethodHandle(ClassFile.REF_invokeInterface, types.findDescriptorSymbol(targetType.tsym)),
+                new Pool.MethodHandle(refKind, refSym),
+                new MethodType(mtype.getParameterTypes(),
+                        mtype.getReturnType(),
+                        mtype.getThrownTypes(),
+                        syms.methodClass));
+
+        //computed indy arg types
+        ListBuffer<Type> indy_args_types = ListBuffer.lb();
+        for (JCExpression arg : indy_args) {
+            indy_args_types.append(arg.type);
+        }
+
+        //finally, compute the type of the indy call
+        MethodType indyType = new MethodType(indy_args_types.toList(),
+                tree.type,
+                List.<Type>nil(),
+                syms.methodClass);
+
+        return makeIndyCall(tree, syms.lambdaMetafactory, names.metaFactory, staticArgs, indyType, indy_args);
+    }
+
+    /**
+     * Generate an indy method call with given name, type and static bootstrap
+     * arguments types
+     */
+    private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmName, List<Object> staticArgs, MethodType indyType, List<JCExpression> indyArgs) {
+        int prevPos = make.pos;
+        try {
+            make.at(pos);
+            List<Type> bsm_staticArgs = List.of(syms.methodHandleLookupType,
+                    syms.stringType,
+                    syms.methodTypeType).appendList(bsmStaticArgToTypes(staticArgs));
+
+            Symbol bsm = rs.resolveInternalMethod(pos, attrEnv, site,
+                    bsmName, bsm_staticArgs, List.<Type>nil());
+
+            DynamicMethodSymbol dynSym =
+                    new DynamicMethodSymbol(names.lambda,
+                                            syms.noSymbol,
+                                            bsm.isStatic() ? ClassFile.REF_invokeStatic : ClassFile.REF_invokeVirtual,
+                                            (MethodSymbol)bsm,
+                                            indyType,
+                                            staticArgs.toArray());
+
+            JCFieldAccess qualifier = make.Select(make.QualIdent(site.tsym), bsmName);
+            qualifier.sym = dynSym;
+            qualifier.type = indyType.getReturnType();
+
+            JCMethodInvocation proxyCall = make.Apply(List.<JCExpression>nil(), qualifier, indyArgs);
+            proxyCall.type = indyType.getReturnType();
+            return proxyCall;
+        } finally {
+            make.at(prevPos);
+        }
+    }
+    //where
+    private List<Type> bsmStaticArgToTypes(List<Object> args) {
+        ListBuffer<Type> argtypes = ListBuffer.lb();
+        for (Object arg : args) {
+            argtypes.append(bsmStaticArgToType(arg));
+        }
+        return argtypes.toList();
+    }
+
+    private Type bsmStaticArgToType(Object arg) {
+        Assert.checkNonNull(arg);
+        if (arg instanceof ClassSymbol) {
+            return syms.classType;
+        } else if (arg instanceof Integer) {
+            return syms.intType;
+        } else if (arg instanceof Long) {
+            return syms.longType;
+        } else if (arg instanceof Float) {
+            return syms.floatType;
+        } else if (arg instanceof Double) {
+            return syms.doubleType;
+        } else if (arg instanceof String) {
+            return syms.stringType;
+        } else if (arg instanceof Pool.MethodHandle) {
+            return syms.methodHandleType;
+        } else if (arg instanceof MethodType) {
+            return syms.methodTypeType;
+        } else {
+            Assert.error("bad static arg " + arg.getClass());
+            return null;
+        }
+    }
+
+    /**
+     * Get the opcode associated with this method reference
+     */
+    private int referenceKind(Symbol refSym) {
+        if (refSym.isConstructor()) {
+            return ClassFile.REF_newInvokeSpecial;
+        } else {
+            if (refSym.isStatic()) {
+                return ClassFile.REF_invokeStatic;
+            } else if (refSym.enclClass().isInterface()) {
+                return ClassFile.REF_invokeInterface;
+            } else {
+                return ClassFile.REF_invokeVirtual;
+            }
+        }
+    }
+    // </editor-fold>
+
+    // <editor-fold defaultstate="collapsed" desc="Lambda/reference analyzer">\
+    /**
+     * This visitor collects information about translation of a lambda expression.
+     * More specifically, it keeps track of the enclosing contexts and captured locals
+     * accessed by the lambda being translated (as well as other useful info).
+     */
+    class LambdaAnalyzer extends TreeScanner {
+
+        /** the frame stack - used to reconstruct translation info about enclosing scopes */
+        private List<Frame> frameStack;
+
+        /**
+         * keep the count of lambda expression (used to generate unambiguous
+         * names)
+         */
+        private int lambdaCount = 0;
+
+        private void analyzeClass(JCClassDecl tree) {
+            frameStack = List.nil();
+            scan(tree);
+        }
+
+        @Override
+        public void visitBlock(JCBlock tree) {
+            List<Frame> prevStack = frameStack;
+            try {
+                if (frameStack.nonEmpty() && frameStack.head.tree.hasTag(CLASSDEF)) {
+                    frameStack = frameStack.prepend(new Frame(tree));
+                }
+                super.visitBlock(tree);
+            }
+            finally {
+                frameStack = prevStack;
+            }
+        }
+
+        @Override
+        public void visitClassDef(JCClassDecl tree) {
+            List<Frame> prevStack = frameStack;
+            try {
+                if (frameStack.nonEmpty() && enclosingLambda() != null) {
+                    tree.sym.owner = owner();
+                    LambdaTranslationContext lambdaContext = (LambdaTranslationContext)contextMap.get(enclosingLambda());
+                    Type encl = lambdaContext.enclosingType();
+                    if (encl.hasTag(NONE)) {
+                        //if the translated lambda body occurs in a static context,
+                        //any class declaration within it must be made static
+                        tree.sym.flags_field |= STATIC;
+                        ((ClassType)tree.sym.type).setEnclosingType(Type.noType);
+                    } else {
+                        //if the translated lambda body is in an instance context
+                        //the enclosing type of any class declaration within it
+                        //must be updated to point to the new enclosing type (if any)
+                        ((ClassType)tree.sym.type).setEnclosingType(encl);
+                    }
+                }
+                frameStack = frameStack.prepend(new Frame(tree));
+                super.visitClassDef(tree);
+            }
+            finally {
+                frameStack = prevStack;
+            }
+            if (frameStack.nonEmpty() && enclosingLambda() != null) {
+                // Any class defined within a lambda is an implicit 'this' reference
+                // because its constructor will reference the enclosing class
+                ((LambdaTranslationContext) context()).addSymbol(tree.sym.type.getEnclosingType().tsym, CAPTURED_THIS);
+            }
+        }
+
+        @Override
+        public void visitIdent(JCIdent tree) {
+            if (context() == null || !lambdaIdentSymbolFilter(tree.sym)) {
+                super.visitIdent(tree);
+            } else {
+                if (tree.sym.kind == VAR &&
+                        tree.sym.owner.kind == MTH &&
+                        tree.type.constValue() == null) {
+                    TranslationContext<?> localContext = context();
+                    while (localContext != null) {
+                        if (localContext.tree.getTag() == LAMBDA) {
+                            JCTree block = capturedDecl(localContext.depth, tree.sym);
+                            if (block == null) break;
+                            ((LambdaTranslationContext)localContext).addSymbol(tree.sym, CAPTURED_VAR);
+                        }
+                        localContext = localContext.prev;
+                    }
+                } else if (tree.sym.owner.kind == TYP) {
+                    TranslationContext<?> localContext = context();
+                    while (localContext != null) {
+                        if (localContext.tree.hasTag(LAMBDA)) {
+                            JCTree block = capturedDecl(localContext.depth, tree.sym);
+                            if (block == null) break;
+                            switch (block.getTag()) {
+                                case CLASSDEF:
+                                    JCClassDecl cdecl = (JCClassDecl)block;
+                                    ((LambdaTranslationContext)localContext).addSymbol(cdecl.sym, CAPTURED_THIS);
+                                    break;
+                                default:
+                                    Assert.error("bad block kind");
+                            }
+                        }
+                        localContext = localContext.prev;
+                    }
+                }
+            }
+        }
+
+        @Override
+        public void visitLambda(JCLambda tree) {
+            List<Frame> prevStack = frameStack;
+            try {
+                LambdaTranslationContext context = (LambdaTranslationContext)makeLambdaContext(tree);
+                frameStack = frameStack.prepend(new Frame(tree));
+                for (JCVariableDecl param : tree.params) {
+                    context.addSymbol(param.sym, PARAM);
+                    frameStack.head.addLocal(param.sym);
+                }
+                contextMap.put(tree, context);
+                scan(tree.body);
+                context.complete();
+            }
+            finally {
+                frameStack = prevStack;
+            }
+        }
+
+        @Override
+        public void visitMethodDef(JCMethodDecl tree) {
+            List<Frame> prevStack = frameStack;
+            try {
+                frameStack = frameStack.prepend(new Frame(tree));
+                super.visitMethodDef(tree);
+            }
+            finally {
+                frameStack = prevStack;
+            }
+        }
+
+        @Override
+        public void visitNewClass(JCNewClass tree) {
+            if (lambdaNewClassFilter(context(), tree)) {
+                ((LambdaTranslationContext) context()).addSymbol(tree.type.getEnclosingType().tsym, CAPTURED_THIS);
+            }
+            super.visitNewClass(tree);
+        }
+
+        @Override
+        public void visitReference(JCMemberReference tree) {
+            scan(tree.getQualifierExpression());
+            contextMap.put(tree, makeReferenceContext(tree));
+        }
+
+        @Override
+        public void visitSelect(JCFieldAccess tree) {
+            if (context() != null && lambdaSelectSymbolFilter(tree.sym)) {
+                TranslationContext<?> localContext = context();
+                while (localContext != null) {
+                    if (localContext.tree.hasTag(LAMBDA)) {
+                        JCClassDecl clazz = (JCClassDecl)capturedDecl(localContext.depth, tree.sym);
+                        if (clazz == null) break;
+                        ((LambdaTranslationContext)localContext).addSymbol(clazz.sym, CAPTURED_THIS);
+                    }
+                    localContext = localContext.prev;
+                }
+                scan(tree.selected);
+            } else {
+                super.visitSelect(tree);
+            }
+        }
+
+        @Override
+        public void visitVarDef(JCVariableDecl tree) {
+            if (frameStack.head.tree.hasTag(LAMBDA)) {
+                ((LambdaTranslationContext)context()).addSymbol(tree.sym, LOCAL_VAR);
+            }
+            List<Frame> prevStack = frameStack;
+            try {
+                if (tree.sym.owner.kind == MTH) {
+                    frameStack.head.addLocal(tree.sym);
+                }
+                frameStack = frameStack.prepend(new Frame(tree));
+                super.visitVarDef(tree);
+            }
+            finally {
+                frameStack = prevStack;
+            }
+        }
+
+        private Name lambdaName() {
+            return names.lambda.append(names.fromString("$" + lambdaCount++));
+        }
+
+        /**
+         * Return a valid owner given the current declaration stack
+         * (required to skip synthetic lambda symbols)
+         */
+        private Symbol owner() {
+            List<Frame> frameStack2 = frameStack;
+            while (frameStack2.nonEmpty()) {
+                switch (frameStack2.head.tree.getTag()) {
+                    case VARDEF:
+                        if (((JCVariableDecl)frameStack2.head.tree).sym.isLocal()) {
+                            frameStack2 = frameStack2.tail;
+                            break;
+                        }
+                        JCClassDecl cdecl = (JCClassDecl)frameStack2.tail.head.tree;
+                        return makeSyntheticMethod(((JCVariableDecl)frameStack2.head.tree).sym.flags() & STATIC, names.empty, null, cdecl.sym);
+                    case BLOCK:
+                        JCClassDecl cdecl2 = (JCClassDecl)frameStack2.tail.head.tree;
+                        return makeSyntheticMethod(((JCBlock)frameStack2.head.tree).flags & STATIC | Flags.BLOCK, names.empty, null, cdecl2.sym);
+                    case CLASSDEF:
+                        return ((JCClassDecl)frameStack2.head.tree).sym;
+                    case METHODDEF:
+                        return ((JCMethodDecl)frameStack2.head.tree).sym;
+                    case LAMBDA:
+                        return ((LambdaTranslationContext)contextMap.get(frameStack2.head.tree)).translatedSym;
+                    default:
+                        frameStack2 = frameStack2.tail;
+                }
+            }
+            Assert.error();
+            return null;
+        }
+
+        private JCTree enclosingLambda() {
+            List<Frame> frameStack2 = frameStack;
+            while (frameStack2.nonEmpty()) {
+                switch (frameStack2.head.tree.getTag()) {
+                    case CLASSDEF:
+                    case METHODDEF:
+                        return null;
+                    case LAMBDA:
+                        return frameStack2.head.tree;
+                    default:
+                        frameStack2 = frameStack2.tail;
+                }
+            }
+            Assert.error();
+            return null;
+        }
+
+        /**
+         * Return the declaration corresponding to a symbol in the enclosing
+         * scope; the depth parameter is used to filter out symbols defined
+         * in nested scopes (which do not need to undergo capture).
+         */
+        private JCTree capturedDecl(int depth, Symbol sym) {
+            int currentDepth = frameStack.size() - 1;
+            for (Frame block : frameStack) {
+                switch (block.tree.getTag()) {
+                    case CLASSDEF:
+                        ClassSymbol clazz = ((JCClassDecl)block.tree).sym;
+                        if (sym.isMemberOf(clazz, types)) {
+                            return currentDepth > depth ? null : block.tree;
+                        }
+                        break;
+                    case VARDEF:
+                        if (((JCVariableDecl)block.tree).sym == sym &&
+                                sym.owner.kind == MTH) { //only locals are captured
+                            return currentDepth > depth ? null : block.tree;
+                        }
+                        break;
+                    case BLOCK:
+                    case METHODDEF:
+                    case LAMBDA:
+                        if (block.locals != null && block.locals.contains(sym)) {
+                            return currentDepth > depth ? null : block.tree;
+                        }
+                        break;
+                    default:
+                        Assert.error("bad decl kind " + block.tree.getTag());
+                }
+                currentDepth--;
+            }
+            return null;
+        }
+
+        private TranslationContext<?> context() {
+            for (Frame frame : frameStack) {
+                TranslationContext<?> context = contextMap.get(frame.tree);
+                if (context != null) {
+                    return context;
+                }
+            }
+            return null;
+        }
+
+        /**
+         *  This is used to filter out those identifiers that needs to be adjusted
+         *  when translating away lambda expressions
+         */
+        private boolean lambdaIdentSymbolFilter(Symbol sym) {
+            return (sym.kind == VAR || sym.kind == MTH)
+                    && !sym.isStatic()
+                    && sym.name != names.init;
+        }
+
+        private boolean lambdaSelectSymbolFilter(Symbol sym) {
+            return (sym.kind == VAR || sym.kind == MTH) &&
+                        !sym.isStatic() &&
+                        (sym.name == names._this ||
+                        sym.name == names._super);
+        }
+
+        /**
+         * This is used to filter out those new class expressions that need to
+         * be qualified with an enclosing tree
+         */
+        private boolean lambdaNewClassFilter(TranslationContext<?> context, JCNewClass tree) {
+            if (context != null
+                    && tree.encl == null
+                    && tree.def == null
+                    && tree.type.getEnclosingType().hasTag(NONE)) {
+                Type encl = tree.type.getEnclosingType();
+                Type current = context.owner.enclClass().type;
+                while (current.hasTag(NONE)) {
+                    if (current.tsym.isSubClass(encl.tsym, types)) {
+                        return true;
+                    }
+                    current = current.getEnclosingType();
+                }
+                return false;
+            } else {
+                return false;
+            }
+        }
+
+        private TranslationContext<JCLambda> makeLambdaContext(JCLambda tree) {
+            return new LambdaTranslationContext(tree);
+        }
+
+        private TranslationContext<JCMemberReference> makeReferenceContext(JCMemberReference tree) {
+            return new ReferenceTranslationContext(tree);
+        }
+
+        private class Frame {
+            final JCTree tree;
+            List<Symbol> locals;
+
+            public Frame(JCTree tree) {
+                this.tree = tree;
+            }
+
+            void addLocal(Symbol sym) {
+                if (locals == null) {
+                    locals = List.nil();
+                }
+                locals = locals.prepend(sym);
+            }
+        }
+
+        /**
+         * This class is used to store important information regarding translation of
+         * lambda expression/method references (see subclasses).
+         */
+        private abstract class TranslationContext<T extends JCTree> {
+
+            /** the underlying (untranslated) tree */
+            T tree;
+
+            /** points to the adjusted enclosing scope in which this lambda/mref expression occurs */
+            Symbol owner;
+
+            /** the depth of this lambda expression in the frame stack */
+            int depth;
+
+            /** the enclosing translation context (set for nested lambdas/mref) */
+            TranslationContext<?> prev;
+
+            TranslationContext(T tree) {
+                this.tree = tree;
+                this.owner = owner();
+                this.depth = frameStack.size() - 1;
+                this.prev = context();
+            }
+        }
+
+        /**
+         * This class retains all the useful information about a lambda expression;
+         * the contents of this class are filled by the LambdaAnalyzer visitor,
+         * and the used by the main translation routines in order to adjust references
+         * to captured locals/members, etc.
+         */
+        private class LambdaTranslationContext extends TranslationContext<JCLambda> {
+
+            /** variable in the enclosing context to which this lambda is assigned */
+            Symbol self;
+
+            /** map from original to translated lambda parameters */
+            Map<Symbol, Symbol> lambdaParams = new LinkedHashMap<Symbol, Symbol>();
+
+            /** map from original to translated lambda locals */
+            Map<Symbol, Symbol> lambdaLocals = new LinkedHashMap<Symbol, Symbol>();
+
+            /** map from variables in enclosing scope to translated synthetic parameters */
+            Map<Symbol, Symbol> capturedLocals  = new LinkedHashMap<Symbol, Symbol>();
+
+            /** map from class symbols to translated synthetic parameters (for captured member access) */
+            Map<Symbol, Symbol> capturedThis = new LinkedHashMap<Symbol, Symbol>();
+
+            /** the synthetic symbol for the method hoisting the translated lambda */
+            Symbol translatedSym;
+
+            List<JCVariableDecl> syntheticParams;
+
+            LambdaTranslationContext(JCLambda tree) {
+                super(tree);
+                Frame frame = frameStack.head;
+                if (frame.tree.hasTag(VARDEF)) {
+                    self = ((JCVariableDecl)frame.tree).sym;
+                }
+                this.translatedSym = makeSyntheticMethod(0, lambdaName(), null, owner.enclClass());
+            }
+
+            /**
+             * Translate a symbol of a given kind into something suitable for the
+             * synthetic lambda body
+             */
+            Symbol translate(String name, Symbol sym, LambdaSymbolKind skind) {
+                if (skind == CAPTURED_THIS) {
+                    return sym;  // self represented
+                } else {
+                    return makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
+                }
+            }
+
+            void addSymbol(Symbol sym, LambdaSymbolKind skind) {
+                Map<Symbol, Symbol> transMap = null;
+                String preferredName;
+                switch (skind) {
+                    case CAPTURED_THIS:
+                        transMap = capturedThis;
+                        preferredName = "encl$" + capturedThis.size();
+                        break;
+                    case CAPTURED_VAR:
+                        transMap = capturedLocals;
+                        preferredName = "cap$" + capturedLocals.size();
+                        break;
+                    case LOCAL_VAR:
+                        transMap = lambdaLocals;
+                        preferredName = sym.name.toString();
+                        break;
+                    case PARAM:
+                        transMap = lambdaParams;
+                        preferredName = sym.name.toString();
+                        break;
+                    default: throw new AssertionError();
+                }
+                if (!transMap.containsKey(sym)) {
+                    transMap.put(sym, translate(preferredName, sym, skind));
+                }
+            }
+
+            Map<Symbol, Symbol> getSymbolMap(LambdaSymbolKind... skinds) {
+                LinkedHashMap<Symbol, Symbol> translationMap = new LinkedHashMap<Symbol, Symbol>();
+                for (LambdaSymbolKind skind : skinds) {
+                    switch (skind) {
+                        case CAPTURED_THIS:
+                            translationMap.putAll(capturedThis);
+                            break;
+                        case CAPTURED_VAR:
+                            translationMap.putAll(capturedLocals);
+                            break;
+                        case LOCAL_VAR:
+                            translationMap.putAll(lambdaLocals);
+                            break;
+                        case PARAM:
+                            translationMap.putAll(lambdaParams);
+                            break;
+                        default: throw new AssertionError();
+                    }
+                }
+                return translationMap;
+            }
+
+            /**
+             * The translatedSym is not complete/accurate until the analysis is
+             * finished.  Once the analysis is finished, the translatedSym is
+             * "completed" -- updated with type information, access modifiers,
+             * and full parameter list.
+             */
+            void complete() {
+                if (syntheticParams != null) {
+                    return;
+                }
+                boolean inInterface = translatedSym.owner.isInterface();
+                boolean thisReferenced = !getSymbolMap(CAPTURED_THIS).isEmpty();
+                boolean needInstance = thisReferenced || inInterface;
+
+                // If instance access isn't needed, make it static
+                // Interface methods much be public default methods, otherwise make it private
+                translatedSym.flags_field = SYNTHETIC | (needInstance? 0 : STATIC) | (inInterface? PUBLIC | DEFAULT : PRIVATE);
+
+                //compute synthetic params
+                ListBuffer<JCVariableDecl> params = ListBuffer.lb();
+
+                // The signature of the method is augmented with the following
+                // synthetic parameters:
+                //
+                // 1) reference to enclosing contexts captured by the lambda expression
+                // 2) enclosing locals captured by the lambda expression
+                for (Symbol thisSym : getSymbolMap(CAPTURED_VAR, PARAM).values()) {
+                    params.append(make.VarDef((VarSymbol) thisSym, null));
+                }
+
+                syntheticParams = params.toList();
+
+                //prepend synthetic args to translated lambda method signature
+                translatedSym.type = (MethodType) types.createMethodTypeWithParameters(
+                        (MethodType) generatedLambdaSig(),
+                        TreeInfo.types(syntheticParams));
+            }
+
+            Type enclosingType() {
+                //local inner classes defined inside a lambda are always non-static
+                return owner.enclClass().type;
+            }
+
+            Type generatedLambdaSig() {
+                return types.erasure(types.findDescriptorType(tree.targetType));
+            }
+        }
+
+        /**
+         * This class retains all the useful information about a method reference;
+         * the contents of this class are filled by the LambdaAnalyzer visitor,
+         * and the used by the main translation routines in order to adjust method
+         * references (i.e. in case a bridge is needed)
+         */
+        private class ReferenceTranslationContext extends TranslationContext<JCMemberReference> {
+
+            final boolean isSuper;
+            final Symbol bridgeSym;
+
+            ReferenceTranslationContext(JCMemberReference tree) {
+                super(tree);
+                this.isSuper = tree.hasKind(ReferenceKind.SUPER);
+                this.bridgeSym = needsBridge()
+                        ? makeSyntheticMethod(isSuper ? 0 : STATIC,
+                                              lambdaName().append(names.fromString("$bridge")), null,
+                                              owner.enclClass())
+                        : null;
+            }
+
+            /**
+             * Get the opcode associated with this method reference
+             */
+            int referenceKind() {
+                return LambdaToMethod.this.referenceKind(needsBridge() ? bridgeSym : tree.sym);
+            }
+
+            boolean needsVarArgsConversion() {
+                return tree.varargsElement != null;
+            }
+
+            /**
+             * @return Is this an array operation like clone()
+             */
+            boolean isArrayOp() {
+                return tree.sym.owner == syms.arrayClass;
+            }
+
+            /**
+             * Does this reference needs a bridge (i.e. var args need to be
+             * expanded or "super" is used)
+             */
+            final boolean needsBridge() {
+                return isSuper || needsVarArgsConversion() || isArrayOp();
+            }
+
+            Type generatedRefSig() {
+                return types.erasure(tree.sym.type);
+            }
+
+            Type bridgedRefSig() {
+                return types.erasure(types.findDescriptorSymbol(tree.targetType.tsym).type);
+            }
+        }
+    }
+    // </editor-fold>
+
+    enum LambdaSymbolKind {
+        CAPTURED_VAR,
+        CAPTURED_THIS,
+        LOCAL_VAR,
+        PARAM;
+    }
+}
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java	Wed Nov 14 16:41:12 2012 -0800
@@ -45,7 +45,7 @@
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.BLOCK;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -485,7 +485,7 @@
      *  @param value      The literal's value.
      */
     JCExpression makeLit(Type type, Object value) {
-        return make.Literal(type.tag, value).setType(type.constType(value));
+        return make.Literal(type.getTag(), value).setType(type.constType(value));
     }
 
     /** Make an attributed tree representing null.
@@ -502,7 +502,7 @@
         JCNewClass tree = make.NewClass(null,
             null, make.QualIdent(ctype.tsym), args, null);
         tree.constructor = rs.resolveConstructor(
-            make_pos, attrEnv, ctype, TreeInfo.types(args), null, false, false);
+            make_pos, attrEnv, ctype, TreeInfo.types(args), List.<Type>nil());
         tree.type = ctype;
         return tree;
     }
@@ -549,7 +549,7 @@
      *  reference type..
      */
     JCExpression makeString(JCExpression tree) {
-        if (tree.type.tag >= CLASS) {
+        if (!tree.type.isPrimitiveOrVoid()) {
             return tree;
         } else {
             Symbol valueOfSym = lookupMethod(tree.pos(),
@@ -1405,7 +1405,7 @@
     Name outerThisName(Type type, Symbol owner) {
         Type t = type.getEnclosingType();
         int nestingLevel = 0;
-        while (t.tag == CLASS) {
+        while (t.hasTag(CLASS)) {
             t = t.getEnclosingType();
             nestingLevel++;
         }
@@ -1529,7 +1529,7 @@
             new VarSymbol(SYNTHETIC | FINAL,
                           makeSyntheticName(names.fromString("twrVar" +
                                            depth), twrVars),
-                          (resource.type.tag == TypeTags.BOT) ?
+                          (resource.type.hasTag(BOT)) ?
                           syms.autoCloseableType : resource.type,
                           currentMethodSym);
             twrVars.enter(syntheticTwrVar);
@@ -1992,7 +1992,7 @@
     }
 
     private JCExpression classOfType(Type type, DiagnosticPosition pos) {
-        switch (type.tag) {
+        switch (type.getTag()) {
         case BYTE: case SHORT: case CHAR: case INT: case LONG: case FLOAT:
         case DOUBLE: case BOOLEAN: case VOID:
             // replace with <BoxedClass>.TYPE
@@ -2761,7 +2761,7 @@
     }
 //where
         private JCTree convert(JCTree tree, Type pt) {
-            if (tree.type == pt || tree.type.tag == TypeTags.BOT)
+            if (tree.type == pt || tree.type.hasTag(BOT))
                 return tree;
             JCTree result = make_at(tree.pos()).TypeCast(make.Type(pt), (JCExpression)tree);
             result.type = (tree.type.constValue() != null) ? cfolder.coerce(tree.type, pt)
@@ -2934,7 +2934,7 @@
             return tree;
         if (havePrimitive) {
             Type unboxedTarget = types.unboxedType(type);
-            if (unboxedTarget.tag != NONE) {
+            if (!unboxedTarget.hasTag(NONE)) {
                 if (!types.isSubtype(tree.type, unboxedTarget)) //e.g. Character c = 89;
                     tree.type = unboxedTarget.constType(tree.type.constValue());
                 return (T)boxPrimitive((JCExpression)tree, type);
@@ -2974,7 +2974,7 @@
     /** Unbox an object to a primitive value. */
     JCExpression unbox(JCExpression tree, Type primitive) {
         Type unboxedType = types.unboxedType(tree.type);
-        if (unboxedType.tag == NONE) {
+        if (unboxedType.hasTag(NONE)) {
             unboxedType = primitive;
             if (!unboxedType.isPrimitive())
                 throw new AssertionError(unboxedType);
@@ -3292,7 +3292,7 @@
                 iteratorTarget = types.erasure(iterableType.getTypeArguments().head);
             Type eType = tree.expr.type;
             tree.expr.type = types.erasure(eType);
-            if (eType.tag == TYPEVAR && eType.getUpperBound().isCompound())
+            if (eType.hasTag(TYPEVAR) && eType.getUpperBound().isCompound())
                 tree.expr = make.TypeCast(types.erasure(iterableType), tree.expr);
             Symbol iterator = lookupMethod(tree.expr.pos(),
                                            names.iterator,
@@ -3631,15 +3631,26 @@
 
     public void visitSelect(JCFieldAccess tree) {
         // need to special case-access of the form C.super.x
-        // these will always need an access method.
+        // these will always need an access method, unless C
+        // is a default interface subclassed by the current class.
         boolean qualifiedSuperAccess =
             tree.selected.hasTag(SELECT) &&
-            TreeInfo.name(tree.selected) == names._super;
+            TreeInfo.name(tree.selected) == names._super &&
+            !types.isDirectSuperInterface(((JCFieldAccess)tree.selected).selected.type, currentClass);
         tree.selected = translate(tree.selected);
-        if (tree.name == names._class)
+        if (tree.name == names._class) {
             result = classOf(tree.selected);
-        else if (tree.name == names._this || tree.name == names._super)
+        }
+        else if (tree.name == names._super &&
+                types.isDirectSuperInterface(tree.selected.type, currentClass)) {
+            //default super call!! Not a classic qualified super call
+            TypeSymbol supSym = tree.selected.type.tsym;
+            Assert.checkNonNull(types.asSuper(currentClass.type, supSym));
+            result = tree;
+        }
+        else if (tree.name == names._this || tree.name == names._super) {
             result = makeThis(tree.pos(), tree.selected.type.tsym);
+        }
         else
             result = access(tree.sym, tree, enclOp, qualifiedSuperAccess);
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -42,7 +42,9 @@
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Flags.ANNOTATION;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+import static com.sun.tools.javac.code.TypeTag.ERROR;
+import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
@@ -370,7 +372,7 @@
         ListBuffer<Type> thrownbuf = new ListBuffer<Type>();
         for (List<JCExpression> l = thrown; l.nonEmpty(); l = l.tail) {
             Type exc = attr.attribType(l.head, env);
-            if (exc.tag != TYPEVAR)
+            if (!exc.hasTag(TYPEVAR))
                 exc = chk.checkClassType(l.head.pos(), exc);
             thrownbuf.append(exc);
         }
@@ -558,6 +560,12 @@
         MethodSymbol m = new MethodSymbol(0, tree.name, null, enclScope.owner);
         m.flags_field = chk.checkFlags(tree.pos(), tree.mods.flags, m, tree);
         tree.sym = m;
+
+        //if this is a default method, add the DEFAULT flag to the enclosing interface
+        if ((tree.mods.flags & DEFAULT) != 0) {
+            m.enclClass().flags_field |= DEFAULT;
+        }
+
         Env<AttrContext> localEnv = methodEnv(tree, env);
 
         DeferredLintHandler prevLintHandler =
@@ -675,7 +683,7 @@
             localEnv.info.scope.owner = tree.sym;
         }
         if ((tree.mods.flags & STATIC) != 0 ||
-            (env.enclClass.sym.flags() & INTERFACE) != 0)
+                ((env.enclClass.sym.flags() & INTERFACE) != 0 && env.enclMethod == null))
             localEnv.info.staticLevel++;
         return localEnv;
     }
@@ -921,7 +929,7 @@
             }
             for (JCExpression iface : interfaceTrees) {
                 Type i = attr.attribBase(iface, baseEnv, false, true, true);
-                if (i.tag == CLASS) {
+                if (i.hasTag(CLASS)) {
                     interfaces.append(i);
                     if (all_interfaces != null) all_interfaces.append(i);
                     chk.checkNotRepeated(iface.pos(), types.erasure(i), interfaceSet);
@@ -999,20 +1007,19 @@
                 }
             }
 
-            // If this is a class, enter symbols for this and super into
-            // current scope.
-            if ((c.flags_field & INTERFACE) == 0) {
-                VarSymbol thisSym =
-                    new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
-                thisSym.pos = Position.FIRSTPOS;
-                env.info.scope.enter(thisSym);
-                if (ct.supertype_field.tag == CLASS) {
-                    VarSymbol superSym =
-                        new VarSymbol(FINAL | HASINIT, names._super,
-                                      ct.supertype_field, c);
-                    superSym.pos = Position.FIRSTPOS;
-                    env.info.scope.enter(superSym);
-                }
+            // enter symbols for 'this' into current scope.
+            VarSymbol thisSym =
+                new VarSymbol(FINAL | HASINIT, names._this, c.type, c);
+            thisSym.pos = Position.FIRSTPOS;
+            env.info.scope.enter(thisSym);
+            // if this is a class, enter symbol for 'super' into current scope.
+            if ((c.flags_field & INTERFACE) == 0 &&
+                    ct.supertype_field.hasTag(CLASS)) {
+                VarSymbol superSym =
+                    new VarSymbol(FINAL | HASINIT, names._super,
+                                  ct.supertype_field, c);
+                superSym.pos = Position.FIRSTPOS;
+                env.info.scope.enter(superSym);
             }
 
             // check that no package exists with same fully qualified name,
@@ -1020,11 +1027,13 @@
             // name as a top-level package.
             if (checkClash &&
                 c.owner.kind == PCK && c.owner != syms.unnamedPackage &&
-                reader.packageExists(c.fullname))
-                {
-                    log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
-                }
-
+                reader.packageExists(c.fullname)) {
+                log.error(tree.pos, "clash.with.pkg.of.same.name", Kinds.kindName(sym), c);
+            }
+            if (c.owner.kind == PCK && (c.flags_field & PUBLIC) == 0 &&
+                !env.toplevel.sourcefile.isNameCompatible(c.name.toString(),JavaFileObject.Kind.SOURCE)) {
+                c.flags_field |= AUXILIARY;
+            }
         } catch (CompletionFailure ex) {
             chk.completionError(tree.pos(), ex);
         } finally {
@@ -1094,7 +1103,7 @@
     }
 
     Type modelMissingTypes(Type t, final JCExpression tree, final boolean interfaceExpected) {
-        if (t.tag != ERROR)
+        if (!t.hasTag(ERROR))
             return t;
 
         return new ErrorType(((ErrorType) t).getOriginalType(), t.tsym) {
@@ -1139,7 +1148,7 @@
 
         @Override
         public void visitIdent(JCIdent tree) {
-            if (tree.type.tag != ERROR) {
+            if (!tree.type.hasTag(ERROR)) {
                 result = tree.type;
             } else {
                 result = synthesizeClass(tree.name, syms.unnamedPackage).type;
@@ -1148,7 +1157,7 @@
 
         @Override
         public void visitSelect(JCFieldAccess tree) {
-            if (tree.type.tag != ERROR) {
+            if (!tree.type.hasTag(ERROR)) {
                 result = tree.type;
             } else {
                 Type selectedType;
@@ -1166,7 +1175,7 @@
 
         @Override
         public void visitTypeApply(JCTypeApply tree) {
-            if (tree.type.tag != ERROR) {
+            if (!tree.type.hasTag(ERROR)) {
                 result = tree.type;
             } else {
                 ClassType clazzType = (ClassType) visit(tree.clazz);
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java	Wed Nov 14 16:41:12 2012 -0800
@@ -51,7 +51,10 @@
 import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.Map;
+import java.util.Set;
 
 import javax.lang.model.element.ElementVisitor;
 
@@ -59,7 +62,7 @@
 import static com.sun.tools.javac.code.Flags.BLOCK;
 import static com.sun.tools.javac.code.Kinds.*;
 import static com.sun.tools.javac.code.Kinds.ERRONEOUS;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.comp.Resolve.MethodResolutionPhase.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
@@ -88,6 +91,7 @@
     public final boolean boxingEnabled; // = source.allowBoxing();
     public final boolean varargsEnabled; // = source.allowVarargs();
     public final boolean allowMethodHandles;
+    public final boolean allowDefaultMethods;
     private final boolean debugResolve;
     final EnumSet<VerboseResolutionMode> verboseResolutionMode;
 
@@ -122,6 +126,7 @@
         verboseResolutionMode = VerboseResolutionMode.getVerboseResolutionMode(options);
         Target target = Target.instance(context);
         allowMethodHandles = target.hasMethodHandles();
+        allowDefaultMethods = source.allowDefaultMethods();
         polymorphicSignatureScope = new Scope(syms.noSymbol);
 
         inapplicableMethodException = new InapplicableMethodException(diags);
@@ -228,7 +233,7 @@
 
     JCDiagnostic getVerboseApplicableCandidateDiag(int pos, Symbol sym, Type inst) {
         JCDiagnostic subDiag = null;
-        if (sym.type.tag == FORALL) {
+        if (sym.type.hasTag(FORALL)) {
             subDiag = diags.fragment("partial.inst.sig", inst);
         }
 
@@ -331,7 +336,7 @@
     }
 
     boolean isAccessible(Env<AttrContext> env, Type t, boolean checkInner) {
-        return (t.tag == ARRAY)
+        return (t.hasTag(ARRAY))
             ? isAccessible(env, types.elemtype(t))
             : isAccessible(env, t.tsym, checkInner);
     }
@@ -447,30 +452,17 @@
                         List<Type> typeargtypes,
                         boolean allowBoxing,
                         boolean useVarargs,
-                        Warner warn)
-        throws Infer.InferenceException {
-        if (useVarargs && (m.flags() & VARARGS) == 0) {
-            //better error recovery - if we stumbled upon a non-varargs method
-            //during varargs applicability phase, the method should be treated as
-            //not applicable; the reason for inapplicability can be found in the
-            //candidate for 'm' that was created during the BOX phase.
-            Candidate prevCandidate = currentResolutionContext.getCandidate(m, BOX);
-            JCDiagnostic details = null;
-            if (prevCandidate != null && !prevCandidate.isApplicable()) {
-                details = prevCandidate.details;
-            }
-            throw inapplicableMethodException.setMessage(details);
-        }
+                        Warner warn) throws Infer.InferenceException {
+
         Type mt = types.memberType(site, m);
-
         // tvars is the list of formal type variables for which type arguments
         // need to inferred.
         List<Type> tvars = List.nil();
         if (typeargtypes == null) typeargtypes = List.nil();
-        if (mt.tag != FORALL && typeargtypes.nonEmpty()) {
+        if (!mt.hasTag(FORALL) && typeargtypes.nonEmpty()) {
             // This is not a polymorphic method, but typeargs are supplied
             // which is fine, see JLS 15.12.2.1
-        } else if (mt.tag == FORALL && typeargtypes.nonEmpty()) {
+        } else if (mt.hasTag(FORALL) && typeargtypes.nonEmpty()) {
             ForAll pmt = (ForAll) mt;
             if (typeargtypes.length() != pmt.tvars.length())
                 throw inapplicableMethodException.setMessage("arg.length.mismatch"); // not enough args
@@ -487,7 +479,7 @@
                 actuals = actuals.tail;
             }
             mt = types.subst(pmt.qtype, pmt.tvars, typeargtypes);
-        } else if (mt.tag == FORALL) {
+        } else if (mt.hasTag(FORALL)) {
             ForAll pmt = (ForAll) mt;
             List<Type> tvars1 = types.newInstances(pmt.tvars);
             tvars = tvars.appendList(tvars1);
@@ -499,7 +491,7 @@
         for (List<Type> l = argtypes;
              l.tail != null/*inlined: l.nonEmpty()*/ && !instNeeded;
              l = l.tail) {
-            if (l.head.tag == FORALL) instNeeded = true;
+            if (l.head.hasTag(FORALL)) instNeeded = true;
         }
 
         if (instNeeded)
@@ -807,7 +799,7 @@
 
         @Override
         protected Type check(DiagnosticPosition pos, Type found) {
-            if (found.tag == DEFERRED) {
+            if (found.hasTag(DEFERRED)) {
                 DeferredType dt = (DeferredType)found;
                 return dt.check(this);
             } else {
@@ -875,7 +867,7 @@
                      Type site,
                      Name name,
                      TypeSymbol c) {
-        while (c.type.tag == TYPEVAR)
+        while (c.type.hasTag(TYPEVAR))
             c = c.type.getUpperBound().tsym;
         Symbol bestSoFar = varNotFound;
         Symbol sym;
@@ -888,7 +880,7 @@
             e = e.next();
         }
         Type st = types.supertype(c.type);
-        if (st != null && (st.tag == CLASS || st.tag == TYPEVAR)) {
+        if (st != null && (st.hasTag(CLASS) || st.hasTag(TYPEVAR))) {
             sym = findField(env, site, name, st.tsym);
             if (sym.kind < bestSoFar.kind) bestSoFar = sym;
         }
@@ -1020,8 +1012,11 @@
                       boolean allowBoxing,
                       boolean useVarargs,
                       boolean operator) {
-        if (sym.kind == ERR) return bestSoFar;
-        if (!sym.isInheritedIn(site.tsym, types)) return bestSoFar;
+        if (sym.kind == ERR ||
+                !sym.isInheritedIn(site.tsym, types) ||
+                (useVarargs && (sym.flags() & VARARGS) == 0)) {
+            return bestSoFar;
+        }
         Assert.check(sym.kind < AMBIGUOUS);
         try {
             Type mt = rawInstantiate(env, site, sym, null, argtypes, typeargtypes,
@@ -1032,13 +1027,13 @@
             if (!operator)
                 currentResolutionContext.addInapplicableCandidate(sym, ex.getDiagnostic());
             switch (bestSoFar.kind) {
-            case ABSENT_MTH:
-                return new InapplicableSymbolError(currentResolutionContext);
-            case WRONG_MTH:
-                if (operator) return bestSoFar;
-                bestSoFar = new InapplicableSymbolsError(currentResolutionContext);
-            default:
-                return bestSoFar;
+                case ABSENT_MTH:
+                    return new InapplicableSymbolError(currentResolutionContext);
+                case WRONG_MTH:
+                    if (operator) return bestSoFar;
+                    bestSoFar = new InapplicableSymbolsError(currentResolutionContext);
+                default:
+                    return bestSoFar;
             }
         }
         if (!isAccessible(env, site, sym)) {
@@ -1184,7 +1179,7 @@
                     lastFormal2 : formals2.head;
 
             //is this a structural actual argument?
-            boolean isStructuralPoly = actual.tag == DEFERRED &&
+            boolean isStructuralPoly = actual.hasTag(DEFERRED) &&
                     (((DeferredType)actual).tree.hasTag(LAMBDA) ||
                     ((DeferredType)actual).tree.hasTag(REFERENCE));
 
@@ -1301,7 +1296,7 @@
         Type rt1 = mt1.getReturnType();
         Type rt2 = mt2.getReturnType();
 
-        if (mt1.tag == FORALL && mt2.tag == FORALL) {
+        if (mt1.hasTag(FORALL) && mt2.hasTag(FORALL)) {
             //if both are generic methods, adjust return type ahead of subtyping check
             rt1 = types.subst(rt1, mt1.getTypeArguments(), mt2.getTypeArguments());
         }
@@ -1327,6 +1322,42 @@
         }
     }
 
+    Symbol findMethodInScope(Env<AttrContext> env,
+            Type site,
+            Name name,
+            List<Type> argtypes,
+            List<Type> typeargtypes,
+            Scope sc,
+            Symbol bestSoFar,
+            boolean allowBoxing,
+            boolean useVarargs,
+            boolean operator,
+            boolean abstractok) {
+        for (Symbol s : sc.getElementsByName(name, new LookupFilter(abstractok))) {
+            bestSoFar = selectBest(env, site, argtypes, typeargtypes, s,
+                    bestSoFar, allowBoxing, useVarargs, operator);
+        }
+        return bestSoFar;
+    }
+    //where
+        class LookupFilter implements Filter<Symbol> {
+
+            boolean abstractOk;
+
+            LookupFilter(boolean abstractOk) {
+                this.abstractOk = abstractOk;
+            }
+
+            public boolean accepts(Symbol s) {
+                long flags = s.flags();
+                return s.kind == MTH &&
+                        (flags & SYNTHETIC) == 0 &&
+                        (abstractOk ||
+                        (flags & DEFAULT) != 0 ||
+                        (flags & ABSTRACT) == 0);
+            }
+        };
+
     /** Find best qualified method matching given name, type and value
      *  arguments.
      *  @param env       The current environment.
@@ -1371,49 +1402,76 @@
                               boolean allowBoxing,
                               boolean useVarargs,
                               boolean operator) {
-        boolean abstractOk = true;
-        List<Type> itypes = List.nil();
+        @SuppressWarnings({"unchecked","rawtypes"})
+        List<Type>[] itypes = (List<Type>[])new List[] { List.<Type>nil(), List.<Type>nil() };
+        InterfaceLookupPhase iphase = InterfaceLookupPhase.ABSTRACT_OK;
         for (TypeSymbol s : superclasses(intype)) {
-            bestSoFar = lookupMethod(env, site, name, argtypes, typeargtypes,
+            bestSoFar = findMethodInScope(env, site, name, argtypes, typeargtypes,
                     s.members(), bestSoFar, allowBoxing, useVarargs, operator, true);
-            //We should not look for abstract methods if receiver is a concrete class
-            //(as concrete classes are expected to implement all abstracts coming
-            //from superinterfaces)
-            abstractOk &= (s.flags() & (ABSTRACT | INTERFACE | ENUM)) != 0;
-            if (abstractOk) {
+            if (name == names.init) return bestSoFar;
+            iphase = (iphase == null) ? null : iphase.update(s, this);
+            if (iphase != null) {
                 for (Type itype : types.interfaces(s.type)) {
-                    itypes = types.union(types.closure(itype), itypes);
+                    itypes[iphase.ordinal()] = types.union(types.closure(itype), itypes[iphase.ordinal()]);
                 }
             }
-            if (name == names.init) break;
         }
 
         Symbol concrete = bestSoFar.kind < ERR &&
                 (bestSoFar.flags() & ABSTRACT) == 0 ?
                 bestSoFar : methodNotFound;
 
-        if (name != names.init) {
+        for (InterfaceLookupPhase iphase2 : InterfaceLookupPhase.values()) {
+            if (iphase2 == InterfaceLookupPhase.DEFAULT_OK && !allowDefaultMethods) break;
             //keep searching for abstract methods
-            for (Type itype : itypes) {
+            for (Type itype : itypes[iphase2.ordinal()]) {
                 if (!itype.isInterface()) continue; //skip j.l.Object (included by Types.closure())
-                bestSoFar = lookupMethod(env, site, name, argtypes, typeargtypes,
-                    itype.tsym.members(), bestSoFar, allowBoxing, useVarargs, operator, true);
-                    if (concrete != bestSoFar &&
-                            concrete.kind < ERR  && bestSoFar.kind < ERR &&
-                            types.isSubSignature(concrete.type, bestSoFar.type)) {
-                        //this is an hack - as javac does not do full membership checks
-                        //most specific ends up comparing abstract methods that might have
-                        //been implemented by some concrete method in a subclass and,
-                        //because of raw override, it is possible for an abstract method
-                        //to be more specific than the concrete method - so we need
-                        //to explicitly call that out (see CR 6178365)
-                        bestSoFar = concrete;
-                    }
+                if (iphase2 == InterfaceLookupPhase.DEFAULT_OK &&
+                        (itype.tsym.flags() & DEFAULT) == 0) continue;
+                bestSoFar = findMethodInScope(env, site, name, argtypes, typeargtypes,
+                        itype.tsym.members(), bestSoFar, allowBoxing, useVarargs, operator, true);
+                if (concrete != bestSoFar &&
+                        concrete.kind < ERR  && bestSoFar.kind < ERR &&
+                        types.isSubSignature(concrete.type, bestSoFar.type)) {
+                    //this is an hack - as javac does not do full membership checks
+                    //most specific ends up comparing abstract methods that might have
+                    //been implemented by some concrete method in a subclass and,
+                    //because of raw override, it is possible for an abstract method
+                    //to be more specific than the concrete method - so we need
+                    //to explicitly call that out (see CR 6178365)
+                    bestSoFar = concrete;
+                }
             }
         }
         return bestSoFar;
     }
 
+    enum InterfaceLookupPhase {
+        ABSTRACT_OK() {
+            @Override
+            InterfaceLookupPhase update(Symbol s, Resolve rs) {
+                //We should not look for abstract methods if receiver is a concrete class
+                //(as concrete classes are expected to implement all abstracts coming
+                //from superinterfaces)
+                if ((s.flags() & (ABSTRACT | INTERFACE | ENUM)) != 0) {
+                    return this;
+                } else if (rs.allowDefaultMethods) {
+                    return DEFAULT_OK;
+                } else {
+                    return null;
+                }
+            }
+        },
+        DEFAULT_OK() {
+            @Override
+            InterfaceLookupPhase update(Symbol s, Resolve rs) {
+                return this;
+            }
+        };
+
+        abstract InterfaceLookupPhase update(Symbol s, Resolve rs);
+    }
+
     /**
      * Return an Iterable object to scan the superclasses of a given type.
      * It's crucial that the scan is done lazily, as we don't want to accidentally
@@ -1448,11 +1506,11 @@
                     }
 
                     TypeSymbol symbolFor(Type t) {
-                        if (t.tag != CLASS &&
-                                t.tag != TYPEVAR) {
+                        if (!t.hasTag(CLASS) &&
+                                !t.hasTag(TYPEVAR)) {
                             return null;
                         }
-                        while (t.tag == TYPEVAR)
+                        while (t.hasTag(TYPEVAR))
                             t = t.getUpperBound();
                         if (seen.contains(t.tsym)) {
                             //degenerate case in which we have a circular
@@ -1467,34 +1525,6 @@
         };
     }
 
-    /**
-     * Lookup a method with given name and argument types in a given scope
-     */
-    Symbol lookupMethod(Env<AttrContext> env,
-            Type site,
-            Name name,
-            List<Type> argtypes,
-            List<Type> typeargtypes,
-            Scope sc,
-            Symbol bestSoFar,
-            boolean allowBoxing,
-            boolean useVarargs,
-            boolean operator,
-            boolean abstractok) {
-        for (Symbol s : sc.getElementsByName(name, lookupFilter)) {
-            bestSoFar = selectBest(env, site, argtypes, typeargtypes, s,
-                    bestSoFar, allowBoxing, useVarargs, operator);
-        }
-        return bestSoFar;
-    }
-    //where
-        Filter<Symbol> lookupFilter = new Filter<Symbol>() {
-            public boolean accepts(Symbol s) {
-                return s.kind == MTH &&
-                        (s.flags() & SYNTHETIC) == 0;
-            }
-        };
-
     /** Find unqualified method matching given name, type and value arguments.
      *  @param env       The current environment.
      *  @param name      The method's name.
@@ -1610,7 +1640,7 @@
             e = e.next();
         }
         Type st = types.supertype(c.type);
-        if (st != null && st.tag == CLASS) {
+        if (st != null && st.hasTag(CLASS)) {
             sym = findMemberType(env, site, name, st.tsym);
             if (sym.kind < bestSoFar.kind) bestSoFar = sym;
         }
@@ -1660,7 +1690,7 @@
                  e = e.next()) {
                 if (e.sym.kind == TYP) {
                     if (staticOnly &&
-                        e.sym.type.tag == TYPEVAR &&
+                        e.sym.type.hasTag(TYPEVAR) &&
                         e.sym.owner.kind == TYP) return new StaticError(e.sym);
                     return e.sym;
                 }
@@ -1669,8 +1699,8 @@
             sym = findMemberType(env1, env1.enclClass.sym.type, name,
                                  env1.enclClass.sym);
             if (staticOnly && sym.kind == TYP &&
-                sym.type.tag == CLASS &&
-                sym.type.getEnclosingType().tag == CLASS &&
+                sym.type.hasTag(CLASS) &&
+                sym.type.getEnclosingType().hasTag(CLASS) &&
                 env1.enclClass.sym.type.isParameterized() &&
                 sym.type.getEnclosingType().isParameterized())
                 return new StaticError(sym);
@@ -1898,7 +1928,7 @@
                         ((InapplicableSymbolError)errSym).errCandidate().sym : accessedSym;
 
                 List<Type> argtypes2 = Type.map(argtypes,
-                        deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, msym, currentResolutionContext.firstErroneousResolutionPhase()));
+                        deferredAttr.new RecoveryDeferredTypeMap(AttrMode.SPECULATIVE, msym, currentResolutionContext.step));
 
                 if (msym != accessedSym) {
                     //fixup deferred type caches - this 'hack' is required because the symbol
@@ -1906,7 +1936,7 @@
                     //method symbol that can be used for lookups in the speculative cache,
                     //causing problems in Attr.checkId()
                     for (Type t : argtypes) {
-                        if (t.tag == DEFERRED) {
+                        if (t.hasTag(DEFERRED)) {
                             DeferredType dt = (DeferredType)t;
                             dt.speculativeCache.dupAllTo(msym, accessedSym);
                         }
@@ -1920,7 +1950,7 @@
     /** Check that sym is not an abstract method.
      */
     void checkNonAbstract(DiagnosticPosition pos, Symbol sym) {
-        if ((sym.flags() & ABSTRACT) != 0)
+        if ((sym.flags() & ABSTRACT) != 0 && (sym.flags() & DEFAULT) == 0)
             log.error(pos, "abstract.cant.be.accessed.directly",
                       kindName(sym), sym, sym.location());
     }
@@ -1955,7 +1985,7 @@
     }
 
     public void printscopes(Type t) {
-        while (t.tag == CLASS) {
+        while (t.hasTag(CLASS)) {
             printscopes(t.tsym.members());
             t = types.supertype(t);
         }
@@ -1992,33 +2022,14 @@
                          Name name,
                          List<Type> argtypes,
                          List<Type> typeargtypes) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = new MethodResolutionContext();
-            Symbol sym = methodNotFound;
-            List<MethodResolutionPhase> steps = methodResolutionSteps;
-            while (steps.nonEmpty() &&
-                   steps.head.isApplicable(boxingEnabled, varargsEnabled) &&
-                   sym.kind >= ERRONEOUS) {
-                currentResolutionContext.step = env.info.pendingResolutionPhase = steps.head;
-                sym = findFun(env, name, argtypes, typeargtypes,
-                        steps.head.isBoxingRequired,
-                        steps.head.isVarargsRequired);
-                currentResolutionContext.resolutionCache.put(steps.head, sym);
-                steps = steps.tail;
+        return lookupMethod(env, pos, env.enclClass.sym, new BasicLookupHelper(name, env.enclClass.sym.type, argtypes, typeargtypes) {
+            @Override
+            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                return findFun(env, name, argtypes, typeargtypes,
+                        phase.isBoxingRequired(),
+                        phase.isVarargsRequired());
             }
-            if (sym.kind >= AMBIGUOUS) {//if nothing is found return the 'first' error
-                MethodResolutionPhase errPhase =
-                        currentResolutionContext.firstErroneousResolutionPhase();
-                sym = accessMethod(currentResolutionContext.resolutionCache.get(errPhase),
-                        pos, env.enclClass.sym.type, name, false, argtypes, typeargtypes);
-                env.info.pendingResolutionPhase = errPhase;
-            }
-            return sym;
-        }
-        finally {
-            currentResolutionContext = prevResolutionContext;
-        }
+        });
     }
 
     /** Resolve a qualified method identifier
@@ -2044,40 +2055,27 @@
                                   DiagnosticPosition pos, Env<AttrContext> env,
                                   Symbol location, Type site, Name name, List<Type> argtypes,
                                   List<Type> typeargtypes) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = resolveContext;
-            Symbol sym = methodNotFound;
-            List<MethodResolutionPhase> steps = methodResolutionSteps;
-            while (steps.nonEmpty() &&
-                   steps.head.isApplicable(boxingEnabled, varargsEnabled) &&
-                   sym.kind >= ERRONEOUS) {
-                currentResolutionContext.step = env.info.pendingResolutionPhase = steps.head;
-                sym = findMethod(env, site, name, argtypes, typeargtypes,
-                        steps.head.isBoxingRequired(),
-                        steps.head.isVarargsRequired(), false);
-                currentResolutionContext.resolutionCache.put(steps.head, sym);
-                steps = steps.tail;
+        return lookupMethod(env, pos, location, resolveContext, new BasicLookupHelper(name, site, argtypes, typeargtypes) {
+            @Override
+            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                return findMethod(env, site, name, argtypes, typeargtypes,
+                        phase.isBoxingRequired(),
+                        phase.isVarargsRequired(), false);
             }
-            if (sym.kind >= AMBIGUOUS) {
-                //if nothing is found return the 'first' error
-                MethodResolutionPhase errPhase =
-                        currentResolutionContext.firstErroneousResolutionPhase();
-                sym = accessMethod(currentResolutionContext.resolutionCache.get(errPhase),
-                        pos, location, site, name, true, argtypes, typeargtypes);
-                env.info.pendingResolutionPhase = errPhase;
-            } else if (allowMethodHandles) {
-                MethodSymbol msym = (MethodSymbol)sym;
-                if (msym.isSignaturePolymorphic(types)) {
-                    env.info.pendingResolutionPhase = BASIC;
-                    return findPolymorphicSignatureInstance(env, sym, argtypes);
+            @Override
+            Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+                if (sym.kind >= AMBIGUOUS) {
+                    sym = super.access(env, pos, location, sym);
+                } else if (allowMethodHandles) {
+                    MethodSymbol msym = (MethodSymbol)sym;
+                    if (msym.isSignaturePolymorphic(types)) {
+                        env.info.pendingResolutionPhase = BASIC;
+                        return findPolymorphicSignatureInstance(env, sym, argtypes);
+                    }
                 }
+                return sym;
             }
-            return sym;
-        }
-        finally {
-            currentResolutionContext = prevResolutionContext;
-        }
+        });
     }
 
     /** Find or create an implicit method of exactly the given type (after erasure).
@@ -2145,38 +2143,53 @@
                               List<Type> typeargtypes) {
         return resolveConstructor(new MethodResolutionContext(), pos, env, site, argtypes, typeargtypes);
     }
+
     private Symbol resolveConstructor(MethodResolutionContext resolveContext,
-                              DiagnosticPosition pos,
+                              final DiagnosticPosition pos,
                               Env<AttrContext> env,
                               Type site,
                               List<Type> argtypes,
                               List<Type> typeargtypes) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = resolveContext;
-            Symbol sym = methodNotFound;
-            List<MethodResolutionPhase> steps = methodResolutionSteps;
-            while (steps.nonEmpty() &&
-                   steps.head.isApplicable(boxingEnabled, varargsEnabled) &&
-                   sym.kind >= ERRONEOUS) {
-                currentResolutionContext.step = env.info.pendingResolutionPhase = steps.head;
-                sym = findConstructor(pos, env, site, argtypes, typeargtypes,
-                        steps.head.isBoxingRequired(),
-                        steps.head.isVarargsRequired());
-                currentResolutionContext.resolutionCache.put(steps.head, sym);
-                steps = steps.tail;
+        return lookupMethod(env, pos, site.tsym, resolveContext, new BasicLookupHelper(names.init, site, argtypes, typeargtypes) {
+            @Override
+            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                return findConstructor(pos, env, site, argtypes, typeargtypes,
+                        phase.isBoxingRequired(),
+                        phase.isVarargsRequired());
             }
-            if (sym.kind >= AMBIGUOUS) {//if nothing is found return the 'first' error
-                MethodResolutionPhase errPhase = currentResolutionContext.firstErroneousResolutionPhase();
-                sym = accessMethod(currentResolutionContext.resolutionCache.get(errPhase),
-                        pos, site, names.init, true, argtypes, typeargtypes);
-                env.info.pendingResolutionPhase = errPhase;
-            }
-            return sym;
-        }
-        finally {
-            currentResolutionContext = prevResolutionContext;
-        }
+        });
+    }
+
+    /** Resolve a constructor, throw a fatal error if not found.
+     *  @param pos       The position to use for error reporting.
+     *  @param env       The environment current at the method invocation.
+     *  @param site      The type to be constructed.
+     *  @param argtypes  The types of the invocation's value arguments.
+     *  @param typeargtypes  The types of the invocation's type arguments.
+     */
+    public MethodSymbol resolveInternalConstructor(DiagnosticPosition pos, Env<AttrContext> env,
+                                        Type site,
+                                        List<Type> argtypes,
+                                        List<Type> typeargtypes) {
+        MethodResolutionContext resolveContext = new MethodResolutionContext();
+        resolveContext.internalResolution = true;
+        Symbol sym = resolveConstructor(resolveContext, pos, env, site, argtypes, typeargtypes);
+        if (sym.kind == MTH) return (MethodSymbol)sym;
+        else throw new FatalError(
+                 diags.fragment("fatal.err.cant.locate.ctor", site));
+    }
+
+    Symbol findConstructor(DiagnosticPosition pos, Env<AttrContext> env,
+                              Type site, List<Type> argtypes,
+                              List<Type> typeargtypes,
+                              boolean allowBoxing,
+                              boolean useVarargs) {
+        Symbol sym = findMethod(env, site,
+                                    names.init, argtypes,
+                                    typeargtypes, allowBoxing,
+                                    useVarargs, false);
+        chk.checkDeprecated(pos, env.info.scope.owner, sym);
+        return sym;
     }
 
     /** Resolve constructor using diamond inference.
@@ -2194,47 +2207,36 @@
                               Type site,
                               List<Type> argtypes,
                               List<Type> typeargtypes) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = new MethodResolutionContext();
-            Symbol sym = methodNotFound;
-            List<MethodResolutionPhase> steps = methodResolutionSteps;
-            while (steps.nonEmpty() &&
-                   steps.head.isApplicable(boxingEnabled, varargsEnabled) &&
-                   sym.kind >= ERRONEOUS) {
-                currentResolutionContext.step = env.info.pendingResolutionPhase = steps.head;
-                sym = findDiamond(env, site, argtypes, typeargtypes,
-                        steps.head.isBoxingRequired(),
-                        steps.head.isVarargsRequired());
-                currentResolutionContext.resolutionCache.put(steps.head, sym);
-                steps = steps.tail;
+        return lookupMethod(env, pos, site.tsym, new BasicLookupHelper(names.init, site, argtypes, typeargtypes) {
+            @Override
+            Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                return findDiamond(env, site, argtypes, typeargtypes,
+                        phase.isBoxingRequired(),
+                        phase.isVarargsRequired());
             }
-            if (sym.kind >= AMBIGUOUS) {
-                Symbol errSym =
-                        currentResolutionContext.resolutionCache.get(currentResolutionContext.firstErroneousResolutionPhase());
-                final JCDiagnostic details = errSym.kind == WRONG_MTH ?
-                                ((InapplicableSymbolError)errSym).errCandidate().details :
-                                null;
-                errSym = new InapplicableSymbolError(errSym.kind, "diamondError", currentResolutionContext) {
-                    @Override
-                    JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
-                            Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
-                        String key = details == null ?
-                            "cant.apply.diamond" :
-                            "cant.apply.diamond.1";
-                        return diags.create(dkind, log.currentSource(), pos, key,
-                                diags.fragment("diamond", site.tsym), details);
-                    }
-                };
-                MethodResolutionPhase errPhase = currentResolutionContext.firstErroneousResolutionPhase();
-                sym = accessMethod(errSym, pos, site, names.init, true, argtypes, typeargtypes);
-                env.info.pendingResolutionPhase = errPhase;
+            @Override
+            Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+                if (sym.kind >= AMBIGUOUS) {
+                    final JCDiagnostic details = sym.kind == WRONG_MTH ?
+                                    ((InapplicableSymbolError)sym).errCandidate().details :
+                                    null;
+                    sym = new InapplicableSymbolError(sym.kind, "diamondError", currentResolutionContext) {
+                        @Override
+                        JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos,
+                                Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
+                            String key = details == null ?
+                                "cant.apply.diamond" :
+                                "cant.apply.diamond.1";
+                            return diags.create(dkind, log.currentSource(), pos, key,
+                                    diags.fragment("diamond", site.tsym), details);
+                        }
+                    };
+                    sym = accessMethod(sym, pos, site, names.init, true, argtypes, typeargtypes);
+                    env.info.pendingResolutionPhase = currentResolutionContext.step;
+                }
+                return sym;
             }
-            return sym;
-        }
-        finally {
-            currentResolutionContext = prevResolutionContext;
-        }
+        });
     }
 
     /** This method scans all the constructor symbol in a given class scope -
@@ -2259,7 +2261,7 @@
             //- System.out.println(" e " + e.sym);
             if (sym.kind == MTH &&
                 (sym.flags_field & SYNTHETIC) == 0) {
-                    List<Type> oldParams = e.sym.type.tag == FORALL ?
+                    List<Type> oldParams = e.sym.type.hasTag(FORALL) ?
                             ((ForAll)sym.type).tvars :
                             List.<Type>nil();
                     Type constrType = new ForAll(site.tsym.type.getTypeArguments().appendList(oldParams),
@@ -2281,392 +2283,7 @@
         return bestSoFar;
     }
 
-    /**
-     * Resolution of member references is typically done as a single
-     * overload resolution step, where the argument types A are inferred from
-     * the target functional descriptor.
-     *
-     * If the member reference is a method reference with a type qualifier,
-     * a two-step lookup process is performed. The first step uses the
-     * expected argument list A, while the second step discards the first
-     * type from A (which is treated as a receiver type).
-     *
-     * There are two cases in which inference is performed: (i) if the member
-     * reference is a constructor reference and the qualifier type is raw - in
-     * which case diamond inference is used to infer a parameterization for the
-     * type qualifier; (ii) if the member reference is an unbound reference
-     * where the type qualifier is raw - in that case, during the unbound lookup
-     * the receiver argument type is used to infer an instantiation for the raw
-     * qualifier type.
-     *
-     * When a multi-step resolution process is exploited, it is an error
-     * if two candidates are found (ambiguity).
-     *
-     * This routine returns a pair (T,S), where S is the member reference symbol,
-     * and T is the type of the class in which S is defined. This is necessary as
-     * the type T might be dynamically inferred (i.e. if constructor reference
-     * has a raw qualifier).
-     */
-    Pair<Symbol, ReferenceLookupHelper> resolveMemberReference(DiagnosticPosition pos,
-                                  Env<AttrContext> env,
-                                  JCMemberReference referenceTree,
-                                  Type site,
-                                  Name name, List<Type> argtypes,
-                                  List<Type> typeargtypes,
-                                  boolean boxingAllowed) {
-        //step 1 - bound lookup
-        ReferenceLookupHelper boundLookupHelper = name.equals(names.init) ?
-                new ConstructorReferenceLookupHelper(referenceTree, site, argtypes, typeargtypes, boxingAllowed) :
-                new MethodReferenceLookupHelper(referenceTree, name, site, argtypes, typeargtypes, boxingAllowed);
-        Env<AttrContext> boundEnv = env.dup(env.tree, env.info.dup());
-        Symbol boundSym = findMemberReference(boundEnv, boundLookupHelper);
-
-        //step 2 - unbound lookup
-        ReferenceLookupHelper unboundLookupHelper = boundLookupHelper.unboundLookup();
-        Env<AttrContext> unboundEnv = env.dup(env.tree, env.info.dup());
-        Symbol unboundSym = findMemberReference(unboundEnv, unboundLookupHelper);
-
-        //merge results
-        Pair<Symbol, ReferenceLookupHelper> res;
-        if (unboundSym.kind != MTH) {
-            res = new Pair<Symbol, ReferenceLookupHelper>(boundSym, boundLookupHelper);
-            env.info.pendingResolutionPhase = boundEnv.info.pendingResolutionPhase;
-        } else if (boundSym.kind == MTH) {
-            res = new Pair<Symbol, ReferenceLookupHelper>(ambiguityError(boundSym, unboundSym), boundLookupHelper);
-            env.info.pendingResolutionPhase = boundEnv.info.pendingResolutionPhase;
-        } else {
-            res = new Pair<Symbol, ReferenceLookupHelper>(unboundSym, unboundLookupHelper);
-            env.info.pendingResolutionPhase = unboundEnv.info.pendingResolutionPhase;
-        }
-
-        return res;
-    }
-
-    /**
-     * Helper for defining custom method-like lookup logic; a lookup helper
-     * provides hooks for (i) the actual lookup logic and (ii) accessing the
-     * lookup result (this step might result in compiler diagnostics to be generated)
-     */
-    abstract class LookupHelper {
-
-        /** name of the symbol to lookup */
-        Name name;
-
-        /** location in which the lookup takes place */
-        Type site;
-
-        /** actual types used during the lookup */
-        List<Type> argtypes;
-
-        /** type arguments used during the lookup */
-        List<Type> typeargtypes;
-
-        LookupHelper(Name name, Type site, List<Type> argtypes, List<Type> typeargtypes) {
-            this.name = name;
-            this.site = site;
-            this.argtypes = argtypes;
-            this.typeargtypes = typeargtypes;
-        }
-
-        /**
-         * Search for a symbol under a given overload resolution phase - this method
-         * is usually called several times, once per each overload resolution phase
-         */
-        abstract Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase);
-
-        /**
-         * Validate the result of the lookup
-         */
-        abstract Symbol access(Env<AttrContext> env, Symbol symbol);
-    }
-
-    /**
-     * Helper class for member reference lookup. A reference lookup helper
-     * defines the basic logic for member reference lookup; a method gives
-     * access to an 'unbound' helper used to perform an unbound member
-     * reference lookup.
-     */
-    abstract class ReferenceLookupHelper extends LookupHelper {
-
-        /** The member reference tree */
-        JCMemberReference referenceTree;
-
-        /** Max overload resolution phase handled by this helper */
-        MethodResolutionPhase maxPhase;
-
-        ReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
-                List<Type> argtypes, List<Type> typeargtypes, boolean boxingAllowed) {
-            super(name, site, argtypes, typeargtypes);
-            this.referenceTree = referenceTree;
-            this.maxPhase = boxingAllowed ? VARARITY : BASIC;
-        }
-
-        /**
-         * Returns an unbound version of this lookup helper. By default, this
-         * method returns an dummy lookup helper.
-         */
-        ReferenceLookupHelper unboundLookup() {
-            //dummy loopkup helper that always return 'methodNotFound'
-            return new ReferenceLookupHelper(referenceTree, name, site, argtypes, typeargtypes, maxPhase.isBoxingRequired()) {
-                @Override
-                ReferenceLookupHelper unboundLookup() {
-                    return this;
-                }
-                @Override
-                Symbol lookupReference(Env<AttrContext> env, MethodResolutionPhase phase) {
-                    return methodNotFound;
-                }
-                @Override
-                ReferenceKind referenceKind(Symbol sym) {
-                    Assert.error();
-                    return null;
-                }
-            };
-        }
-
-        /**
-         * Get the kind of the member reference
-         */
-        abstract JCMemberReference.ReferenceKind referenceKind(Symbol sym);
-
-        @Override
-        Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
-            return (env.info.pendingResolutionPhase.ordinal() > maxPhase.ordinal()) ?
-                    methodNotFound : lookupReference(env, phase);
-        }
-
-        abstract Symbol lookupReference(Env<AttrContext> env, MethodResolutionPhase phase);
-
-        Symbol access(Env<AttrContext> env, Symbol sym) {
-            if (sym.kind >= AMBIGUOUS) {
-                MethodResolutionPhase errPhase = currentResolutionContext.firstErroneousResolutionPhase();
-                if (errPhase.ordinal() > maxPhase.ordinal()) {
-                    errPhase = maxPhase;
-                }
-                env.info.pendingResolutionPhase = errPhase;
-                sym = currentResolutionContext.resolutionCache.get(errPhase);
-            }
-            return sym;
-        }
-    }
-
-    /**
-     * Helper class for method reference lookup. The lookup logic is based
-     * upon Resolve.findMethod; in certain cases, this helper class has a
-     * corresponding unbound helper class (see UnboundMethodReferenceLookupHelper).
-     * In such cases, non-static lookup results are thrown away.
-     */
-    class MethodReferenceLookupHelper extends ReferenceLookupHelper {
-
-        MethodReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
-                List<Type> argtypes, List<Type> typeargtypes, boolean boxingAllowed) {
-            super(referenceTree, name, site, argtypes, typeargtypes, boxingAllowed);
-        }
-
-        protected Symbol lookupReferenceInternal(Env<AttrContext> env, MethodResolutionPhase phase) {
-            return findMethod(env, site, name, argtypes, typeargtypes,
-                    phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name));
-        }
-
-        protected Symbol adjustLookupResult(Env<AttrContext> env, Symbol sym) {
-            return !TreeInfo.isStaticSelector(referenceTree.expr, names) ||
-                        sym.kind != MTH ||
-                        sym.isStatic() ? sym : new StaticError(sym);
-        }
-
-        @Override
-        final Symbol lookupReference(Env<AttrContext> env, MethodResolutionPhase phase) {
-            return adjustLookupResult(env, lookupReferenceInternal(env, phase));
-        }
-
-        @Override
-        ReferenceLookupHelper unboundLookup() {
-            if (TreeInfo.isStaticSelector(referenceTree.expr, names) &&
-                    argtypes.nonEmpty() &&
-                    types.isSubtypeUnchecked(argtypes.head, site)) {
-                return new UnboundMethodReferenceLookupHelper(referenceTree, name,
-                        site, argtypes, typeargtypes, maxPhase.isBoxingRequired());
-            } else {
-                return super.unboundLookup();
-            }
-        }
-
-        @Override
-        ReferenceKind referenceKind(Symbol sym) {
-            if (sym.isStatic()) {
-                return TreeInfo.isStaticSelector(referenceTree.expr, names) ?
-                        ReferenceKind.STATIC : ReferenceKind.STATIC_EVAL;
-            } else {
-                Name selName = TreeInfo.name(referenceTree.getQualifierExpression());
-                return selName != null && selName == names._super ?
-                        ReferenceKind.SUPER :
-                        ReferenceKind.BOUND;
-            }
-        }
-    }
-
-    /**
-     * Helper class for unbound method reference lookup. Essentially the same
-     * as the basic method reference lookup helper; main difference is that static
-     * lookup results are thrown away. If qualifier type is raw, an attempt to
-     * infer a parameterized type is made using the first actual argument (that
-     * would otherwise be ignored during the lookup).
-     */
-    class UnboundMethodReferenceLookupHelper extends MethodReferenceLookupHelper {
-
-        UnboundMethodReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
-                List<Type> argtypes, List<Type> typeargtypes, boolean boxingAllowed) {
-            super(referenceTree, name,
-                    site.isRaw() ? types.asSuper(argtypes.head, site.tsym) : site,
-                    argtypes.tail, typeargtypes, boxingAllowed);
-        }
-
-        @Override
-        protected Symbol adjustLookupResult(Env<AttrContext> env, Symbol sym) {
-            return sym.kind != MTH || !sym.isStatic() ? sym : new StaticError(sym);
-        }
-
-        @Override
-        ReferenceLookupHelper unboundLookup() {
-            return this;
-        }
-
-        @Override
-        ReferenceKind referenceKind(Symbol sym) {
-            return ReferenceKind.UNBOUND;
-        }
-    }
-
-    /**
-     * Helper class for constructor reference lookup. The lookup logic is based
-     * upon either Resolve.findMethod or Resolve.findDiamond - depending on
-     * whether the constructor reference needs diamond inference (this is the case
-     * if the qualifier type is raw). A special erroneous symbol is returned
-     * if the lookup returns the constructor of an inner class and there's no
-     * enclosing instance in scope.
-     */
-    class ConstructorReferenceLookupHelper extends ReferenceLookupHelper {
-
-        boolean needsInference;
-
-        ConstructorReferenceLookupHelper(JCMemberReference referenceTree, Type site, List<Type> argtypes,
-                List<Type> typeargtypes, boolean boxingAllowed) {
-            super(referenceTree, names.init, site, argtypes, typeargtypes, boxingAllowed);
-            if (site.isRaw()) {
-                this.site = new ClassType(site.getEnclosingType(), site.tsym.type.getTypeArguments(), site.tsym);
-                needsInference = true;
-            }
-        }
-
-        @Override
-        protected Symbol lookupReference(Env<AttrContext> env, MethodResolutionPhase phase) {
-            Symbol sym = needsInference ?
-                findDiamond(env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) :
-                findMethod(env, site, name, argtypes, typeargtypes,
-                        phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name));
-            return sym.kind != MTH ||
-                          site.getEnclosingType().tag == NONE ||
-                          hasEnclosingInstance(env, site) ?
-                          sym : new InvalidSymbolError(Kinds.MISSING_ENCL, sym, null) {
-                    @Override
-                    JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
-                       return diags.create(dkind, log.currentSource(), pos,
-                            "cant.access.inner.cls.constr", site.tsym.name, argtypes, site.getEnclosingType());
-                    }
-                };
-        }
-
-        @Override
-        ReferenceKind referenceKind(Symbol sym) {
-            return site.getEnclosingType().tag == NONE ?
-                    ReferenceKind.TOPLEVEL : ReferenceKind.IMPLICIT_INNER;
-        }
-    }
-
-    /**
-     * Resolution step for member reference. This generalizes a standard
-     * method/constructor lookup - on each overload resolution step, a
-     * lookup helper class is used to perform the reference lookup; at the end
-     * of the lookup, the helper is used to validate the results.
-     */
-    Symbol findMemberReference(Env<AttrContext> env, LookupHelper lookupHelper) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = new MethodResolutionContext();
-            Symbol sym = methodNotFound;
-            List<MethodResolutionPhase> steps = methodResolutionSteps;
-            while (steps.nonEmpty() &&
-                   steps.head.isApplicable(boxingEnabled, varargsEnabled) &&
-                   sym.kind >= ERRONEOUS) {
-                currentResolutionContext.step = env.info.pendingResolutionPhase = steps.head;
-                sym = lookupHelper.lookup(env, steps.head);
-                currentResolutionContext.resolutionCache.put(steps.head, sym);
-                steps = steps.tail;
-            }
-            return lookupHelper.access(env, sym);
-        }
-        finally {
-            currentResolutionContext = prevResolutionContext;
-        }
-    }
-
-    /** Resolve constructor.
-     *  @param pos       The position to use for error reporting.
-     *  @param env       The environment current at the constructor invocation.
-     *  @param site      The type of class for which a constructor is searched.
-     *  @param argtypes  The types of the constructor invocation's value
-     *                   arguments.
-     *  @param typeargtypes  The types of the constructor invocation's type
-     *                   arguments.
-     *  @param allowBoxing Allow boxing and varargs conversions.
-     *  @param useVarargs Box trailing arguments into an array for varargs.
-     */
-    Symbol resolveConstructor(DiagnosticPosition pos, Env<AttrContext> env,
-                              Type site, List<Type> argtypes,
-                              List<Type> typeargtypes,
-                              boolean allowBoxing,
-                              boolean useVarargs) {
-        MethodResolutionContext prevResolutionContext = currentResolutionContext;
-        try {
-            currentResolutionContext = new MethodResolutionContext();
-            return findConstructor(pos, env, site, argtypes, typeargtypes, allowBoxing, useVarargs);
-        }
-        finally {
-            currentResolutionContext = prevResolutionContext;
-        }
-    }
-
-    Symbol findConstructor(DiagnosticPosition pos, Env<AttrContext> env,
-                              Type site, List<Type> argtypes,
-                              List<Type> typeargtypes,
-                              boolean allowBoxing,
-                              boolean useVarargs) {
-        Symbol sym = findMethod(env, site,
-                                    names.init, argtypes,
-                                    typeargtypes, allowBoxing,
-                                    useVarargs, false);
-        chk.checkDeprecated(pos, env.info.scope.owner, sym);
-        return sym;
-    }
-
-    /** Resolve a constructor, throw a fatal error if not found.
-     *  @param pos       The position to use for error reporting.
-     *  @param env       The environment current at the method invocation.
-     *  @param site      The type to be constructed.
-     *  @param argtypes  The types of the invocation's value arguments.
-     *  @param typeargtypes  The types of the invocation's type arguments.
-     */
-    public MethodSymbol resolveInternalConstructor(DiagnosticPosition pos, Env<AttrContext> env,
-                                        Type site,
-                                        List<Type> argtypes,
-                                        List<Type> typeargtypes) {
-        MethodResolutionContext resolveContext = new MethodResolutionContext();
-        resolveContext.internalResolution = true;
-        Symbol sym = resolveConstructor(resolveContext, pos, env, site, argtypes, typeargtypes);
-        if (sym.kind == MTH) return (MethodSymbol)sym;
-        else throw new FatalError(
-                 diags.fragment("fatal.err.cant.locate.ctor", site));
-    }
+
 
     /** Resolve operator.
      *  @param pos       The position to use for error reporting.
@@ -2719,6 +2336,350 @@
     }
 
     /**
+     * Resolution of member references is typically done as a single
+     * overload resolution step, where the argument types A are inferred from
+     * the target functional descriptor.
+     *
+     * If the member reference is a method reference with a type qualifier,
+     * a two-step lookup process is performed. The first step uses the
+     * expected argument list A, while the second step discards the first
+     * type from A (which is treated as a receiver type).
+     *
+     * There are two cases in which inference is performed: (i) if the member
+     * reference is a constructor reference and the qualifier type is raw - in
+     * which case diamond inference is used to infer a parameterization for the
+     * type qualifier; (ii) if the member reference is an unbound reference
+     * where the type qualifier is raw - in that case, during the unbound lookup
+     * the receiver argument type is used to infer an instantiation for the raw
+     * qualifier type.
+     *
+     * When a multi-step resolution process is exploited, it is an error
+     * if two candidates are found (ambiguity).
+     *
+     * This routine returns a pair (T,S), where S is the member reference symbol,
+     * and T is the type of the class in which S is defined. This is necessary as
+     * the type T might be dynamically inferred (i.e. if constructor reference
+     * has a raw qualifier).
+     */
+    Pair<Symbol, ReferenceLookupHelper> resolveMemberReference(DiagnosticPosition pos,
+                                  Env<AttrContext> env,
+                                  JCMemberReference referenceTree,
+                                  Type site,
+                                  Name name, List<Type> argtypes,
+                                  List<Type> typeargtypes,
+                                  boolean boxingAllowed) {
+        MethodResolutionPhase maxPhase = boxingAllowed ? VARARITY : BASIC;
+        //step 1 - bound lookup
+        ReferenceLookupHelper boundLookupHelper = name.equals(names.init) ?
+                new ConstructorReferenceLookupHelper(referenceTree, site, argtypes, typeargtypes, maxPhase) :
+                new MethodReferenceLookupHelper(referenceTree, name, site, argtypes, typeargtypes, maxPhase);
+        Env<AttrContext> boundEnv = env.dup(env.tree, env.info.dup());
+        Symbol boundSym = lookupMethod(boundEnv, env.tree.pos(), site.tsym, boundLookupHelper);
+
+        //step 2 - unbound lookup
+        ReferenceLookupHelper unboundLookupHelper = boundLookupHelper.unboundLookup();
+        Env<AttrContext> unboundEnv = env.dup(env.tree, env.info.dup());
+        Symbol unboundSym = lookupMethod(unboundEnv, env.tree.pos(), site.tsym, unboundLookupHelper);
+
+        //merge results
+        Pair<Symbol, ReferenceLookupHelper> res;
+        if (unboundSym.kind != MTH) {
+            res = new Pair<Symbol, ReferenceLookupHelper>(boundSym, boundLookupHelper);
+            env.info.pendingResolutionPhase = boundEnv.info.pendingResolutionPhase;
+        } else if (boundSym.kind == MTH) {
+            res = new Pair<Symbol, ReferenceLookupHelper>(ambiguityError(boundSym, unboundSym), boundLookupHelper);
+            env.info.pendingResolutionPhase = boundEnv.info.pendingResolutionPhase;
+        } else {
+            res = new Pair<Symbol, ReferenceLookupHelper>(unboundSym, unboundLookupHelper);
+            env.info.pendingResolutionPhase = unboundEnv.info.pendingResolutionPhase;
+        }
+
+        return res;
+    }
+
+    /**
+     * Helper for defining custom method-like lookup logic; a lookup helper
+     * provides hooks for (i) the actual lookup logic and (ii) accessing the
+     * lookup result (this step might result in compiler diagnostics to be generated)
+     */
+    abstract class LookupHelper {
+
+        /** name of the symbol to lookup */
+        Name name;
+
+        /** location in which the lookup takes place */
+        Type site;
+
+        /** actual types used during the lookup */
+        List<Type> argtypes;
+
+        /** type arguments used during the lookup */
+        List<Type> typeargtypes;
+
+        /** Max overload resolution phase handled by this helper */
+        MethodResolutionPhase maxPhase;
+
+        LookupHelper(Name name, Type site, List<Type> argtypes, List<Type> typeargtypes, MethodResolutionPhase maxPhase) {
+            this.name = name;
+            this.site = site;
+            this.argtypes = argtypes;
+            this.typeargtypes = typeargtypes;
+            this.maxPhase = maxPhase;
+        }
+
+        /**
+         * Should lookup stop at given phase with given result
+         */
+        protected boolean shouldStop(Symbol sym, MethodResolutionPhase phase) {
+            return phase.ordinal() > maxPhase.ordinal() ||
+                    sym.kind < ERRONEOUS || sym.kind == AMBIGUOUS;
+        }
+
+        /**
+         * Search for a symbol under a given overload resolution phase - this method
+         * is usually called several times, once per each overload resolution phase
+         */
+        abstract Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase);
+
+        /**
+         * Validate the result of the lookup
+         */
+        abstract Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym);
+    }
+
+    abstract class BasicLookupHelper extends LookupHelper {
+
+        BasicLookupHelper(Name name, Type site, List<Type> argtypes, List<Type> typeargtypes) {
+            super(name, site, argtypes, typeargtypes, MethodResolutionPhase.VARARITY);
+        }
+
+        @Override
+        Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+            if (sym.kind >= AMBIGUOUS) {
+                //if nothing is found return the 'first' error
+                sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes);
+            }
+            return sym;
+        }
+    }
+
+    /**
+     * Helper class for member reference lookup. A reference lookup helper
+     * defines the basic logic for member reference lookup; a method gives
+     * access to an 'unbound' helper used to perform an unbound member
+     * reference lookup.
+     */
+    abstract class ReferenceLookupHelper extends LookupHelper {
+
+        /** The member reference tree */
+        JCMemberReference referenceTree;
+
+        ReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
+                List<Type> argtypes, List<Type> typeargtypes, MethodResolutionPhase maxPhase) {
+            super(name, site, argtypes, typeargtypes, maxPhase);
+            this.referenceTree = referenceTree;
+
+        }
+
+        /**
+         * Returns an unbound version of this lookup helper. By default, this
+         * method returns an dummy lookup helper.
+         */
+        ReferenceLookupHelper unboundLookup() {
+            //dummy loopkup helper that always return 'methodNotFound'
+            return new ReferenceLookupHelper(referenceTree, name, site, argtypes, typeargtypes, maxPhase) {
+                @Override
+                ReferenceLookupHelper unboundLookup() {
+                    return this;
+                }
+                @Override
+                Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+                    return methodNotFound;
+                }
+                @Override
+                ReferenceKind referenceKind(Symbol sym) {
+                    Assert.error();
+                    return null;
+                }
+            };
+        }
+
+        /**
+         * Get the kind of the member reference
+         */
+        abstract JCMemberReference.ReferenceKind referenceKind(Symbol sym);
+
+        Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
+            //skip error reporting
+            return sym;
+        }
+    }
+
+    /**
+     * Helper class for method reference lookup. The lookup logic is based
+     * upon Resolve.findMethod; in certain cases, this helper class has a
+     * corresponding unbound helper class (see UnboundMethodReferenceLookupHelper).
+     * In such cases, non-static lookup results are thrown away.
+     */
+    class MethodReferenceLookupHelper extends ReferenceLookupHelper {
+
+        MethodReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
+                List<Type> argtypes, List<Type> typeargtypes, MethodResolutionPhase maxPhase) {
+            super(referenceTree, name, site, argtypes, typeargtypes, maxPhase);
+        }
+
+        protected Symbol lookupReferenceInternal(Env<AttrContext> env, MethodResolutionPhase phase) {
+            return findMethod(env, site, name, argtypes, typeargtypes,
+                    phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name));
+        }
+
+        protected Symbol adjustLookupResult(Env<AttrContext> env, Symbol sym) {
+            return !TreeInfo.isStaticSelector(referenceTree.expr, names) ||
+                        sym.kind != MTH ||
+                        sym.isStatic() ? sym : new StaticError(sym);
+        }
+
+        @Override
+        final Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            return adjustLookupResult(env, lookupReferenceInternal(env, phase));
+        }
+
+        @Override
+        ReferenceLookupHelper unboundLookup() {
+            if (TreeInfo.isStaticSelector(referenceTree.expr, names) &&
+                    argtypes.nonEmpty() &&
+                    types.isSubtypeUnchecked(argtypes.head, site)) {
+                return new UnboundMethodReferenceLookupHelper(referenceTree, name,
+                        site, argtypes, typeargtypes, maxPhase);
+            } else {
+                return super.unboundLookup();
+            }
+        }
+
+        @Override
+        ReferenceKind referenceKind(Symbol sym) {
+            if (sym.isStatic()) {
+                return TreeInfo.isStaticSelector(referenceTree.expr, names) ?
+                        ReferenceKind.STATIC : ReferenceKind.STATIC_EVAL;
+            } else {
+                Name selName = TreeInfo.name(referenceTree.getQualifierExpression());
+                return selName != null && selName == names._super ?
+                        ReferenceKind.SUPER :
+                        ReferenceKind.BOUND;
+            }
+        }
+    }
+
+    /**
+     * Helper class for unbound method reference lookup. Essentially the same
+     * as the basic method reference lookup helper; main difference is that static
+     * lookup results are thrown away. If qualifier type is raw, an attempt to
+     * infer a parameterized type is made using the first actual argument (that
+     * would otherwise be ignored during the lookup).
+     */
+    class UnboundMethodReferenceLookupHelper extends MethodReferenceLookupHelper {
+
+        UnboundMethodReferenceLookupHelper(JCMemberReference referenceTree, Name name, Type site,
+                List<Type> argtypes, List<Type> typeargtypes, MethodResolutionPhase maxPhase) {
+            super(referenceTree, name,
+                    site.isRaw() ? types.asSuper(argtypes.head, site.tsym) : site,
+                    argtypes.tail, typeargtypes, maxPhase);
+        }
+
+        @Override
+        protected Symbol adjustLookupResult(Env<AttrContext> env, Symbol sym) {
+            return sym.kind != MTH || !sym.isStatic() ? sym : new StaticError(sym);
+        }
+
+        @Override
+        ReferenceLookupHelper unboundLookup() {
+            return this;
+        }
+
+        @Override
+        ReferenceKind referenceKind(Symbol sym) {
+            return ReferenceKind.UNBOUND;
+        }
+    }
+
+    /**
+     * Helper class for constructor reference lookup. The lookup logic is based
+     * upon either Resolve.findMethod or Resolve.findDiamond - depending on
+     * whether the constructor reference needs diamond inference (this is the case
+     * if the qualifier type is raw). A special erroneous symbol is returned
+     * if the lookup returns the constructor of an inner class and there's no
+     * enclosing instance in scope.
+     */
+    class ConstructorReferenceLookupHelper extends ReferenceLookupHelper {
+
+        boolean needsInference;
+
+        ConstructorReferenceLookupHelper(JCMemberReference referenceTree, Type site, List<Type> argtypes,
+                List<Type> typeargtypes, MethodResolutionPhase maxPhase) {
+            super(referenceTree, names.init, site, argtypes, typeargtypes, maxPhase);
+            if (site.isRaw()) {
+                this.site = new ClassType(site.getEnclosingType(), site.tsym.type.getTypeArguments(), site.tsym);
+                needsInference = true;
+            }
+        }
+
+        @Override
+        protected Symbol lookup(Env<AttrContext> env, MethodResolutionPhase phase) {
+            Symbol sym = needsInference ?
+                findDiamond(env, site, argtypes, typeargtypes, phase.isBoxingRequired(), phase.isVarargsRequired()) :
+                findMethod(env, site, name, argtypes, typeargtypes,
+                        phase.isBoxingRequired(), phase.isVarargsRequired(), syms.operatorNames.contains(name));
+            return sym.kind != MTH ||
+                          site.getEnclosingType().hasTag(NONE) ||
+                          hasEnclosingInstance(env, site) ?
+                          sym : new InvalidSymbolError(Kinds.MISSING_ENCL, sym, null) {
+                    @Override
+                    JCDiagnostic getDiagnostic(DiagnosticType dkind, DiagnosticPosition pos, Symbol location, Type site, Name name, List<Type> argtypes, List<Type> typeargtypes) {
+                       return diags.create(dkind, log.currentSource(), pos,
+                            "cant.access.inner.cls.constr", site.tsym.name, argtypes, site.getEnclosingType());
+                    }
+                };
+        }
+
+        @Override
+        ReferenceKind referenceKind(Symbol sym) {
+            return site.getEnclosingType().hasTag(NONE) ?
+                    ReferenceKind.TOPLEVEL : ReferenceKind.IMPLICIT_INNER;
+        }
+    }
+
+    /**
+     * Main overload resolution routine. On each overload resolution step, a
+     * lookup helper class is used to perform the method/constructor lookup;
+     * at the end of the lookup, the helper is used to validate the results
+     * (this last step might trigger overload resolution diagnostics).
+     */
+    Symbol lookupMethod(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, LookupHelper lookupHelper) {
+        return lookupMethod(env, pos, location, new MethodResolutionContext(), lookupHelper);
+    }
+
+    Symbol lookupMethod(Env<AttrContext> env, DiagnosticPosition pos, Symbol location,
+            MethodResolutionContext resolveContext, LookupHelper lookupHelper) {
+        MethodResolutionContext prevResolutionContext = currentResolutionContext;
+        try {
+            Symbol bestSoFar = methodNotFound;
+            currentResolutionContext = resolveContext;
+            for (MethodResolutionPhase phase : methodResolutionSteps) {
+                if (!phase.isApplicable(boxingEnabled, varargsEnabled) ||
+                        lookupHelper.shouldStop(bestSoFar, phase)) break;
+                MethodResolutionPhase prevPhase = currentResolutionContext.step;
+                Symbol prevBest = bestSoFar;
+                currentResolutionContext.step = phase;
+                bestSoFar = phase.mergeResults(bestSoFar, lookupHelper.lookup(env, phase));
+                env.info.pendingResolutionPhase = (prevBest == bestSoFar) ? prevPhase : phase;
+            }
+            return lookupHelper.access(env, pos, location, bestSoFar);
+        } finally {
+            currentResolutionContext = prevResolutionContext;
+        }
+    }
+
+    /**
      * Resolve `c.name' where name == this or name == super.
      * @param pos           The position to use for error reporting.
      * @param env           The environment current at the expression.
@@ -2744,9 +2705,47 @@
             if ((env1.enclClass.sym.flags() & STATIC) != 0) staticOnly = true;
             env1 = env1.outer;
         }
+        if (allowDefaultMethods && c.isInterface() &&
+                name == names._super && !isStatic(env) &&
+                types.isDirectSuperInterface(c.type, env.enclClass.sym)) {
+            //this might be a default super call if one of the superinterfaces is 'c'
+            for (Type t : pruneInterfaces(env.enclClass.type)) {
+                if (t.tsym == c) {
+                    env.info.defaultSuperCallSite = t;
+                    return new VarSymbol(0, names._super,
+                            types.asSuper(env.enclClass.type, c), env.enclClass.sym);
+                }
+            }
+            //find a direct superinterface that is a subtype of 'c'
+            for (Type i : types.interfaces(env.enclClass.type)) {
+                if (i.tsym.isSubClass(c, types) && i.tsym != c) {
+                    log.error(pos, "illegal.default.super.call", c,
+                            diags.fragment("redundant.supertype", c, i));
+                    return syms.errSymbol;
+                }
+            }
+            Assert.error();
+        }
         log.error(pos, "not.encl.class", c);
         return syms.errSymbol;
     }
+    //where
+    private List<Type> pruneInterfaces(Type t) {
+        ListBuffer<Type> result = ListBuffer.lb();
+        for (Type t1 : types.interfaces(t)) {
+            boolean shouldAdd = true;
+            for (Type t2 : types.interfaces(t)) {
+                if (t1 != t2 && types.isSubtypeNoCapture(t2, t1)) {
+                    shouldAdd = false;
+                }
+            }
+            if (shouldAdd) {
+                result.append(t1);
+            }
+        }
+        return result.toList();
+    }
+
 
     /**
      * Resolve `c.this' for an enclosing class c that contains the
@@ -2847,7 +2846,7 @@
         } else {
             ListBuffer<Object> diagArgs = ListBuffer.lb();
             for (Type t : argtypes) {
-                if (t.tag == DEFERRED) {
+                if (t.hasTag(DEFERRED)) {
                     diagArgs.append(((DeferredAttr.DeferredType)t).tree);
                 } else {
                     diagArgs.append(t);
@@ -3114,20 +3113,14 @@
             return types.createErrorType(name, location, syms.errSymbol.type).tsym;
         }
 
-        protected boolean shouldReport(Candidate c) {
-            MethodResolutionPhase errPhase = resolveContext.firstErroneousResolutionPhase();
-            return !c.isApplicable() &&
-                    c.step == errPhase;
-        }
-
         private Candidate errCandidate() {
+            Candidate bestSoFar = null;
             for (Candidate c : resolveContext.candidates) {
-                if (shouldReport(c)) {
-                    return c;
-                }
+                if (c.isApplicable()) continue;
+                bestSoFar = c;
             }
-            Assert.error();
-            return null;
+            Assert.checkNonNull(bestSoFar);
+            return bestSoFar;
         }
     }
 
@@ -3156,7 +3149,7 @@
                         pos,
                         "cant.apply.symbols",
                         name == names.init ? KindName.CONSTRUCTOR : absentKind(kind),
-                        getName(),
+                        name == names.init ? site.tsym.name : name,
                         argtypes);
                 return new JCDiagnostic.MultilineDiagnostic(err, candidateDetails(site));
             } else {
@@ -3167,24 +3160,17 @@
 
         //where
         List<JCDiagnostic> candidateDetails(Type site) {
-            List<JCDiagnostic> details = List.nil();
+            Map<Symbol, JCDiagnostic> details = new LinkedHashMap<Symbol, JCDiagnostic>();
             for (Candidate c : resolveContext.candidates) {
-                if (!shouldReport(c)) continue;
+                if (c.isApplicable()) continue;
                 JCDiagnostic detailDiag = diags.fragment("inapplicable.method",
                         Kinds.kindName(c.sym),
                         c.sym.location(site, types),
                         c.sym.asMemberOf(site, types),
                         c.details);
-                details = details.prepend(detailDiag);
+                details.put(c.sym, detailDiag);
             }
-            return details.reverse();
-        }
-
-        private Name getName() {
-            Symbol sym = resolveContext.candidates.head.sym;
-            return sym.name == names.init ?
-                sym.owner.name :
-                sym.name;
+            return List.from(details.values());
         }
     }
 
@@ -3222,7 +3208,7 @@
                 Name name,
                 List<Type> argtypes,
                 List<Type> typeargtypes) {
-            if (sym.owner.type.tag == ERROR)
+            if (sym.owner.type.hasTag(ERROR))
                 return null;
 
             if (sym.name == names.init && sym.owner != site.tsym) {
@@ -3267,7 +3253,7 @@
                 Name name,
                 List<Type> argtypes,
                 List<Type> typeargtypes) {
-            Symbol errSym = ((sym.kind == TYP && sym.type.tag == CLASS)
+            Symbol errSym = ((sym.kind == TYP && sym.type.hasTag(CLASS))
                 ? types.erasure(sym.type).tsym
                 : sym);
             return diags.create(dkind, log.currentSource(), pos,
@@ -3322,7 +3308,21 @@
     enum MethodResolutionPhase {
         BASIC(false, false),
         BOX(true, false),
-        VARARITY(true, true);
+        VARARITY(true, true) {
+            @Override
+            public Symbol mergeResults(Symbol bestSoFar, Symbol sym) {
+                switch (sym.kind) {
+                    case WRONG_MTH:
+                        return (bestSoFar.kind == WRONG_MTH || bestSoFar.kind == WRONG_MTHS) ?
+                            bestSoFar :
+                            sym;
+                    case ABSENT_MTH:
+                        return bestSoFar;
+                    default:
+                        return sym;
+                }
+            }
+        };
 
         boolean isBoxingRequired;
         boolean isVarargsRequired;
@@ -3344,6 +3344,10 @@
             return (varargsEnabled || !isVarargsRequired) &&
                    (boxingEnabled || !isBoxingRequired);
         }
+
+        public Symbol mergeResults(Symbol prev, Symbol sym) {
+            return sym;
+        }
     }
 
     final List<MethodResolutionPhase> methodResolutionSteps = List.of(BASIC, BOX, VARARITY);
@@ -3359,29 +3363,11 @@
 
         private List<Candidate> candidates = List.nil();
 
-        private Map<MethodResolutionPhase, Symbol> resolutionCache =
-            new EnumMap<MethodResolutionPhase, Symbol>(MethodResolutionPhase.class);
-
         MethodResolutionPhase step = null;
 
         private boolean internalResolution = false;
         private DeferredAttr.AttrMode attrMode = DeferredAttr.AttrMode.SPECULATIVE;
 
-        private MethodResolutionPhase firstErroneousResolutionPhase() {
-            MethodResolutionPhase bestSoFar = BASIC;
-            Symbol sym = methodNotFound;
-            List<MethodResolutionPhase> steps = methodResolutionSteps;
-            while (steps.nonEmpty() &&
-                   steps.head.isApplicable(boxingEnabled, varargsEnabled) &&
-                   sym.kind >= WRONG_MTHS) {
-                sym = resolutionCache.get(steps.head);
-                if (sym.kind == ABSENT_MTH) break; //ignore spurious empty entries
-                bestSoFar = steps.head;
-                steps = steps.tail;
-            }
-            return bestSoFar;
-        }
-
         void addInapplicableCandidate(Symbol sym, JCDiagnostic details) {
             Candidate c = new Candidate(currentResolutionContext.step, sym, details, null);
             candidates = candidates.append(c);
@@ -3392,16 +3378,6 @@
             candidates = candidates.append(c);
         }
 
-        Candidate getCandidate(Symbol sym, MethodResolutionPhase phase) {
-            for (Candidate c : currentResolutionContext.candidates) {
-                if (c.step == phase &&
-                        c.sym.baseSymbol() == sym.baseSymbol()) {
-                    return c;
-                }
-            }
-            return null;
-        }
-
         /**
          * This class represents an overload resolution candidate. There are two
          * kinds of candidates: applicable methods and inapplicable methods;
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java	Wed Nov 14 16:41:12 2012 -0800
@@ -37,7 +37,9 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+import static com.sun.tools.javac.code.TypeTag.TYPEVAR;
+import static com.sun.tools.javac.code.TypeTag.VOID;
 
 /** This pass translates Generic Java to conventional Java.
  *
@@ -118,6 +120,16 @@
      *  @param tree    The expression tree.
      *  @param target  The target type.
      */
+    public JCExpression coerce(Env<AttrContext> env, JCExpression tree, Type target) {
+        Env<AttrContext> prevEnv = this.env;
+        try {
+            this.env = env;
+            return coerce(tree, target);
+        }
+        finally {
+            this.env = prevEnv;
+        }
+    }
     JCExpression coerce(JCExpression tree, Type target) {
         Type btarget = target.baseType();
         if (tree.type.isPrimitive() == target.isPrimitive()) {
@@ -155,7 +167,7 @@
      */
     JCExpression retype(JCExpression tree, Type erasedType, Type target) {
 //      System.err.println("retype " + tree + " to " + erasedType);//DEBUG
-        if (erasedType.tag > lastBaseTag) {
+        if (!erasedType.isPrimitive()) {
             if (target != null && target.isPrimitive())
                 target = erasure(tree.type);
             tree.type = erasedType;
@@ -194,6 +206,20 @@
         return _args;
     }
 
+    public <T extends JCTree> List<T> translateArgs(List<T> _args,
+                                           List<Type> parameters,
+                                           Type varargsElement,
+                                           Env<AttrContext> localEnv) {
+        Env<AttrContext> prevEnv = env;
+        try {
+            env = localEnv;
+            return translateArgs(_args, parameters, varargsElement);
+        }
+        finally {
+            env = prevEnv;
+        }
+    }
+
     /** Add a bridge definition and enter corresponding method symbol in
      *  local scope of origin.
      *
@@ -245,7 +271,7 @@
                            make.Select(receiver, impl).setType(calltype),
                            translateArgs(make.Idents(md.params), origErasure.getParameterTypes(), null))
                 .setType(calltype);
-            JCStatement stat = (origErasure.getReturnType().tag == VOID)
+            JCStatement stat = (origErasure.getReturnType().hasTag(VOID))
                 ? make.Exec(call)
                 : make.Return(coerce(call, bridgeType.getReturnType()));
             md.body = make.Block(0, List.of(stat));
@@ -400,7 +426,7 @@
      */
     void addBridges(DiagnosticPosition pos, ClassSymbol origin, ListBuffer<JCTree> bridges) {
         Type st = types.supertype(origin.type);
-        while (st.tag == CLASS) {
+        while (st.hasTag(CLASS)) {
 //          if (isSpecialization(st))
             addBridges(pos, st.tsym, origin, bridges);
             st = types.supertype(st);
@@ -449,9 +475,9 @@
         result = tree;
     }
 
-    JCMethodDecl currentMethod = null;
+    JCTree currentMethod = null;
     public void visitMethodDef(JCMethodDecl tree) {
-        JCMethodDecl previousMethod = currentMethod;
+        JCTree previousMethod = currentMethod;
         try {
             currentMethod = tree;
             tree.restype = translate(tree.restype, null);
@@ -517,6 +543,22 @@
         result = tree;
     }
 
+    public void visitLambda(JCLambda tree) {
+        JCTree prevMethod = currentMethod;
+        try {
+            currentMethod = null;
+            tree.params = translate(tree.params);
+            tree.body = translate(tree.body, null);
+            //save non-erased target
+            tree.targetType = tree.type;
+            tree.type = erasure(tree.type);
+            result = tree;
+        }
+        finally {
+            currentMethod = prevMethod;
+        }
+    }
+
     public void visitSwitch(JCSwitch tree) {
         Type selsuper = types.supertype(tree.selector.type);
         boolean enumSwitch = selsuper != null &&
@@ -568,7 +610,7 @@
     }
 
     public void visitReturn(JCReturn tree) {
-        tree.expr = translate(tree.expr, currentMethod.sym.erasure(types).getReturnType());
+        tree.expr = translate(tree.expr, currentMethod != null ? types.erasure(currentMethod.type).getReturnType() : null);
         result = tree;
     }
 
@@ -599,6 +641,7 @@
             Assert.check(tree.args.length() == argtypes.length());
         tree.args = translateArgs(tree.args, argtypes, tree.varargsElement);
 
+        tree.type = types.erasure(tree.type);
         // Insert casts of method invocation results as needed.
         result = retype(tree, mt.getReturnType(), pt);
     }
@@ -612,6 +655,8 @@
         tree.args = translateArgs(
             tree.args, tree.constructor.erasure(types).getParameterTypes(), tree.varargsElement);
         tree.def = translate(tree.def, null);
+        if (tree.constructorType != null)
+            tree.constructorType = erasure(tree.constructorType);
         tree.type = erasure(tree.type);
         result = tree;
     }
@@ -629,16 +674,6 @@
         result = tree;
     }
 
-    @Override
-    public void visitLambda(JCLambda tree) {
-        Assert.error("Translation of lambda expression not supported yet");
-    }
-
-    @Override
-    public void visitReference(JCMemberReference tree) {
-        Assert.error("Translation of method reference not supported yet");
-    }
-
     public void visitParens(JCParens tree) {
         tree.expr = translate(tree.expr, pt);
         tree.type = erasure(tree.type);
@@ -701,7 +736,7 @@
         Type et = tree.sym.erasure(types);
 
         // Map type variables to their bounds.
-        if (tree.sym.kind == TYP && tree.sym.type.tag == TYPEVAR) {
+        if (tree.sym.kind == TYP && tree.sym.type.hasTag(TYPEVAR)) {
             result = make.at(tree.pos).Type(et);
         } else
         // Map constants expressions to themselves.
@@ -720,7 +755,7 @@
 
     public void visitSelect(JCFieldAccess tree) {
         Type t = tree.selected.type;
-        while (t.tag == TYPEVAR)
+        while (t.hasTag(TYPEVAR))
             t = t.getUpperBound();
         if (t.isCompound()) {
             if ((tree.sym.flags() & IPROXY) != 0) {
@@ -747,6 +782,14 @@
         }
     }
 
+    public void visitReference(JCMemberReference tree) {
+        tree.expr = translate(tree.expr, null);
+        //save non-erased target
+        tree.targetType = tree.type;
+        tree.type = erasure(tree.type);
+        result = tree;
+    }
+
     public void visitTypeArray(JCArrayTypeTree tree) {
         tree.elemtype = translate(tree.elemtype, null);
         tree.type = erasure(tree.type);
@@ -844,7 +887,7 @@
                        translateArgs(make.Idents(md.params),
                                      implErasure.getParameterTypes(), null))
             .setType(calltype);
-        JCStatement stat = (member.getReturnType().tag == VOID)
+        JCStatement stat = (member.getReturnType().hasTag(VOID))
             ? make.Exec(call)
             : make.Return(coerce(call, member.erasure(types).getReturnType()));
         md.body = make.Block(0, List.of(stat));
@@ -862,7 +905,7 @@
         Type st = types.supertype(c.type);
 
         // process superclass before derived
-        if (st.tag == CLASS)
+        if (st.hasTag(CLASS))
             translateClass((ClassSymbol)st.tsym);
 
         Env<AttrContext> myEnv = enter.typeEnvs.remove(c);
--- a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java	Wed Nov 14 16:41:12 2012 -0800
@@ -90,7 +90,7 @@
         EnumSet.of(JavaFileObject.Kind.SOURCE, JavaFileObject.Kind.CLASS);
 
     protected boolean mmappedIO;
-    protected boolean ignoreSymbolFile;
+    protected boolean symbolFileEnabled;
 
     protected enum SortFiles implements Comparator<File> {
         FORWARD {
@@ -142,7 +142,7 @@
             zipFileIndexCache = ZipFileIndexCache.getSharedInstance();
 
         mmappedIO = options.isSet("mmappedIO");
-        ignoreSymbolFile = options.isSet("ignore.symbol.file");
+        symbolFileEnabled = !options.isSet("ignore.symbol.file");
 
         String sf = options.get("sortFiles");
         if (sf != null) {
@@ -150,6 +150,13 @@
         }
     }
 
+    /**
+     * Set whether or not to use ct.sym as an alternate to rt.jar.
+     */
+    public void setSymbolFileEnabled(boolean b) {
+        symbolFileEnabled = b;
+    }
+
     @Override
     public boolean isDefaultBootClassPath() {
         return locations.isDefaultBootClassPath();
@@ -466,7 +473,7 @@
      */
     private Archive openArchive(File zipFileName, boolean useOptimizedZip) throws IOException {
         File origZipFileName = zipFileName;
-        if (!ignoreSymbolFile && locations.isDefaultBootClassPathRtJar(zipFileName)) {
+        if (symbolFileEnabled && locations.isDefaultBootClassPathRtJar(zipFileName)) {
             File file = zipFileName.getParentFile().getParentFile(); // ${java.home}
             if (new File(file.getName()).equals(new File("jre")))
                 file = file.getParentFile();
--- a/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java	Wed Nov 14 16:41:12 2012 -0800
@@ -420,14 +420,10 @@
             if (!options.contains(option))
                 return false;
             searchPath = value == null ? null :
-                    Collections.unmodifiableCollection(computePath(value));
+                    Collections.unmodifiableCollection(createPath().addFiles(value));
             return true;
         }
 
-        protected Path computePath(String value) {
-            return new Path().addFiles(value);
-        }
-
         @Override
         Collection<File> getLocation() {
             return searchPath;
@@ -439,10 +435,18 @@
             if (files == null) {
                 p = computePath(null);
             } else {
-                p = new Path().addFiles(files);
+                p = createPath().addFiles(files);
             }
             searchPath = Collections.unmodifiableCollection(p);
         }
+
+        protected Path computePath(String value) {
+            return createPath().addFiles(value);
+        }
+
+        protected Path createPath() {
+            return new Path();
+        }
     }
 
     /**
@@ -477,11 +481,15 @@
             // Default to current working directory.
             if (cp == null) cp = ".";
 
+            return createPath().addFiles(cp);
+        }
+
+        @Override
+        protected Path createPath() {
             return new Path()
-                .expandJarClassPaths(true)        // Only search user jars for Class-Paths
-                .emptyPathDefault(new File("."))  // Empty path elt ==> current directory
-                .addFiles(cp);
-            }
+                .expandJarClassPaths(true)         // Only search user jars for Class-Paths
+                .emptyPathDefault(new File("."));  // Empty path elt ==> current directory
+        }
 
         private void lazy() {
             if (searchPath == null)
@@ -591,7 +599,6 @@
             String extdirsOpt = optionValues.get(EXTDIRS);
             String xbootclasspathPrependOpt = optionValues.get(XBOOTCLASSPATH_PREPEND);
             String xbootclasspathAppendOpt = optionValues.get(XBOOTCLASSPATH_APPEND);
-
             path.addFiles(xbootclasspathPrependOpt);
 
             if (endorseddirsOpt != null)
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java	Wed Nov 14 16:41:12 2012 -0800
@@ -503,6 +503,14 @@
             result = sr;
         }
 
+        @Override
+        public void visitLetExpr(LetExpr tree) {
+            SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
+            sr.mergeWith(csp(tree.defs));
+            sr.mergeWith(csp(tree.expr));
+            result = sr;
+        }
+
         public void visitTypeParameter(JCTypeParameter tree) {
             SourceRange sr = new SourceRange(startPos(tree), endPos(tree));
             sr.mergeWith(csp(tree.bounds));
@@ -525,7 +533,7 @@
          */
         public int startPos(JCTree tree) {
             if (tree == null) return Position.NOPOS;
-            return tree.pos;
+            return TreeInfo.getStartPos(tree);
         }
 
         /** The end position of given tree, if it has
@@ -533,9 +541,7 @@
          */
         public int endPos(JCTree tree) {
             if (tree == null) return Position.NOPOS;
-            if (tree.hasTag(JCTree.Tag.BLOCK))
-                return ((JCBlock) tree).endpos;
-            return endPosTable.getEndPos(tree);
+            return TreeInfo.getEndPos(tree, endPosTable);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java	Wed Nov 14 16:41:12 2012 -0800
@@ -55,7 +55,7 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.jvm.ClassFile.*;
 import static com.sun.tools.javac.jvm.ClassFile.Version.*;
 
@@ -115,6 +115,9 @@
      */
     boolean lintClassfile;
 
+    /** Switch: allow default methods
+     */
+    boolean allowDefaultMethods;
 
     /** Switch: preserve parameter names from the variable table.
      */
@@ -279,6 +282,7 @@
         allowVarargs     = source.allowVarargs();
         allowAnnotations = source.allowAnnotations();
         allowSimplifiedVarargs = source.allowSimplifiedVarargs();
+        allowDefaultMethods = source.allowDefaultMethods();
         saveParameterNames = options.isSet("save-parameter-names");
         cacheCompletionFailure = options.isUnset("dev");
         preferSource = "source".equals(options.get("-Xprefer"));
@@ -937,6 +941,18 @@
 
             new AttributeReader(names.Code, V45_3, MEMBER_ATTRIBUTE) {
                 protected void read(Symbol sym, int attrLen) {
+                    if (currentOwner.isInterface() &&
+                            (sym.flags_field & ABSTRACT) == 0 && !name.equals(names.clinit)) {
+                        if (majorVersion > Target.JDK1_8.majorVersion ||
+                                //todo replace with Target.Version when available
+                                (majorVersion == Target.JDK1_8.majorVersion && minorVersion >= Target.JDK1_8.minorVersion)) {
+                            currentOwner.flags_field |= DEFAULT;
+                            sym.flags_field |= DEFAULT | ABSTRACT;
+                        } else {
+                            //protect against ill-formed classfiles
+                            throw new CompletionFailure(currentOwner, "default method found in pre JDK 8 classfile");
+                        }
+                    }
                     if (readAllOfClassFile || saveParameterNames)
                         ((MethodSymbol)sym).code = readCode(sym);
                     else
@@ -1018,6 +1034,15 @@
                     ClassSymbol c = (ClassSymbol) sym;
                     Name n = readName(nextChar());
                     c.sourcefile = new SourceFileObject(n, c.flatname);
+                    // If the class is a toplevel class, originating from a Java source file,
+                    // but the class name does not match the file name, then it is
+                    // an auxiliary class.
+                    String sn = n.toString();
+                    if (c.owner.kind == Kinds.PCK &&
+                        sn.endsWith(".java") &&
+                        !sn.equals(c.name.toString()+".java")) {
+                        c.flags_field |= AUXILIARY;
+                    }
                 }
             },
 
@@ -1870,7 +1895,7 @@
      *  `typevars'.
      */
     protected void enterTypevars(Type t) {
-        if (t.getEnclosingType() != null && t.getEnclosingType().tag == CLASS)
+        if (t.getEnclosingType() != null && t.getEnclosingType().hasTag(CLASS))
             enterTypevars(t.getEnclosingType());
         for (List<Type> xs = t.getTypeArguments(); xs.nonEmpty(); xs = xs.tail)
             typevars.enter(xs.head.tsym);
@@ -1895,7 +1920,7 @@
 
         // prepare type variable table
         typevars = typevars.dup(currentOwner);
-        if (ct.getEnclosingType().tag == CLASS)
+        if (ct.getEnclosingType().hasTag(CLASS))
             enterTypevars(ct.getEnclosingType());
 
         // read flags, or skip if this is an inner class
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -45,7 +45,7 @@
 import static com.sun.tools.javac.code.BoundKind.*;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.jvm.UninitializedType.*;
 import static com.sun.tools.javac.main.Option.*;
 import static javax.tools.StandardLocation.CLASS_OUTPUT;
@@ -274,7 +274,7 @@
     /** Assemble signature of given type in string buffer.
      */
     void assembleSig(Type type) {
-        switch (type.tag) {
+        switch (type.getTag()) {
         case BYTE:
             sigbuf.appendByte('B');
             break;
@@ -361,13 +361,13 @@
             assembleSig(types.erasure(((UninitializedType)type).qtype));
             break;
         default:
-            throw new AssertionError("typeSig " + type.tag);
+            throw new AssertionError("typeSig " + type.getTag());
         }
     }
 
     boolean hasTypeVar(List<Type> l) {
         while (l.nonEmpty()) {
-            if (l.head.tag == TypeTags.TYPEVAR) return true;
+            if (l.head.hasTag(TYPEVAR)) return true;
             l = l.tail;
         }
         return false;
@@ -439,9 +439,9 @@
      *  external representation.
      */
     public Name xClassName(Type t) {
-        if (t.tag == CLASS) {
+        if (t.hasTag(CLASS)) {
             return names.fromUtf(externalize(t.tsym.flatName()));
-        } else if (t.tag == ARRAY) {
+        } else if (t.hasTag(ARRAY)) {
             return typeSig(types.erasure(t));
         } else {
             throw new AssertionError("xClassName");
@@ -521,7 +521,7 @@
                 ClassSymbol c = (ClassSymbol)value;
                 if (c.owner.kind == TYP) pool.put(c.owner);
                 poolbuf.appendByte(CONSTANT_Class);
-                if (c.type.tag == ARRAY) {
+                if (c.type.hasTag(ARRAY)) {
                     poolbuf.appendChar(pool.put(typeSig(c.type)));
                 } else {
                     poolbuf.appendChar(pool.put(names.fromUtf(externalize(c.flatname))));
@@ -555,7 +555,7 @@
                 poolbuf.appendChar(pool.put(typeSig(mtype)));
             } else if (value instanceof Type) {
                 Type type = (Type)value;
-                if (type.tag == CLASS) enterInner((ClassSymbol)type.tsym);
+                if (type.hasTag(CLASS)) enterInner((ClassSymbol)type.tsym);
                 poolbuf.appendByte(CONSTANT_Class);
                 poolbuf.appendChar(pool.put(xClassName(type)));
             } else if (value instanceof Pool.MethodHandle) {
@@ -815,7 +815,7 @@
     class AttributeWriter implements Attribute.Visitor {
         public void visitConstant(Attribute.Constant _value) {
             Object value = _value.value;
-            switch (_value.type.tag) {
+            switch (_value.type.getTag()) {
             case BYTE:
                 databuf.appendByte('B');
                 break;
@@ -901,7 +901,7 @@
             System.err.println("error: " + c + ": " + ex.getMessage());
             throw ex;
         }
-        if (c.type.tag != CLASS) return; // arrays
+        if (!c.type.hasTag(CLASS)) return; // arrays
         if (pool != null && // pool might be null if called from xClassName
             c.owner.enclClass() != null &&
             (innerClasses == null || !innerClasses.contains(c))) {
@@ -1207,7 +1207,7 @@
                 if (debugstackmap) System.out.print("empty");
                 databuf.appendByte(0);
             }
-            else switch(t.tag) {
+            else switch(t.getTag()) {
             case BYTE:
             case CHAR:
             case SHORT:
@@ -1430,7 +1430,7 @@
         }
 
         static boolean isInt(Type t) {
-            return (t.tag < TypeTags.INT || t.tag == TypeTags.BOOLEAN);
+            return (t.getTag().isStrictSubRangeOf(INT)  || t.hasTag(BOOLEAN));
         }
 
         static boolean isSameType(Type t1, Type t2, Types types) {
@@ -1439,15 +1439,15 @@
 
             if (isInt(t1) && isInt(t2)) { return true; }
 
-            if (t1.tag == UNINITIALIZED_THIS) {
-                return t2.tag == UNINITIALIZED_THIS;
-            } else if (t1.tag == UNINITIALIZED_OBJECT) {
-                if (t2.tag == UNINITIALIZED_OBJECT) {
+            if (t1.hasTag(UNINITIALIZED_THIS)) {
+                return t2.hasTag(UNINITIALIZED_THIS);
+            } else if (t1.hasTag(UNINITIALIZED_OBJECT)) {
+                if (t2.hasTag(UNINITIALIZED_OBJECT)) {
                     return ((UninitializedType)t1).offset == ((UninitializedType)t2).offset;
                 } else {
                     return false;
                 }
-            } else if (t2.tag == UNINITIALIZED_THIS || t2.tag == UNINITIALIZED_OBJECT) {
+            } else if (t2.hasTag(UNINITIALIZED_THIS) || t2.hasTag(UNINITIALIZED_OBJECT)) {
                 return false;
             }
 
@@ -1540,7 +1540,7 @@
         List<Type> interfaces = types.interfaces(c.type);
         List<Type> typarams = c.type.getTypeArguments();
 
-        int flags = adjustFlags(c.flags());
+        int flags = adjustFlags(c.flags() & ~DEFAULT);
         if ((flags & PROTECTED) != 0) flags |= PUBLIC;
         flags = flags & ClassFlags & ~STRICTFP;
         if ((flags & INTERFACE) == 0) flags |= ACC_SUPER;
@@ -1554,7 +1554,7 @@
         databuf.appendChar(flags);
 
         databuf.appendChar(pool.put(c));
-        databuf.appendChar(supertype.tag == CLASS ? pool.put(supertype.tsym) : 0);
+        databuf.appendChar(supertype.hasTag(CLASS) ? pool.put(supertype.tsym) : 0);
         databuf.appendChar(interfaces.length());
         for (List<Type> l = interfaces; l.nonEmpty(); l = l.tail)
             databuf.appendChar(pool.put(l.head.tsym));
@@ -1676,6 +1676,8 @@
             result |= ACC_BRIDGE;
         if ((flags & VARARGS) != 0  && target.useVarargsFlag())
             result |= ACC_VARARGS;
+        if ((flags & DEFAULT) != 0)
+            result &= ~ABSTRACT;
         return result;
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java	Wed Nov 14 16:41:12 2012 -0800
@@ -30,7 +30,8 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.BOT;
+import static com.sun.tools.javac.code.TypeTag.INT;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import static com.sun.tools.javac.jvm.UninitializedType.*;
 import static com.sun.tools.javac.jvm.ClassWriter.StackMapTableFrame;
@@ -224,7 +225,7 @@
      *  JVM architecture).
      */
     public static int typecode(Type type) {
-        switch (type.tag) {
+        switch (type.getTag()) {
         case BYTE: return BYTEcode;
         case SHORT: return SHORTcode;
         case CHAR: return CHARcode;
@@ -242,7 +243,7 @@
         case UNINITIALIZED_THIS:
         case UNINITIALIZED_OBJECT:
             return OBJECTcode;
-        default: throw new AssertionError("typecode " + type.tag);
+        default: throw new AssertionError("typecode " + type.getTag());
         }
     }
 
@@ -281,7 +282,7 @@
     /** Given a type, return its code for allocating arrays of that type.
      */
     public static int arraycode(Type type) {
-        switch (type.tag) {
+        switch (type.getTag()) {
         case BYTE: return 8;
         case BOOLEAN: return 4;
         case SHORT: return 9;
@@ -477,7 +478,7 @@
             state.pop(1);
             //sometimes 'null type' is treated as a one-dimensional array type
             //see Gen.visitLiteral - we should handle this case accordingly
-            Type stackType = a.tag == BOT ?
+            Type stackType = a.hasTag(BOT) ?
                 syms.objectType :
                 types.erasure(types.elemtype(a));
             state.push(stackType); }
@@ -1656,13 +1657,13 @@
 
         void push(Type t) {
             if (debugCode) System.err.println("   pushing " + t);
-            switch (t.tag) {
-            case TypeTags.VOID:
+            switch (t.getTag()) {
+            case VOID:
                 return;
-            case TypeTags.BYTE:
-            case TypeTags.CHAR:
-            case TypeTags.SHORT:
-            case TypeTags.BOOLEAN:
+            case BYTE:
+            case CHAR:
+            case SHORT:
+            case BOOLEAN:
                 t = syms.intType;
                 break;
             default:
@@ -1722,7 +1723,7 @@
          *  of its current type. */
         void forceStackTop(Type t) {
             if (!alive) return;
-            switch (t.tag) {
+            switch (t.getTag()) {
             case CLASS:
             case ARRAY:
                 int width = width(t);
@@ -1824,7 +1825,7 @@
         }
     }
 
-    static Type jsrReturnValue = new Type(TypeTags.INT, null);
+    static Type jsrReturnValue = new Type(INT, null);
 
 
 /* **************************************************************************
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java	Wed Nov 14 16:41:12 2012 -0800
@@ -42,7 +42,7 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.jvm.ByteCodes.*;
 import static com.sun.tools.javac.jvm.CRTFlags.*;
 import static com.sun.tools.javac.main.Option.*;
@@ -258,7 +258,7 @@
      */
     Symbol binaryQualifier(Symbol sym, Type site) {
 
-        if (site.tag == ARRAY) {
+        if (site.hasTag(ARRAY)) {
             if (sym == syms.lengthVar ||
                 sym.owner != syms.arrayClass)
                 return sym;
@@ -305,13 +305,13 @@
      */
     int makeRef(DiagnosticPosition pos, Type type) {
         checkDimension(pos, type);
-        return pool.put(type.tag == CLASS ? (Object)type.tsym : (Object)type);
+        return pool.put(type.hasTag(CLASS) ? (Object)type.tsym : (Object)type);
     }
 
     /** Check if the given type is an array with too many dimensions.
      */
     private void checkDimension(DiagnosticPosition pos, Type t) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case METHOD:
             checkDimension(pos, t.getReturnType());
             for (List<Type> args = t.getParameterTypes(); args.nonEmpty(); args = args.tail)
@@ -922,7 +922,7 @@
                 if (code.isAlive()) {
                     code.statBegin(TreeInfo.endPos(tree.body));
                     if (env.enclMethod == null ||
-                        env.enclMethod.sym.type.getReturnType().tag == VOID) {
+                        env.enclMethod.sym.type.getReturnType().hasTag(VOID)) {
                         code.emitop0(return_);
                     } else {
                         // sometime dead code seems alive (4415991);
@@ -1110,7 +1110,7 @@
 
     public void visitSwitch(JCSwitch tree) {
         int limit = code.nextreg;
-        Assert.check(tree.selector.type.tag != CLASS);
+        Assert.check(!tree.selector.type.hasTag(CLASS));
         int startpcCrt = genCrt ? code.curPc() : 0;
         Item sel = genExpr(tree.selector, syms.intType);
         List<JCCase> cases = tree.cases;
@@ -1817,8 +1817,8 @@
             // proceeding further.
             if ((tree.hasTag(PLUS_ASG) || tree.hasTag(MINUS_ASG)) &&
                 l instanceof LocalItem &&
-                tree.lhs.type.tag <= INT &&
-                tree.rhs.type.tag <= INT &&
+                tree.lhs.type.getTag().isSubRangeOf(INT) &&
+                tree.rhs.type.getTag().isSubRangeOf(INT) &&
                 tree.rhs.type.constValue() != null) {
                 int ival = ((Number) tree.rhs.type.constValue()).intValue();
                 if (tree.hasTag(MINUS_ASG)) ival = -ival;
@@ -1969,7 +1969,7 @@
          */
         void appendString(JCTree tree) {
             Type t = tree.type.baseType();
-            if (t.tag > lastBaseTag && t.tsym != syms.stringType.tsym) {
+            if (!t.isPrimitive() && t.tsym != syms.stringType.tsym) {
                 t = syms.objectType;
             }
             items.makeMemberItem(getStringBufferAppend(tree, t), false).invoke();
@@ -2067,7 +2067,7 @@
         // which is not statically a supertype of the expression's type.
         // For basic types, the coerce(...) in genExpr(...) will do
         // the conversion.
-        if (tree.clazz.type.tag > lastBaseTag &&
+        if (!tree.clazz.type.isPrimitive() &&
             types.asSuper(tree.expr.type, tree.clazz.type.tsym) == null) {
             code.emitop2(checkcast, makeRef(tree.pos(), tree.clazz.type));
         }
@@ -2185,7 +2185,7 @@
     }
 
     public void visitLiteral(JCLiteral tree) {
-        if (tree.type.tag == TypeTags.BOT) {
+        if (tree.type.hasTag(BOT)) {
             code.emitop0(aconst_null);
             if (types.dimensions(pt) > 1) {
                 code.emitop2(checkcast, makeRef(tree.pos(), pt));
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java	Wed Nov 14 16:41:12 2012 -0800
@@ -523,7 +523,7 @@
         Item invoke() {
             MethodType mtype = (MethodType)member.externalType(types);
             int rescode = Code.typecode(mtype.restype);
-            if ((member.owner.flags() & Flags.INTERFACE) != 0) {
+            if ((member.owner.flags() & Flags.INTERFACE) != 0 && !nonvirtual) {
                 code.emitInvokeinterface(pool.put(member), mtype);
             } else if (nonvirtual) {
                 code.emitInvokespecial(pool.put(member), mtype);
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -68,8 +68,8 @@
     /** JDK 7. */
     JDK1_7("1.7", 51, 0),
 
-    /** JDK 8. */ // For now, a clone of 7
-    JDK1_8("1.8", 51, 0);
+    /** JDK 8. */
+    JDK1_8("1.8", 52, 0);
 
     private static final Context.Key<Target> targetKey =
         new Context.Key<Target>();
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/UninitializedType.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/UninitializedType.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -27,6 +27,8 @@
 
 import com.sun.tools.javac.code.*;
 
+import static com.sun.tools.javac.code.TypeTag.UNINITIALIZED_OBJECT;
+import static com.sun.tools.javac.code.TypeTag.UNINITIALIZED_THIS;
 
 /** These pseudo-types appear in the generated verifier tables to
  *  indicate objects that have been allocated but not yet constructed.
@@ -37,8 +39,6 @@
  *  deletion without notice.</b>
  */
 class UninitializedType extends Type.DelegatedType {
-    public static final int UNINITIALIZED_THIS = TypeTags.TypeTagCount;
-    public static final int UNINITIALIZED_OBJECT = UNINITIALIZED_THIS + 1;
 
     public static UninitializedType uninitializedThis(Type qtype) {
         return new UninitializedType(UNINITIALIZED_THIS, qtype, -1);
@@ -49,7 +49,7 @@
     }
 
     public final int offset; // PC where allocation took place
-    private UninitializedType(int tag, Type qtype, int offset) {
+    private UninitializedType(TypeTag tag, Type qtype, int offset) {
         super(tag, qtype);
         this.offset = offset;
     }
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java	Wed Nov 14 16:41:12 2012 -0800
@@ -63,6 +63,7 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.Log.WriterKind;
 
+import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.main.Option.*;
 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag.*;
 import static com.sun.tools.javac.util.ListBuffer.lb;
@@ -270,6 +271,10 @@
      */
     protected TransTypes transTypes;
 
+    /** The lambda translator.
+     */
+    protected LambdaToMethod lambdaToMethod;
+
     /** The syntactic sugar desweetener.
      */
     protected Lower lower;
@@ -368,6 +373,8 @@
 
         options = Options.instance(context);
 
+        lambdaToMethod = LambdaToMethod.instance(context);
+
         verbose       = options.isSet(VERBOSE);
         sourceOutput  = options.isSet(PRINTSOURCE); // used to be -s
         stubOutput    = options.isSet("-stubs");
@@ -523,8 +530,10 @@
         ATTR(4),
         FLOW(5),
         TRANSTYPES(6),
-        LOWER(7),
-        GENERATE(8);
+        UNLAMBDA(7),
+        LOWER(8),
+        GENERATE(9);
+
         CompileState(int value) {
             this.value = value;
         }
@@ -1349,7 +1358,7 @@
             @Override
             public void visitClassDef(JCClassDecl node) {
                 Type st = types.supertype(node.sym.type);
-                if (st.tag == TypeTags.CLASS) {
+                if (st.hasTag(CLASS)) {
                     ClassSymbol c = st.tsym.outermostClass();
                     Env<AttrContext> stEnv = enter.getEnv(c);
                     if (stEnv != null && env != stEnv) {
@@ -1417,6 +1426,12 @@
             env.tree = transTypes.translateTopLevelClass(env.tree, localMake);
             compileStates.put(env, CompileState.TRANSTYPES);
 
+            if (shouldStop(CompileState.UNLAMBDA))
+                return;
+
+            env.tree = lambdaToMethod.translateTopLevelClass(env, env.tree, localMake);
+            compileStates.put(env, CompileState.UNLAMBDA);
+
             if (shouldStop(CompileState.LOWER))
                 return;
 
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java	Wed Nov 14 16:41:12 2012 -0800
@@ -533,7 +533,7 @@
      * annotation processor.
      */
     void apMessage(AnnotationProcessingError ex) {
-        log.printLines("msg.proc.annotation.uncaught.exception");
+        log.printLines(PrefixKind.JAVAC, "msg.proc.annotation.uncaught.exception");
         ex.getCause().printStackTrace(log.getWriter(WriterKind.NOTICE));
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java	Wed Nov 14 16:41:12 2012 -0800
@@ -38,7 +38,7 @@
 
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.code.TypeTags;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Enter;
 import com.sun.tools.javac.comp.Env;
@@ -50,6 +50,7 @@
 import com.sun.tools.javac.tree.TreeScanner;
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.Name;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /**
@@ -124,7 +125,7 @@
             if (result != null || !inherited)
                 break;
             Type sup = annotated.getSuperclass();
-            if (sup.tag != TypeTags.CLASS || sup.isErroneous())
+            if (!sup.hasTag(CLASS) || sup.isErroneous())
                 break;
             annotated = (ClassSymbol) sup.tsym;
         }
@@ -444,7 +445,7 @@
         List<Attribute.Compound> annos = sym.getAnnotationMirrors();
         while (sym.getKind() == ElementKind.CLASS) {
             Type sup = ((ClassSymbol) sym).getSuperclass();
-            if (sup.tag != TypeTags.CLASS || sup.isErroneous() ||
+            if (!sup.hasTag(CLASS) || sup.isErroneous() ||
                     sup.tsym == syms.objectType.tsym) {
                 break;
             }
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavaTokenizer.java	Wed Nov 14 16:41:12 2012 -0800
@@ -662,7 +662,10 @@
                             tk = TokenKind.EOF;
                             pos = reader.buflen;
                         } else {
-                            lexError(pos, "illegal.char", String.valueOf((int)reader.ch));
+                            String arg = (32 < reader.ch && reader.ch < 127) ?
+                                            String.format("%s", reader.ch) :
+                                            String.format("\\u%04x", (int)reader.ch);
+                            lexError(pos, "illegal.char", arg);
                             reader.scanChar();
                         }
                     }
--- a/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java	Wed Nov 14 16:41:12 2012 -0800
@@ -88,6 +88,15 @@
     /** End position mappings container */
     private final AbstractEndPosTable endPosTable;
 
+    interface ErrorRecoveryAction {
+        JCTree doRecover(JavacParser parser);
+    }
+
+    enum BasicErrorRecoveryAction implements ErrorRecoveryAction {
+        BLOCK_STMT {public JCTree doRecover(JavacParser parser) { return parser.parseStatementAsBlock(); }},
+        CATCH_CLAUSE {public JCTree doRecover(JavacParser parser) { return parser.catchClause(); }}
+    }
+
     /** Construct a parser from a given scanner, tree factory and log.
      */
     protected JavacParser(ParserFactory fac,
@@ -560,7 +569,7 @@
         case INTLITERAL:
             try {
                 t = F.at(pos).Literal(
-                    TypeTags.INT,
+                    TypeTag.INT,
                     Convert.string2int(strval(prefix), token.radix()));
             } catch (NumberFormatException ex) {
                 error(token.pos, "int.number.too.large", strval(prefix));
@@ -569,7 +578,7 @@
         case LONGLITERAL:
             try {
                 t = F.at(pos).Literal(
-                    TypeTags.LONG,
+                    TypeTag.LONG,
                     new Long(Convert.string2long(strval(prefix), token.radix())));
             } catch (NumberFormatException ex) {
                 error(token.pos, "int.number.too.large", strval(prefix));
@@ -591,7 +600,7 @@
             else if (n.floatValue() == Float.POSITIVE_INFINITY)
                 error(token.pos, "fp.number.too.large");
             else
-                t = F.at(pos).Literal(TypeTags.FLOAT, n);
+                t = F.at(pos).Literal(TypeTag.FLOAT, n);
             break;
         }
         case DOUBLELITERAL: {
@@ -610,27 +619,27 @@
             else if (n.doubleValue() == Double.POSITIVE_INFINITY)
                 error(token.pos, "fp.number.too.large");
             else
-                t = F.at(pos).Literal(TypeTags.DOUBLE, n);
+                t = F.at(pos).Literal(TypeTag.DOUBLE, n);
             break;
         }
         case CHARLITERAL:
             t = F.at(pos).Literal(
-                TypeTags.CHAR,
+                TypeTag.CHAR,
                 token.stringVal().charAt(0) + 0);
             break;
         case STRINGLITERAL:
             t = F.at(pos).Literal(
-                TypeTags.CLASS,
+                TypeTag.CLASS,
                 token.stringVal());
             break;
         case TRUE: case FALSE:
             t = F.at(pos).Literal(
-                TypeTags.BOOLEAN,
+                TypeTag.BOOLEAN,
                 (token.kind == TRUE ? 1 : 0));
             break;
         case NULL:
             t = F.at(pos).Literal(
-                TypeTags.BOT,
+                TypeTag.BOT,
                 null);
             break;
         default:
@@ -814,7 +823,7 @@
         if (t.hasTag(JCTree.Tag.PLUS)) {
             StringBuilder buf = foldStrings(t);
             if (buf != null) {
-                t = toP(F.at(startPos).Literal(TypeTags.CLASS, buf.toString()));
+                t = toP(F.at(startPos).Literal(TypeTag.CLASS, buf.toString()));
             }
         }
 
@@ -846,7 +855,7 @@
             while (true) {
                 if (tree.hasTag(LITERAL)) {
                     JCLiteral lit = (JCLiteral) tree;
-                    if (lit.typetag == TypeTags.CLASS) {
+                    if (lit.typetag == TypeTag.CLASS) {
                         StringBuilder sbuf =
                             new StringBuilder((String)lit.value);
                         while (buf.nonEmpty()) {
@@ -859,7 +868,7 @@
                     JCBinary op = (JCBinary)tree;
                     if (op.rhs.hasTag(LITERAL)) {
                         JCLiteral lit = (JCLiteral) op.rhs;
-                        if (lit.typetag == TypeTags.CLASS) {
+                        if (lit.typetag == TypeTag.CLASS) {
                             buf = buf.prepend((String) lit.value);
                             tree = op.lhs;
                             continue;
@@ -1211,7 +1220,7 @@
             if ((mode & EXPR) != 0) {
                 nextToken();
                 if (token.kind == DOT) {
-                    JCPrimitiveTypeTree ti = toP(F.at(pos).TypeIdent(TypeTags.VOID));
+                    JCPrimitiveTypeTree ti = toP(F.at(pos).TypeIdent(TypeTag.VOID));
                     t = bracketsSuffix(ti);
                 } else {
                     return illegal(pos);
@@ -1220,7 +1229,7 @@
                 // Support the corner case of myMethodHandle.<void>invoke() by passing
                 // a void type (like other primitive types) to the next phase.
                 // The error will be reported in Attr.attribTypes or Attr.visitApply.
-                JCPrimitiveTypeTree ti = to(F.at(pos).TypeIdent(TypeTags.VOID));
+                JCPrimitiveTypeTree ti = to(F.at(pos).TypeIdent(TypeTag.VOID));
                 nextToken();
                 return ti;
                 //return illegal();
@@ -2102,11 +2111,15 @@
             nextToken();
             return toP(F.at(pos).Skip());
         case ELSE:
-            return toP(F.Exec(syntaxError("else.without.if")));
+            int elsePos = token.pos;
+            nextToken();
+            return doRecover(elsePos, BasicErrorRecoveryAction.BLOCK_STMT, "else.without.if");
         case FINALLY:
-            return toP(F.Exec(syntaxError("finally.without.try")));
+            int finallyPos = token.pos;
+            nextToken();
+            return doRecover(finallyPos, BasicErrorRecoveryAction.BLOCK_STMT, "finally.without.try");
         case CATCH:
-            return toP(F.Exec(syntaxError("catch.without.try")));
+            return doRecover(token.pos, BasicErrorRecoveryAction.CATCH_CLAUSE, "catch.without.try");
         case ASSERT: {
             if (allowAsserts && token.kind == ASSERT) {
                 nextToken();
@@ -2139,6 +2152,13 @@
         }
     }
 
+    private JCStatement doRecover(int startPos, ErrorRecoveryAction action, String key) {
+        int errPos = S.errPos();
+        JCTree stm = action.doRecover(this);
+        S.errPos(errPos);
+        return toP(F.Exec(syntaxError(startPos, List.<JCTree>of(stm), key)));
+    }
+
     /** CatchClause     = CATCH "(" FormalParameter ")" Block
      */
     protected JCCatch catchClause() {
@@ -2920,7 +2940,7 @@
                 JCExpression type;
                 boolean isVoid = token.kind == VOID;
                 if (isVoid) {
-                    type = to(F.at(pos).TypeIdent(TypeTags.VOID));
+                    type = to(F.at(pos).TypeIdent(TypeTag.VOID));
                     nextToken();
                 } else {
                     type = parseType();
@@ -3283,28 +3303,28 @@
     }
 
     /** Return type tag of basic type represented by token,
-     *  -1 if token is not a basic type identifier.
+     *  NONE if token is not a basic type identifier.
      */
-    static int typetag(TokenKind token) {
+    static TypeTag typetag(TokenKind token) {
         switch (token) {
         case BYTE:
-            return TypeTags.BYTE;
+            return TypeTag.BYTE;
         case CHAR:
-            return TypeTags.CHAR;
+            return TypeTag.CHAR;
         case SHORT:
-            return TypeTags.SHORT;
+            return TypeTag.SHORT;
         case INT:
-            return TypeTags.INT;
+            return TypeTag.INT;
         case LONG:
-            return TypeTags.LONG;
+            return TypeTag.LONG;
         case FLOAT:
-            return TypeTags.FLOAT;
+            return TypeTag.FLOAT;
         case DOUBLE:
-            return TypeTags.DOUBLE;
+            return TypeTag.DOUBLE;
         case BOOLEAN:
-            return TypeTags.BOOLEAN;
+            return TypeTag.BOOLEAN;
         default:
-            return -1;
+            return TypeTag.NONE;
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties	Wed Nov 14 16:41:12 2012 -0800
@@ -475,7 +475,7 @@
 
 # 0: string
 compiler.err.illegal.char=\
-    illegal character: \\{0}
+    illegal character: ''{0}''
 
 compiler.err.illegal.char.for.encoding=\
     unmappable character for encoding {0}
@@ -574,7 +574,7 @@
     interface expected here
 
 compiler.err.intf.meth.cant.have.body=\
-    interface methods cannot have body
+    interface abstract methods cannot have body
 
 compiler.err.invalid.annotation.member.type=\
     invalid type for annotation member
@@ -941,6 +941,31 @@
 compiler.err.types.incompatible.diff.ret=\
     types {0} and {1} are incompatible; both define {2}, but with unrelated return types
 
+# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+compiler.err.types.incompatible.unrelated.defaults=\
+    {0} {1} inherits unrelated defaults for {2}({3}) from types {4} and {5}
+
+# 0: kind, 1: type, 2: name, 3: list of type, 4: symbol, 5: symbol
+compiler.err.types.incompatible.abstract.default=\
+    {0} {1} inherits abstract and default for {2}({3}) from types {4} and {5}
+
+# 0: name, 1: kind, 2: symbol
+compiler.err.default.overrides.object.member=\
+    default method {0} in {1} {2} overrides a member of java.lang.Object
+
+# 0: type, 1: message segment
+compiler.err.illegal.default.super.call=\
+    bad type qualifier {0} in default super call\n\
+    {1}
+
+# 0: symbol, 1: type
+compiler.misc.overridden.default=\
+    method {0} is overridden in {2}
+
+# 0: symbol, 1: symbol
+compiler.misc.redundant.supertype=\
+    redundant interface {0} is extended by {1}
+
 compiler.err.unclosed.char.lit=\
     unclosed character literal
 
@@ -1847,6 +1872,11 @@
 
 #####
 
+# 0: type, 1: file name
+compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file=\
+    auxiliary class {0} in {1} should not be accessed from outside its own source file
+
+
 ## The first argument ({0}) is a "kindname".
 # 0: symbol kind, 1: symbol, 2: symbol
 compiler.err.abstract.cant.be.accessed.directly=\
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java	Wed Nov 14 16:41:12 2012 -0800
@@ -81,7 +81,7 @@
 public abstract class JCTree implements Tree, Cloneable, DiagnosticPosition {
 
     /* Tree tag values, identifying kinds of trees */
-    public enum Tag{
+    public enum Tag {
         /** For methods that return an invalid tag if a given condition is not met
          */
         NO_TAG,
@@ -1912,10 +1912,10 @@
      * A constant value given literally.
      */
     public static class JCLiteral extends JCExpression implements LiteralTree {
-        public int typetag;
+        public TypeTag typetag;
         /** value representation */
         public Object value;
-        protected JCLiteral(int typetag, Object value) {
+        protected JCLiteral(TypeTag typetag, Object value) {
             this.typetag = typetag;
             this.value = value;
         }
@@ -1923,33 +1923,15 @@
         public void accept(Visitor v) { v.visitLiteral(this); }
 
         public Kind getKind() {
-            switch (typetag) {
-            case TypeTags.INT:
-                return Kind.INT_LITERAL;
-            case TypeTags.LONG:
-                return Kind.LONG_LITERAL;
-            case TypeTags.FLOAT:
-                return Kind.FLOAT_LITERAL;
-            case TypeTags.DOUBLE:
-                return Kind.DOUBLE_LITERAL;
-            case TypeTags.BOOLEAN:
-                return Kind.BOOLEAN_LITERAL;
-            case TypeTags.CHAR:
-                return Kind.CHAR_LITERAL;
-            case TypeTags.CLASS:
-                return Kind.STRING_LITERAL;
-            case TypeTags.BOT:
-                return Kind.NULL_LITERAL;
-            default:
-                throw new AssertionError("unknown literal kind " + this);
-            }
+            return typetag.getKindLiteral();
         }
+
         public Object getValue() {
             switch (typetag) {
-                case TypeTags.BOOLEAN:
+                case BOOLEAN:
                     int bi = (Integer) value;
                     return (bi != 0);
-                case TypeTags.CHAR:
+                case CHAR:
                     int ci = (Integer) value;
                     char c = (char) ci;
                     if (c != ci)
@@ -1976,12 +1958,12 @@
 
     /**
      * Identifies a basic type.
-     * @see TypeTags
+     * @see TypeTag
      */
     public static class JCPrimitiveTypeTree extends JCExpression implements PrimitiveTypeTree {
         /** the basic type id */
-        public int typetag;
-        protected JCPrimitiveTypeTree(int typetag) {
+        public TypeTag typetag;
+        protected JCPrimitiveTypeTree(TypeTag typetag) {
             this.typetag = typetag;
         }
         @Override
@@ -1989,29 +1971,9 @@
 
         public Kind getKind() { return Kind.PRIMITIVE_TYPE; }
         public TypeKind getPrimitiveTypeKind() {
-            switch (typetag) {
-            case TypeTags.BOOLEAN:
-                return TypeKind.BOOLEAN;
-            case TypeTags.BYTE:
-                return TypeKind.BYTE;
-            case TypeTags.SHORT:
-                return TypeKind.SHORT;
-            case TypeTags.INT:
-                return TypeKind.INT;
-            case TypeTags.LONG:
-                return TypeKind.LONG;
-            case TypeTags.CHAR:
-                return TypeKind.CHAR;
-            case TypeTags.FLOAT:
-                return TypeKind.FLOAT;
-            case TypeTags.DOUBLE:
-                return TypeKind.DOUBLE;
-            case TypeTags.VOID:
-                return TypeKind.VOID;
-            default:
-                throw new AssertionError("unknown primitive type " + this);
-            }
+            return typetag.getPrimitiveTypeKind();
         }
+
         @Override
         public <R,D> R accept(TreeVisitor<R,D> v, D d) {
             return v.visitPrimitiveType(this, d);
@@ -2161,7 +2123,7 @@
         }
         @Override
         public Tag getTag() {
-            return WILDCARD;
+            return Tag.WILDCARD;
         }
     }
 
@@ -2362,8 +2324,8 @@
         JCArrayAccess Indexed(JCExpression indexed, JCExpression index);
         JCFieldAccess Select(JCExpression selected, Name selector);
         JCIdent Ident(Name idname);
-        JCLiteral Literal(int tag, Object value);
-        JCPrimitiveTypeTree TypeIdent(int typetag);
+        JCLiteral Literal(TypeTag tag, Object value);
+        JCPrimitiveTypeTree TypeIdent(TypeTag typetag);
         JCArrayTypeTree TypeArray(JCExpression elemtype);
         JCTypeApply TypeApply(JCExpression clazz, List<JCExpression> arguments);
         JCTypeParameter TypeParameter(Name name, List<JCExpression> bounds);
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1133,28 +1133,28 @@
     public void visitLiteral(JCLiteral tree) {
         try {
             switch (tree.typetag) {
-                case TypeTags.INT:
+                case INT:
                     print(tree.value.toString());
                     break;
-                case TypeTags.LONG:
+                case LONG:
                     print(tree.value + "L");
                     break;
-                case TypeTags.FLOAT:
+                case FLOAT:
                     print(tree.value + "F");
                     break;
-                case TypeTags.DOUBLE:
+                case DOUBLE:
                     print(tree.value.toString());
                     break;
-                case TypeTags.CHAR:
+                case CHAR:
                     print("\'" +
                             Convert.quote(
                             String.valueOf((char)((Number)tree.value).intValue())) +
                             "\'");
                     break;
-                case TypeTags.BOOLEAN:
+                case BOOLEAN:
                     print(((Number)tree.value).intValue() == 1 ? "true" : "false");
                     break;
-                case TypeTags.BOT:
+                case BOT:
                     print("null");
                     break;
                 default:
@@ -1169,31 +1169,31 @@
     public void visitTypeIdent(JCPrimitiveTypeTree tree) {
         try {
             switch(tree.typetag) {
-                case TypeTags.BYTE:
+                case BYTE:
                     print("byte");
                     break;
-                case TypeTags.CHAR:
+                case CHAR:
                     print("char");
                     break;
-                case TypeTags.SHORT:
+                case SHORT:
                     print("short");
                     break;
-                case TypeTags.INT:
+                case INT:
                     print("int");
                     break;
-                case TypeTags.LONG:
+                case LONG:
                     print("long");
                     break;
-                case TypeTags.FLOAT:
+                case FLOAT:
                     print("float");
                     break;
-                case TypeTags.DOUBLE:
+                case DOUBLE:
                     print("double");
                     break;
-                case TypeTags.BOOLEAN:
+                case BOOLEAN:
                     print("boolean");
                     break;
-                case TypeTags.VOID:
+                case VOID:
                     print("void");
                     break;
                 default:
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -34,6 +34,7 @@
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import static com.sun.tools.javac.code.Flags.*;
+import static com.sun.tools.javac.code.TypeTag.BOT;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 import static com.sun.tools.javac.tree.JCTree.Tag.BLOCK;
 import static com.sun.tools.javac.tree.JCTree.Tag.SYNCHRONIZED;
@@ -300,7 +301,7 @@
         if (!tree.hasTag(LITERAL))
             return false;
         JCLiteral lit = (JCLiteral) tree;
-        return (lit.typetag == TypeTags.BOT);
+        return (lit.typetag == BOT);
     }
 
     public static String getCommentText(Env<?> env, JCTree tree) {
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java	Wed Nov 14 16:41:12 2012 -0800
@@ -35,7 +35,7 @@
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.Kinds.*;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 
 /** Factory class for trees.
  *
@@ -426,13 +426,13 @@
         return tree;
     }
 
-    public JCLiteral Literal(int tag, Object value) {
+    public JCLiteral Literal(TypeTag tag, Object value) {
         JCLiteral tree = new JCLiteral(tag, value);
         tree.pos = pos;
         return tree;
     }
 
-    public JCPrimitiveTypeTree TypeIdent(int typetag) {
+    public JCPrimitiveTypeTree TypeIdent(TypeTag typetag) {
         JCPrimitiveTypeTree tree = new JCPrimitiveTypeTree(typetag);
         tree.pos = pos;
         return tree;
@@ -629,10 +629,10 @@
     public JCExpression Type(Type t) {
         if (t == null) return null;
         JCExpression tp;
-        switch (t.tag) {
+        switch (t.getTag()) {
         case BYTE: case CHAR: case SHORT: case INT: case LONG: case FLOAT:
         case DOUBLE: case BOOLEAN: case VOID:
-            tp = TypeIdent(t.tag);
+            tp = TypeIdent(t.getTag());
             break;
         case TYPEVAR:
             tp = Ident(t.tsym);
@@ -644,7 +644,7 @@
         }
         case CLASS:
             Type outer = t.getEnclosingType();
-            JCExpression clazz = outer.tag == CLASS && t.tsym.owner.kind == TYP
+            JCExpression clazz = outer.hasTag(CLASS) && t.tsym.owner.kind == TYP
                 ? Select(Type(outer), t.tsym)
                 : QualIdent(t.tsym);
             tp = t.getTypeArguments().isEmpty()
@@ -849,7 +849,7 @@
      *  depending on whether the method invocation expression's type is void.
      */
     public JCStatement Call(JCExpression apply) {
-        return apply.type.tag == VOID ? Exec(apply) : Return(apply);
+        return apply.type.hasTag(VOID) ? Exec(apply) : Return(apply);
     }
 
     /** Construct an assignment from a variable symbol and a right hand side.
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Constants.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Constants.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2012, 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
@@ -27,8 +27,6 @@
 
 import com.sun.tools.javac.code.Type;
 
-import static com.sun.tools.javac.code.TypeTags.*;
-
 /**
  * Utilities for operating on constant values.
  *
@@ -48,7 +46,7 @@
     public static Object decode(Object value, Type type) {
         if (value instanceof Integer) {
             int i = (Integer) value;
-            switch (type.tag) {
+            switch (type.getTag()) {
             case BOOLEAN:  return i != 0;
             case CHAR:     return (char) i;
             case BYTE:     return (byte) i;
@@ -64,7 +62,7 @@
      */
     public static String format(Object value, Type type) {
         value = decode(value, type);
-        switch (type.tag) {
+        switch (type.getTag()) {
         case BYTE:      return formatByte((Byte) value);
         case LONG:      return formatLong((Long) value);
         case FLOAT:     return formatFloat((Float) value);
--- a/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/Names.java	Wed Nov 14 16:41:12 2012 -0800
@@ -170,6 +170,10 @@
     public final Name ex;
     public final Name package_info;
 
+    //lambda-related
+    public final Name lambda;
+    public final Name metaFactory;
+
     public final Name.Table table;
 
     public Names(Context context) {
@@ -298,6 +302,10 @@
         deprecated = fromString("deprecated");
         ex = fromString("ex");
         package_info = fromString("package-info");
+
+        //lambda-related
+        lambda = fromString("lambda");
+        metaFactory = fromString("metaFactory");
     }
 
     protected Name.Table createTable(Options options) {
--- a/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -39,7 +39,7 @@
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.code.Types;
 
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.util.LayoutCharacters.*;
 import static com.sun.tools.javac.util.RichDiagnosticFormatter.RichConfiguration.*;
@@ -295,7 +295,7 @@
                     conflicts.contains(s))) {
                     List<Name> l = List.nil();
                     Symbol s2 = s;
-                    while (s2.type.getEnclosingType().tag == CLASS
+                    while (s2.type.getEnclosingType().hasTag(CLASS)
                             && s2.owner.kind == Kinds.TYP) {
                         l = l.prepend(s2.getSimpleName());
                         s2 = s2.owner;
@@ -414,7 +414,7 @@
                     ? ownerName
                     : s.name.toString();
                 if (s.type != null) {
-                    if (s.type.tag == FORALL) {
+                    if (s.type.hasTag(FORALL)) {
                         ms = "<" + visitTypes(s.type.getTypeArguments(), locale) + ">" + ms;
                     }
                     ms += "(" + printMethodArgs(
@@ -532,8 +532,8 @@
                 nameSimplifier.addUsage(t.tsym);
 
                 boolean boundErroneous = bounds.head == null ||
-                                         bounds.head.tag == NONE ||
-                                         bounds.head.tag == ERROR;
+                                         bounds.head.hasTag(NONE) ||
+                                         bounds.head.hasTag(ERROR);
 
                 if ((t.tsym.flags() & SYNTHETIC) == 0) {
                     //this is a true typevar
--- a/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationValueImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/AnnotationValueImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -29,8 +29,8 @@
 
 import com.sun.tools.javac.code.Attribute;
 import com.sun.tools.javac.code.Symbol.*;
-import com.sun.tools.javac.code.TypeTags;
 
+import static com.sun.tools.javac.code.TypeTag.BOOLEAN;
 
 /**
  * Represents a value of an annotation type element.
@@ -76,7 +76,7 @@
         public Object value;
 
         public void visitConstant(Attribute.Constant c) {
-            if (c.type.tag == TypeTags.BOOLEAN) {
+            if (c.type.hasTag(BOOLEAN)) {
                 // javac represents false and true as integers 0 and 1
                 value = Boolean.valueOf(
                                 ((Integer)c.value).intValue() != 0);
@@ -133,7 +133,7 @@
         }
 
         public void visitConstant(Attribute.Constant c) {
-            if (c.type.tag == TypeTags.BOOLEAN) {
+            if (c.type.hasTag(BOOLEAN)) {
                 // javac represents false and true as integers 0 and 1
                 sb.append(((Integer)c.value).intValue() != 0);
             } else {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -45,7 +45,6 @@
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Type.ClassType;
-import com.sun.tools.javac.code.TypeTags;
 
 import com.sun.tools.javac.comp.AttrContext;
 import com.sun.tools.javac.comp.Env;
@@ -63,6 +62,7 @@
 import com.sun.tools.javac.util.Position;
 
 import static com.sun.tools.javac.code.Kinds.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
 import static com.sun.tools.javac.tree.JCTree.Tag.*;
 
 /**
@@ -164,7 +164,7 @@
         if (isEnum() || isInterface() || isAnnotationType()) {
             return false;
         }
-        for (Type t = type; t.tag == TypeTags.CLASS; t = env.types.supertype(t)) {
+        for (Type t = type; t.hasTag(CLASS); t = env.types.supertype(t)) {
             if (t.tsym == env.syms.errorType.tsym ||
                 t.tsym == env.syms.exceptionType.tsym) {
                 return false;
@@ -201,7 +201,7 @@
         if (isEnum() || isInterface() || isAnnotationType()) {
             return false;
         }
-        for (Type t = type; t.tag == TypeTags.CLASS; t = env.types.supertype(t)) {
+        for (Type t = type; t.hasTag(CLASS); t = env.types.supertype(t)) {
             if (t.tsym == env.syms.exceptionType.tsym) {
                 return true;
             }
@@ -217,7 +217,7 @@
         if (isEnum() || isInterface() || isAnnotationType()) {
             return false;
         }
-        for (Type t = type; t.tag == TypeTags.CLASS; t = env.types.supertype(t)) {
+        for (Type t = type; t.hasTag(CLASS); t = env.types.supertype(t)) {
             if (t.tsym == env.syms.errorType.tsym) {
                 return true;
             }
@@ -232,7 +232,7 @@
         if (isEnum() || isInterface() || isAnnotationType()) {
             return false;
         }
-        for (Type t = type; t.tag == TypeTags.CLASS; t = env.types.supertype(t)) {
+        for (Type t = type; t.hasTag(CLASS); t = env.types.supertype(t)) {
             if (t.tsym == env.syms.throwableType.tsym) {
                 return true;
             }
--- a/langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -32,12 +32,13 @@
 import com.sun.tools.javac.code.Flags;
 import com.sun.tools.javac.code.Symbol.ClassSymbol;
 import com.sun.tools.javac.code.Symbol.VarSymbol;
-import com.sun.tools.javac.code.TypeTags;
 
 import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
 
 import com.sun.tools.javac.util.Position;
 
+import static com.sun.tools.javac.code.TypeTag.BOOLEAN;
+
 /**
  * Represents a field in a java class.
  *
@@ -103,7 +104,7 @@
      */
     public Object constantValue() {
         Object result = sym.getConstValue();
-        if (result != null && sym.type.tag == TypeTags.BOOLEAN)
+        if (result != null && sym.type.hasTag(BOOLEAN))
             // javac represents false and true as Integers 0 and 1
             result = Boolean.valueOf(((Integer)result).intValue() != 0);
         return result;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java	Wed Nov 14 16:41:12 2012 -0800
@@ -81,6 +81,9 @@
             docenv.makeAnnotationTypeElementDoc(meth, docComment, tree, lineMap);
         else
             docenv.makeMethodDoc(meth, docComment, tree, lineMap);
+
+        // release resources
+        tree.body = null;
     }
 
     @Override
--- a/langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -31,10 +31,11 @@
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type;
-import com.sun.tools.javac.code.TypeTags;
 import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
 import com.sun.tools.javac.util.Position;
 
+import static com.sun.tools.javac.code.TypeTag.CLASS;
+
 /**
  * Represents a method of a java class.
  *
@@ -129,7 +130,7 @@
 
         ClassSymbol origin = (ClassSymbol)sym.owner;
         for (Type t = env.types.supertype(origin.type);
-             t.tag == TypeTags.CLASS;
+             t.hasTag(CLASS);
              t = env.types.supertype(t)) {
             ClassSymbol c = (ClassSymbol)t.tsym;
             for (Scope.Entry e = c.members().lookup(sym.name); e.scope != null; e = e.next()) {
@@ -161,7 +162,7 @@
 
         ClassSymbol origin = (ClassSymbol)sym.owner;
         for (Type t = env.types.supertype(origin.type);
-             t.tag == TypeTags.CLASS;
+             t.hasTag(CLASS);
              t = env.types.supertype(t)) {
             ClassSymbol c = (ClassSymbol)t.tsym;
             for (Scope.Entry e = c.members().lookup(sym.name); e.scope != null; e = e.next()) {
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ParameterizedTypeImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ParameterizedTypeImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -31,7 +31,7 @@
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Type.ClassType;
 
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.CLASS;
 
 
 /**
@@ -95,7 +95,7 @@
      * Return null is this is a top-level type.
      */
     public com.sun.javadoc.Type containingType() {
-        if (type.getEnclosingType().tag == CLASS) {
+        if (type.getEnclosingType().hasTag(CLASS)) {
             // This is the type of an inner class.
             return TypeMaker.getType(env, type.getEnclosingType());
         }
@@ -134,7 +134,7 @@
             return TypeMaker.getTypeName(cl, full);
         }
         StringBuilder s = new StringBuilder();
-        if (cl.getEnclosingType().tag != CLASS) {               // if not an inner class...
+        if (!(cl.getEnclosingType().hasTag(CLASS))) {               // if not an inner class...
             s.append(TypeMaker.getTypeName(cl, full));
         } else {
             ClassType encl = (ClassType)cl.getEnclosingType();
--- a/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java	Wed Nov 14 16:41:12 2012 -0800
@@ -267,8 +267,6 @@
             }
 
             if (referencedClass == null) { /* may just not be in this run */
-//                docenv().warning(holder, "tag.see.class_not_found",
-//                                 where, text);
                 // check if it's a package name
                 referencedPackage = docenv().lookupPackage(where);
                 return;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java	Wed Nov 14 16:41:12 2012 -0800
@@ -237,6 +237,9 @@
 
         SerialFieldTag[] sfTag = spfDoc.serialFieldTags();
         for (int i = 0; i < sfTag.length; i++) {
+            if (sfTag[i].fieldName() == null || sfTag[i].fieldType() == null) // ignore malformed @serialField tags
+                continue;
+
             Name fieldName = names.fromString(sfTag[i].fieldName());
 
             // Look for a FieldDocImpl that is documented by serialFieldTagImpl.
--- a/langtools/src/share/classes/com/sun/tools/javadoc/Start.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/Start.java	Wed Nov 14 16:41:12 2012 -0800
@@ -54,6 +54,8 @@
  * @author Neal Gafter (rewrite)
  */
 class Start {
+    /** Context for this invocation. */
+    private final Context context;
 
     private final String defaultDocletClassName;
     private final ClassLoader docletParentClassLoader;
@@ -69,7 +71,7 @@
 
     private long defaultFilter = PUBLIC | PROTECTED;
 
-    private Messager messager;
+    private final Messager messager;
 
     String docLocale = "";
 
@@ -96,8 +98,8 @@
           PrintWriter noticeWriter,
           String defaultDocletClassName,
           ClassLoader docletParentClassLoader) {
-        Context tempContext = new Context(); // interim context until option decoding completed
-        messager = new Messager(tempContext, programName, errWriter, warnWriter, noticeWriter);
+        context = new Context();
+        messager = new Messager(context, programName, errWriter, warnWriter, noticeWriter);
         this.defaultDocletClassName = defaultDocletClassName;
         this.docletParentClassLoader = docletParentClassLoader;
     }
@@ -108,8 +110,8 @@
 
     Start(String programName, String defaultDocletClassName,
           ClassLoader docletParentClassLoader) {
-        Context tempContext = new Context(); // interim context until option decoding completed
-        messager = new Messager(tempContext, programName);
+        context = new Context();
+        messager = new Messager(context, programName);
         this.defaultDocletClassName = defaultDocletClassName;
         this.docletParentClassLoader = docletParentClassLoader;
     }
@@ -219,16 +221,6 @@
         ListBuffer<String> subPackages = new ListBuffer<String>();
         ListBuffer<String> excludedPackages = new ListBuffer<String>();
 
-        Context context = new Context();
-        // Setup a new Messager, using the same initial parameters as the
-        // existing Messager, except that this one will be able to use any
-        // options that may be set up below.
-        Messager.preRegister(context,
-                messager.programName,
-                messager.getWriter(Log.WriterKind.ERROR),
-                messager.getWriter(Log.WriterKind.WARNING),
-                messager.getWriter(Log.WriterKind.NOTICE));
-
         Options compOpts = Options.instance(context);
         boolean docClasses = false;
 
@@ -368,6 +360,7 @@
                 javaNames.append(arg);
             }
         }
+        compOpts.notifyListeners();
 
         if (javaNames.isEmpty() && subPackages.isEmpty()) {
             usageError("main.No_packages_or_classes_specified");
@@ -394,14 +387,13 @@
                 // legacy?
                 languageVersion == null || languageVersion == LanguageVersion.JAVA_1_1, quiet);
 
+        // release resources
+        comp = null;
+
         // pass off control to the doclet
         boolean ok = root != null;
         if (ok) ok = docletInvoker.start(root);
 
-        Messager docletMessager = Messager.instance0(context);
-        messager.nwarnings += docletMessager.nwarnings;
-        messager.nerrors += docletMessager.nerrors;
-
         // We're done.
         if (compOpts.get("-verbose") != null) {
             tm = System.currentTimeMillis() - tm;
--- a/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java	Wed Nov 14 16:41:12 2012 -0800
@@ -33,7 +33,7 @@
 import com.sun.tools.javac.code.Type.ClassType;
 import com.sun.tools.javac.code.Type.TypeVar;
 import com.sun.tools.javac.util.List;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.ARRAY;
 
 /**
  *  <p><b>This is NOT part of any supported API.
@@ -57,7 +57,7 @@
         if (env.legacyDoclet) {
             t = env.types.erasure(t);
         }
-        switch (t.tag) {
+        switch (t.getTag()) {
         case CLASS:
             if (ClassDocImpl.isGeneric((ClassSymbol)t.tsym)) {
                 return env.getParameterizedType((ClassType)t);
@@ -107,10 +107,10 @@
     }
 
     public static String getTypeName(Type t, boolean full) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case ARRAY:
             StringBuilder s = new StringBuilder();
-            while (t.tag == ARRAY) {
+            while (t.hasTag(ARRAY)) {
                 s.append("[]");
                 t = ((ArrayType)t).elemtype;
             }
@@ -129,10 +129,10 @@
      * Class names are qualified if "full" is true.
      */
     static String getTypeString(DocEnv env, Type t, boolean full) {
-        switch (t.tag) {
+        switch (t.getTag()) {
         case ARRAY:
             StringBuilder s = new StringBuilder();
-            while (t.tag == ARRAY) {
+            while (t.hasTag(ARRAY)) {
                 s.append("[]");
                 t = env.types.elemtype(t);
             }
@@ -203,7 +203,7 @@
         private com.sun.javadoc.Type skipArrays() {
             if (skipArraysCache == null) {
                 Type t;
-                for (t = arrayType; t.tag == ARRAY; t = env.types.elemtype(t)) { }
+                for (t = arrayType; t.hasTag(ARRAY); t = env.types.elemtype(t)) { }
                 skipArraysCache = TypeMaker.getType(env, t);
             }
             return skipArraysCache;
@@ -216,7 +216,7 @@
          */
         public String dimension() {
             StringBuilder dimension = new StringBuilder();
-            for (Type t = arrayType; t.tag == ARRAY; t = env.types.elemtype(t)) {
+            for (Type t = arrayType; t.hasTag(ARRAY); t = env.types.elemtype(t)) {
                 dimension.append("[]");
             }
             return dimension.toString();
--- a/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 2012, 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
@@ -64,7 +64,6 @@
 main.incompatible.access.flags=More than one of -public, -private, -package, or -protected specified.
 main.cant.read=cannot read {0}
 main.Loading_source_files_for_package=Loading source files for package {0}...
-main.Loading_source_file_for_class=Loading source file for class {0}...
 main.Loading_source_file=Loading source file {0}...
 main.Building_tree=Constructing Javadoc information...
 main.no_source_files_for_package=No source files for package {0}
@@ -96,13 +95,12 @@
 tag.see.can_not_find_member=Tag {0}: can''t find {1} in {2}
 tag.see.no_close_bracket_on_url=Tag {0}: missing final ''>'': "{1}"
 tag.see.no_close_quote=Tag {0}: no final close quote: "{1}"
-tag.see.class_not_found=class {0} not found for @see tag: "{1}"
 tag.see.class_not_specified=Tag {0}: class not specified: "{1}"
 tag.see.illegal_character=Tag {0}:illegal character: "{1}" in "{2}"
 tag.see.malformed_see_tag=Tag {0}: malformed: "{1}"
-tag.throws.exception_not_found={0} tag, class {1} not found.
 tag.End_delimiter_missing_for_possible_SeeTag=End Delimiter } missing for possible See Tag in comment string: "{0}"
 tag.Improper_Use_Of_Link_Tag=Missing closing ''}'' character for inline tag: "{0}"
+tag.serialField.illegal_character=illegal character {0} in @serialField tag: {1}.
 javadoc.File_Read_Error=Error while reading file {0}
 javadoc.Body_missing_from_html_file=Body tag missing from HTML file
 javadoc.End_body_missing_from_html_file=Close body tag missing from HTML file
@@ -110,4 +108,3 @@
 javadoc.class_not_found=Class {0} not found.
 javadoc.error=error
 javadoc.warning=warning
-tag.serialField.illegal_character=illegal character {0} in @serialField tag: {1}.
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahFileManager.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, 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
@@ -44,7 +44,7 @@
 class JavahFileManager extends JavacFileManager {
     private JavahFileManager(Context context, Charset charset) {
         super(context, true, charset);
-        setIgnoreSymbolFile(true);
+        setSymbolFileEnabled(false);
     }
 
     static JavahFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) {
@@ -56,8 +56,4 @@
 
         return new JavahFileManager(javac_context, null);
     }
-
-    void setIgnoreSymbolFile(boolean b) {
-        ignoreSymbolFile = b;
-    }
 }
--- a/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javah/JavahTask.java	Wed Nov 14 16:41:12 2012 -0800
@@ -500,7 +500,7 @@
         g.setForce(force);
 
         if (fileManager instanceof JavahFileManager)
-            ((JavahFileManager) fileManager).setIgnoreSymbolFile(true);
+            ((JavahFileManager) fileManager).setSymbolFileEnabled(false);
 
         JavaCompiler c = ToolProvider.getSystemJavaCompiler();
         List<String> opts = new ArrayList<String>();
--- a/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/src/share/classes/com/sun/tools/javap/JavapFileManager.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2012, 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
@@ -44,7 +44,7 @@
 public class JavapFileManager extends JavacFileManager {
     private JavapFileManager(Context context, Charset charset) {
         super(context, true, charset);
-        setIgnoreSymbolFile(true);
+        setSymbolFileEnabled(false);
     }
 
     public static JavapFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) {
@@ -56,8 +56,4 @@
 
         return new JavapFileManager(javac_context, null);
     }
-
-    void setIgnoreSymbolFile(boolean b) {
-        ignoreSymbolFile = b;
-    }
 }
--- a/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -77,17 +77,19 @@
     //Output dir = Input Dir
     private static final String[] ARGS1 =
         new String[] {
-            "-d", BUG_ID + "-1", "-sourcepath",
-            "blah" + String.valueOf(File.pathSeparatorChar) +
-                BUG_ID + "-1" + String.valueOf(File.pathSeparatorChar) +
-                "blah", "pkg"};
+            "-d", BUG_ID + "-1",
+            "-sourcepath",
+                "blah" + File.pathSeparator + BUG_ID + "-1" + File.pathSeparator + "blah",
+            "pkg"};
 
     //Exercising -docfilessubdirs and -excludedocfilessubdir
     private static final String[] ARGS2 =
         new String[] {
-            "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR,
-            "-docfilessubdirs", "-excludedocfilessubdir",
-            "subdir-excluded1:subdir-excluded2", "pkg"};
+            "-d", BUG_ID + "-2",
+            "-sourcepath", SRC_DIR,
+            "-docfilessubdirs",
+            "-excludedocfilessubdir", "subdir-excluded1:subdir-excluded2",
+            "pkg"};
 
     //Output dir = "", Input dir = ""
     private static final String[] ARGS0 =
--- a/langtools/test/com/sun/javadoc/testIndex/TestIndex.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/com/sun/javadoc/testIndex/TestIndex.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -53,28 +53,28 @@
 
         //Test index-all.html
         {BUG_ID + FS + "index-all.html",
-            "<a href=\"./pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">C</span></a>" +
-            " - Class in <a href=\"./pkg/package-summary.html\">pkg</a>"},
+            "<a href=\"pkg/C.html\" title=\"class in pkg\"><span class=\"strong\">C</span></a>" +
+            " - Class in <a href=\"pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<a href=\"./pkg/Interface.html\" title=\"interface in pkg\">" +
+            "<a href=\"pkg/Interface.html\" title=\"interface in pkg\">" +
             "<span class=\"strong\">Interface</span></a> - Interface in " +
-            "<a href=\"./pkg/package-summary.html\">pkg</a>"},
+            "<a href=\"pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<a href=\"./pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
+            "<a href=\"pkg/AnnotationType.html\" title=\"annotation in pkg\">" +
             "<span class=\"strong\">AnnotationType</span></a> - Annotation Type in " +
-            "<a href=\"./pkg/package-summary.html\">pkg</a>"},
+            "<a href=\"pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<a href=\"./pkg/Coin.html\" title=\"enum in pkg\">" +
+            "<a href=\"pkg/Coin.html\" title=\"enum in pkg\">" +
             "<span class=\"strong\">Coin</span></a> - Enum in " +
-            "<a href=\"./pkg/package-summary.html\">pkg</a>"},
+            "<a href=\"pkg/package-summary.html\">pkg</a>"},
         {BUG_ID + FS + "index-all.html",
-            "Class in <a href=\"./package-summary.html\">&lt;Unnamed&gt;</a>"},
+            "Class in <a href=\"package-summary.html\">&lt;Unnamed&gt;</a>"},
         {BUG_ID + FS + "index-all.html",
-            "<dl>" + NL + "<dt><span class=\"strong\"><a href=\"./pkg/C.html#Java\">" +
-            "Java</a></span> - Static variable in class pkg.<a href=\"./pkg/C.html\" " +
+            "<dl>" + NL + "<dt><span class=\"strong\"><a href=\"pkg/C.html#Java\">" +
+            "Java</a></span> - Static variable in class pkg.<a href=\"pkg/C.html\" " +
             "title=\"class in pkg\">C</a></dt>" + NL + "<dd>&nbsp;</dd>" + NL +
-            "<dt><span class=\"strong\"><a href=\"./pkg/C.html#JDK\">JDK</a></span> " +
-            "- Static variable in class pkg.<a href=\"./pkg/C.html\" title=\"class in pkg\">" +
+            "<dt><span class=\"strong\"><a href=\"pkg/C.html#JDK\">JDK</a></span> " +
+            "- Static variable in class pkg.<a href=\"pkg/C.html\" title=\"class in pkg\">" +
             "C</a></dt>" + NL + "<dd>&nbsp;</dd>" + NL + "</dl>"},
     };
     private static final String[][] NEGATED_TEST = NO_TEST;
--- a/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, 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
@@ -663,14 +663,14 @@
             // TYPE PARAMETER IN INDEX
             //=================================
             {BUG_ID + FS + "index-all.html",
-                "<span class=\"strong\"><a href=\"./pkg2/Foo.html#method(java.util.Vector)\">" +
+                "<span class=\"strong\"><a href=\"pkg2/Foo.html#method(java.util.Vector)\">" +
                 "method(Vector&lt;Object&gt;)</a></span>"
             },
             //=================================
             // TYPE PARAMETER IN INDEX
             //=================================
             {BUG_ID + FS + "index-all.html",
-                "<span class=\"strong\"><a href=\"./pkg2/Foo.html#method(java.util.Vector)\">" +
+                "<span class=\"strong\"><a href=\"pkg2/Foo.html#method(java.util.Vector)\">" +
                 "method(Vector&lt;Object&gt;)</a></span>"
             },
         };
--- a/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2012, 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
@@ -52,7 +52,7 @@
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
         {BUG_ID + "-1" + FS + "index-all.html",
-            "<li><a href=\"./com/pkg/package-summary.html\">Package</a></li>"
+            "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
         },
         {BUG_ID + "-1" + FS + "help-doc.html",
             "<li><a href=\"com/pkg/package-summary.html\">Package</a></li>"
--- a/langtools/test/tools/javac/6889255/T6889255.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/6889255/T6889255.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, 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
@@ -36,7 +36,7 @@
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Type.ClassType;
-import com.sun.tools.javac.code.TypeTags;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.jvm.ClassReader;
 import com.sun.tools.javac.util.Context;
@@ -436,7 +436,7 @@
         // The rest of this method assumes the local conventions in the test program
         Type t = v.type;
         String s;
-        if (t.tag == TypeTags.CLASS)
+        if (t.hasTag(TypeTag.CLASS))
             s = ((ClassType) t).tsym.name.toString();
         else
             s = t.toString();
--- a/langtools/test/tools/javac/7132880/T7132880.out	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/7132880/T7132880.out	Wed Nov 14 16:41:12 2012 -0800
@@ -1,4 +1,4 @@
 T7132880.java:23:12: compiler.err.cant.apply.symbol: kindname.method, m1, java.lang.Integer, java.lang.String, kindname.class, Outer.Inner1, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer))
-T7132880.java:33:12: compiler.err.cant.apply.symbols: kindname.method, m1, java.lang.String,{(compiler.misc.inapplicable.method: kindname.method, Outer.Inner2, m1(java.lang.Double), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Double))),(compiler.misc.inapplicable.method: kindname.method, Outer.Inner2, m1(java.lang.Integer), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer)))}
+T7132880.java:33:12: compiler.err.cant.apply.symbols: kindname.method, m1, java.lang.String,{(compiler.misc.inapplicable.method: kindname.method, Outer.Inner2, m1(java.lang.Integer), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Integer))),(compiler.misc.inapplicable.method: kindname.method, Outer.Inner2, m1(java.lang.Double), (compiler.misc.no.conforming.assignment.exists: (compiler.misc.inconvertible.types: java.lang.String, java.lang.Double)))}
 T7132880.java:43:12: compiler.err.ref.ambiguous: m2, kindname.method, m2(java.lang.Object,int), Outer.Inner3, kindname.method, m2(int,java.lang.Object), Outer.Inner3
 3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/8002286/T8002286.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,12 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8002286
+ * @summary Resolve should support nested resolution contexts
+ * @compile/fail/ref=T8002286.out -XDrawDiagnostics T8002286.java
+ */
+class T8002286 {
+    @Anno(nonExistent())
+    static class Test { }
+
+    @interface Anno { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/8002286/T8002286.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+T8002286.java:8:22: compiler.err.cant.resolve.location.args: kindname.method, value, , , (compiler.misc.location: kindname.annotation, T8002286.Anno, null)
+T8002286.java:8:11: compiler.err.cant.resolve.location.args: kindname.method, nonExistent, , , (compiler.misc.location: kindname.class, T8002286, null)
+2 errors
--- a/langtools/test/tools/javac/Diagnostics/6799605/T6799605.out	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/Diagnostics/6799605/T6799605.out	Wed Nov 14 16:41:12 2012 -0800
@@ -1,4 +1,4 @@
-T6799605.java:17:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.inferred.do.not.conform.to.upper.bounds: compiler.misc.type.captureof: 1, ?, T6799605<compiler.misc.type.captureof: 1, ?>))}
-T6799605.java:18:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.inferred.do.not.conform.to.eq.bounds: compiler.misc.type.captureof: 2, ?, compiler.misc.type.captureof: 2, ?,compiler.misc.type.captureof: 1, ?)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T))}
-T6799605.java:19:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.inferred.do.not.conform.to.eq.bounds: compiler.misc.type.captureof: 3, ?, compiler.misc.type.captureof: 3, ?,compiler.misc.type.captureof: 2, ?,compiler.misc.type.captureof: 1, ?)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T))}
+T6799605.java:17:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.inferred.do.not.conform.to.upper.bounds: compiler.misc.type.captureof: 1, ?, T6799605<compiler.misc.type.captureof: 1, ?>)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T))}
+T6799605.java:18:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.inferred.do.not.conform.to.eq.bounds: compiler.misc.type.captureof: 2, ?, compiler.misc.type.captureof: 2, ?,compiler.misc.type.captureof: 1, ?)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T))}
+T6799605.java:19:9: compiler.err.cant.apply.symbols: kindname.method, m, T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>,{(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.method, T6799605, <T>m(T6799605<T>,T6799605<T>,T6799605<T>), (compiler.misc.inferred.do.not.conform.to.eq.bounds: compiler.misc.type.captureof: 3, ?, compiler.misc.type.captureof: 3, ?,compiler.misc.type.captureof: 2, ?,compiler.misc.type.captureof: 1, ?))}
 3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/Paths/TestCompileJARInClassPath.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2002, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6725230
+ * @summary Test to make sure that java Compilation with JSR199 does not ignore
+ * Class-Path in manifest
+ * @author vicente.romero
+ * @build TestCompileJARInClassPath
+ * @run main TestCompileJARInClassPath
+ */
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.List;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+public class TestCompileJARInClassPath {
+
+    public static void main(String args[]) throws Exception {
+        TestCompileJARInClassPath theTest = new TestCompileJARInClassPath();
+        theTest.run();
+    }
+
+    void run() throws Exception {
+        try {
+            clean();
+            generateFilesNeeded();
+            compileWithJSR199();
+        } finally {
+            clean();
+        }
+    }
+
+    void writeFile(String f, String contents) throws IOException {
+        PrintStream s = new PrintStream(new FileOutputStream(f));
+        s.println(contents);
+        s.close();
+    }
+
+    void rm(String filename) throws Exception {
+        File f = new File(filename);
+        f.delete();
+        if (f.exists())
+            throw new Exception(filename + ": couldn't remove");
+    }
+
+    void clean() throws Exception {
+        rm("C1.java");
+        rm("C1.class");
+        rm("C1.jar");
+
+        rm("C2.java");
+        rm("C2.class");
+        rm("C2.jar");
+        rm("MANIFEST.MF");
+
+        rm("C3.java");
+        rm("C3.class");
+    }
+
+    void generateFilesNeeded() throws Exception {
+        sun.tools.jar.Main jarGenerator = new sun.tools.jar.Main(System.out, System.err, "jar");
+
+        writeFile("C1.java",
+                  "public class C1 {public static void f() {}}");
+        com.sun.tools.javac.Main.compile(new String[]{"C1.java"});
+        jarGenerator.run(new String[] {"cf", "C1.jar", "C1.class"});
+
+        writeFile("C2.java",
+                  "public class C2 {public static void g() {}}");
+        writeFile("MANIFEST.MF",
+                  "Manifest-Version: 1.0\n" +
+                  "Class-Path: C1.jar\n" +
+                  "Main-Class: C2");
+        com.sun.tools.javac.Main.compile(new String[]{"C2.java"});
+        jarGenerator.run(new String[] {"cfm", "C2.jar", "MANIFEST.MF", "C2.class"});
+
+        writeFile("C3.java",
+                  "public class C3 {public static void h() {C2.g(); C1.f();}}");
+    }
+
+    void compileWithJSR199() throws IOException {
+        String cpath = "C2.jar";
+        File clientJarFile = new File(cpath);
+        File sourceFileToCompile = new File("C3.java");
+
+
+        javax.tools.JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
+        DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
+        StandardJavaFileManager stdFileManager = javac.getStandardFileManager(diagnostics, null, null);
+
+        List<File> files = new ArrayList<>();
+        files.add(clientJarFile);
+
+        stdFileManager.setLocation(StandardLocation.CLASS_PATH, files);
+
+        Iterable<? extends JavaFileObject> sourceFiles = stdFileManager.getJavaFileObjects(sourceFileToCompile);
+
+        if (!javac.getTask(null, stdFileManager, diagnostics, null, null, sourceFiles).call()) {
+            throw new AssertionError("compilation failed");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,20 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Base annotation specify itself as ContainerAnnotation
+ * @compile/fail/ref=BaseAnnoAsContainerAnno.out -XDrawDiagnostics BaseAnnoAsContainerAnno.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(Foo.class)
+@ContainerFor(Foo.class)
+@interface Foo {
+    Foo[] value() default {};
+}
+
+@Foo() @Foo()
+public class BaseAnnoAsContainerAnno {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+BaseAnnoAsContainerAnno.java:15:11: compiler.err.cyclic.annotation.element
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/ClassReaderDefault.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ *
+ * @bug 7199925
+ *
+ * @clean ClassReaderDefault SeparateCompile
+ * @compile ClassReaderDefault.java
+ * @compile SeparateCompile.java
+ */
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+public class ClassReaderDefault {
+}
+
+@ContainerFor(Foo.class)
+@interface FooContainer {
+     Foo[] value();
+     int f() default 0;
+}
+
+@ContainedBy(FooContainer.class)
+@interface Foo {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,26 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Cyclic annotation not allowed
+ * @compile/fail/ref=CyclicAnnotation.out -XDrawDiagnostics CyclicAnnotation.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(Foo.class)
+@ContainerFor(Baz.class)
+@interface Baz {
+    Foo[] value() default {};
+}
+
+@ContainedBy(Baz.class)
+@ContainerFor(Foo.class)
+@interface Foo{
+    Baz[] value() default {};
+}
+
+@Foo(value = {@Baz,@Baz})
+@Baz(value = {@Foo,@Foo})
+public class CyclicAnnotation {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/CyclicAnnotation.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,6 @@
+CyclicAnnotation.java:12:1: compiler.err.invalid.container.wrong.containerfor: Foo, Baz
+CyclicAnnotation.java:13:1: compiler.err.invalid.container.wrong.containedby: Foo, Baz
+CyclicAnnotation.java:15:11: compiler.err.cyclic.annotation.element
+CyclicAnnotation.java:18:1: compiler.err.invalid.container.wrong.containerfor: Baz, Foo
+CyclicAnnotation.java:19:1: compiler.err.invalid.container.wrong.containedby: Baz, Foo
+5 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DefaultCasePresent.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Default case for methods other than value() in ContainerAnno
+ * @compile DefaultCasePresent.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer {
+    Foo[] value();
+    String other() default "other-method";
+}
+
+@Foo @Foo
+public class DefaultCasePresent {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DocumentedContainerAnno.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,23 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Base anno is Documented but Container anno is not
+ * @compile/fail/ref=DocumentedContainerAnno.out -XDrawDiagnostics DocumentedContainerAnno.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+import java.lang.annotation.Documented;
+
+@Documented
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer{
+    Foo[] value();
+}
+
+@Foo @Foo
+public class DocumentedContainerAnno {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/DocumentedContainerAnno.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+DocumentedContainerAnno.java:14:1: compiler.err.invalid.containedby.annotation.not.documented: FooContainer, Foo
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/InheritedContainerAnno.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,24 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author   sogoel
+ * @summary Base anno is Inherited but Container anno is not
+ * @compile/fail/ref=InheritedContainerAnno.out -XDrawDiagnostics InheritedContainerAnno.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+import java.lang.annotation.Inherited;
+
+@Inherited
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer{
+    Foo[] value();
+}
+
+@Foo @Foo
+public class InheritedContainerAnno {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/InheritedContainerAnno.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+InheritedContainerAnno.java:14:1: compiler.err.invalid.containedby.annotation.not.inherited: FooContainer, Foo
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingContainer.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,21 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary ContainerAnnotation does not have FooContainer.class specified
+ * @compile/fail/ref=MissingContainer.out -XDrawDiagnostics MissingContainer.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy()
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer {
+    Foo[] value();
+}
+
+@Foo @Foo
+public class MissingContainer {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingContainer.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,5 @@
+MissingContainer.java:20:1: compiler.err.invalid.containedby.annotation: Foo
+MissingContainer.java:20:6: compiler.err.invalid.containedby.annotation: Foo
+MissingContainer.java:12:1: compiler.err.annotation.missing.default.value: java.lang.annotation.ContainedBy, value
+MissingContainer.java:15:1: compiler.err.invalid.container.wrong.containedby: Foo, FooContainer
+4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,23 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Default case not specified for other methods in container annotation
+ * @compile/fail/ref=MissingDefaultCase1.out -XDrawDiagnostics MissingDefaultCase1.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer {
+    Foo[] value();
+    String other();  // missing default clause
+}
+
+@Foo @Foo
+public class MissingDefaultCase1 {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase1.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+MissingDefaultCase1.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,23 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Missing default case for other method and return type is base annotation
+ * @compile/fail/ref=MissingDefaultCase2.out -XDrawDiagnostics MissingDefaultCase2.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer {
+    Foo[] value();
+    Foo other();  // missing default clause and return type is an annotation
+}
+
+@Foo @Foo
+public class MissingDefaultCase2 {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+MissingDefaultCase2.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, other()
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingValueMethod.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,22 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author   sogoel
+ * @summary Missing value() method in ContainerAnnotation
+ * @compile/fail/ref=MissingValueMethod.out -XDrawDiagnostics MissingValueMethod.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainerFor(Foo.class)
+@interface FooContainer{
+    Foo[] values();  // wrong method name
+}
+
+@Foo @Foo
+public class MissingValueMethod {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MissingValueMethod.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,4 @@
+MissingValueMethod.java:20:1: compiler.err.invalid.containedby.annotation.no.value: FooContainer
+MissingValueMethod.java:20:6: compiler.err.invalid.containedby.annotation.no.value: FooContainer
+MissingValueMethod.java:12:1: compiler.err.invalid.containedby.annotation.elem.nondefault: FooContainer, values()
+3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MultiLevelRepeatableAnno.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     7169362
+ * @author  sogoel
+ * @summary ContainerType can have its own container
+ * @compile MultiLevelRepeatableAnno.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {}
+
+@ContainedBy(FooContainerContainer.class)
+@ContainerFor(Foo.class)
+@interface FooContainer {
+    Foo[] value();
+}
+
+@ContainerFor(FooContainer.class)
+@interface FooContainerContainer {
+  FooContainer[] value();
+}
+
+@Foo @Foo
+public class MultiLevelRepeatableAnno  {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/MultipleAnnoMixedOrder.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Repeatable annotations in random order
+ * @compile MultipleAnnoMixedOrder.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {
+    int getNumbers();
+}
+
+@ContainerFor(Foo.class)
+@interface FooContainer {
+  Foo[] value();
+}
+
+@ContainedBy(BazContainer.class)
+@interface Baz {
+    String getStr();
+}
+
+@ContainerFor(Baz.class)
+@interface BazContainer {
+  Baz[] value();
+}
+
+@Foo(getNumbers=1)
+@Baz(getStr="hello")
+@Foo(getNumbers=2)
+@Baz(getStr="world")
+public class MultipleAnnoMixedOrder  {}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,12 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Foo is not a repeatable annotation but used as one.
+ * @compile/fail/ref=NoRepeatableAnno.out -XDrawDiagnostics NoRepeatableAnno.java
+ */
+
+@interface Foo {}
+
+@Foo @Foo
+public class NoRepeatableAnno {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/NoRepeatableAnno.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+NoRepeatableAnno.java:11:1: compiler.err.duplicate.annotation.missing.container: Foo
+NoRepeatableAnno.java:11:6: compiler.err.duplicate.annotation.missing.container: Foo
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/SeparateCompile.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * part of test for bug: 7199925
+ * see: ClassReaderDefault.java
+ */
+@Foo  @Foo
+public class SeparateCompile {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,23 @@
+/**
+ * @test    /nodynamiccopyright/
+ * @bug     7169362
+ * @author  sogoel
+ * @summary Wrong return type for value() in ContainerAnnotation
+ * @compile/fail/ref=WrongReturnTypeForValue.out -XDrawDiagnostics WrongReturnTypeForValue.java
+ */
+
+import java.lang.annotation.ContainedBy;
+import java.lang.annotation.ContainerFor;
+
+@ContainedBy(FooContainer.class)
+@interface Foo {
+    int getNumbers();
+}
+
+@ContainerFor(Foo.class)
+@interface FooContainer{
+    Foo value();     // wrong return type
+}
+
+@Foo @Foo
+public class WrongReturnTypeForValue {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/WrongReturnTypeForValue.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+WrongReturnTypeForValue.java:22:1: compiler.err.invalid.containedby.annotation.value.return: FooContainer, Foo, Foo[]
+WrongReturnTypeForValue.java:22:6: compiler.err.invalid.containedby.annotation.value.return: FooContainer, Foo, Foo[]
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/BasicSyntaxCombo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug      8002157
+ * @author   sogoel
+ * @summary  Basic Syntax test for repeating annotations on all elements
+ * @build    Helper
+ * @compile  BasicSyntaxCombo.java
+ * @run main BasicSyntaxCombo
+ */
+
+
+import java.util.Arrays;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaFileObject;
+import javax.tools.Diagnostic;
+
+/*
+ * Generate test src for element kinds with repeating annotations.
+ * The test uses Helper.java to get the template to create test src and
+ * compile the test src.
+ * The test passes if valid test src compile as expected and
+ * and invalid test src fail as expected.
+ */
+
+public class BasicSyntaxCombo extends Helper{
+    static int errors = 0;
+    static boolean exitMode = false;
+    static String TESTPKG = "testpkg";
+    static String srcContent = "";
+    static String pkgInfoContent = "";
+
+    static {
+        // If EXIT_ON_FAIL is set, the combo test will exit at the first error
+        String exitOnFail = System.getenv("EXIT_ON_FAIL");
+        if (exitOnFail == null || exitOnFail == ""  ) {
+            exitMode = false;
+        }
+        else {
+            if (exitOnFail.equalsIgnoreCase("YES") ||
+                    exitOnFail.equalsIgnoreCase("Y") ||
+                    exitOnFail.equalsIgnoreCase("TRUE") ||
+                    exitOnFail.equalsIgnoreCase("T")) {
+                exitMode = true;
+            }
+        }
+    }
+
+    enum TestElem {
+        ANNOTATION_TYPE(true),
+        PACKAGE(true),
+        CONSTRUCTOR(true),
+        FIELD(true),
+        LOCAL_VARIABLE(true),
+        METHOD(true),
+        TYPE(true),
+        PARAMETER(true),
+        INNER_CLASS(true),
+        STATIC_INI(false),
+        INSTANCE_INI(false);
+
+        TestElem(boolean compile) {
+            this.compile = compile;
+        }
+
+        boolean compile;
+        boolean shouldCompile() {
+            return compile;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        new BasicSyntaxCombo().runTest();
+    }
+
+    public void runTest() throws Exception {
+        boolean result = false;
+        Iterable<? extends JavaFileObject> files = null;
+        int testCtr = 0;
+        for (TestElem type : TestElem.values()) {
+            testCtr++;
+            String className = "BasicCombo_"+type;
+            files = getFileList(className, type);
+
+            boolean shouldCompile = type.shouldCompile();
+            result = getCompileResult(className, shouldCompile,files);
+
+            if (shouldCompile && !result) {
+                error(className + " did not compile as expected", srcContent);
+                if(!pkgInfoContent.isEmpty()) {
+                    System.out.println("package-info.java contents: " + pkgInfoContent);
+                }
+            }
+
+            if (!shouldCompile && !result) {
+                error(className + " compiled unexpectedly", srcContent);
+                if(!pkgInfoContent.isEmpty()) {
+                    System.out.println("package-info.java contents: " + pkgInfoContent);
+                }
+            }
+        }
+
+        System.out.println("Total number of tests run: " + testCtr);
+        System.out.println("Total number of errors: " + errors);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    private boolean getCompileResult(String className, boolean shouldCompile,
+            Iterable<? extends JavaFileObject> files) throws Exception {
+
+        DiagnosticCollector<JavaFileObject> diagnostics =
+                new DiagnosticCollector<JavaFileObject>();
+        boolean ok =  Helper.compileCode(diagnostics,files);
+        if (!shouldCompile && !ok) {
+            checkErrorKeys(className, diagnostics);
+        }
+        return (shouldCompile == ok);
+    }
+
+    private void checkErrorKeys (
+            String className, DiagnosticCollector<JavaFileObject> diagnostics) throws Exception {
+        String expectedErrKey = "compiler.err.illegal.start.of.type";
+        for (Diagnostic<?> d : diagnostics.getDiagnostics()) {
+            if ((d.getKind() == Diagnostic.Kind.ERROR) &&
+                d.getCode().contains(expectedErrKey)) {
+                break; // Found the expected error
+            } else {
+                error("Incorrect error key, expected = "
+                      + expectedErrKey + ", Actual = " + d.getCode()
+                      + " for className = " + className, srcContent);
+            }
+        }
+    }
+
+    private Iterable<? extends JavaFileObject> getFileList(String className,
+            TestElem type ) {
+
+        String template = Helper.template;
+        String replaceStr = "/*"+type+"*/";
+        StringBuilder annoData = new StringBuilder();
+        annoData.append(Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal())
+                .append(Helper.ContentVars.CONTAINERFOR.getVal())
+                .append(Helper.ContentVars.CONTAINER.getVal())
+                .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                .append(Helper.ContentVars.BASE.getVal());
+
+        JavaFileObject pkgInfoFile = null;
+
+        if (type.equals("PACKAGE")) {
+            srcContent = template.replace(replaceStr, "package testpkg;")
+                        .replace("#ClassName", className);
+
+            String pkgInfoName = TESTPKG+"."+"package-info";
+            pkgInfoContent = Helper.ContentVars.REPEATABLEANNO.getVal()
+                             + "package " + TESTPKG + ";"
+                             + annoData;
+            pkgInfoFile = getFile(pkgInfoName, pkgInfoContent);
+        } else {
+            template = template.replace(replaceStr, Helper.ContentVars.REPEATABLEANNO.getVal())
+                       .replace("#ClassName", className);
+            srcContent = annoData + template;
+        }
+
+        JavaFileObject srcFile = getFile(className, srcContent);
+
+        Iterable<? extends JavaFileObject> files = null;
+        if (pkgInfoFile != null) {
+            files = Arrays.asList(pkgInfoFile,srcFile);
+        }
+        else {
+            files = Arrays.asList(srcFile);
+        }
+        return files;
+    }
+
+    private void error(String msg, String... contents) throws Exception {
+        System.out.println("error: " + msg);
+        errors++;
+        if (contents.length == 1) {
+            System.out.println("Contents = " + contents[0]);
+        }
+        // Test exits as soon as it gets a failure
+        if (exitMode) throw new Exception();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/DeprecatedAnnoCombo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug      8002157
+ * @author   sogoel
+ * @summary  Combo test to check for usage of Deprecated
+ * @build    Helper
+ * @compile  DeprecatedAnnoCombo.java
+ * @run main DeprecatedAnnoCombo
+ */
+
+import java.util.List;
+import javax.tools.Diagnostic;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaFileObject;
+
+/*
+ * Generate test src for use of @Deprecated on base anno
+ * or container anno or on both. In all cases, test src should compile and a
+ * warning should be generated. Repeating annotations used only on class for
+ * these generated test src.
+ */
+
+public class DeprecatedAnnoCombo extends Helper {
+    static int errors = 0;
+
+    enum TestCases {
+        DeprecatedonBoth,
+        DeprecatedonContainer,
+        DeprecatedonBase;
+    }
+
+    public static void main(String[] args) throws Exception {
+        new DeprecatedAnnoCombo().runTest();
+    }
+
+    public void runTest() throws Exception {
+        boolean ok = false;
+        int testCtr = 0;
+
+        for (TestCases clName : TestCases.values()) {
+            testCtr++;
+
+            // Create test source content
+            String contents = getContent(clName.toString());
+
+            // Compile the generated source file
+            DiagnosticCollector<JavaFileObject> diagnostics =
+                    new DiagnosticCollector<JavaFileObject>();
+            ok = compileCode(clName.toString(), contents, diagnostics);
+
+            String errorKey1 = "compiler.note.deprecated.filename";
+            String errorKey2 = "compiler.note.deprecated.recompile";
+            List<Diagnostic<? extends JavaFileObject>> diags = diagnostics.getDiagnostics();
+
+            //Check for deprecated warnings
+            if (ok) {
+                if (diags.size() == 0) {
+                    error("Did not get any warnings for @Deprecated usage");
+                } else {
+                    for (Diagnostic<?> d : diags) {
+                        if (d.getKind() == Diagnostic.Kind.NOTE) {
+                            if (d.getCode().contains(errorKey1)
+                                || d.getCode().contains(errorKey2)) {
+                                System.out.println("TestCase =" + clName + " passed as expected");
+                            } else {
+                                error("TestCase =" + clName + " did not give correct warnings" +
+                                    "Expected warning keys: " +
+                                    "errorKey1 = " + errorKey1 +
+                                    "errorKey2 = " + errorKey2 +
+                                    "actualErrorKey = " + d.getCode(), contents);
+                            }
+                        } else {
+                            error("Diagnostic Kind is incorrect, expected = " +
+                                 Diagnostic.Kind.NOTE + "actual = " + d.getKind(), contents);
+                        }
+                    }
+                }
+            } else {
+                error("TestCase =" + clName + " did not compile as expected", contents);
+            }
+        }
+
+        System.out.println("Total number of tests run: " + testCtr);
+        System.out.println("Total number of errors: " + errors);
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    private String getContent(String className) {
+        StringBuilder annoData = new StringBuilder();
+
+        switch(className) {
+        case "DeprecatedonBoth":
+            annoData.append(Helper.ContentVars.DEPRECATED.getVal())
+                    .append(Helper.ContentVars.CONTAINERFOR.getVal())
+                    .append(Helper.ContentVars.CONTAINER.getVal())
+                    .append(Helper.ContentVars.DEPRECATED.getVal())
+                    .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                    .append(Helper.ContentVars.BASE.getVal());
+            break;
+        case "DeprecatedonBase":
+            annoData.append(Helper.ContentVars.CONTAINERFOR.getVal())
+                    .append(Helper.ContentVars.CONTAINER.getVal())
+                    .append(Helper.ContentVars.DEPRECATED.getVal())
+                    .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                    .append(Helper.ContentVars.BASE.getVal());
+            break;
+        case "DeprecatedonContainer":
+            annoData.append(Helper.ContentVars.DEPRECATED.getVal())
+                    .append(Helper.ContentVars.CONTAINERFOR.getVal())
+                    .append(Helper.ContentVars.CONTAINER.getVal())
+                    .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                    .append(Helper.ContentVars.BASE.getVal());
+            break;
+        }
+
+        String contents = Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal()
+                          + Helper.ContentVars.IMPORTDEPRECATED.getVal()
+                          + annoData
+                          + Helper.ContentVars.REPEATABLEANNO.getVal()
+                          + "\nclass "+ className + "{}";
+        return contents;
+    }
+
+    private void error(String msg, String... contents) {
+        System.out.println("error: " + msg);
+        errors++;
+        if (contents.length == 1) {
+            System.out.println("Contents = " + contents[0]);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/DocumentedAnnoCombo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug      8002157
+ * @author   sogoel
+ * @summary  Positive combo test for use of Documented on baseAnno/containerAnno
+ * @build    Helper
+ * @compile  DocumentedAnnoCombo.java
+ * @run main DocumentedAnnoCombo
+ */
+
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaFileObject;
+
+/*
+ * Generate valid test src for the use of @Documented on container anno
+ * or on both base anno and container anno. Both test src should compile.
+ * Repeating annotations used only on class for these generated test src.
+ */
+public class DocumentedAnnoCombo extends Helper {
+    static int errors = 0;
+
+    enum TestCases {
+        DocumentedonBothAnno(true),
+        DocumentedonContainer(true);
+
+        TestCases(boolean compile) {
+            this.compile = compile;
+        }
+
+        boolean compile;
+        boolean shouldCompile() {
+            return compile;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        new DocumentedAnnoCombo().runTest();
+    }
+
+    public void runTest() throws Exception {
+        boolean ok = false;
+        int testCtr = 0;
+
+        // Create test source content
+        for (TestCases className : TestCases.values()) {
+            testCtr++;
+            String contents = getContent(className.toString());
+
+            // Compile the generated source file
+            DiagnosticCollector<JavaFileObject> diagnostics =
+                    new DiagnosticCollector<JavaFileObject>();
+            ok = compileCode(className.toString(), contents, diagnostics);
+            if (!ok) {
+                error("Class="+ className +" did not compile as expected", contents);
+            } else {
+                System.out.println("Test passed for className: " + className);
+            }
+        }
+
+        System.out.println("Total number of tests run: " + testCtr);
+        System.out.println("Total number of errors: " + errors);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    private String getContent(String className) {
+
+        StringBuilder annoData = new StringBuilder();
+        switch(className) {
+            case "DocumentedonBothAnno":
+                annoData.append(Helper.ContentVars.DOCUMENTED.getVal())
+                .append(Helper.ContentVars.CONTAINERFOR.getVal())
+                .append(Helper.ContentVars.CONTAINER.getVal())
+                .append(Helper.ContentVars.DOCUMENTED.getVal())
+                .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                .append(Helper.ContentVars.BASE.getVal());
+            break;
+            case "DocumentedonContainer":
+                annoData.append(Helper.ContentVars.DOCUMENTED.getVal())
+                .append(Helper.ContentVars.CONTAINERFOR.getVal())
+                .append(Helper.ContentVars.CONTAINER.getVal())
+                .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                .append(Helper.ContentVars.BASE.getVal());
+            break;
+        }
+
+        String contents = Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal()
+                          + Helper.ContentVars.IMPORTDOCUMENTED.getVal()
+                          + annoData
+                          + Helper.ContentVars.REPEATABLEANNO.getVal()
+                          + "\nclass "+ className + "{}";
+        return contents;
+    }
+
+    private void error(String msg, String... contents) {
+        System.out.println("error: " + msg);
+        errors++;
+        if (contents.length == 1) {
+            System.out.println("Contents = " + contents[0]);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/Helper.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.ToolProvider;
+import javax.tools.JavaCompiler.CompilationTask;
+
+public class Helper {
+
+    enum ContentVars {
+        IMPORTCONTAINERSTMTS("\nimport java.lang.annotation.ContainedBy;\n" +
+                            "\nimport java.lang.annotation.ContainerFor;\n"),
+        IMPORTDEPRECATED("import java.lang.Deprecated;\n"),
+        IMPORTDOCUMENTED("import java.lang.annotation.Documented;\n"),
+        IMPORTINHERITED("import java.lang.annotation.Inherited;\n"),
+        IMPORTRETENTION("import java.lang.annotation.Retention;\n" +
+                        "\nimport java.lang.annotation.RetentionPolicy;\n"),
+        CONTAINEDBY("\n@ContainedBy(FooContainer.class)\n"),
+        CONTAINERFOR("@ContainerFor(Foo.class)\n"),
+        CONTAINER("@interface FooContainer {\n" +"  Foo[] value();\n}\n"),
+        BASE("@interface Foo {}\n"),
+        REPEATABLEANNO("\n@Foo() @Foo()"),
+        DEPRECATED("\n@Deprecated"),
+        DOCUMENTED("\n@Documented"),
+        INHERITED("\n@Inherited"),
+        RETENTION("@Retention(RetentionPolicy.#VAL)\n");
+
+        private String val;
+
+
+        private ContentVars(String val) {
+            this.val = val;
+        }
+
+        public String getVal() {
+            return val;
+        }
+    }
+
+    /* String template where /*<TYPE>*/ /*gets replaced by repeating anno
+     * Used to generate test src for combo tests
+     *   - BasicSyntaxCombo.java
+     *   - TargetAnnoCombo.java
+     */
+    public static final String template =
+            "/*PACKAGE*/\n" +
+            "//pkg test;\n\n" +
+            "/*TYPE*/ //class\n" +
+            "class #ClassName {\n" +
+            "  /*FIELD*/ //instance var\n" +
+            "  public int x = 0;\n\n" +
+            "  /*FIELD*/ //Enum constants\n" +
+            "  TestEnum testEnum;\n\n" +
+            "  /*FIELD*/ // Static field\n" +
+            "  public static int num;\n\n" +
+            "  /*STATIC_INI*/\n" +
+            "  static { \n" + "num = 10; \n  }\n\n" +
+            "  /*CONSTRUCTOR*/\n" +
+            "  #ClassName() {}\n\n" +
+            "  /*INSTANCE_INI*/\n" +
+            "  { \n x = 10; \n }" +
+            "  /*INNER_CLASS*/\n" +
+            "  class innerClass {}\n" +
+            "  /*METHOD*/\n" +
+            "  void bar(/*PARAMETER*/ int baz) {\n" +
+            "    /*LOCAL_VARIABLE*/\n" +
+            "    int y = 0;\n" +
+            "  }\n" +
+            "}\n\n" +
+            "/*TYPE*/ //Enum\n" +
+            "enum TestEnum {}\n\n" +
+            "/*TYPE*/ //Interface\n" +
+            "interface TestInterface {}\n\n" +
+            "/*TYPE*/\n" +
+            "/*ANNOTATION_TYPE*/\n" +
+            "@interface TestAnnotationType{}\n";
+
+    // Create and compile FileObject using values for className and contents
+    public static boolean compileCode(String className, String contents,
+            DiagnosticCollector<JavaFileObject> diagnostics) {
+        boolean ok = false;
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        if (compiler == null) {
+            throw new RuntimeException("can't get javax.tools.JavaCompiler!");
+        }
+
+        JavaFileObject file = getFile(className, contents);
+        Iterable<? extends JavaFileObject> compilationUnit = Arrays.asList(file);
+
+        CompilationTask task = compiler.getTask(null, null, diagnostics, null, null, compilationUnit);
+        ok = task.call();
+        return ok;
+
+    }
+
+    // Compile a list of FileObjects
+    public static boolean compileCode(DiagnosticCollector<JavaFileObject> diagnostics, Iterable<? extends JavaFileObject> files) {
+        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
+        if (compiler == null) {
+            throw new RuntimeException("can't get javax.tools.JavaCompiler!");
+        }
+
+        CompilationTask task = compiler.getTask(null, null, diagnostics, null, null, files);
+        boolean ok = task.call();
+        return ok;
+    }
+
+    static JavaFileObject getFile(String name, String code) {
+        JavaFileObject o = null;
+        try {
+            o = new JavaStringFileObject(name, code);
+        } catch (URISyntaxException e) {
+            throw new RuntimeException(e);
+        }
+        return o;
+    }
+    static class JavaStringFileObject extends SimpleJavaFileObject {
+        final String theCode;
+        public JavaStringFileObject(String fileName, String theCode) throws URISyntaxException {
+            super(new URI("string:///" + fileName.replace('.','/') + ".java"), Kind.SOURCE);
+            this.theCode = theCode;
+        }
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return theCode;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/InheritedAnnoCombo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,128 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug      8002157
+ * @author   sogoel
+ * @summary  Positive combo test for use of Inherited on baseAnno/containerAnno
+ * @build    Helper
+ * @compile  InheritedAnnoCombo.java
+ * @run main InheritedAnnoCombo
+ */
+
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaFileObject;
+
+/*
+ * Generate valid test src for the use of @Inherited on container anno
+ * or on both base anno and container anno. Both test src should compile.
+ * Repeating annotations used only on class for these generated test src.
+ */
+
+public class InheritedAnnoCombo extends Helper {
+    static int errors = 0;
+    enum TestCases {
+        InheritedonBothAnno(true),
+        InheritedonBase(true);
+
+        TestCases(boolean compile) {
+            this.compile = compile;
+        }
+
+        boolean compile;
+        boolean shouldCompile() {
+            return compile;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        new InheritedAnnoCombo().runTest();
+    }
+
+    public void runTest() throws Exception {
+        int testCtr = 0;
+        boolean ok = false;
+
+        // Create test source content
+        for (TestCases className : TestCases.values()) {
+            testCtr++;
+            String contents = getContent(className.toString());
+
+            // Compile the generated code
+            DiagnosticCollector<JavaFileObject> diagnostics =
+                    new DiagnosticCollector<JavaFileObject>();
+            ok = compileCode(className.toString(), contents, diagnostics);
+
+            if (!ok) {
+                error("Class="+ className +" did not compile as expected", contents);
+            } else {
+                System.out.println("Test passed for className: " + className);
+            }
+        }
+
+        System.out.println("Total number of tests run: " + testCtr);
+        System.out.println("Total number of errors: " + errors);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    private String getContent(String className) {
+
+        StringBuilder annoData = new StringBuilder();
+        switch(className) {
+        case "InheritedonBothAnno":
+            annoData.append(Helper.ContentVars.INHERITED.getVal())
+            .append(Helper.ContentVars.CONTAINERFOR.getVal())
+            .append(Helper.ContentVars.CONTAINER.getVal())
+            .append(Helper.ContentVars.INHERITED.getVal())
+            .append(Helper.ContentVars.CONTAINEDBY.getVal())
+            .append(Helper.ContentVars.BASE.getVal());
+            break;
+        case "InheritedonBase":
+            annoData.append(Helper.ContentVars.INHERITED.getVal())
+            .append(Helper.ContentVars.CONTAINERFOR.getVal())
+            .append(Helper.ContentVars.CONTAINER.getVal())
+            .append(Helper.ContentVars.CONTAINEDBY.getVal())
+            .append(Helper.ContentVars.BASE.getVal());
+            break;
+        }
+
+        String contents = Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal()
+                          + Helper.ContentVars.IMPORTINHERITED.getVal()
+                          + annoData
+                          + Helper.ContentVars.REPEATABLEANNO.getVal()
+                          + "\nclass "+ className + "{}";
+        return contents;
+    }
+
+    private void error(String msg, String... contents) {
+        System.out.println("error: " + msg);
+        errors++;
+        if (contents.length == 1) {
+            System.out.println("Contents = " + contents[0]);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/annotations/repeatingAnnotations/combo/RetentionAnnoCombo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,201 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug      8002157
+ * @author   sogoel
+ * @summary  Combo test for all possible combinations for Retention Values
+ * @build    Helper
+ * @compile  RetentionAnnoCombo.java
+ * @run main RetentionAnnoCombo
+ */
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.tools.DiagnosticCollector;
+import javax.tools.JavaFileObject;
+import javax.tools.Diagnostic;
+
+/*
+ * Generate all combinations for the use of @Retention on base anno or container
+ * anno or both. The test passes if valid test src compile as expected and
+ * and invalid test src fail as expected.
+ * Repeating annotations used only on class for these generated test src.
+ */
+
+public class RetentionAnnoCombo extends Helper {
+    static int errors = 0;
+    static boolean exitMode = false;
+    static {
+        String exitOnFail = System.getenv("EXIT_ON_FAIL");
+        if (exitOnFail == null || exitOnFail == ""  ) {
+            exitMode = false;
+        }
+        else {
+            if (exitOnFail.equalsIgnoreCase("YES") ||
+                    exitOnFail.equalsIgnoreCase("Y") ||
+                    exitOnFail.equalsIgnoreCase("TRUE") ||
+                    exitOnFail.equalsIgnoreCase("T")) {
+                exitMode = true;
+            }
+        }
+    }
+
+    public static void main(String args[]) throws Exception {
+        new RetentionAnnoCombo().runTest();
+    }
+
+    public void runTest() throws Exception {
+
+        /* 4x4 matrix for Retention values SOURCE, DEFAULT, CLASS, RUNTIME
+         * i -> Retention value on ContainerAnno
+         * j -> Retention value on BaseAnno
+         * 1 -> retention value combo should compile
+         */
+        int[][] retention = { {1, 0, 0, 0},
+                              {1, 1, 1, 0},
+                              {1, 1, 1, 0},
+                              {1, 1, 1, 1} };
+
+        Map<Integer, String> retMap = setRetentionValMatrix();
+        String contents = "";
+        boolean result = false;
+        int testCtr = 0;
+        for (int i = 0; i < 4 ; i ++) {
+            for (int j = 0; j < 4; j++ ) {
+                testCtr++;
+                String className = "RetentionTest_"+i+"_"+j;
+                contents = getContent(className, retMap, i, j);
+                if (retention[i][j] == 1) {
+                    // Code generated should compile
+                    result = getCompileResult(contents,className, true);
+                    if (!result) {
+                        error("FAIL: " +  className + " did not compile as expected!", contents);
+                    }
+                } else {
+                    result = getCompileResult(contents,className, false);
+                    if (!result) {
+                        error("FAIL: " +  className + " compiled unexpectedly!", contents);
+                    }
+                }
+                if (result) {
+                    System.out.println("Test passed for className = " + className);
+                }
+            }
+        }
+
+        System.out.println("Total number of tests run: " + testCtr);
+        System.out.println("Total number of errors: " + errors);
+
+        if (errors > 0)
+            throw new Exception(errors + " errors found");
+    }
+
+    private boolean getCompileResult(String contents, String className,
+            boolean shouldCompile) throws Exception{
+
+        DiagnosticCollector<JavaFileObject> diagnostics =
+                new DiagnosticCollector<JavaFileObject>();
+        boolean ok = compileCode(className, contents, diagnostics);
+
+        String expectedErrKey = "compiler.err.invalid.containedby" +
+                                        ".annotation.retention";
+        if (!shouldCompile && !ok) {
+            for (Diagnostic<?> d : diagnostics.getDiagnostics()) {
+                if (!((d.getKind() == Diagnostic.Kind.ERROR) &&
+                    d.getCode().contains(expectedErrKey))) {
+                    error("FAIL: Incorrect error given, expected = "
+                            + expectedErrKey + ", Actual = " + d.getCode()
+                            + " for className = " + className, contents);
+                }
+            }
+        }
+
+        return (shouldCompile  == ok);
+    }
+
+    private Map<Integer,String> setRetentionValMatrix() {
+        HashMap<Integer,String> hm = new HashMap<>();
+        hm.put(0,"SOURCE");
+        hm.put(1,"DEFAULT");
+        hm.put(2,"CLASS");
+        hm.put(3,"RUNTIME");
+        return hm;
+    }
+
+    private String getContent(String className, Map<Integer, String> retMap,
+            int i, int j) {
+
+        String retContainerVal = retMap.get(i).toString();
+        String retBaseVal = retMap.get(j).toString();
+        String replacedRetBaseVal = "", replacedRetCAVal = "";
+        String retention = Helper.ContentVars.RETENTION.getVal();
+
+        // @Retention is available as default for both base and container anno
+        if (retContainerVal.equalsIgnoreCase("DEFAULT")
+                && retBaseVal.equalsIgnoreCase("DEFAULT")) {
+            replacedRetBaseVal = "";
+            replacedRetCAVal = "";
+        // @Retention is available as default for container anno
+        } else if (retContainerVal.equalsIgnoreCase("DEFAULT")) {
+            replacedRetBaseVal = retention.replace("#VAL", retBaseVal);
+            replacedRetCAVal = "";
+        // @Retention is available as default for base anno
+        } else if (retBaseVal.equalsIgnoreCase("DEFAULT")) {
+            replacedRetBaseVal = "";
+            replacedRetCAVal = retention.replace("#VAL", retContainerVal);
+        // @Retention is not available as default for both base and container anno
+        } else {
+            replacedRetBaseVal = retention.replace("#VAL", retBaseVal);
+            replacedRetCAVal = retention.replace("#VAL", retContainerVal);
+        }
+
+        StringBuilder annoData = new StringBuilder();
+        annoData.append(Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal())
+                .append(Helper.ContentVars.IMPORTRETENTION.getVal())
+                .append(Helper.ContentVars.CONTAINERFOR.getVal())
+                .append(replacedRetCAVal)
+                .append(Helper.ContentVars.CONTAINER.getVal())
+                .append(Helper.ContentVars.CONTAINEDBY.getVal())
+                .append(replacedRetBaseVal)
+                .append(Helper.ContentVars.BASE.getVal());
+
+        String contents = annoData
+                          + Helper.ContentVars.REPEATABLEANNO.getVal()
+                          + "\nclass "+ className + "{}";
+        return contents;
+    }
+
+    private void error(String msg,String... contents) throws Exception {
+        System.out.println("error: " + msg);
+        errors++;
+        if (contents.length == 1) {
+            System.out.println("Contents = " + contents[0]);
+        }
+        // Test exits as soon as it gets a failure
+        if (exitMode) throw new Exception();
+    }
+}
+
--- a/langtools/test/tools/javac/classfiles/ClassVersionChecker.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/classfiles/ClassVersionChecker.java	Wed Nov 14 16:41:12 2012 -0800
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 7157626
+ * @bug 7157626 8001112
  * @summary Test major version for all legal combinations for -source and -target
  * @author sgoel
  *
@@ -57,14 +57,14 @@
          * -1 => invalid combinations
          */
         int[][] ver =
-                {{51, -1, -1, -1, -1, -1, -1, -1},
-                 {48, 46, 47, 48, 49, 50, 51, 51},
-                 {48, 46, 47, 48, 49, 50, 51, 51},
-                 {48, -1, -1, 48, 49, 50, 51, 51},
-                 {51, -1, -1, -1, 49, 50, 51, 51},
-                 {51, -1, -1, -1, -1, 50, 51, 51},
-                 {51, -1, -1, -1, -1, -1, 51, 51},
-                 {51, -1, -1, -1, -1, -1, -1, 51}};
+                {{52, -1, -1, -1, -1, -1, -1, -1},
+                 {48, 46, 47, 48, 49, 50, 51, 52},
+                 {48, 46, 47, 48, 49, 50, 51, 52},
+                 {48, -1, -1, 48, 49, 50, 51, 52},
+                 {52, -1, -1, -1, 49, 50, 51, 52},
+                 {52, -1, -1, -1, -1, 50, 51, 52},
+                 {52, -1, -1, -1, -1, -1, 51, 52},
+                 {52, -1, -1, -1, -1, -1, -1, 52}};
 
         // Loop to run all possible combinations of source/target values
         for (int i = 0; i< ver.length; i++) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/ClassReaderTest/ClassReaderTest.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that default methods don't cause ClassReader to complete classes recursively
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods pkg/Foo.java
+ * @compile ClassReaderTest.java
+ */
+
+abstract class ClassReaderTest implements pkg.Foo {}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/ClassReaderTest/pkg/Foo.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2011, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg;
+
+public interface Foo  {
+    default void m1() { Impl.m1(this); }
+    default void m2() { Impl.m2(this); }
+}
+
+class Impl {
+    static void m1(Foo f) { }
+    static void m2(Foo f) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg01.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,18 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary negative test for ambiguous defaults
+ * @compile/fail/ref=Neg01.out -XDallowDefaultMethods -XDrawDiagnostics Neg01.java
+ */
+
+class Neg01 {
+    interface IA { default int m() { return Neg01.m1(this); } }
+    interface IB { default int m() { return Neg01.m2(this); } }
+
+    static class A implements IA {}
+    static class B implements IB {}
+
+    static class AB implements IA, IB {}
+
+    static int m1(IA a) { return 0; }
+    static int m2(IB b) { return 0; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg01.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg01.java:14:12: compiler.err.types.incompatible.unrelated.defaults: kindname.class, Neg01.AB, m, , Neg01.IA, Neg01.IB
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg02.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,26 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that ill-formed MI hierarchies do not compile
+ * @compile/fail/ref=Neg02.out -XDallowDefaultMethods -XDrawDiagnostics Neg02.java
+ */
+
+class Neg02 {
+     interface A {
+         default void m() { Neg02.impl(this); }
+     }
+
+     interface B {
+         default void m() { Neg02.impl(this); }
+     }
+
+     static class X implements A, B { } //error
+
+     void test(X x) {
+         x.m();
+         ((A)x).m();
+         ((B)x).m();
+     }
+
+     static void impl(A a) { }
+     static void impl(B b) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg02.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg02.java:16:13: compiler.err.types.incompatible.unrelated.defaults: kindname.class, Neg02.X, m, , Neg02.A, Neg02.B
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg03.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,38 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that re-abstraction works properly
+ * @compile/fail/ref=Neg03.out -XDallowDefaultMethods -XDrawDiagnostics Neg03.java
+ */
+
+class Neg03 {
+    interface A {
+        default void m() { Neg03.one(this); }
+    }
+
+    interface B {
+        default void m() { Neg03.two(this); }
+    }
+
+    interface C extends A, B {
+        default void m() { Neg03.one(this); }
+    }
+
+    static class X implements C, A { } //ok - ignore extraneous remix of A
+
+    interface D extends A, B {
+      void m();  // ok - m() is not reabstracted!
+    }
+
+    static class Y implements D, A { } // invalid - abstract D.m()
+
+    interface E extends A {
+        void m();  // reabstraction of m()
+    }
+
+    static class W implements D, E { } // invalid - abstracts D.m()/E.m()
+
+    static class Z implements D, A, B { } // invalid - abstract D.m()
+
+    static void one(Object a) {  }
+    static void two(Object a) {  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg03.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,4 @@
+Neg03.java:26:12: compiler.err.does.not.override.abstract: Neg03.Y, m(), Neg03.D
+Neg03.java:32:12: compiler.err.does.not.override.abstract: Neg03.W, m(), Neg03.D
+Neg03.java:34:12: compiler.err.does.not.override.abstract: Neg03.Z, m(), Neg03.D
+3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg04.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default method must have most specific return type
+ * @compile/fail/ref=Neg04.out -XDallowDefaultMethods -XDrawDiagnostics Neg04.java
+ */
+
+class Neg04 {
+    interface IA1 { Integer m(); }
+    interface IA2 extends IA1 { default Number m() { return Neg04.m(this); } } //error
+
+    abstract class C implements IA1, IA2 {}
+
+    static int m(IA2 a) { return 0; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg04.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg04.java:9:48: compiler.err.override.incompatible.ret: (compiler.misc.clashes.with: m(), Neg04.IA2, m(), Neg04.IA1), java.lang.Number, java.lang.Integer
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg05.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that abstract methods are compatible with inherited defaults
+ * @compile/fail/ref=Neg05.out -XDallowDefaultMethods -XDrawDiagnostics Neg05.java
+ */
+
+class Neg05 {
+    interface IA1 { default Number m() { return Neg05.m1(this); } }
+    interface IA2 extends IA1 { default Integer m() { return Neg05.m2(this); } }
+    interface IA3 extends IA2 { Number m(); } //error
+
+    static class C implements IA3{}
+
+    static int m1(IA1 a) { return 0; }
+    static int m2(IA2 b) { return 0; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg05.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+Neg05.java:10:40: compiler.err.override.incompatible.ret: (compiler.misc.clashes.with: m(), Neg05.IA3, m(), Neg05.IA2), java.lang.Number, java.lang.Integer
+Neg05.java:12:12: compiler.err.does.not.override.abstract: Neg05.C, m(), Neg05.IA3
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg06.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,16 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary flow analysis is not run on inlined default bodies
+ * @compile/fail/ref=Neg06.out -XDallowDefaultMethods -XDrawDiagnostics Neg06.java
+ */
+
+class Neg06 {
+
+    interface A {
+        default String m() { C.m(); }
+    }
+
+    static class C {
+        static String m() { return ""; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg06.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg06.java:10:37: compiler.err.missing.ret.stmt
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg07.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,21 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default overrides are properly type-checked
+ * @compile/fail/ref=Neg07.out -XDallowDefaultMethods -XDrawDiagnostics Neg07.java
+ */
+
+class Neg07 {
+    interface I {
+        default int m() { return 1; }
+    }
+
+    static class C1 {
+        public void m() { } //incompatible return
+    }
+
+    static class C2 extends C1 implements I { }
+
+    static class C3 implements I {
+        public void m() { } //incompatible return
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg07.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+Neg07.java:16:12: compiler.err.override.incompatible.ret: (compiler.misc.cant.implement: m(), Neg07.C1, m(), Neg07.I), void, int
+Neg07.java:19:21: compiler.err.override.incompatible.ret: (compiler.misc.cant.implement: m(), Neg07.C3, m(), Neg07.I), void, int
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg08.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default overrides are properly type-checked
+ * @compile/fail/ref=Neg08.out -XDallowDefaultMethods -XDrawDiagnostics Neg08.java
+ */
+class Neg08 {
+    interface I {
+        default void m() { }
+    }
+
+    static class C1 {
+        void m() { } //weaker modifier
+    }
+
+    static class C2 extends C1 implements I { }
+
+    static class C3 implements I {
+        void m() { } //weaker modifier
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg08.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+Neg08.java:15:12: compiler.err.override.weaker.access: (compiler.misc.cant.implement: m(), Neg08.C1, m(), Neg08.I), public
+Neg08.java:18:14: compiler.err.override.weaker.access: (compiler.misc.cant.implement: m(), Neg08.C3, m(), Neg08.I), public
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg09.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,22 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default overrides are properly type-checked
+ * @compile/fail/ref=Neg09.out -Werror -Xlint:unchecked -XDallowDefaultMethods -XDrawDiagnostics Neg09.java
+ */
+import java.util.List;
+
+class Neg09 {
+    interface I {
+        default List<String> m() { return null; }
+    }
+
+    static class C1 {
+        public List m() { return null; } //unchecked (return) override
+    }
+
+    static class C2 extends C1 implements I { }
+
+    static class C3 implements I {
+        public List m() { return null; } //unchecked (return) override
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg09.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,5 @@
+Neg09.java:17:12: compiler.warn.override.unchecked.ret: (compiler.misc.unchecked.implement: m(), Neg09.C1, m(), Neg09.I), java.util.List, java.util.List<java.lang.String>
+Neg09.java:20:21: compiler.warn.override.unchecked.ret: (compiler.misc.unchecked.implement: m(), Neg09.C3, m(), Neg09.I), java.util.List, java.util.List<java.lang.String>
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg10.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default overrides are properly type-checked
+ * @compile/fail/ref=Neg10.out -Werror -Xlint:unchecked -XDallowDefaultMethods -XDrawDiagnostics Neg10.java
+ */
+class Neg10 {
+    interface I<X extends Exception> {
+        default void m() throws X { }
+    }
+
+    static class C1 {
+        public void m() throws Exception { } //unchecked (throws) override
+    }
+
+    static class C2<Z extends Exception> extends C1 implements I<Z> { }
+
+    static class C3<Z extends Exception> implements I<Z> {
+        public void m() throws Exception { } //unchecked (throws) override
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg10.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,5 @@
+Neg10.java:15:12: compiler.warn.override.unchecked.thrown: (compiler.misc.cant.implement: m(), Neg10.C1, m(), Neg10.I), java.lang.Exception
+Neg10.java:18:21: compiler.warn.override.unchecked.thrown: (compiler.misc.cant.implement: m(), Neg10.C3, m(), Neg10.I), java.lang.Exception
+- compiler.err.warnings.and.werror
+1 error
+2 warnings
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg11.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,20 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default overrides are properly type-checked
+ * @compile/fail/ref=Neg11.out -XDallowDefaultMethods -XDrawDiagnostics Neg11.java
+ */
+class Neg11 {
+    interface I {
+        default void m() { }
+    }
+
+    static class C1 {
+        public void m() throws Exception { } //bad throws
+    }
+
+    static class C2 extends C1 implements I { }
+
+    static class C3 implements I {
+        public void m() throws Exception { } //bad throws
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg11.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,3 @@
+Neg11.java:15:12: compiler.err.override.meth.doesnt.throw: (compiler.misc.cant.implement: m(), Neg11.C1, m(), Neg11.I), java.lang.Exception
+Neg11.java:18:21: compiler.err.override.meth.doesnt.throw: (compiler.misc.cant.implement: m(), Neg11.C3, m(), Neg11.I), java.lang.Exception
+2 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg12.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,27 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that abstract methods are discarded in overload resolution diags
+ * @compile/fail/ref=Neg12.out -XDallowDefaultMethods -XDrawDiagnostics Neg12.java
+ */
+class Neg12 {
+
+    interface I1 {
+        default void m(String s) {};
+    }
+
+    interface I2 {
+        void m(String s);
+    }
+
+    static class B {
+        void m(Integer i) { }
+    }
+
+    static class C extends B implements I1 { }
+    static class D extends B implements I2 { }
+
+    void test(C c, D d) {
+        c.m();
+        d.m();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg12.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,4 @@
+Neg12.java:21:12: compiler.err.does.not.override.abstract: Neg12.D, m(java.lang.String), Neg12.I2
+Neg12.java:24:10: compiler.err.cant.apply.symbols: kindname.method, m, ,{(compiler.misc.inapplicable.method: kindname.method, Neg12.I1, m(java.lang.String), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, Neg12.B, m(java.lang.Integer), (compiler.misc.arg.length.mismatch))}
+Neg12.java:25:10: compiler.err.cant.apply.symbol: kindname.method, m, java.lang.Integer, compiler.misc.no.args, kindname.class, Neg12.B, (compiler.misc.arg.length.mismatch)
+3 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg13.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,18 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that default method overriding object members are flagged as error
+ * @compile/fail/ref=Neg13.out -XDallowDefaultMethods -XDrawDiagnostics Neg13.java
+ */
+interface Neg13 {
+    default protected Object clone() { return null; } //protected not allowed here
+    default boolean equals(Object obj) { return false; }
+    default protected void finalize() { } //protected not allowed here
+    default Class<?> getClass() { return null; }
+    default int hashCode() { return 0; }
+    default void notify() { }
+    default void notifyAll() { }
+    default String toString() { return null; }
+    default void wait() { }
+    default void wait(long timeout) { }
+    default void wait(long timeout, int nanos) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg13.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,12 @@
+Neg13.java:7:30: compiler.err.mod.not.allowed.here: protected
+Neg13.java:9:28: compiler.err.mod.not.allowed.here: protected
+Neg13.java:8:21: compiler.err.default.overrides.object.member: equals, kindname.interface, Neg13
+Neg13.java:10:22: compiler.err.override.meth: (compiler.misc.cant.override: getClass(), Neg13, getClass(), java.lang.Object), final
+Neg13.java:11:17: compiler.err.default.overrides.object.member: hashCode, kindname.interface, Neg13
+Neg13.java:12:18: compiler.err.override.meth: (compiler.misc.cant.override: notify(), Neg13, notify(), java.lang.Object), final
+Neg13.java:13:18: compiler.err.override.meth: (compiler.misc.cant.override: notifyAll(), Neg13, notifyAll(), java.lang.Object), final
+Neg13.java:14:20: compiler.err.default.overrides.object.member: toString, kindname.interface, Neg13
+Neg13.java:15:18: compiler.err.override.meth: (compiler.misc.cant.override: wait(), Neg13, wait(), java.lang.Object), final
+Neg13.java:16:18: compiler.err.override.meth: (compiler.misc.cant.override: wait(long), Neg13, wait(long), java.lang.Object), final
+Neg13.java:17:18: compiler.err.override.meth: (compiler.misc.cant.override: wait(long,int), Neg13, wait(long,int), java.lang.Object), final
+11 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg14.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,11 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that a class cannot have two sibling interfaces with a default and abstract method
+ * @compile/fail/ref=Neg14.out -XDallowDefaultMethods -XDrawDiagnostics Neg14.java
+ */
+class Neg14 {
+    interface IA { int m(); }
+    interface IB { default int m() { return 1; } }
+
+    abstract class AB implements IA, IB {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg14.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg14.java:10:14: compiler.err.types.incompatible.abstract.default: kindname.class, Neg14.AB, m, , Neg14.IB, Neg14.IA
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg15.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that level skipping in default super calls is correctly rejected
+ * @compile/fail/ref=Neg15.out -XDallowDefaultMethods -XDrawDiagnostics Neg15.java
+ */
+class Neg15 {
+    interface I { default void m() {  } }
+    interface J extends I { default void m() {  } }
+    interface K extends I {}
+
+    static class C implements J, K {
+        void foo() { K.super.m(); }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg15.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg15.java:12:31: compiler.err.illegal.default.super.call: Neg15.K, (compiler.misc.overridden.default: m(), Neg15.J)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg16.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,13 @@
+/*
+ * @test /nodynamiccopyright/
+ * @summary check that level skipping in default super calls is correctly rejected
+ * @compile/fail/ref=Neg16.out -XDallowDefaultMethods -XDrawDiagnostics Neg16.java
+ */
+class Neg16 {
+    interface I { default void m() {  } }
+    interface J extends I { default void m() {  } }
+
+    static class C implements I, J {
+        void foo() { I.super.m(); }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Neg16.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,2 @@
+Neg16.java:11:23: compiler.err.illegal.default.super.call: Neg16.I, (compiler.misc.redundant.supertype: Neg16.I, Neg16.J)
+1 error
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos01.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary basic test for default methods
+ * @ignore awaits lambda support
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowLambda -XDallowPoly -XDallowDefaultMethods Pos01.java
+ */
+
+import java.util.*;
+
+class Pos01 {
+
+    interface Mapper<T> {
+        T map(T in);
+    }
+
+    interface ExtendedList<T> extends List<T> {
+        default List<T> testMap(Mapper<T> r) {
+            return Pos01.<T>listMapper(this, r);
+        }
+    }
+
+    static class MyList<E> extends ArrayList<E> implements ExtendedList<E> {}
+
+    public static void main(String[] args) {
+       MyList<Integer> l = new MyList<Integer>();
+       l.add(1); l.add(2); l.add(3);
+       l.testMap((Integer x) -> x * x );
+    }
+
+    static <T> List<T> listMapper(List<T> l, Mapper<T> mapper) {
+        MyList<T> new_list = new MyList<T>();
+        for (T el : l) {
+            new_list.add(mapper.map(el));
+        }
+        return new_list;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos02.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary test for explicit resolution of ambiguous default methods
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos02.java
+ */
+
+class Pos02 {
+    interface IA { default int m() { return Pos02.m1(this); } }
+    interface IB { default int m() { return Pos02.m2(this); } }
+
+    static class A implements IA {}
+    static class B implements IB {}
+
+    static class AB implements IA, IB {
+        public int m() { return 0; }
+        void test() {
+            AB.this.m();
+            IA.super.m();
+        }
+    }
+
+    static int m1(IA a) { return 0; }
+    static int m2(IB b) { return 0; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos04.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary test for overriding with default method
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos04.java
+ */
+
+class Pos04 {
+    interface A { default int m() { return Pos04.m(this); } }
+    static abstract class B { public int m() { return 0; } }
+
+    static class C extends B implements A {
+        void test() {
+            C.this.m();
+            A.super.m();
+        }
+    }
+
+    static int m(A a) { return 0; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos05.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that indirectly inherited default methods are discovered during resolution
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos05.java
+ */
+
+class Pos05  {
+     interface A {
+         default void m() { Pos05.impl(this); }
+     }
+
+     interface B extends A { }
+
+     static class E implements B { }
+
+     void test(E e) {
+         e.m();
+     }
+
+     static void impl(A a) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos06.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that well-formed MI hierarchies behaves well w.r.t. method resolution (i.e. no ambiguities)
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos06.java
+ */
+
+class Pos06 {
+     interface A {
+         default void m() { Pos06.impl(this); }
+     }
+
+     interface B extends A {
+         default void m() { Pos06.impl(this); }
+     }
+
+     static class X implements A, B { }
+
+     void test(X x) {
+         x.m();
+         ((A)x).m();
+         ((B)x).m();
+     }
+
+     static void impl(Object a) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos07.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that compilation order does not matter
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos07.java
+ */
+
+class Pos07 {
+    interface A {
+         default void foo() { Pos07.impl(this); }
+         default void bar() { Pos07.impl(this); }
+    }
+
+    static class C implements B, A {}
+
+    interface B extends A {
+        default void foo() { Pos07.impl(this); }
+    }
+
+    static void impl(A a) {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos08.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that common overrider solves default method conflicts
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos08.java
+ */
+
+class Pos08 {
+    interface A {
+        default void m() { Pos08.a(this); }
+    }
+
+    interface B {
+        default void m() { Pos08.b(this); }
+    }
+
+    interface C extends A, B {
+        default void m() { Pos08.b(this); }
+    }
+
+    static void a(A o) { }
+    static void b(B o) { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos10.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that type-variables in generic extension decl can be accessed from default impl
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods Pos10.java
+ */
+
+class Pos10 {
+    interface Function<X,Y> {
+        Y apply(X x);
+    }
+
+    interface A<T> {
+        default <R> void m(Function<T,R> f) { Impl.<T,R>m(this, f); }
+    }
+
+    static class Impl {
+        static <T,R> void m(A<T> a, Function<T,R> f) {  }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos11.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary complex test with conflict resolution via overriding
+ * @author  Brian Goetz
+ * @compile -XDallowDefaultMethods Pos11.java
+ */
+
+class Pos11 {
+    interface A {
+        default void get() { Pos11.one(this); }
+    }
+
+    interface B {
+        default void get() { Pos11.two(this); }
+    }
+
+    interface C extends A {
+        default void get() { Pos11.two(this); }
+    }
+
+    interface D extends A, B {
+        default void get() { Pos11.two(this); }
+    }
+
+    static class X implements C { }
+
+    static class Y implements C, A { }
+
+    static class Z implements D, A, B { }
+
+    static void one(Object a) {  }
+    static void two(Object a) {  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos12.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that 'this' can be used from within an extension method
+ * @compile -XDallowDefaultMethods Pos12.java
+ */
+
+interface Pos12 {
+
+    default Object m() {
+        Object o = this;
+        f(this);
+        return this;
+    }
+
+    void f(Object o);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos13.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary qualified 'this' inside default method causes StackOverflowException
+ * @compile -XDallowDefaultMethods Pos13.java
+ */
+
+public class Pos13 {
+
+    static int assertionCount = 0;
+
+    static void assertTrue(boolean cond) {
+        assertionCount++;
+        if (!cond)
+            throw new AssertionError();
+    }
+
+    interface Outer {
+        abstract void doSomething();
+
+        default void m() {
+            new SubOuter() {
+                public void doSomething() {
+                    Outer.this.doSomething();
+                }
+            }.doSomething();
+        }
+    }
+
+    interface SubOuter extends Outer { }
+
+    static class E implements Outer {
+        public void doSomething() { assertTrue(true); }
+    }
+
+    public static void main(String[] args) {
+        new E().m();
+        assertTrue(assertionCount == 1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos14.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that overload resolution selects most specific signature
+ * @compile -XDallowDefaultMethods Pos14.java
+ */
+
+class Pos14 {
+    interface A { default Object m() { return null; } }
+    static abstract class B { abstract public String m(); }
+
+    static abstract class C extends B implements A {
+        void test() {
+            m().length();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos15.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that overload resolution selects most specific signature
+ * @compile -XDallowDefaultMethods Pos15.java
+ */
+
+class Pos15 {
+    interface A { default String m() { return null; } }
+    static abstract class B { abstract public Object m(); }
+
+    static abstract class C extends B implements A {
+        void test() {
+            m().length();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/Pos16.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary 'class wins' should not short-circuit overload resolution
+ * @compile -XDallowDefaultMethods Pos16.java
+ */
+
+class Pos16 {
+    interface I {
+        default String m(Integer i) { return ""; }
+    }
+
+    class C implements I {
+        Integer m(Object o) { return 1; }
+    }
+
+    void test(C c) {
+        c.m(1).length();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/TestDefaultBody.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,125 @@
+/*
+ * Copyright (c) 2011, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @ignore awaits for VM support
+ * @summary  check that code attributed for default methods is correctly generated
+ * @compile -XDallowDefaultMethods TestDefaultBody.java
+ * @run main TestDefaultBody
+ */
+
+import com.sun.tools.classfile.AccessFlags;
+import com.sun.tools.classfile.Attribute;
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPool.*;
+import com.sun.tools.classfile.Code_attribute;
+import com.sun.tools.classfile.Instruction;
+import com.sun.tools.classfile.Method;
+
+import com.sun.tools.classfile.Opcode;
+import java.io.*;
+
+public class TestDefaultBody {
+
+    interface TestInterface {
+        int no_default(int i);
+        default int yes_default(int i) { return impl(this, i); }
+    }
+
+    static int impl(TestInterface ti, int i) { return 0; }
+
+    static final String TARGET_CLASS_NAME = "TestDefaultBody";
+    static final String TARGET_NAME = "impl";
+    static final String TARGET_TYPE = "(LTestDefaultBody$TestInterface;I)I";
+    static final String SUBTEST_NAME = TestInterface.class.getName() + ".class";
+    static final String TEST_METHOD_NAME = "yes_default";
+
+    public static void main(String... args) throws Exception {
+        new TestDefaultBody().run();
+    }
+
+    public void run() throws Exception {
+        String workDir = System.getProperty("test.classes");
+        File compiledTest = new File(workDir, SUBTEST_NAME);
+        verifyDefaultBody(compiledTest);
+    }
+
+    void verifyDefaultBody(File f) {
+        System.err.println("verify: " + f);
+        try {
+            ClassFile cf = ClassFile.read(f);
+            Method testMethod = null;
+            Code_attribute codeAttr = null;
+            for (Method m : cf.methods) {
+                codeAttr = (Code_attribute)m.attributes.get(Attribute.Code);
+                String mname = m.getName(cf.constant_pool);
+                if (mname.equals(TEST_METHOD_NAME)) {
+                    testMethod = m;
+                    break;
+                } else {
+                    codeAttr = null;
+                }
+            }
+            if (testMethod == null) {
+                throw new Error("Test method not found");
+            }
+            if (testMethod.access_flags.is(AccessFlags.ACC_ABSTRACT)) {
+                throw new Error("Test method is abstract");
+            }
+            if (codeAttr == null) {
+                throw new Error("Code attribute in test method not found");
+            }
+
+            boolean found = false;
+            for (Instruction instr : codeAttr.getInstructions()) {
+                if (instr.getOpcode() == Opcode.INVOKESTATIC) {
+                    found = true;
+                    int pc_index = instr.getShort(1);
+                    CONSTANT_Methodref_info mref = (CONSTANT_Methodref_info)cf.constant_pool.get(pc_index);
+                    String className = mref.getClassName();
+                    String targetName = mref.getNameAndTypeInfo().getName();
+                    String targetType = mref.getNameAndTypeInfo().getType();
+
+                    if (!className.equals(TARGET_CLASS_NAME)) {
+                        throw new Error("unexpected class in default method body " + className);
+                    }
+                    if (!targetName.equals(TARGET_NAME)) {
+                        throw new Error("unexpected method name in default method body " + targetName);
+                    }
+                    if (!targetType.equals(TARGET_TYPE)) {
+                        throw new Error("unexpected method type in default method body " + targetType);
+                    }
+                    break;
+                }
+            }
+
+            if (!found) {
+                throw new Error("no invokestatic found in default method body");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + f +": " + e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/TestNoBridgeOnDefaults.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2011, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @ignore awaits for VM support
+ * @summary  check that javac does not generate bridge methods for defaults
+ * @compile -XDallowDefaultMethods TestNoBridgeOnDefaults.java
+ * @run main TestNoBridgeOnDefaults
+ */
+
+import com.sun.tools.classfile.ClassFile;
+import com.sun.tools.classfile.ConstantPool.*;
+import com.sun.tools.classfile.Method;
+
+import java.io.*;
+
+public class TestNoBridgeOnDefaults {
+
+    interface A<X> {
+        default <Y> A<X> m(X x, Y y) { return Impl.<X,Y>m1(this, x, y); }
+    }
+
+    static abstract class B<X> implements A<X> { }
+
+    interface C<X> extends A<X> {
+        default <Y> C<X> m(X x, Y y) { return Impl.<X,Y>m2(this, x, y); }
+    }
+
+    static abstract class D<X> extends B<X> implements C<X> { }
+
+    static class Impl {
+       static <X, Y> A<X> m1(A<X> rec, X x, Y y) { return null; }
+       static <X, Y> C<X> m2(C<X> rec, X x, Y y) { return null; }
+    }
+
+    static final String[] SUBTEST_NAMES = { B.class.getName() + ".class", D.class.getName() + ".class" };
+    static final String TEST_METHOD_NAME = "m";
+
+    public static void main(String... args) throws Exception {
+        new TestNoBridgeOnDefaults().run();
+    }
+
+    public void run() throws Exception {
+        String workDir = System.getProperty("test.classes");
+        for (int i = 0 ; i < SUBTEST_NAMES.length ; i ++) {
+            File compiledTest = new File(workDir, SUBTEST_NAMES[i]);
+            checkNoBridgeOnDefaults(compiledTest);
+        }
+    }
+
+    void checkNoBridgeOnDefaults(File f) {
+        System.err.println("check: " + f);
+        try {
+            ClassFile cf = ClassFile.read(f);
+            for (Method m : cf.methods) {
+                String mname = m.getName(cf.constant_pool);
+                if (mname.equals(TEST_METHOD_NAME)) {
+                    throw new Error("unexpected bridge method found " + m);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new Error("error reading " + f +": " + e);
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/crossCompile/Clinit.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+interface Clinit {
+    String s = Inner.m();
+
+    static class Inner {
+        static String m() { return ""; }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/crossCompile/CrossCompile.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary check that clinit in interface doesn't cause spurious default method diagnostics
+ * @compile -source 1.4 -target 1.4 Clinit.java
+ * @compile CrossCompile.java
+ */
+class CrossCompile {
+   void test() {
+        String s = Clinit.s;
+   }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/FDTest.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Automatic test for checking correctness of default resolution
+ */
+
+import shapegen.*;
+
+import com.sun.source.util.JavacTask;
+
+import java.net.URI;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+public class FDTest {
+
+    enum TestKind {
+        POSITIVE,
+        NEGATIVE;
+
+        Collection<Hierarchy> getHierarchy(HierarchyGenerator hg) {
+            return this == POSITIVE ?
+                    hg.getOK() : hg.getErr();
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        //create default shared JavaCompiler - reused across multiple compilations
+        JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+        StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
+
+        HierarchyGenerator hg = new HierarchyGenerator();
+        for (TestKind tk : TestKind.values()) {
+            for (Hierarchy hs : tk.getHierarchy(hg)) {
+                new FDTest(tk, hs).run(comp, fm);
+            }
+        }
+    }
+
+    TestKind tk;
+    Hierarchy hs;
+    DefenderTestSource source;
+    DiagnosticChecker diagChecker;
+
+    FDTest(TestKind tk, Hierarchy hs) {
+        this.tk = tk;
+        this.hs = hs;
+        this.source = new DefenderTestSource();
+        this.diagChecker = new DiagnosticChecker();
+    }
+
+    void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
+        JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
+                Arrays.asList("-XDallowDefaultMethods"), null, Arrays.asList(source));
+        try {
+            ct.analyze();
+        } catch (Throwable ex) {
+            throw new AssertionError("Error thrown when analyzing the following source:\n" + source.getCharContent(true));
+        }
+        check();
+    }
+
+    void check() {
+        boolean errorExpected = tk == TestKind.NEGATIVE;
+        if (errorExpected != diagChecker.errorFound) {
+            throw new AssertionError("problem in source: \n" +
+                    "\nerror found = " + diagChecker.errorFound +
+                    "\nerror expected = " + errorExpected +
+                    "\n" + dumpHierarchy() +
+                    "\n" + source.getCharContent(true));
+        }
+    }
+
+    String dumpHierarchy() {
+        StringBuilder buf = new StringBuilder();
+        buf.append("root = " + hs.root + "\n");
+        for (ClassCase cc : hs.all) {
+            buf.append("  class name = " + cc.getName() + "\n");
+            buf.append("    class OK = " + cc.get_OK() + "\n");
+            buf.append("    prov = " + cc.get_mprov() + "\n");
+
+        }
+        return buf.toString();
+    }
+
+    class DefenderTestSource extends SimpleJavaFileObject {
+
+        String source;
+
+        public DefenderTestSource() {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            StringBuilder buf = new StringBuilder();
+            List<ClassCase> defaultRef = new ArrayList<>();
+            for (ClassCase cc : hs.all) {
+                hs.genClassDef(buf, cc, null, defaultRef);
+            }
+            source = buf.toString();
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        boolean errorFound;
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
+                errorFound = true;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/ClassCase.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,310 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ *
+ * @author Robert Field
+ */
+public class ClassCase {
+
+    public enum Kind {
+        IVAC        (true,  "v"),
+        IPRESENT    (true,  "p"),
+        IDEFAULT    (true,  "d"),
+        CNONE       (false, "n"),
+        CABSTRACT   (false, "a"),
+        CCONCRETE   (false, "c");
+
+        private final String prefix;
+        public final boolean isInterface;
+
+        Kind(boolean isInterface, String prefix) {
+            this.isInterface = isInterface;
+            this.prefix = prefix;
+        }
+    }
+
+    public final Kind kind;
+    private final ClassCase superclass;
+    private final List<ClassCase> supertypes;
+
+    private String name;
+    private boolean _OK;
+    private boolean _HasClassMethod;
+    private Set<ClassCase> _mprov;
+    private boolean _IsConcrete;
+    private boolean _HasDefault;
+    private ClassCase _mres;
+    private ClassCase _mdefend;
+
+    private Set<RuleGroup> executed = new HashSet<RuleGroup>() {};
+
+    public ClassCase(Kind kind, ClassCase superclass, List<ClassCase> interfaces) {
+        this.kind = kind;
+        this.superclass = superclass;
+
+        // Set supertypes from superclass (if any) and interfaces
+        List<ClassCase> lc;
+        if (superclass == null) {
+            lc = interfaces;
+        } else {
+            lc = new ArrayList<>();
+            lc.add(superclass);
+            lc.addAll(interfaces);
+        }
+        this.supertypes = lc;
+    }
+
+    public final boolean isInterface() { return kind.isInterface; }
+    public final boolean isClass() { return !kind.isInterface; }
+
+    public Set<ClassCase> get_mprov() {
+        exec(RuleGroup.PROVENENCE);
+        return _mprov;
+    }
+
+    public void set_mprov(ClassCase cc) {
+        Set<ClassCase> s = new HashSet<>();
+        s.add(cc);
+        _mprov = s;
+    }
+
+    public void set_mprov(Set<ClassCase> s) {
+        _mprov = s;
+    }
+
+    public ClassCase get_mres() {
+        exec(RuleGroup.RESOLUTION);
+        return _mres;
+    }
+
+    public void set_mres(ClassCase cc) {
+        _mres = cc;
+    }
+
+    public ClassCase get_mdefend() {
+        exec(RuleGroup.DEFENDER);
+        return _mdefend;
+    }
+
+    public void set_mdefend(ClassCase cc) {
+        _mdefend = cc;
+    }
+
+    public boolean get_HasClassMethod() {
+        exec(RuleGroup.PROVENENCE);
+        return _HasClassMethod;
+    }
+
+    public void set_HasClassMethod(boolean bool) {
+        _HasClassMethod = bool;
+    }
+
+    public boolean get_HasDefault() {
+        exec(RuleGroup.MARKER);
+        return _HasDefault;
+    }
+
+    public void set_HasDefault(boolean bool) {
+        _HasDefault = bool;
+    }
+
+    public boolean get_IsConcrete() {
+        exec(RuleGroup.MARKER);
+        return _IsConcrete;
+    }
+
+    public void set_IsConcrete(boolean bool) {
+        _IsConcrete = bool;
+    }
+
+    public boolean get_OK() {
+        exec(RuleGroup.CHECKING);
+        return _OK;
+    }
+
+    public void set_OK(boolean bool) {
+        _OK = bool;
+    }
+
+    public boolean isMethodDefined() {
+        for (ClassCase cc : supertypes) {
+            if (cc.isMethodDefined()) {
+                return true;
+            }
+        }
+        switch (kind) {
+            case CCONCRETE:
+            case CABSTRACT:
+            case IPRESENT:
+            case IDEFAULT:
+                return true;
+            default:
+                return false;
+        }
+    }
+
+    public boolean isAbstract() {
+        return isMethodDefined() && (get_mres()==null);
+    }
+
+    public boolean hasSuperclass() {
+        return superclass != null;
+    }
+
+    public ClassCase getSuperclass() {
+        return superclass;
+    }
+
+    public List<ClassCase> getSupertypes() {
+        return supertypes;
+    }
+
+    public List<ClassCase> getInterfaces() {
+        if (superclass != null) {
+            if (supertypes.get(0) != superclass) {
+                throw new AssertionError("superclass missing from supertypes");
+            }
+            return supertypes.subList(1, supertypes.size());
+        } else {
+            return supertypes;
+        }
+    }
+
+    public boolean isSubtypeOf(ClassCase cc) {
+        // S-Refl
+        if (cc.equals(this)) {
+            return true;
+        }
+
+        // S-Def
+        for (ClassCase sp : getSupertypes()) {
+            if (cc.equals(sp)) {
+                return true;
+            }
+        }
+
+        // _S-Trans
+        for (ClassCase sp : getSupertypes()) {
+            if (sp.isSubtypeOf(cc)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    public void init(Map<String, Integer> namingContext) {
+        if (name != null) {
+            return; // Already inited
+        }
+
+        for (ClassCase sup : supertypes) {
+            sup.init(namingContext);
+        }
+
+        // Build name
+        StringBuilder sb = new StringBuilder();
+        if (!supertypes.isEmpty()) {
+            sb.append(isInterface() ? "I" : "C");
+            for (ClassCase cc : supertypes) {
+                sb.append(cc.getName());
+            }
+            sb.append(kind.isInterface ? "i" : "c");
+        }
+        sb.append(kind.prefix);
+        String pname = sb.toString();
+        Integer icnt = namingContext.get(pname);
+        int cnt = icnt == null ? 0 : icnt;
+        ++cnt;
+        namingContext.put(pname, cnt);
+        if (cnt > 1) {
+            sb.append(cnt);
+        }
+        this.name = sb.toString();
+    }
+
+    public boolean isa(Kind... kinds) {
+        for (Kind k : kinds) {
+            if (kind == k) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private void exec(RuleGroup rg ) {
+        if (!executed.contains(rg)) {
+            rg.exec(this);
+            executed.add(rg);
+        }
+    }
+
+    public void collectClasses(Set<ClassCase> seen) {
+        seen.add(this);
+        for (ClassCase cc : supertypes) {
+            cc.collectClasses(seen);
+        }
+    }
+
+    public String getID() {
+        if (name == null) {
+            throw new Error("Access to uninitialized ClassCase");
+        } else {
+            return name;
+        }
+    }
+
+    public final String getName() {
+        if (name == null) {
+            return "ClassCase uninited@" + hashCode();
+        } else {
+            return name;
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return obj instanceof ClassCase && getID().equals(((ClassCase)obj).getID());
+    }
+
+    @Override
+    public int hashCode() {
+        return getID().hashCode();
+    }
+
+    @Override
+    public String toString() {
+        return getName();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/Hierarchy.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import java.util.List;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+
+import static shapegen.ClassCase.Kind.*;
+
+/**
+ *
+ * @author Robert Field
+ */
+public class Hierarchy {
+
+    public final ClassCase root;
+    public final Set<ClassCase> all;
+
+    public Hierarchy(ClassCase root) {
+        this.root = root;
+        root.init(new HashMap<String,Integer>());
+        Set<ClassCase> allClasses = new HashSet<>();
+        root.collectClasses(allClasses);
+        this.all = allClasses;
+    }
+
+    public boolean anyDefaults() {
+        for (ClassCase cc : all) {
+            if (cc.kind == IDEFAULT) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean get_OK() {
+        return root.get_OK();
+    }
+
+    public String testName() {
+        return root + "Test";
+    }
+
+    private static void genInterfaceList(StringBuilder buf, String prefix, List<ClassCase> interfaces) {
+        if (!interfaces.isEmpty()) {
+            buf.append(" ");
+            buf.append(prefix);
+            buf.append(" ");
+            buf.append(interfaces.get(0));
+            for (int i = 1; i < interfaces.size(); ++i) {
+                buf.append(", " + interfaces.get(i));
+            }
+        }
+    }
+
+    public static void genClassDef(StringBuilder buf, ClassCase cc, String implClass, List<ClassCase> defaultRef) {
+        if (cc.isInterface()) {
+            buf.append("interface ");
+            buf.append(cc.getName() + " ");
+            genInterfaceList(buf, "extends", cc.getInterfaces());
+            buf.append(" {\n");
+
+            switch (cc.kind) {
+                case IDEFAULT:
+                    buf.append("    default String m() { return \"\"; }\n");
+                    defaultRef.add(cc);
+                    break;
+                case IPRESENT:
+                    buf.append("    String m();\n");
+                    break;
+                case IVAC:
+                    break;
+                default:
+                    throw new AssertionError("Unexpected kind");
+            }
+            buf.append("}\n\n");
+        } else {
+            buf.append((cc.isAbstract()? "abstract " : ""));
+            buf.append(" class " + cc.getName());
+            if (cc.getSuperclass() != null) {
+                buf.append(" extends " + cc.getSuperclass());
+            }
+
+            genInterfaceList(buf, "implements", cc.getInterfaces());
+            buf.append(" {\n");
+
+            switch (cc.kind) {
+                case CCONCRETE:
+                    buf.append("   public String m() { return \"\"; }\n");
+                    break;
+                case CABSTRACT:
+                    buf.append("   public abstract String m();\n");
+                    break;
+                case CNONE:
+                    break;
+                default:
+                    throw new AssertionError("Unexpected kind");
+            }
+            buf.append("}\n\n");
+        }
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return obj instanceof Hierarchy && root.getID().equals(((Hierarchy)obj).root.getID());
+    }
+
+    @Override
+    public int hashCode() {
+        return root.getID().hashCode();
+    }
+
+    @Override
+    public String toString() {
+        return root.getName();
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/HierarchyGenerator.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import shapegen.ClassCase.Kind;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Collections;
+import java.util.ArrayList;
+import java.util.List;
+
+import static shapegen.ClassCase.Kind.*;
+
+import static java.lang.Math.pow;
+
+/**
+ *
+ * @author Robert Field
+ */
+public final class HierarchyGenerator {
+
+    private static int okcnt = 0;
+    private static int errcnt = 0;
+    private static Set<Hierarchy> uniqueOK = new HashSet<>();
+    private static Set<Hierarchy> uniqueErr = new HashSet<>();
+
+    /**
+     * @param args the command line arguments
+     */
+    public HierarchyGenerator() {
+        organize("exhaustive interface", iExhaustive(2));
+        organize("exhaustive class", cExhaustive());
+        organize("shapes interface", iShapes());
+        organize("shapes class/interface", ciShapes());
+
+        System.out.printf("\nExpect OK:    %d -- unique %d",   okcnt,  uniqueOK.size());
+        System.out.printf("\nExpect Error: %d -- unique %d\n", errcnt, uniqueErr.size());
+    }
+
+    public Collection<Hierarchy> getOK() {
+        return uniqueOK;
+    }
+
+    public Collection<Hierarchy> getErr() {
+        return uniqueErr;
+    }
+
+    private void organize(String tname, List<Hierarchy> totest) {
+        System.out.printf("\nTesting %s....\n", tname);
+        int nodefault = 0;
+        List<Hierarchy> ok = new ArrayList<>();
+        List<Hierarchy> err = new ArrayList<>();
+        for (Hierarchy cc : totest) {
+            if (cc.anyDefaults()) {
+                //System.out.printf("  %s\n", cc);
+                if (cc.get_OK()) {
+                    ok.add(cc);
+                } else {
+                    err.add(cc);
+                }
+            } else {
+                ++nodefault;
+            }
+        }
+
+        errcnt += err.size();
+        okcnt += ok.size();
+        uniqueErr.addAll(err);
+        uniqueOK.addAll(ok);
+
+        System.out.printf("  %5d No default\n  %5d Error\n  %5d OK\n  %5d Total\n",
+                nodefault, err.size(), ok.size(), totest.size());
+    }
+
+    public List<Hierarchy> iExhaustive(int idepth) {
+        List<ClassCase> current = new ArrayList<>();
+        for (int i = 0; i < idepth; ++i) {
+            current = ilayer(current);
+        }
+        return wrapInClassAndHierarchy(current);
+    }
+
+    private List<ClassCase> ilayer(List<ClassCase> srcLayer) {
+        List<ClassCase> lay = new ArrayList<>();
+        for (int i = (int) pow(2, srcLayer.size()) - 1; i >= 0; --i) {
+            List<ClassCase> itfs = new ArrayList<>();
+            for (int b = srcLayer.size() - 1; b >= 0; --b) {
+                if ((i & (1<<b)) != 0) {
+                    itfs.add(srcLayer.get(b));
+                }
+            }
+            lay.add(new ClassCase(IVAC, null, itfs));
+            lay.add(new ClassCase(IPRESENT, null, itfs));
+            lay.add(new ClassCase(IDEFAULT, null, itfs));
+            lay.add(new ClassCase(IDEFAULT, null, itfs));
+        }
+        return lay;
+    }
+
+    public List<Hierarchy> cExhaustive() {
+        final Kind[] iKinds = new Kind[]{IDEFAULT, IVAC, IPRESENT, null};
+        final Kind[] cKinds = new Kind[]{CNONE, CABSTRACT, CCONCRETE};
+        List<Hierarchy> totest = new ArrayList<>();
+        for (int i1 = 0; i1 < iKinds.length; ++i1) {
+            for (int i2 = 0; i2 < iKinds.length; ++i2) {
+                for (int i3 = 0; i3 < iKinds.length; ++i3) {
+                    for (int c1 = 0; c1 < cKinds.length; ++c1) {
+                        for (int c2 = 0; c2 < cKinds.length; ++c2) {
+                            for (int c3 = 0; c3 < cKinds.length; ++c3) {
+                                totest.add( new Hierarchy(
+                                        new ClassCase(cKinds[c1],
+                                            new ClassCase(cKinds[c2],
+                                                new ClassCase(cKinds[c3],
+                                                    null,
+                                                    iList(iKinds[i1])
+                                                ),
+                                                iList(iKinds[i2])
+                                            ),
+                                            iList(iKinds[i3])
+                                        )));
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return totest;
+    }
+
+    private List<ClassCase> iList(Kind kind) {
+        if (kind == null) {
+            return Collections.EMPTY_LIST;
+        } else {
+            List<ClassCase> itfs = new ArrayList<>();
+            itfs.add(new ClassCase(kind, null, Collections.EMPTY_LIST));
+            return itfs;
+        }
+    }
+
+    public List<Hierarchy> ciShapes() {
+        return wrapInHierarchy(TTShape.allCases(true));
+    }
+
+    public List<Hierarchy> iShapes() {
+        return wrapInClassAndHierarchy(TTShape.allCases(false));
+    }
+
+    public List<Hierarchy> wrapInClassAndHierarchy(List<ClassCase> ihs) {
+        List<Hierarchy> totest = new ArrayList<>();
+        for (ClassCase cc : ihs) {
+            List<ClassCase> interfaces = new ArrayList<>();
+            interfaces.add(cc);
+            totest.add(new Hierarchy(new ClassCase(CNONE, null, interfaces)));
+        }
+        return totest;
+    }
+
+    public List<Hierarchy> wrapInHierarchy(List<ClassCase> ihs) {
+        List<Hierarchy> totest = new ArrayList<>();
+        for (ClassCase cc : ihs) {
+            totest.add(new Hierarchy(cc));
+        }
+        return totest;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/Rule.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+/**
+ *
+ * @author Robert Field
+ */
+public abstract class Rule {
+
+    public final String name;
+
+    public Rule(String name) {
+        this.name = name;
+    }
+
+    abstract boolean guard(ClassCase cc);
+
+    abstract void eval(ClassCase cc);
+
+    @Override
+    public String toString() {
+        return name;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/RuleGroup.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import static shapegen.ClassCase.Kind.*;
+
+/**
+ *
+ * @author Robert Field
+ */
+public class RuleGroup {
+
+    final String name;
+    private final Rule[] rules;
+
+    public RuleGroup(String name, Rule[] rules) {
+        this.name = name;
+        this.rules = rules;
+    }
+
+    public boolean exec(ClassCase cc) {
+        boolean found = false;
+        for (Rule rule : rules) {
+            if (rule.guard(cc)) {
+                if (found) {
+                    throw new RuntimeException("Bad rules -- multiple matches " + toString() + " for " + cc);
+                } else {
+                    rule.eval(cc);
+                    found = true;
+                }
+            }
+        }
+        return found;
+    }
+
+    @Override
+    public String toString() {
+        return name;
+    }
+
+    public static RuleGroup PROVENENCE = new RuleGroup("Provenence", new Rule[] {
+        new Rule("P-CDeclare") {
+            boolean guard(ClassCase cc) {
+                return cc.isa(CCONCRETE, CABSTRACT);
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_mprov(cc);
+                cc.set_HasClassMethod(true);
+            }
+        },
+
+        new Rule("P-IDeclare") {
+            boolean guard(ClassCase cc) {
+                return cc.isa(IDEFAULT, IPRESENT);
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_mprov(cc);
+            }
+        },
+
+        new Rule("P-IntfInh") {
+            boolean guard(ClassCase cc) {
+                return cc.isa(IVAC, CNONE) && !(cc.hasSuperclass() && cc.getSuperclass().get_HasClassMethod());
+            }
+
+            void eval(ClassCase cc) {
+                Set<ClassCase> _S = new HashSet<>();
+                for (ClassCase t : cc.getSupertypes()) {
+                    _S.addAll(t.get_mprov());
+                }
+                Set<ClassCase> tops = new HashSet<>();
+                for (ClassCase _W : _S) {
+                    for (ClassCase _V : _S) {
+                        if (_V.equals(_W) || !(_V.isSubtypeOf(_W))) {
+                            tops.add(_W);
+                        }
+                    }
+                }
+                cc.set_mprov(tops);
+            }
+        },
+
+        new Rule("P-ClassInh") {
+            boolean guard(ClassCase cc) {
+                return cc.isa(CNONE) && (cc.hasSuperclass() && cc.getSuperclass().get_HasClassMethod());
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_mprov(cc.getSuperclass());
+                cc.set_HasClassMethod(true);
+            }
+        },
+
+    });
+
+    public static RuleGroup MARKER = new RuleGroup("Marker", new Rule[] {
+        new Rule("M-Default") {
+            boolean guard(ClassCase cc) {
+                return cc.isa(IDEFAULT);
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_HasDefault(true);
+            }
+        },
+
+        new Rule("M-Conc") {
+            boolean guard(ClassCase cc) {
+              return cc.isa(CCONCRETE);
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_IsConcrete(true);
+            }
+        },
+
+    });
+
+    public static RuleGroup RESOLUTION = new RuleGroup("Resolution", new Rule[] {
+        new Rule("R-Resolve") {
+            boolean guard(ClassCase cc) {
+                if (!(cc.isClass() && cc.get_mprov().size() == 1)) {
+                    return false;
+                }
+                ClassCase _V = cc.get_mprov().iterator().next();
+                return _V.get_IsConcrete() || _V.get_HasDefault();
+            }
+
+            void eval(ClassCase cc) {
+                ClassCase _V = cc.get_mprov().iterator().next();
+                cc.set_mres(_V);
+            }
+        },
+
+    });
+
+    public static RuleGroup DEFENDER = new RuleGroup("Defender", new Rule[] {
+        new Rule("D-Defend") {
+            boolean guard(ClassCase cc) {
+                ClassCase mresSuper = cc.hasSuperclass() ? cc.getSuperclass().get_mres() : null;
+                boolean eq = cc.get_mres() == null ? mresSuper == null : cc.get_mres().equals(mresSuper);
+                return cc.isa(CNONE) && !eq;
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_mdefend(cc.get_mres());
+            }
+        },
+
+    });
+
+    public static RuleGroup CHECKING = new RuleGroup("Checking", new Rule[] {
+        new Rule("C-Check") {
+            boolean guard(ClassCase cc) {
+                for (ClassCase t : cc.getSupertypes()) {
+                    if (! t.get_OK()) {
+                        return false;
+                    }
+                }
+                int defenderCount = 0;
+                int provCount = 0;
+                for (ClassCase prov : cc.get_mprov()) {
+                    if (prov.get_HasDefault()) {
+                        defenderCount++;
+                    }
+                    provCount++;
+                }
+                return provCount <= 1 || defenderCount == 0;
+            }
+
+            void eval(ClassCase cc) {
+                cc.set_OK(true);
+            }
+        },
+
+    });
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/TTNode.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import shapegen.ClassCase.Kind;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import static shapegen.ClassCase.Kind.*;
+
+/**
+ * Type Template Node
+ *
+ * @author Robert Field
+ */
+public class TTNode {
+
+    final List<TTNode> supertypes;
+    final boolean canBeClass;
+
+    private int currentKindIndex;
+    private Kind[] kinds;
+
+    public TTNode(List<TTNode> subtypes, boolean canBeClass) {
+        this.supertypes = subtypes;
+        this.canBeClass = canBeClass;
+    }
+
+    public void start(boolean includeClasses) {
+        kinds =
+             supertypes.isEmpty()?
+                (new Kind[]{IDEFAULT, IPRESENT})
+             :  ((includeClasses && canBeClass)?
+                  new Kind[]{CNONE, IVAC, IDEFAULT, IPRESENT}
+                : new Kind[]{IVAC, IDEFAULT, IPRESENT});
+        currentKindIndex = 0;
+
+        for (TTNode sub : supertypes) {
+            sub.start(includeClasses);
+        }
+    }
+
+    public boolean next() {
+        ++currentKindIndex;
+        if (currentKindIndex >= kinds.length) {
+            currentKindIndex = 0;
+            return false;
+        } else {
+            return true;
+        }
+    }
+
+    public void collectAllSubtypes(Set<TTNode> subs) {
+        subs.add(this);
+        for (TTNode n : supertypes) {
+            n.collectAllSubtypes(subs);
+        }
+    }
+
+    private Kind getKind() {
+        return kinds[currentKindIndex];
+    }
+
+    boolean isInterface() {
+        return getKind().isInterface;
+    }
+
+    boolean isClass() {
+        return !isInterface();
+    }
+
+    boolean hasDefault() {
+        return getKind() == IDEFAULT;
+    }
+
+    public boolean isValid() {
+        for (TTNode n : supertypes) {
+            if (!n.isValid() || (isInterface() && n.isClass())) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public ClassCase genCase() {
+        ClassCase subclass;
+        List<TTNode> ttintfs;
+        if (isClass() && !supertypes.isEmpty() && supertypes.get(0).isClass()) {
+            subclass = supertypes.get(0).genCase();
+            ttintfs = supertypes.subList(1, supertypes.size());
+        } else {
+            subclass = null;
+            ttintfs = supertypes;
+        }
+        List<ClassCase> intfs = new ArrayList<>();
+        for (TTNode node : ttintfs) {
+            intfs.add(node.genCase());
+        }
+        return new ClassCase(getKind(), subclass, intfs);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/TTParser.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.StringReader;
+
+import static java.lang.Character.isLetter;
+import static java.lang.Character.isUpperCase;
+import static java.lang.Character.isWhitespace;
+
+/**
+ * Parse a type template definition string
+ *
+ *   input     :: classDef
+ *   classDef  :: letter [ ( classDef* ) ]
+ *
+ * @author Robert Field
+ */
+public class TTParser extends StringReader {
+
+    private Map<Character, TTNode> letterMap = new HashMap<>();
+    private char ch;
+
+    private final String def;
+
+    public TTParser(String s) {
+        super(s);
+        this.def = s;
+    }
+
+    private void advance() throws IOException {
+        do {
+            ch = (char)read();
+        } while (isWhitespace(ch));
+    }
+
+    public TTNode parse() {
+        try {
+            advance();
+            return classDef();
+        } catch (IOException t) {
+            throw new RuntimeException(t);
+        }
+    }
+
+    private TTNode classDef() throws IOException {
+        if (!isLetter(ch)) {
+            if (ch == (char)-1) {
+                throw new IOException("Unexpected end of type template in " + def);
+            } else {
+                throw new IOException("Unexpected character in type template: " + (Character)ch + " in " + def);
+            }
+        }
+        char nodeCh = ch;
+        TTNode node = letterMap.get(nodeCh);
+        boolean canBeClass = isUpperCase(nodeCh);
+        advance();
+        if (node == null) {
+            List<TTNode> subtypes = new ArrayList<>();
+            if (ch == '(') {
+                advance();
+                while (ch != ')') {
+                    subtypes.add(classDef());
+                }
+                advance();
+            }
+            node = new TTNode(subtypes, canBeClass);
+            letterMap.put(nodeCh, node);
+        }
+        return node;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/fd/shapegen/TTShape.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package shapegen;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ *
+ * @author Robert Field
+ */
+public class TTShape {
+
+    private final TTNode root;
+    private final TTNode[] nodes;
+
+    TTShape(TTNode root) {
+        this.root = root;
+        Set<TTNode> subs = new HashSet<>();
+        root.collectAllSubtypes(subs);
+        nodes = subs.toArray(new TTNode[subs.size()]);
+    }
+
+    private List<ClassCase> toCases(boolean includeClasses) {
+        List<ClassCase> ccs = new ArrayList<>();
+        root.start(includeClasses);
+        int i;
+        outer:
+        while (true) {
+            if (root.isValid()) {
+                ClassCase cc = root.genCase();
+                //System.out.println(cc);
+                ccs.add(cc);
+            }
+
+            i = 0;
+            do {
+                if (i >= nodes.length) {
+                    break outer;
+                }
+            } while(!nodes[i++].next());
+        }
+        return ccs;
+    }
+
+   public static List<ClassCase> allCases(boolean includeClasses) {
+        List<ClassCase> ccs = new ArrayList<>();
+        for (TTShape shape : SHAPES) {
+            ccs.addAll(shape.toCases(includeClasses));
+        }
+        return ccs;
+    }
+
+    public static TTShape parse(String s) {
+        return new TTShape(new TTParser(s).parse());
+    }
+
+    public static final TTShape[] SHAPES = new TTShape[] {
+        parse("a"),
+        parse("a(b)"),
+        parse("A(bb)"),
+        parse("A(B(d)c(d))"),
+        parse("A(b(c))"),
+        parse("A(B(cd)d)"),
+        parse("A(B(c)c)"),
+        parse("A(B(Ce)d(e))"),
+        parse("A(B(C)d(e))"),
+        parse("A(Bc(d))"),
+        parse("A(B(d)dc)"),
+        parse("A(B(dc)dc)"),
+        parse("A(B(c(d))d)"),
+        parse("A(B(C(d))d)"),
+        parse("A(B(C(e)d(e))e)"),
+        parse("A(B(c(d))c)"),
+        parse("A(B(dc(d))c)"),
+        parse("A(B(C(d))d)"),
+    };
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/separate/Separate.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary smoke test for separate compilation of default methods
+ * @author  Maurizio Cimadamore
+ * @compile -XDallowDefaultMethods pkg1/A.java
+ * @compile -XDallowDefaultMethods Separate.java
+ */
+
+import pkg1.A;
+
+class Separate {
+    interface B extends A.I {
+        default void m() { A.m(this); }
+    }
+
+    interface C extends A.I, B { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/separate/pkg1/A.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package pkg1;
+
+public class A {
+    public interface I {
+        default void m() { A.m(this); }
+    }
+
+    public static void m(Object o) {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/defaultMethods/super/TestDefaultSuperCall.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,406 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @summary Automatic test for checking correctness of default super/this resolution
+ */
+
+import com.sun.source.util.JavacTask;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import javax.tools.Diagnostic;
+import javax.tools.JavaCompiler;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.ToolProvider;
+
+public class TestDefaultSuperCall {
+
+    static int checkCount = 0;
+
+    enum InterfaceKind {
+        DEFAULT("interface A extends B { default void m() { } }"),
+        ABSTRACT("interface A extends B { void m(); }"),
+        NONE("interface A extends B { }");
+
+        String interfaceStr;
+
+        InterfaceKind(String interfaceStr) {
+            this.interfaceStr = interfaceStr;
+        }
+
+        boolean methodDefined() {
+            return this == DEFAULT;
+        }
+    }
+
+    enum PruneKind {
+        NO_PRUNE("interface C { }"),
+        PRUNE("interface C extends A { }");
+
+        boolean methodDefined(InterfaceKind ik) {
+            return this == PRUNE &&
+                    ik.methodDefined();
+        }
+
+        String interfaceStr;
+
+        PruneKind(String interfaceStr) {
+            this.interfaceStr = interfaceStr;
+        }
+    }
+
+    enum QualifierKind {
+        DIRECT_1("C"),
+        DIRECT_2("A"),
+        INDIRECT("B"),
+        UNRELATED("E"),
+        ENCLOSING_1(null),
+        ENCLOSING_2(null);
+
+        String qualifierStr;
+
+        QualifierKind(String qualifierStr) {
+            this.qualifierStr = qualifierStr;
+        }
+
+        String getQualifier(Shape sh) {
+            switch (this) {
+                case ENCLOSING_1: return sh.enclosingAt(0);
+                case ENCLOSING_2: return sh.enclosingAt(1);
+                default:
+                    return qualifierStr;
+            }
+        }
+
+        boolean isEnclosing() {
+            return this == ENCLOSING_1 ||
+                    this == ENCLOSING_2;
+        }
+
+        boolean allowSuperCall(InterfaceKind ik, PruneKind pk) {
+            switch (this) {
+                case DIRECT_1:
+                    return pk.methodDefined(ik);
+                case DIRECT_2:
+                    return ik.methodDefined() && pk == PruneKind.NO_PRUNE;
+                default:
+                    return false;
+            }
+        }
+    }
+
+    enum ExprKind {
+        THIS("this"),
+        SUPER("super");
+
+        String exprStr;
+
+        ExprKind(String exprStr) {
+            this.exprStr = exprStr;
+        }
+    }
+
+    enum ElementKind {
+        INTERFACE("interface #N { #B }", true),
+        INTERFACE_EXTENDS("interface #N extends A, C { #B }", true),
+        CLASS("class #N { #B }", false),
+        CLASS_EXTENDS("abstract class #N implements A, C { #B }", false),
+        STATIC_CLASS("static class #N { #B }", true),
+        STATIC_CLASS_EXTENDS("abstract static class #N implements A, C { #B }", true),
+        ANON_CLASS("new Object() { #B };", false),
+        METHOD("void test() { #B }", false),
+        STATIC_METHOD("static void test() { #B }", true),
+        DEFAULT_METHOD("default void test() { #B }", false);
+
+        String templateDecl;
+        boolean isStatic;
+
+        ElementKind(String templateDecl, boolean isStatic) {
+            this.templateDecl = templateDecl;
+            this.isStatic = isStatic;
+        }
+
+        boolean isClassDecl() {
+            switch(this) {
+                case METHOD:
+                case STATIC_METHOD:
+                case DEFAULT_METHOD:
+                    return false;
+                default:
+                    return true;
+            }
+        }
+
+        boolean isAllowedEnclosing(ElementKind ek, boolean isTop) {
+            switch (this) {
+                case CLASS:
+                case CLASS_EXTENDS:
+                    //class is implicitly static inside interface, so skip this combo
+                    return ek.isClassDecl() &&
+                            ek != INTERFACE && ek != INTERFACE_EXTENDS;
+                case ANON_CLASS:
+                    return !ek.isClassDecl();
+                case METHOD:
+                    return ek == CLASS || ek == CLASS_EXTENDS ||
+                            ek == STATIC_CLASS || ek == STATIC_CLASS_EXTENDS ||
+                            ek == ANON_CLASS;
+                case INTERFACE:
+                case INTERFACE_EXTENDS:
+                case STATIC_CLASS:
+                case STATIC_CLASS_EXTENDS:
+                case STATIC_METHOD:
+                    return (isTop && (ek == CLASS || ek == CLASS_EXTENDS)) ||
+                            ek == STATIC_CLASS || ek == STATIC_CLASS_EXTENDS;
+                case DEFAULT_METHOD:
+                    return ek == INTERFACE || ek == INTERFACE_EXTENDS;
+                default:
+                    throw new AssertionError("Bad enclosing element kind" + this);
+            }
+        }
+
+        boolean isAllowedTop() {
+            switch (this) {
+                case CLASS:
+                case CLASS_EXTENDS:
+                case INTERFACE:
+                case INTERFACE_EXTENDS:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        boolean hasSuper() {
+            return this == INTERFACE_EXTENDS ||
+                    this == STATIC_CLASS_EXTENDS ||
+                    this == CLASS_EXTENDS;
+        }
+    }
+
+    static class Shape {
+
+        String shapeStr;
+        List<ElementKind> enclosingElements;
+        List<String> enclosingNames;
+        List<String> elementsWithMethod;
+
+        Shape(ElementKind... elements) {
+            System.err.println("elements = " + Arrays.toString(elements));
+            enclosingElements = new ArrayList<>();
+            enclosingNames = new ArrayList<>();
+            elementsWithMethod = new ArrayList<>();
+            int count = 0;
+            String prevName = null;
+            for (ElementKind ek : elements) {
+                String name = "name"+count++;
+                if (ek.isStatic) {
+                    enclosingElements = new ArrayList<>();
+                    enclosingNames = new ArrayList<>();
+                }
+                if (ek.isClassDecl()) {
+                    enclosingElements.add(ek);
+                    enclosingNames.add(name);
+                } else {
+                    elementsWithMethod.add(prevName);
+                }
+                String element = ek.templateDecl.replaceAll("#N", name);
+                shapeStr = shapeStr == null ? element : shapeStr.replaceAll("#B", element);
+                prevName = name;
+            }
+        }
+
+        String getShape(QualifierKind qk, ExprKind ek) {
+            String methName = ek == ExprKind.THIS ? "test" : "m";
+            String call = qk.getQualifier(this) + "." + ek.exprStr + "." + methName + "();";
+            return shapeStr.replaceAll("#B", call);
+        }
+
+        String enclosingAt(int index) {
+            return index < enclosingNames.size() ? enclosingNames.get(index) : "BAD";
+        }
+    }
+
+    public static void main(String... args) throws Exception {
+
+        //create default shared JavaCompiler - reused across multiple compilations
+        JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+        StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
+
+        for (InterfaceKind ik : InterfaceKind.values()) {
+            for (PruneKind pk : PruneKind.values()) {
+                for (ElementKind ek1 : ElementKind.values()) {
+                    if (!ek1.isAllowedTop()) continue;
+                    for (ElementKind ek2 : ElementKind.values()) {
+                        if (!ek2.isAllowedEnclosing(ek1, true)) continue;
+                        for (ElementKind ek3 : ElementKind.values()) {
+                            if (!ek3.isAllowedEnclosing(ek2, false)) continue;
+                            for (ElementKind ek4 : ElementKind.values()) {
+                                if (!ek4.isAllowedEnclosing(ek3, false)) continue;
+                                for (ElementKind ek5 : ElementKind.values()) {
+                                    if (!ek5.isAllowedEnclosing(ek4, false) || ek5.isClassDecl()) continue;
+                                    for (QualifierKind qk : QualifierKind.values()) {
+                                        for (ExprKind ek : ExprKind.values()) {
+                                            new TestDefaultSuperCall(ik, pk, new Shape(ek1, ek2, ek3, ek4, ek5), qk, ek).run(comp, fm);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        System.out.println("Total check executed: " + checkCount);
+    }
+
+    InterfaceKind ik;
+    PruneKind pk;
+    Shape sh;
+    QualifierKind qk;
+    ExprKind ek;
+    JavaSource source;
+    DiagnosticChecker diagChecker;
+
+    TestDefaultSuperCall(InterfaceKind ik, PruneKind pk, Shape sh, QualifierKind qk, ExprKind ek) {
+        this.ik = ik;
+        this.pk = pk;
+        this.sh = sh;
+        this.qk = qk;
+        this.ek = ek;
+        this.source = new JavaSource();
+        this.diagChecker = new DiagnosticChecker();
+    }
+
+    class JavaSource extends SimpleJavaFileObject {
+
+        String template = "interface E {}\n" +
+                          "interface B { }\n" +
+                          "#I\n" +
+                          "#P\n" +
+                          "#C";
+
+        String source;
+
+        public JavaSource() {
+            super(URI.create("myfo:/Test.java"), JavaFileObject.Kind.SOURCE);
+            source = template.replaceAll("#I", ik.interfaceStr)
+                    .replaceAll("#P", pk.interfaceStr)
+                    .replaceAll("#C", sh.getShape(qk, ek));
+        }
+
+        @Override
+        public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+            return source;
+        }
+    }
+
+    void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
+        JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
+                Arrays.asList("-XDallowDefaultMethods"), null, Arrays.asList(source));
+        try {
+            ct.analyze();
+        } catch (Throwable ex) {
+            throw new AssertionError("Error thrown when analyzing the following source:\n" + source.getCharContent(true));
+        }
+        check();
+    }
+
+    void check() {
+        boolean errorExpected = false;
+
+        boolean badEnclosing = false;
+        boolean badThis = false;
+        boolean badSuper = false;
+
+        if (qk == QualifierKind.ENCLOSING_1 &&
+                sh.enclosingNames.size() < 1) {
+            errorExpected |= true;
+            badEnclosing = true;
+        }
+
+        if (qk == QualifierKind.ENCLOSING_2 &&
+                sh.enclosingNames.size() < 2) {
+            errorExpected |= true;
+            badEnclosing = true;
+        }
+
+        if (ek == ExprKind.THIS) {
+            boolean found = false;
+            for (int i = 0; i < sh.enclosingElements.size(); i++) {
+                if (sh.enclosingElements.get(i) == ElementKind.ANON_CLASS) continue;
+                if (sh.enclosingNames.get(i).equals(qk.getQualifier(sh))) {
+                    found = sh.elementsWithMethod.contains(sh.enclosingNames.get(i));
+                    break;
+                }
+            }
+            errorExpected |= !found;
+            if (!found) {
+                badThis = true;
+            }
+        }
+
+        if (ek == ExprKind.SUPER) {
+
+            int lastIdx = sh.enclosingElements.size() - 1;
+            boolean found = lastIdx == -1 ? false :
+                    sh.enclosingElements.get(lastIdx).hasSuper() && qk.allowSuperCall(ik, pk);
+
+            errorExpected |= !found;
+            if (!found) {
+                badSuper = true;
+            }
+        }
+
+        checkCount++;
+        if (diagChecker.errorFound != errorExpected) {
+            throw new AssertionError("Problem when compiling source:\n" + source.getCharContent(true) +
+                    "\nenclosingElems: " + sh.enclosingElements +
+                    "\nenclosingNames: " + sh.enclosingNames +
+                    "\nelementsWithMethod: " + sh.elementsWithMethod +
+                    "\nbad encl: " + badEnclosing +
+                    "\nbad this: " + badThis +
+                    "\nbad super: " + badSuper +
+                    "\nqual kind: " + qk +
+                    "\nfound error: " + diagChecker.errorFound);
+        }
+    }
+
+    static class DiagnosticChecker implements javax.tools.DiagnosticListener<JavaFileObject> {
+
+        boolean errorFound;
+
+        public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
+                System.err.println(diagnostic.getMessage(Locale.getDefault()));
+                errorFound = true;
+            }
+        }
+    }
+}
--- a/langtools/test/tools/javac/diags/CheckResourceKeys.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/diags/CheckResourceKeys.java	Wed Nov 14 16:41:12 2012 -0800
@@ -310,9 +310,8 @@
                     pkg, EnumSet.of(JavaFileObject.Kind.CLASS), true)) {
                 String name = fo.getName();
                 // ignore resource files, and files which are not really part of javac
-                if (name.contains("resources")
-                        || name.contains("Launcher.class")
-                        || name.contains("CreateSymbols.class"))
+                if (name.matches(".*resources.[A-Za-z_0-9]+\\.class.*")
+                        || name.matches(".*CreateSymbols\\.class.*"))
                     continue;
                 scan(fo, results);
             }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/AuxiliaryClassWarning/ClassUsingAuxiliary.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file
+// options: -Xlint:auxiliaryclass
+
+class ClassUsingAuxiliary {
+    AuxiliaryClass ahem;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/AuxiliaryClassWarning/ClassWithAuxiliary.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+class ClassWithAuxiliaryClass {
+}
+
+// Auxiliary class that cannot be found through implicit compilation.
+class AuxiliaryClass {
+}
--- a/langtools/test/tools/javac/diags/examples/CatchWithoutTry.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/diags/examples/CatchWithoutTry.java	Wed Nov 14 16:41:12 2012 -0800
@@ -22,9 +22,6 @@
  */
 
 // key: compiler.err.catch.without.try
-// key: compiler.err.expected
-// key: compiler.err.not.stmt
-// key: compiler.err.lambda.not.supported.in.source
 
 class CatchWithoutTry {
     void m() {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/DefaultOverridesObjectMember.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.default.overrides.object.member
+// options: -XDallowDefaultMethods
+
+interface DefaultOverridesObjectMember {
+    default String toString() { return ""; }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/OverriddenDefault.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.illegal.default.super.call
+// key: compiler.misc.overridden.default
+// options: -XDallowDefaultMethods
+
+class OverriddenDefault {
+    interface I { default void m() {  } }
+    interface J extends I { default void m() {  } }
+    interface K extends I {}
+
+    static class C implements J, K {
+        void foo() { K.super.m(); }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/RedundantSupertype.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.illegal.default.super.call
+// key: compiler.misc.redundant.supertype
+// options: -XDallowDefaultMethods
+
+class RedundantSupertype {
+    interface I { default void m() {  } }
+    interface J extends I { default void m() {  } }
+
+    static class C implements I, J {
+        void foo() { I.super.m(); }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/TypesIncompatibleAbstractDefault.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.types.incompatible.abstract.default
+// options: -XDallowDefaultMethods
+
+class TypesIncompatibleAbstractDefault {
+    interface A {
+        default void m() { }
+    }
+
+    interface B {
+        void m();
+    }
+
+    interface AB extends A, B { }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/diags/examples/TypesIncompatibleUnrelatedDefaults.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+// key: compiler.err.types.incompatible.unrelated.defaults
+// options: -XDallowDefaultMethods
+
+class TypesIncompatibleUnrelatedDefaults {
+    interface A {
+        default void m() { }
+    }
+
+    interface B {
+        default void m() { }
+    }
+
+    interface AB extends A, B { }
+}
--- a/langtools/test/tools/javac/generics/7022054/T7022054pos1.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/generics/7022054/T7022054pos1.java	Wed Nov 14 16:41:12 2012 -0800
@@ -26,7 +26,8 @@
  * @bug 7022054
  *
  * @summary  Invalid compiler error on covariant overriding methods with the same erasure
- * @compile T7022054pos1.java
+ * @compile -source 7 T7022054pos1.java
+ * @compile/fail -XDstrictMethodClashCheck T7022054pos1.java
  *
  */
 
--- a/langtools/test/tools/javac/generics/7022054/T7022054pos2.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/generics/7022054/T7022054pos2.java	Wed Nov 14 16:41:12 2012 -0800
@@ -26,8 +26,8 @@
  * @bug 7022054
  *
  * @summary  Invalid compiler error on covariant overriding methods with the same erasure
- * @compile T7022054pos2.java
- *
+ * @compile -source 7 T7022054pos2.java
+ * @compile/fail -XDstrictMethodClashCheck T7022054pos2.java
  */
 
 class T7022054pos2 {
--- a/langtools/test/tools/javac/generics/inference/6611449/T6611449.out	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/generics/inference/6611449/T6611449.out	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
-T6611449.java:18:9: compiler.err.cant.apply.symbols: kindname.constructor, T6611449, int,{(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T,T), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T), (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, S))}
-T6611449.java:19:9: compiler.err.cant.apply.symbols: kindname.constructor, T6611449, int,int,{(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T,T), (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, S)),(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T), (compiler.misc.infer.arg.length.mismatch: T))}
+T6611449.java:18:9: compiler.err.cant.apply.symbols: kindname.constructor, T6611449, int,{(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T), (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, S)),(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T,T), (compiler.misc.infer.arg.length.mismatch: T))}
+T6611449.java:19:9: compiler.err.cant.apply.symbols: kindname.constructor, T6611449, int,int,{(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T), (compiler.misc.infer.arg.length.mismatch: T)),(compiler.misc.inapplicable.method: kindname.constructor, T6611449, <T>T6611449(T,T), (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, S))}
 T6611449.java:20:9: compiler.err.cant.apply.symbol: kindname.method, m1, T, int, kindname.class, T6611449<S>, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, S)
 T6611449.java:21:9: compiler.err.cant.apply.symbol: kindname.method, m2, T,T, int,int, kindname.class, T6611449<S>, (compiler.misc.inferred.do.not.conform.to.upper.bounds: java.lang.Integer, S)
 4 errors
--- a/langtools/test/tools/javac/generics/inference/7086601/T7086601a.out	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/generics/inference/7086601/T7086601a.out	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
-T7086601a.java:20:9: compiler.err.cant.apply.symbols: kindname.method, m1, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, m1(java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m1(java.lang.Iterable<? super S>,java.lang.Iterable<? super S>), (compiler.misc.incompatible.upper.bounds: S, java.lang.Integer,java.lang.String,java.lang.Object))}
-T7086601a.java:24:9: compiler.err.cant.apply.symbols: kindname.method, m2, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,java.lang.Iterable<java.lang.Double>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, m2(java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m2(java.lang.Iterable<? super S>,java.lang.Iterable<? super S>,java.lang.Iterable<? super S>), (compiler.misc.incompatible.upper.bounds: S, java.lang.Double,java.lang.Integer,java.lang.String,java.lang.Object))}
-T7086601a.java:28:9: compiler.err.cant.apply.symbols: kindname.method, m3, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, m3(java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m3(java.lang.Iterable<? super S>...), (compiler.misc.incompatible.upper.bounds: S, java.lang.Integer,java.lang.String,java.lang.Object))}
-T7086601a.java:32:9: compiler.err.cant.apply.symbols: kindname.method, m3, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,java.lang.Iterable<java.lang.Double>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, m3(java.lang.Object), (compiler.misc.arg.length.mismatch)),(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m3(java.lang.Iterable<? super S>...), (compiler.misc.incompatible.upper.bounds: S, java.lang.Double,java.lang.Integer,java.lang.String,java.lang.Object))}
+T7086601a.java:20:9: compiler.err.cant.apply.symbols: kindname.method, m1, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m1(java.lang.Iterable<? super S>,java.lang.Iterable<? super S>), (compiler.misc.incompatible.upper.bounds: S, java.lang.Integer,java.lang.String,java.lang.Object)),(compiler.misc.inapplicable.method: kindname.method, T7086601, m1(java.lang.Object), (compiler.misc.arg.length.mismatch))}
+T7086601a.java:24:9: compiler.err.cant.apply.symbols: kindname.method, m2, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,java.lang.Iterable<java.lang.Double>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m2(java.lang.Iterable<? super S>,java.lang.Iterable<? super S>,java.lang.Iterable<? super S>), (compiler.misc.incompatible.upper.bounds: S, java.lang.Double,java.lang.Integer,java.lang.String,java.lang.Object)),(compiler.misc.inapplicable.method: kindname.method, T7086601, m2(java.lang.Object), (compiler.misc.arg.length.mismatch))}
+T7086601a.java:28:9: compiler.err.cant.apply.symbols: kindname.method, m3, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m3(java.lang.Iterable<? super S>...), (compiler.misc.incompatible.upper.bounds: S, java.lang.Integer,java.lang.String,java.lang.Object)),(compiler.misc.inapplicable.method: kindname.method, T7086601, m3(java.lang.Object), (compiler.misc.arg.length.mismatch))}
+T7086601a.java:32:9: compiler.err.cant.apply.symbols: kindname.method, m3, java.lang.Iterable<java.lang.String>,java.lang.Iterable<java.lang.Integer>,java.lang.Iterable<java.lang.Double>,{(compiler.misc.inapplicable.method: kindname.method, T7086601, <S>m3(java.lang.Iterable<? super S>...), (compiler.misc.incompatible.upper.bounds: S, java.lang.Double,java.lang.Integer,java.lang.String,java.lang.Object)),(compiler.misc.inapplicable.method: kindname.method, T7086601, m3(java.lang.Object), (compiler.misc.arg.length.mismatch))}
 4 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/incompleteStatements/T8000484.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8000484
+ * @summary Bad error recovery when 'catch' without 'try' is found
+ * @compile/fail/ref=T8000484.out -XDrawDiagnostics T8000484.java
+ */
+
+public class T8000484 {
+    void m() {
+        catch (Exception e){}
+        else{}
+        finally{}
+        catch (Exception e) {catch (Exception e){}}
+        else{else{}}
+        finally{finally{}}
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/incompleteStatements/T8000484.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,10 @@
+T8000484.java:10:9: compiler.err.catch.without.try
+T8000484.java:11:9: compiler.err.else.without.if
+T8000484.java:12:9: compiler.err.finally.without.try
+T8000484.java:13:30: compiler.err.catch.without.try
+T8000484.java:13:9: compiler.err.catch.without.try
+T8000484.java:14:14: compiler.err.else.without.if
+T8000484.java:14:9: compiler.err.else.without.if
+T8000484.java:15:17: compiler.err.finally.without.try
+T8000484.java:15:9: compiler.err.finally.without.try
+9 errors
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/options/T6949443.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2010, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6949443
+ * @summary VisitTree assertion triggered using -Xjcov on small sample program
+ * @compile -Xjcov T6949443.java
+ */
+
+public class T6949443 {
+    public static void main(String[] args) {
+        Integer i = 0;
+        i++;
+    }
+}
--- a/langtools/test/tools/javac/quid/T6999438.out	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/quid/T6999438.out	Wed Nov 14 16:41:12 2012 -0800
@@ -1,4 +1,4 @@
-T6999438.java:8:9: compiler.err.illegal.char: 35
+T6999438.java:8:9: compiler.err.illegal.char: #
 T6999438.java:8:10: compiler.err.illegal.start.of.type
 T6999438.java:8:25: compiler.err.expected: token.identifier
 T6999438.java:8:26: compiler.err.expected: ';'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/resolve/tests/AmbiguityPrecedence.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+@TraceResolve(keys={"compiler.err.ref.ambiguous"})
+class AmbiguityPrecedence {
+
+    @Candidate(applicable=Phase.BASIC)
+    static void m1(long l, int i) {}
+    @Candidate(applicable=Phase.BASIC)
+    static void m1(int i, long l) {}
+    @Candidate
+    static void m1(Integer i1, Integer i2) {}
+
+    @Candidate(applicable=Phase.BOX)
+    static void m2(Object o, Integer i) {}
+    @Candidate(applicable=Phase.BOX)
+    static void m2(Integer i, Object o) {}
+    @Candidate
+    static void m2(Integer... o) {}
+
+    {
+        m1(1, 1);
+        m2(1, 1);
+    }
+}
--- a/langtools/test/tools/javac/scope/7046348/EagerInterfaceCompletionTest.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/scope/7046348/EagerInterfaceCompletionTest.java	Wed Nov 14 16:41:12 2012 -0800
@@ -30,6 +30,7 @@
 import java.io.File;
 import java.net.URI;
 import java.util.Arrays;
+import java.util.List;
 
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticListener;
@@ -43,13 +44,15 @@
 
     JavaCompiler javacTool;
     File testDir;
+    VersionKind versionKind;
     HierarchyKind hierarchyKind;
     TestKind testKind;
     ActionKind actionKind;
 
-    EagerInterfaceCompletionTest(JavaCompiler javacTool, File testDir,
+    EagerInterfaceCompletionTest(JavaCompiler javacTool, File testDir, VersionKind versionKind,
             HierarchyKind hierarchyKind, TestKind testKind, ActionKind actionKind) {
         this.javacTool = javacTool;
+        this.versionKind = versionKind;
         this.hierarchyKind = hierarchyKind;
         this.testDir = testDir;
         this.testKind = testKind;
@@ -62,7 +65,7 @@
         actionKind.doAction(this);
         DiagnosticChecker dc = new DiagnosticChecker();
         compile(dc, testKind.source);
-        if (testKind.completionFailure(actionKind, hierarchyKind) != dc.errorFound) {
+        if (testKind.completionFailure(versionKind, actionKind, hierarchyKind) != dc.errorFound) {
             if (dc.errorFound) {
                 error("Unexpected completion failure" +
                       "\nhierarhcyKind " + hierarchyKind +
@@ -80,7 +83,8 @@
     void compile(DiagnosticChecker dc, JavaSource... sources) {
         try {
             CompilationTask ct = javacTool.getTask(null, null, dc,
-                    Arrays.asList("-d", testDir.getAbsolutePath(), "-cp", testDir.getAbsolutePath()),
+                    Arrays.asList("-d", testDir.getAbsolutePath(), "-cp",
+                    testDir.getAbsolutePath(), versionKind.optsArr[0], versionKind.optsArr[1]),
                     null, Arrays.asList(sources));
             ct.call();
         }
@@ -108,12 +112,25 @@
         boolean errorFound = false;
 
         public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
-            errorFound = true;
+            if (diagnostic.getKind() == Diagnostic.Kind.ERROR) {
+                errorFound = true;
+            }
         }
     }
 
     //global declarations
 
+    enum VersionKind {
+        PRE_LAMBDA("-source", "7"),
+        LAMBDA("-source", "8");
+
+        String[] optsArr;
+
+        VersionKind(String... optsArr) {
+            this.optsArr = optsArr;
+        }
+    }
+
     enum HierarchyKind {
         INTERFACE("interface A { boolean f = false; void m(); }\n" +
                   "class B implements A { public void m() {} }"),
@@ -157,13 +174,14 @@
             this.source = new JavaSource("Test2.java", code);
         }
 
-        boolean completionFailure(ActionKind ak, HierarchyKind hk) {
+        boolean completionFailure(VersionKind vk, ActionKind ak, HierarchyKind hk) {
             switch (this) {
                 case ACCESS_ONLY:
                 case CONSTR: return ak == ActionKind.REMOVE_B;
                 case FIELD:
                 case SUPER: return true;
-                case METHOD: return hk != HierarchyKind.INTERFACE || ak == ActionKind.REMOVE_B;
+                case METHOD: return hk != HierarchyKind.INTERFACE || ak == ActionKind.REMOVE_B ||
+                        (hk == HierarchyKind.INTERFACE && ak == ActionKind.REMOVE_A && vk == VersionKind.LAMBDA);
                 default: throw new AssertionError("Unexpected test kind " + this);
             }
         }
@@ -173,12 +191,15 @@
         String SCRATCH_DIR = System.getProperty("user.dir");
         JavaCompiler javacTool = ToolProvider.getSystemJavaCompiler();
         int n = 0;
-        for (HierarchyKind hierarchyKind : HierarchyKind.values()) {
-            for (TestKind testKind : TestKind.values()) {
-                for (ActionKind actionKind : ActionKind.values()) {
-                    File testDir = new File(SCRATCH_DIR, "test"+n);
-                    new EagerInterfaceCompletionTest(javacTool, testDir, hierarchyKind, testKind, actionKind).test();
-                    n++;
+        for (VersionKind versionKind : VersionKind.values()) {
+            for (HierarchyKind hierarchyKind : HierarchyKind.values()) {
+                for (TestKind testKind : TestKind.values()) {
+                    for (ActionKind actionKind : ActionKind.values()) {
+                        File testDir = new File(SCRATCH_DIR, "test"+n);
+                        new EagerInterfaceCompletionTest(javacTool, testDir, versionKind,
+                                hierarchyKind, testKind, actionKind).test();
+                        n++;
+                    }
                 }
             }
         }
--- a/langtools/test/tools/javac/tree/MakeLiteralTest.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/tree/MakeLiteralTest.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,7 +1,5 @@
-
-
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, 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
@@ -30,13 +28,14 @@
  */
 
 import com.sun.tools.javac.code.Type;
+import com.sun.tools.javac.code.TypeTag;
 import com.sun.tools.javac.code.Symtab;
 import com.sun.tools.javac.code.Types;
 import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.tree.JCTree.JCLiteral;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.tree.TreeMaker;
-import static com.sun.tools.javac.code.TypeTags.*;
+import static com.sun.tools.javac.code.TypeTag.*;
 
 public class MakeLiteralTest {
     public static void main(String... args) throws Exception {
@@ -65,9 +64,9 @@
             throw new Exception(errors + " errors found");
     }
 
-    void test(Object value, int tag, Type type, Object constValue) {
+    void test(Object value, TypeTag tag, Type type, Object constValue) {
         JCLiteral l = maker.Literal(value);
-        if (l.type.tag != tag)
+        if (!l.type.hasTag(tag))
             error("unexpected tag: " + l.getTag() + ": expected: " + tag);
         if (!types.isSameType(l.type, type))
             error("unexpected type: " + l.type + ": expected: " + type);
--- a/langtools/test/tools/javac/versions/check.sh	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javac/versions/check.sh	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 2012, 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
@@ -22,7 +22,7 @@
 #
 
 # @test
-# @bug 4981566 5028634 5094412 6304984 7025786 7025789
+# @bug 4981566 5028634 5094412 6304984 7025786 7025789 8001112
 # @summary Check interpretation of -target and -source options
 # @build CheckClassFileVersion
 # @run shell check.sh 
@@ -47,32 +47,39 @@
   "$JC" ${TESTTOOLVMOPTS} -d $TC $* $TC/X.java && "$J" $CFV $TC/X.class $V || exit 2
 }
 
+# check for all combinations of target values
+check_target() {
+  check $1 -source $2 -target $3
+  check $1 -source $2 -target 1.${3}
+}
+# check for all combinations of source and target values
+check_source_target() {
+  check_target $1 $2     $3
+  check_target $1 1.${2} $3
+}
+
 check 48.0 -source 1.4
 
 check 49.0 -source 1.4 -target 1.5
 check 49.0 -source 1.5 -target 1.5
 
-check 50.0 -source 1.4 -target 1.6
-check 50.0 -source 1.5 -target 1.6
-check 50.0 -source 1.6 -target 1.6
-check 50.0 -source 1.6 -target 6
-check 50.0 -source 6 -target 1.6
-check 50.0 -source 6 -target 6
+check_target        50.0 1.4 6
+check_target        50.0 1.5 6
+check_source_target 50.0 6   6
+
+check_target        51.0 1.4 7
+check_target        51.0 1.5 7
+check_source_target 51.0 6   7
+check_source_target 51.0 7   7
 
-check 51.0
-check 51.0 -source 1.5
-check 51.0 -source 1.6
-check 51.0 -source 6
-check 51.0 -source 1.7
-check 51.0 -source 7
-check 51.0 -source 7 -target 1.7
-check 51.0 -source 7 -target 7
+check_target        52.0 1.4 8
+check_target        52.0 1.5 8
+check_source_target 52.0 6   8
+check_source_target 52.0 7   8
+check_source_target 52.0 8   8
 
-# Update when class file version is revved
-check 51.0 -source 1.8
-check 51.0 -source 8
-check 51.0 -target 1.8
-check 51.0 -target 8
+# and finally the default with no options
+check 52.0
 
 # Check source versions
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @compile ClassUsingAnotherAuxiliary.java NotAClassName.java
+ * @compile -Xlint:auxiliaryclass ClassUsingAnotherAuxiliary.java NotAClassName.java
+ * @compile/fail/ref=ClassUsingAnotherAuxiliary.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAnotherAuxiliary.java NotAClassName.java
+ */
+
+class ClassUsingAnotherAuxiliary {
+    AnAuxiliaryClass ahem;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAnotherAuxiliary.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,4 @@
+ClassUsingAnotherAuxiliary.java:32:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AnAuxiliaryClass, NotAClassName.java
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @clean ClassUsingAuxiliary ClassWithAuxiliary AuxiliaryClass ClassWithAuxiliary$NotAnAuxiliaryClass ClassWithAuxiliary$NotAnAuxiliaryClassEither
+ * @run compile ClassUsingAuxiliary.java ClassWithAuxiliary.java
+ * @run compile/fail/ref=ClassUsingAuxiliary1.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAuxiliary.java ClassWithAuxiliary.java
+ * @run compile/fail/ref=ClassUsingAuxiliary2.out -XDrawDiagnostics -Werror -Xlint:auxiliaryclass ClassUsingAuxiliary.java
+ */
+
+class ClassUsingAuxiliary {
+    AuxiliaryClass ahem;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary1.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,4 @@
+ClassUsingAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassUsingAuxiliary2.out	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,4 @@
+ClassUsingAuxiliary.java:33:5: compiler.warn.auxiliary.class.accessed.from.outside.of.its.source.file: AuxiliaryClass, ClassWithAuxiliary.java
+- compiler.err.warnings.and.werror
+1 error
+1 warning
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/ClassWithAuxiliary.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+public class ClassWithAuxiliary {
+    public static class NotAnAuxiliaryClass { }
+    public class NotAnAuxiliaryClassEither { }
+}
+
+// Auxiliary class that cannot be found through implicit compilation.
+class AuxiliaryClass {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/NotAClassName.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+class AnAuxiliaryClass {
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/warnings/AuxiliaryClass/SelfClassWithAux.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * Test that an auxiliary class referenced from its own source file,
+ * does not trigger the warning. Such code does not prevent implicit
+ * compilation. Also test that references to inner classes do not trigger the warning.
+ */
+
+/*
+ * @test
+ * @run compile -Werror -Xlint:auxiliaryclass SelfClassWithAux.java ClassWithAuxiliary.java
+ * @run compile -Werror -Xlint:auxiliaryclass SelfClassWithAux.java
+ */
+
+class SelfClassWithAux {
+    Aux aux;
+    ClassWithAuxiliary.NotAnAuxiliaryClass alfa;
+    ClassWithAuxiliary.NotAnAuxiliaryClassEither beta;
+}
+
+class Aux {
+    Aux aux;
+}
--- a/langtools/test/tools/javadoc/6958836/Test.java	Tue Nov 13 20:02:39 2012 -0800
+++ b/langtools/test/tools/javadoc/6958836/Test.java	Wed Nov 14 16:41:12 2012 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2012, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 6958836
+ * @bug 6958836 8002168
  * @summary javadoc should support -Xmaxerrs and -Xmaxwarns
  */
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javadoc/CheckResourceKeys.java	Wed Nov 14 16:41:12 2012 -0800
@@ -0,0 +1,240 @@
+/*
+ * Copyright (c) 2010, 2012, 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8000612
+ * @summary need test program to validate javadoc resource bundles
+ */
+
+import java.io.*;
+import java.util.*;
+import javax.tools.*;
+import com.sun.tools.classfile.*;
+
+/**
+ * Compare string constants in javadoc classes against keys in javadoc resource bundles.
+ */
+public class CheckResourceKeys {
+    /**
+     * Main program.
+     * Options:
+     * -finddeadkeys
+     *      look for keys in resource bundles that are no longer required
+     * -findmissingkeys
+     *      look for keys in resource bundles that are missing
+     *
+     * @throws Exception if invoked by jtreg and errors occur
+     */
+    public static void main(String... args) throws Exception {
+        CheckResourceKeys c = new CheckResourceKeys();
+        if (c.run(args))
+            return;
+
+        if (is_jtreg())
+            throw new Exception(c.errors + " errors occurred");
+        else
+            System.exit(1);
+    }
+
+    static boolean is_jtreg() {
+        return (System.getProperty("test.src") != null);
+    }
+
+    /**
+     * Main entry point.
+     */
+    boolean run(String... args) throws Exception {
+        boolean findDeadKeys = false;
+        boolean findMissingKeys = false;
+
+        if (args.length == 0) {
+            if (is_jtreg()) {
+                findDeadKeys = true;
+                findMissingKeys = true;
+            } else {
+                System.err.println("Usage: java CheckResourceKeys <options>");
+                System.err.println("where options include");
+                System.err.println("  -finddeadkeys      find keys in resource bundles which are no longer required");
+                System.err.println("  -findmissingkeys   find keys in resource bundles that are required but missing");
+                return true;
+            }
+        } else {
+            for (String arg: args) {
+                if (arg.equalsIgnoreCase("-finddeadkeys"))
+                    findDeadKeys = true;
+                else if (arg.equalsIgnoreCase("-findmissingkeys"))
+                    findMissingKeys = true;
+                else
+                    error("bad option: " + arg);
+            }
+        }
+
+        if (errors > 0)
+            return false;
+
+        Set<String> codeKeys = getCodeKeys();
+        Set<String> resourceKeys = getResourceKeys();
+
+        System.err.println("found " + codeKeys.size() + " keys in code");
+        System.err.println("found " + resourceKeys.size() + " keys in resource bundles");
+
+        if (findDeadKeys)
+            findDeadKeys(codeKeys, resourceKeys);
+
+        if (findMissingKeys)
+            findMissingKeys(codeKeys, resourceKeys);
+
+        return (errors == 0);
+    }
+
+    /**
+     * Find keys in resource bundles which are probably no longer required.
+     * A key is required if there is a string in the code that is a resource key,
+     * or if the key is well-known according to various pragmatic rules.
+     */
+    void findDeadKeys(Set<String> codeKeys, Set<String> resourceKeys) {
+        for (String rk: resourceKeys) {
+            if (codeKeys.contains(rk))
+                continue;
+
+            error("Resource key not found in code: " + rk);
+        }
+    }
+
+    /**
+     * For all strings in the code that look like they might be
+     * a resource key, verify that a key exists.
+     */
+    void findMissingKeys(Set<String> codeKeys, Set<String> resourceKeys) {
+        for (String ck: codeKeys) {
+            if (resourceKeys.contains(ck))
+                continue;
+            error("No resource for \"" + ck + "\"");
+        }
+    }
+
+    /**
+     * Get the set of strings from (most of) the javadoc classfiles.
+     */
+    Set<String> getCodeKeys() throws IOException {
+        Set<String> results = new TreeSet<String>();
+        JavaCompiler c = ToolProvider.getSystemJavaCompiler();
+        JavaFileManager fm = c.getStandardFileManager(null, null, null);
+        JavaFileManager.Location javadocLoc = findJavadocLocation(fm);
+        String[] pkgs = {
+            "com.sun.tools.doclets",
+            "com.sun.tools.javadoc"
+        };
+        for (String pkg: pkgs) {
+            for (JavaFileObject fo: fm.list(javadocLoc,
+                    pkg, EnumSet.of(JavaFileObject.Kind.CLASS), true)) {
+                String name = fo.getName();
+                // ignore resource files
+                if (name.matches(".*resources.[A-Za-z_0-9]+\\.class.*"))
+                    continue;
+                scan(fo, results);
+            }
+        }
+
+        // special handling for code strings synthesized in
+        // com.sun.tools.doclets.internal.toolkit.util.Util.getTypeName
+        String[] extras = {
+            "AnnotationType", "Class", "Enum", "Error", "Exception", "Interface"
+        };
+        for (String s: extras) {
+            if (results.contains("doclet." + s))
+                results.add("doclet." + s.toLowerCase());
+        }
+
+        return results;
+    }
+
+    // depending on how the test is run, javadoc may be on bootclasspath or classpath
+    JavaFileManager.Location findJavadocLocation(JavaFileManager fm) {
+        JavaFileManager.Location[] locns =
+            { StandardLocation.PLATFORM_CLASS_PATH, StandardLocation.CLASS_PATH };
+        try {
+            for (JavaFileManager.Location l: locns) {
+                JavaFileObject fo = fm.getJavaFileForInput(l,
+                    "com.sun.tools.javadoc.Main", JavaFileObject.Kind.CLASS);
+                if (fo != null) {
+                    System.err.println("found javadoc in " + l);
+                    return l;
+                }
+            }
+        } catch (IOException e) {
+            throw new Error(e);
+        }
+        throw new IllegalStateException("Cannot find javadoc");
+    }
+
+    /**
+     * Get the set of strings from a class file.
+     * Only strings that look like they might be a resource key are returned.
+     */
+    void scan(JavaFileObject fo, Set<String> results) throws IOException {
+        //System.err.println("scan " + fo.getName());
+        InputStream in = fo.openInputStream();
+        try {
+            ClassFile cf = ClassFile.read(in);
+            for (ConstantPool.CPInfo cpinfo: cf.constant_pool.entries()) {
+                if (cpinfo.getTag() == ConstantPool.CONSTANT_Utf8) {
+                    String v = ((ConstantPool.CONSTANT_Utf8_info) cpinfo).value;
+                    if (v.matches("(doclet|main|javadoc|tag)\\.[A-Za-z0-9-_.]+"))
+                        results.add(v);
+                }
+            }
+        } catch (ConstantPoolException ignore) {
+        } finally {
+            in.close();
+        }
+    }
+
+    /**
+     * Get the set of keys from the javadoc resource bundles.
+     */
+    Set<String> getResourceKeys() {
+        String[] names = {
+                "com.sun.tools.doclets.formats.html.resources.standard",
+                "com.sun.tools.doclets.internal.toolkit.resources.doclets",
+                "com.sun.tools.javadoc.resources.javadoc",
+        };
+        Set<String> results = new TreeSet<String>();
+        for (String name : names) {
+            ResourceBundle b = ResourceBundle.getBundle(name);
+            results.addAll(b.keySet());
+        }
+        return results;
+    }
+
+    /**
+     * Report an error.
+     */
+    void error(String msg) {
+        System.err.println("Error: " + msg);
+        errors++;
+    }
+
+    int errors;
+}
--- a/make/scripts/vsvars.sh	Tue Nov 13 20:02:39 2012 -0800
+++ b/make/scripts/vsvars.sh	Wed Nov 14 16:41:12 2012 -0800
@@ -183,6 +183,16 @@
   fi
 fi
 
+# VS2012 (VC11)
+if [ "${VS110COMNTOOLS}" = "" ] ; then
+  VS110COMNTOOLS="${progfiles32}/Microsoft Visual Studio 11.0/Common7/Tools/"
+  export VS110COMNTOOLS
+fi
+vc11Bin32Dir=`envpath "${VS110COMNTOOLS}"`/../../VC/Bin
+vc11Bin64Dir="${vc11Bin32Dir}"
+vc11vars32Bat="vcvars32.bat"
+vc11vars64Bat="vcvars64.bat"
+
 # VS2010 (VC10)
 if [ "${VS100COMNTOOLS}" = "" ] ; then
   VS100COMNTOOLS="${progfiles32}/Microsoft Visual Studio 10.0/Common7/Tools/"
@@ -227,7 +237,7 @@
 vcSelection=""
 
 # Parse options
-usage="Usage: $0 [-help] [-debug] [-v] [-c] [-s] [-p] [-v10] [-v9] [-v8] [-v7] [-32] [-64]"
+usage="Usage: $0 [-help] [-debug] [-v] [-c] [-s] [-p] [-v11] [-v10] [-v9] [-v8] [-v7] [-32] [-64]"
 while [ $# -gt 0 ] ; do
   if [ "$1" = "-help" ] ; then
     msg "${usage}"
@@ -237,6 +247,7 @@
     msg "  -c       Print out csh style output"
     msg "  -s       Print out sh style output"
     msg "  -p       Print out properties style output"
+    msg "  -v11     Use Visual Studio 11 VS2012"
     msg "  -v10     Use Visual Studio 10 VS2010"
     msg "  -v9      Use Visual Studio 9 VS2008"
     msg "  -v8      Use Visual Studio 8 VS2005"
@@ -259,6 +270,13 @@
   elif [ "$1" = "-p" ] ; then
     shellStyle="props"
     shift
+  elif [ "$1" = "-v11" ] ; then
+    vcBin32Dir="${vc11Bin32Dir}"
+    vcBin64Dir="${vc11Bin64Dir}"
+    vcvars32Bat="${vc11vars32Bat}"
+    vcvars64Bat="${vc11vars64Bat}"
+    vcSelection="11"
+    shift
   elif [ "$1" = "-v10" ] ; then
     vcBin32Dir="${vc10Bin32Dir}"
     vcBin64Dir="${vc10Bin64Dir}"
@@ -438,6 +456,8 @@
 echo export VS_VS90COMNTOOLS
 echo VS_VS100COMNTOOLS="%VS100COMNTOOLS%"
 echo export VS_VS100COMNTOOLS
+echo VS_VS110COMNTOOLS="%VS110COMNTOOLS%"
+echo export VS_VS110COMNTOOLS
 echo VS_VCINSTALLDIR="%VCINSTALLDIR%"
 echo export VS_VCINSTALLDIR
 echo VS_VSINSTALLDIR="%VSINSTALLDIR%"
@@ -570,7 +590,9 @@
 printEnv MSTOOLS       mstools       VS_MSTOOLS       "${VS_MSTOOLS}"
 printEnv DEVENVDIR     devenvdir     VS_DEVENVDIR     "${VS_DEVENVDIR}"
 printEnv WINDOWSSDKDIR windowssdkdir VS_WINDOWSSDKDIR "${VS_WINDOWSSDKDIR}"
-if [ "${vcSelection}" = "10" ] ; then
+if [ "${vcSelection}" = "11" ] ; then
+  printEnv VS110COMNTOOLS vs110comntools VS_VS110COMNTOOLS "${VS_VS110COMNTOOLS}"
+elif [ "${vcSelection}" = "10" ] ; then
   printEnv VS100COMNTOOLS vs100comntools VS_VS100COMNTOOLS "${VS_VS100COMNTOOLS}"
 elif [ "${vcSelection}" = "9" ] ; then
   printEnv VS90COMNTOOLS vs90comntools VS_VS90COMNTOOLS "${VS_VS90COMNTOOLS}"