OSDN Git Service

* configure.ac: Don't use libdl on mips-sgi-irix6*.
[pf3gnuchains/gcc-fork.git] / libjava / configure
index 9c1e00a..2fd20a4 100755 (executable)
@@ -599,6 +599,7 @@ ac_includes_default="\
 #endif"
 
 enable_option_checking=no
+ac_c_werror_flag=
 ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
@@ -631,6 +632,10 @@ python_mod_dir
 here
 LD_FINISH_STATIC_SPEC
 LD_START_STATIC_SPEC
+ANONVERSCRIPT_SUN_FALSE
+ANONVERSCRIPT_SUN_TRUE
+ANONVERSCRIPT_GNU_FALSE
+ANONVERSCRIPT_GNU_TRUE
 ANONVERSCRIPT_FALSE
 ANONVERSCRIPT_TRUE
 SYSDEP_SOURCES
@@ -702,9 +707,9 @@ GCDEPS
 GCINCS
 GCLIBS
 LIBGCJTESTSPEC
+LIBMATHSPEC
 LIBSTDCXXSPEC
 extra_ldflags
-extra_gij_ldflags
 extra_ldflags_libjava
 X_EXTRA_LIBS
 X_LIBS
@@ -746,7 +751,9 @@ am__fastdepGCJ_FALSE
 am__fastdepGCJ_TRUE
 GCJDEPMODE
 GCJFLAGS
+ac_ct_GCJ
 GCJ
+lt_host_flags
 CXXCPP
 CPP
 OTOOL64
@@ -768,6 +775,7 @@ LIBLTDL
 INCLTDL
 host_exeext
 GCJH
+GCC_FOR_ECJX
 GCJ_FOR_ECJX
 X_AWT_FALSE
 X_AWT_TRUE
@@ -779,6 +787,7 @@ BUILD_SUBLIBS_FALSE
 BUILD_SUBLIBS_TRUE
 LIBGCJ_LD_SYMBOLIC_FUNCTIONS
 LIBGCJ_LD_SYMBOLIC
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS
 LIBGCJ_SUBLIB_LTFLAGS
 LIBGCJ_JAVAFLAGS
 LIBGCJ_CXXFLAGS
@@ -789,6 +798,7 @@ MAINTAINER_MODE_TRUE
 UNZIP
 ZIP
 JAR
+DLLTOOL
 RANLIB
 AR
 LD
@@ -962,8 +972,15 @@ with_jvm_jar_dir
       ac_precious_vars='build_alias
 host_alias
 target_alias
-CPP
+CC
+CFLAGS
+LDFLAGS
+LIBS
 CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+CPP
 CXXCPP
 XMKMF'
 ac_subdirs_all='classpath libltdl'
@@ -2305,8 +2322,10 @@ $as_echo "$ac_res" >&6; }
 ac_fn_c_check_decl ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5
-$as_echo_n "checking whether $2 is declared... " >&6; }
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
 if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
   $as_echo_n "(cached) " >&6
 else
