--- libjava/classpath/configure.orig	2014-04-04 13:53:39 UTC
+++ libjava/classpath/configure
@@ -6383,7 +6383,7 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  netbsd* | bsdsunix* | freebsd* | openbsd* | darwin* | dragonfly*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -6733,13 +6733,13 @@ darwin* | rhapsody*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-freebsd* | dragonfly*)
+bsdsunix* | freebsd* | dragonfly*)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     case $host_cpu in
     i*86 )
       # Not sure whether the presence of OpenBSD here was a mistake.
       # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_deplibs_check_method='file_magic (BSDSUniX|FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
       lt_cv_file_magic_cmd=/usr/bin/file
       lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
       ;;
@@ -7577,7 +7577,7 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+x86_64-*kbsdsunix*-gnu|x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
@@ -7589,6 +7589,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
     case `/usr/bin/file conftest.o` in
       *32-bit*)
 	case $host in
+	  x86_64-*kbsdsunix*-gnu)
+	    LD="${LD-ld} -m elf_i386_bsdsux"
+	    ;;
 	  x86_64-*kfreebsd*-gnu)
 	    LD="${LD-ld} -m elf_i386_fbsd"
 	    ;;
@@ -7618,6 +7621,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*
 	;;
       *64-bit*)
 	case $host in
+	  x86_64-*kbsdsunix*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_bsdsux"
+	    ;;
 	  x86_64-*kfreebsd*-gnu)
 	    LD="${LD-ld} -m elf_x86_64_fbsd"
 	    ;;
@@ -9394,7 +9400,7 @@ $as_echo_n "checking whether the $compil
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
   inherit_rpath=no
-  link_all_deplibs=unknown
+  link_all_deplibs=no
   module_cmds=
   module_expsym_cmds=
   old_archive_from_new_cmds=
@@ -9660,7 +9666,7 @@ _LT_EOF
 	wlarc=
       else
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_expsym_cmds='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
       fi
       ;;
 
@@ -9679,7 +9685,7 @@ _LT_EOF
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_expsym_cmds='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -9708,7 +9714,7 @@ _LT_EOF
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
 	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    archive_expsym_cmds='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -9726,7 +9732,7 @@ _LT_EOF
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_expsym_cmds='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -10055,6 +10061,13 @@ if test -z "$aix_libpath"; then aix_libp
       hardcode_shlibpath_var=no
       ;;
 
+    bsdsunix*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
     hpux9*)
       if test "$GCC" = yes; then
 	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
@@ -10239,7 +10252,7 @@ rm -f core conftest.err conftest.$ac_obj
 	hardcode_direct_absolute=yes
 	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  archive_expsym_cmds='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-version-script,$lib-ver'
 	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
 	  export_dynamic_flag_spec='${wl}-E'
 	else
@@ -10949,6 +10962,25 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
+bsdsunix*)
+  objformat=elf
+  version_type=bsdsunix-$objformat
+  case $version_type in
+    bsdsunix-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix  $libname$release$shared_ext$major       $libname$shared_ext'                    soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    bsdsunix-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -10963,7 +10995,7 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix 	 $libname$release$shared_ext$major		 $libname$shared_ext'				 soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
@@ -12063,7 +12095,7 @@ striplib=
 old_striplib=
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
   test -z "$striplib" && striplib="$STRIP --strip-unneeded"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -13688,7 +13720,7 @@ hardcode_automatic_CXX=no
 inherit_rpath_CXX=no
 module_cmds_CXX=
 module_expsym_cmds_CXX=
-link_all_deplibs_CXX=unknown
+link_all_deplibs_CXX=no
 old_archive_cmds_CXX=$old_archive_cmds
 reload_flag_CXX=$reload_flag
 reload_cmds_CXX=$reload_cmds
@@ -13904,7 +13936,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
       # archiving commands below assume that GNU ld is being used.
       if test "$with_gnu_ld" = yes; then
         archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+        archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
 
         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
         export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
@@ -14246,11 +14278,15 @@ if test -z "$aix_libpath"; then aix_libp
         ld_shlibs_CXX=no
         ;;
 
+      bsdsunix-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
+
       freebsd-elf*)
         archive_cmds_need_lc_CXX=no
         ;;
 
-      freebsd* | dragonfly*)
+      freebsd* | bsdsunix* | dragonfly*)
         # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
         # conventions
         ld_shlibs_CXX=yes
@@ -14456,7 +14492,7 @@ if test -z "$aix_libpath"; then aix_libp
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
 	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
@@ -14464,7 +14500,7 @@ if test -z "$aix_libpath"; then aix_libp
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
 	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib'
 		;;
 	    esac
 	    archive_cmds_need_lc_CXX=no
@@ -14496,7 +14532,7 @@ if test -z "$aix_libpath"; then aix_libp
 	      ;;
 	    *) # Version 6 and above use weak symbols
 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-version-script ${wl}$lib-ver -o $lib'
 	      ;;
 	    esac
 
@@ -14507,7 +14543,7 @@ if test -z "$aix_libpath"; then aix_libp
 	  cxx*)
 	    # Compaq C++
 	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-version-script $wl$lib-ver'
 
 	    runpath_var=LD_RUN_PATH
 	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -14541,7 +14577,7 @@ if test -z "$aix_libpath"; then aix_libp
 	      # Sun C++ 5.9
 	      no_undefined_flag_CXX=' -zdefs'
 	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-version-script ${wl}$lib-ver'
 	      hardcode_libdir_flag_spec_CXX='-R$libdir'
 	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
 	      compiler_needs_object_CXX=yes
@@ -14614,7 +14650,7 @@ if test -z "$aix_libpath"; then aix_libp
 	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
 	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
 	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib-ver~			 sed -e "s|$|;|" < $export_symbols >> $lib-ver~		 echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-version-script,$lib-ver -o $lib'
 	    export_dynamic_flag_spec_CXX='${wl}-E'
 	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
 	  fi
@@ -15215,7 +15251,7 @@ $as_echo_n "checking for $compiler optio
 	    ;;
 	esac
 	;;
-      freebsd* | dragonfly*)
+      freebsd* | bsdsunix* | dragonfly*)
 	# FreeBSD uses GNU C++
 	;;
       hpux9* | hpux10* | hpux11*)
@@ -16009,6 +16045,25 @@ dgux*)
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
+bsdsunix*)
+  objformat=elf
+  version_type=bsdsunix-$objformat
+  case $version_type in
+    bsdsunix-elf*)
+      library_names_spec='$libname$release$shared_ext$versuffix  $libname$release$shared_ext$major       $libname$shared_ext'                    soname_spec='$libname$release$shared_ext$major'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    bsdsunix-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
 freebsd* | dragonfly*)
   # DragonFly does not have aout.  When/if they implement a new
   # versioning mechanism, adjust this.
@@ -16023,7 +16078,7 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix 	 $libname$release$shared_ext$major		 $libname$shared_ext'				 soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;