@@ -2316,8 +2335,12 @@ $4
 int
 main ()
 {
-#ifndef $2
-  (void) $2;
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
 #endif
 
   ;
@@ -3340,18 +3363,9 @@ fi
 # It may not be safe to run linking tests in AC_PROG_CC/AC_PROG_CXX.
 
 
-# (1) We use an abnormal CXX (without library references), so we
-# must cache it under a different name.
-# (2) CC, CFLAGS, CXX, CXXFLAGS, LDFLAGS must not be 'precious', or
-# the non-multilib-adjusted value will be used in multilibs.
-# (3) As a side effect, we must SUBST CXXFLAGS, CFLAGS, and LDFLAGS ourselves.
-# (4) As another side effect, automake doesn't automatically include them
-# in Makefile.in.
-# (5) For libstdc++-v3, -fno-builtin must be present here so that a
+# For libstdc++-v3, -fno-builtin must be present here so that a
 # non-conflicting form of std::exit can be guessed by AC_PROG_CXX, and
 # used in later tests.  This may not be necessary in libjava; I don't know.
-
-
 save_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS="$CXXFLAGS -fno-builtin"
 ac_ext=c
@@ -4407,10 +4421,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 CXXFLAGS="$save_CXXFLAGS"
 
-
-
-
-
 am__api_version='1.11'
 
 # Find a good install program.  We prefer a C program (faster),
@@ -5574,6 +5584,98 @@ else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; 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_DLLTOOL+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL=":"
+  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: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -5796,13 +5898,16 @@ fi
 #      libgcj_cxxflags  - host specific C++ compiler flags
 #      libgcj_javaflags - host specific Java compiler flags
 #      libgcj_sublib_ltflags - host specific Libtool flags
-#                          (only used when building sublibs)
+#      libgcj_sublib_core_extra_deps - host specific extra
+#                         dependencies for core sublib
+#      (these last two only used when building sublibs)
 # and a number of others; see the list at the start of the file.
 
 libgcj_cflags=
 libgcj_cxxflags=
 libgcj_javaflags=
 libgcj_sublib_ltflags=
+libgcj_sublib_core_extra_deps=
 
 . ${srcdir}/configure.host
 
@@ -5853,6 +5958,7 @@ LIBGCJ_CFLAGS="${libgcj_cflags}"
 LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
 LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
 LIBGCJ_SUBLIB_LTFLAGS="${libgcj_sublib_ltflags}"
+LIBGCJ_SUBLIB_CORE_EXTRA_DEPS="${libgcj_sublib_core_extra_deps}"
 LIBGCJ_LD_SYMBOLIC="${libgcj_ld_symbolic}"
 LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
 
@@ -5862,6 +5968,7 @@ LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
 
 
 
+
 # Only use libltdl for non-newlib builds.
 if test "x${with_newlib}" = "x" || test "x${with_newlib}" = "xno"; then
    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
@@ -6599,7 +6706,8 @@ NATIVE=yes
 # Which gcj and host gcj (for ecjx) do we use?
 which_gcj=default
 host_exeext=${ac_exeext}
-GCJ_FOR_ECJX=
+GCJ_FOR_ECJX='$(GCJ)'
+GCC_FOR_ECJX='$(CXX)'
 built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`"
 if test -n "${with_cross_host}"; then
   # We are being configured with a cross compiler. We can't
@@ -6607,6 +6715,7 @@ if test -n "${with_cross_host}"; then
   NATIVE=no
   cross_host_exeext=
   GCJ_FOR_ECJX="${with_cross_host}-gcj"
+  GCC_FOR_ECJX="${with_cross_host}-gcc"
   case "${with_cross_host}" in
      *mingw* | *cygwin*)
          cross_host_exeext=.exe
@@ -6675,6 +6784,7 @@ export JAVAC
 
 
 
+
 # Create it, so that compile/link tests don't fail
 test -f libgcj.spec || touch libgcj.spec
 
@@ -13245,7 +13355,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13248 "configure"
+#line 13358 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13351,7 +13461,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13354 "configure"
+#line 13464 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16617,10 +16727,33 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-for ac_prog in gcj
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+
+
+case $host in
+  *-cygwin* | *-mingw*)
+    # 'host' will be top-level target in the case of a target lib,
+    # we must compare to with_cross_host to decide if this is a native
+    # or cross-compiler and select where to install dlls appropriately.
+    if test -n "$with_cross_host" &&
+       test x"$with_cross_host" != x"no"; then
+      lt_host_flags='-no-undefined -bindir "$(toolexeclibdir)"';
+    else
+      lt_host_flags='-no-undefined -bindir "$(bindir)"';
+    fi
+    ;;
+  *)
+    lt_host_flags=
+    ;;
+esac
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gcj
+  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_GCJ+set}" = set; then :
@@ -16636,7 +16769,7 @@ do
   test -z "$as_dir" && as_dir=.
     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_GCJ="$ac_prog"
+    ac_cv_prog_GCJ="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -16656,9 +16789,65 @@ $as_echo "no" >&6; }
 fi
 
 
-  test -n "$GCJ" && break
+    test -n "$GCJ" && break
+  done
+fi
+if test -z "$GCJ"; then
+  ac_ct_GCJ=$GCJ
+  for ac_prog in gcj
+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_GCJ+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_GCJ"; then
+  ac_cv_prog_ac_ct_GCJ="$ac_ct_GCJ" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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_GCJ="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_GCJ=$ac_cv_prog_ac_ct_GCJ
+if test -n "$ac_ct_GCJ"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCJ" >&5
+$as_echo "$ac_ct_GCJ" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_GCJ" && break
 done
-test -n "$GCJ" || GCJ="gcj"
+
+  if test "x$ac_ct_GCJ" = x; then
+    GCJ="gcj"
+  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: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    GCJ=$ac_ct_GCJ
+  fi
+fi
 
 test -z "$GCJ" && as_fn_error "no acceptable gcj found in \$PATH" "$LINENO" 5
 if test "x${GCJFLAGS-unset}" = xunset; then
 
 
 
-for ac_prog in gcj
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gcj
+  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_GCJ+set}" = set; then :
@@ -16811,7 +17001,7 @@ do
   test -z "$as_dir" && as_dir=.
     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_GCJ="$ac_prog"
+    ac_cv_prog_GCJ="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -16831,9 +17021,65 @@ $as_echo "no" >&6; }
 fi
 
 
-  test -n "$GCJ" && break
+    test -n "$GCJ" && break
+  done
+fi
+if test -z "$GCJ"; then
+  ac_ct_GCJ=$GCJ
+  for ac_prog in gcj
+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_GCJ+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_GCJ"; then
+  ac_cv_prog_ac_ct_GCJ="$ac_ct_GCJ" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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_GCJ="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-test -n "$GCJ" || GCJ="gcj"
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_GCJ=$ac_cv_prog_ac_ct_GCJ
+if test -n "$ac_ct_GCJ"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCJ" >&5
+$as_echo "$ac_ct_GCJ" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_GCJ" && break
+done
+
+  if test "x$ac_ct_GCJ" = x; then
+    GCJ="gcj"
+  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: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    GCJ=$ac_ct_GCJ
+  fi
+fi
 
 test -z "$GCJ" && as_fn_error "no acceptable gcj found in \$PATH" "$LINENO" 5
 if test "x${GCJFLAGS-unset}" = xunset; then
@@ -19216,7 +19462,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then :
   enableval=$enable_sjlj_exceptions; :
 else
   cat > conftest.$ac_ext << EOF
-#line 19219 "configure"
+#line 19465 "configure"
 struct S { ~S(); };
 void bar();
 void foo()
@@ -19546,6 +19792,9 @@ case "${host}" in
         SYSTEMSPEC="-lunicows $SYSTEMSPEC"
       fi
     ;;
+    *-*-darwin[912]*)
+      SYSTEMSPEC="%{!Zdynamiclib:%{!Zbundle:-allow_stack_execute}}"
+    ;;
     *)
       SYSTEMSPEC=
     ;;
@@ -20297,9 +20546,6 @@ case "${host}" in
     # on Darwin -single_module speeds up loading of the dynamic libraries.
     extra_ldflags_libjava=-Wl,-single_module
     ;;
-*-*-darwin[912]*)
-    extra_gij_ldflags=-Wl,-allow_stack_execute
-    ;;
 arm*linux*eabi)
     # Some of the ARM unwinder code is actually in libstdc++.  We
     # could in principle replicate it in libgcj, but it's better to
@@ -20313,6 +20559,58 @@ arm*linux*eabi)
     ;;
 esac
 
+LIBMATHSPEC=
+# extra LD Flags which are required for targets
+case "${host}" in
+*-*-darwin*)
+     ;;
+*)
+     LIBMATHSPEC=-lm
+     ;;
+esac
+
+# Check for --no-merge-exidx-entries, an ARM-specific linker option.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --no-merge-exidx-entries" >&5
+$as_echo_n "checking for --no-merge-exidx-entries... " >&6; }
+if test "${libgcj_cv_exidx+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  saved_ldflags="$LDFLAGS"
+   LDFLAGS="${LDFLAGS} -Wl,--no-merge-exidx-entries"
+   # The IRIX 6 ld doesn't recognize --no-merge-exidx-entries, but only
+   # warns about unknown options, which breaks the testsuite.  So enable
+   # AC_LANG_WERROR, but there's currently (autoconf 2.64) no way to turn
+   # it off again.  As a workaround, save and restore werror flag like
+   # AC_PATH_XTRA.
+   ac_xsave_c_werror_flag=$ac_c_werror_flag
+
+ac_c_werror_flag=yes
+   if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int main(void){ return 0;}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "libgcj_cv_exidx=yes"
+else
+  eval "libgcj_cv_exidx=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+   ac_c_werror_flag=$ac_xsave_c_werror_flag
+   LDFLAGS="${saved_ldflags}"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcj_cv_exidx" >&5
+$as_echo "$libgcj_cv_exidx" >&6; }
+if test "${libgcj_cv_exidx}" = "yes"; then
+  SYSTEMSPEC="${SYSTEMSPEC} --no-merge-exidx-entries"
+  extra_ldflags="${extra_ldflags} -Wl,--no-merge-exidx-entries"
+fi
+
+
 
 
 
@@ -20453,6 +20751,23 @@ case "$THREADS" in
        THREADLIBS='-lpthread -lrt'
        THREADSPEC='-lpthread -lrt'
        ;;
+     *-*-solaris2.8)
+       # Always use alternate thread library on Solaris 8.  Need libthread
+       # for TLS support.
+       # Need -Wl,-R to get it through libtool ...
+       THREADLIBS='-L/usr/lib/lwp$(MULTISUBDIR) -Wl,-R -Wl,/usr/lib/lwp$(MULTISUBDIR) -lpthread -lthread'
+       # ... while ld only accepts -R.
+       THREADSPEC='-L/usr/lib/lwp%{m64:/64} -R/usr/lib/lwp%{m64:/64} -lpthread -lthread'
+        ;;
+     *-*-solaris2.9)
+       # As on Solaris 8, need libthread for TLS support.
+       THREADLIBS='-lpthread -lthread'
+       THREADSPEC='-lpthread -lthread'
+       ;;
+     *-*-darwin*)
+       # Don't set THREADLIBS or THREADSPEC as Darwin already
+       # provides pthread via libSystem.
+       ;;
      *)
        THREADLIBS=-lpthread
        THREADSPEC=-lpthread
    if test "$GC" = boehm; then
       case "${host}" in
           mips-sgi-irix6*)
-           # IRIX 6 lacks a N64 libdl.so, but only the N32 (default multilib)
-           # libgcj.spec is used, so override here
-           SYSTEMSPEC="$SYSTEMSPEC %{!mabi=64:-ldl}"
-         ;;
+           # While IRIX 6 has libdl for the O32 and N32 ABIs, the N64 one is
+           # missing.  It's unnecessary anyway since dlopen lives in libc.
+           ;;
+         *-*-darwin*)
+           ;;
          *)
             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldl" >&5
 $as_echo_n "checking for main in -ldl... " >&6; }
@@ -22868,7 +23184,7 @@ if test "x$ac_cv_lib_dl_main" = x""yes; then :
   SYSTEMSPEC="$SYSTEMSPEC -ldl"
 fi
 
-         ;;
+           ;;
       esac
    fi
 fi
@@ -22912,10 +23228,11 @@ if test ! -f gnu/classpath/Configuration.java; then
 fi
 
 
-for ac_prog in gcj
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gcj
+  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_GCJ+set}" = set; then :
@@ -22931,7 +23248,7 @@ do
   test -z "$as_dir" && as_dir=.
     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_GCJ="$ac_prog"
+    ac_cv_prog_GCJ="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -22951,9 +23268,65 @@ $as_echo "no" >&6; }
 fi
 
 
-  test -n "$GCJ" && break
+    test -n "$GCJ" && break
+  done
+fi
+if test -z "$GCJ"; then
+  ac_ct_GCJ=$GCJ
+  for ac_prog in gcj
+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_GCJ+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_GCJ"; then
+  ac_cv_prog_ac_ct_GCJ="$ac_ct_GCJ" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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_GCJ="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-test -n "$GCJ" || GCJ="gcj"
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_GCJ=$ac_cv_prog_ac_ct_GCJ
+if test -n "$ac_ct_GCJ"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GCJ" >&5
+$as_echo "$ac_ct_GCJ" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_GCJ" && break
+done
+
+  if test "x$ac_ct_GCJ" = x; then
+    GCJ="gcj"
+  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: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    GCJ=$ac_ct_GCJ
+  fi
+fi
 
 test -z "$GCJ" && as_fn_error "no acceptable gcj found in \$PATH" "$LINENO" 5
 if test "x${GCJFLAGS-unset}" = xunset; then
@@ -23844,8 +24217,8 @@ case "${host}" in
  i?86-*-linux*)
     SIGNAL_HANDLER=include/i386-signal.h
     ;;
sparc*-sun-solaris*)
-    SIGNAL_HANDLER=include/sparc-signal.h
*-*-solaris2*)
+    SIGNAL_HANDLER=include/solaris-signal.h
     ;;
 # ia64-*)
 #    SYSDEP_SOURCES=sysdep/ia64.c
@@ -24068,7 +24441,7 @@ rm -f core conftest.err conftest.$ac_objext \
        CFLAGS="$chktls_save_CFLAGS"
        if test "X$thread_CFLAGS" != Xfailed; then
          CFLAGS="$thread_CFLAGS $chktls_save_CFLAGS"
-         if test "$cross_compiling" = yes; then :
+                                                 if test "$cross_compiling" = yes; then :
   { { $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 test program while cross compiling
@@ -24078,7 +24451,7 @@ else
 /* end confdefs.h.  */
 #include <pthread.h>
                __thread int a;
-               static int *a_in_other_thread;
+               static int *volatile a_in_other_thread;
                static void *
                thread_func (void *arg)
                {
@@ -24090,11 +24463,11 @@ main ()
 {
 pthread_t thread;
                void *thread_retval;
-               int *a_in_main_thread;
+               int *volatile a_in_main_thread;
+               a_in_main_thread = &a;
                if (pthread_create (&thread, (pthread_attr_t *)0,
                                    thread_func, (void *)0))
                  return 0;
-               a_in_main_thread = &a;
                if (pthread_join (thread, &thread_retval))
                  return 0;
                return (a_in_other_thread == a_in_main_thread);
@@ -24176,7 +24549,8 @@ if test "${libjava_cv_anon_version_script+set}" = set; then :
 else
   save_CFLAGS="$CFLAGS"; save_LDFLAGS="$LDFLAGS"
    libjava_cv_anon_version_script=no
-   CFLAGS="$CFLAGS -fPIC"; LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
+   CFLAGS="$CFLAGS -fPIC";
+   LDFLAGS="$LDFLAGS -shared -Wl,--version-script,conftest.map"
    echo '{ global: globalsymb*; local: *; };' > conftest.map
    if test x$gcc_no_link = xyes; then
   as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
@@ -24193,16 +24567,45 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
-  libjava_cv_anon_version_script=yes
+  libjava_cv_anon_version_script=gnu
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+   if test x$libjava_cv_anon_version_script = xno; then
+     case "$target_os" in
+       solaris2*)
+         LDFLAGS="$save_LDFLAGS"
+         LDFLAGS="$LDFLAGS -shared -Wl,-M,conftest.map"
+         # Sun ld doesn't understand wildcards here.
+         echo '{ global: globalsymbol; local: *; };' > conftest.map
+         if test x$gcc_no_link = xyes; then
+  as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+void globalsymbol (void) {} void localsymbol (void) {}
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  libjava_cv_anon_version_script=sun
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         ;;
+     esac
+   fi
    CFLAGS="$save_CFLAGS"; LDFLAGS="$save_LDFLAGS"
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libjava_cv_anon_version_script" >&5
 $as_echo "$libjava_cv_anon_version_script" >&6; }
- if test "$libjava_cv_anon_version_script" = yes; then
+ if test "$libjava_cv_anon_version_script" != no; then
   ANONVERSCRIPT_TRUE=
   ANONVERSCRIPT_FALSE='#'
 else
@@ -24210,12 +24613,28 @@ else
   ANONVERSCRIPT_FALSE=
 fi
 
+ if test "$libjava_cv_anon_version_script" = gnu; then
+  ANONVERSCRIPT_GNU_TRUE=
+  ANONVERSCRIPT_GNU_FALSE='#'
+else
+  ANONVERSCRIPT_GNU_TRUE='#'
+  ANONVERSCRIPT_GNU_FALSE=
+fi
+
+ if test "$libjava_cv_anon_version_script" = sun; then
+  ANONVERSCRIPT_SUN_TRUE=
+  ANONVERSCRIPT_SUN_FALSE='#'
+else
+  ANONVERSCRIPT_SUN_TRUE='#'
+  ANONVERSCRIPT_SUN_FALSE=
+fi
+
 
 # Check if linker supports static linking on a per library basis
 LD_START_STATIC_SPEC=
 LD_FINISH_STATIC_SPEC=
-if $LD --help 2>&1 | grep -q -e -call_shared ; then
-  if $LD --help 2>&1 | grep -q -e -non_shared ; then
+if $LD --help 2>&1 | grep -- -call_shared >/dev/null 2>&1; then
+  if $LD --help 2>&1 | grep -- -non_shared >/dev/null 2>&1; then
     LD_START_STATIC_SPEC='%{static-libgcj:-non_shared}'
     LD_FINISH_STATIC_SPEC='%{static-libgcj:-call_shared}'
   fi
@@ -24749,6 +25168,14 @@ if test -z "${ANONVERSCRIPT_TRUE}" && test -z "${ANONVERSCRIPT_FALSE}"; then
   as_fn_error "conditional \"ANONVERSCRIPT\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ANONVERSCRIPT_GNU_TRUE}" && test -z "${ANONVERSCRIPT_GNU_FALSE}"; then
+  as_fn_error "conditional \"ANONVERSCRIPT_GNU\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ANONVERSCRIPT_SUN_TRUE}" && test -z "${ANONVERSCRIPT_SUN_FALSE}"; then
+  as_fn_error "conditional \"ANONVERSCRIPT_SUN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${INSTALL_AOT_RPM_TRUE}" && test -z "${INSTALL_AOT_RPM_FALSE}"; then
   as_fn_error "conditional \"INSTALL_AOT_RPM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5