$NetBSD: patch-ab,v 1.33 2004/03/12 00:11:17 danw Exp $

--- configure.orig	Sun Jan 25 07:36:38 2004
+++ configure	Sun Mar  7 11:35:41 2004
@@ -4424,10 +4424,13 @@ beos*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-bsdi4*)
-  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
-  lt_cv_file_magic_cmd='/usr/bin/file -L'
-  lt_cv_file_magic_test_file=/shlib/libc.so
+# Versions of BSD/OS prior to 4.0 did no have real dynamic linking
+bsdi1*|bsdi2*|bsdi3*)
+  dynamic_linker=no
+  ;;
+
+bsdi*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 cygwin*)
@@ -6837,9 +6840,11 @@ echo $ECHO_N "checking for $compiler opt
       ;;
 
     darwin* | rhapsody*)
-      # PIC is the default on this platform
+      # PIC is the default on this platform, and static linking of
+      # binaries generally doesn't work
       # Common symbols not allowed in MH_DYLIB files
       lt_prog_compiler_pic='-fno-common'
+      lt_prog_compiler_static=''
       ;;
 
     msdosdjgpp*)
@@ -8135,9 +8140,10 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
-  version_type=linux
+bsdi*)
+  version_type=sunos
   need_version=no
+  need_lib_prefix=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
@@ -8253,15 +8259,15 @@ kfreebsd*-gnu)
 
 freebsd*)
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
-  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}'
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  case $objformat in
+    elf*)
+      soname_spec='${libname}${release}${shared_ext}$major'
       need_version=no
       need_lib_prefix=no
       ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+    *)
       need_version=yes
       ;;
   esac
@@ -8340,12 +8346,7 @@ hpux9* | hpux10* | hpux11*)
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
+    *) version_type=sunos ;;
   esac
   need_lib_prefix=no
   need_version=no
@@ -8381,7 +8382,7 @@ linux*oldld* | linux*aout* | linux*coff*
 
 # This must be Linux ELF.
 linux*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -8505,7 +8506,7 @@ sco3.2v5*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10854,6 +10855,13 @@ if test -z "$aix_libpath"; then aix_libp
     if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
       archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
       wlarc=
+      # Determine if we need to override the c++rt0 that is
+      # picked up by analysing output_verbose_link_cmds
+      if test -f ${PREFIX}/lib/c++rt0/c++rt0.o.PIC; then
+        cpprt0_file="${PREFIX}/lib/c++rt0/c++rt0.o.PIC"
+      else
+        cpprt0_file=
+      fi
       hardcode_libdir_flag_spec_CXX='-R$libdir'
       hardcode_direct_CXX=yes
       hardcode_shlibpath_var_CXX=no
@@ -11226,6 +11234,14 @@ if { (eval echo "$as_me:$LINENO: \"$ac_c
     esac
   done
 
+  case "$host_os" in
+  netbsd*)
+    if test -n "$cpprt0_file"; then
+      predep_objects_CXX=`eval echo $predep_objects_CXX | sed -e 's:/usr/lib/c++rt0.o:$cpprt0_file:'`
+    fi
+    ;;
+  esac
+
   # Clean up.
   rm -f a.out a.exe
 else
@@ -11273,9 +11289,11 @@ echo $ECHO_N "checking for $compiler opt
       lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
       ;;
     darwin* | rhapsody*)
-      # PIC is the default on this platform
+      # PIC is the default on this platform, and static linking of
+      # binaries generally doesn't work
       # Common symbols not allowed in MH_DYLIB files
-      lt_prog_compiler_pic_CXX='-fno-common'
+      lt_prog_compiler_pic='-fno-common'
+      lt_prog_compiler_static=''
       ;;
     *djgpp*)
       # DJGPP does not support shared libraries at all
@@ -11828,9 +11846,10 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
-  version_type=linux
+bsdi*)
+  version_type=sunos
   need_version=no
+  need_lib_prefix=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
@@ -11946,15 +11965,15 @@ kfreebsd*-gnu)
 
 freebsd*)
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
-  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}'
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  case $objformat in
+    elf*)
+      soname_spec='${libname}${release}${shared_ext}$major'
       need_version=no
       need_lib_prefix=no
       ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+    *)
       need_version=yes
       ;;
   esac
@@ -12033,12 +12052,7 @@ hpux9* | hpux10* | hpux11*)
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
+    *) version_type=sunos ;;
   esac
   need_lib_prefix=no
   need_version=no
@@ -12074,7 +12088,7 @@ linux*oldld* | linux*aout* | linux*coff*
 
 # This must be Linux ELF.
 linux*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -12198,7 +12212,7 @@ sco3.2v5*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -13690,9 +13704,11 @@ echo $ECHO_N "checking for $compiler opt
       ;;
 
     darwin* | rhapsody*)
-      # PIC is the default on this platform
+      # PIC is the default on this platform, and static linking of
+      # binaries generally doesn't work
       # Common symbols not allowed in MH_DYLIB files
       lt_prog_compiler_pic_F77='-fno-common'
+      lt_prog_compiler_static_F77=''
       ;;
 
     msdosdjgpp*)
@@ -14968,9 +14984,10 @@ beos*)
   shlibpath_var=LIBRARY_PATH
   ;;
 
-bsdi4*)
-  version_type=linux
+bsdi*)
+  version_type=sunos
   need_version=no
+  need_lib_prefix=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
   soname_spec='${libname}${release}${shared_ext}$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
@@ -15086,15 +15103,15 @@ kfreebsd*-gnu)
 
 freebsd*)
   objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
-  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}'
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  case $objformat in
+    elf*)
+      soname_spec='${libname}${release}${shared_ext}$major'
       need_version=no
       need_lib_prefix=no
       ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+    *)
       need_version=yes
       ;;
   esac
@@ -15173,12 +15190,7 @@ hpux9* | hpux10* | hpux11*)
 irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
-    *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
-		version_type=linux
-	else
-		version_type=irix
-	fi ;;
+    *) version_type=sunos ;;
   esac
   need_lib_prefix=no
   need_version=no
@@ -15214,7 +15226,7 @@ linux*oldld* | linux*aout* | linux*coff*
 
 # This must be Linux ELF.
 linux*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -15338,7 +15350,7 @@ sco3.2v5*)
   ;;
 
 solaris*)
-  version_type=linux
+  version_type=sunos
   need_lib_prefix=no
   need_version=no
   library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -16019,9 +16031,11 @@ echo $ECHO_N "checking for $compiler opt
       ;;
 
     darwin* | rhapsody*)
-      # PIC is the default on this platform
+      # PIC is the default on this platform, and static linking of
+      # binaries generally doesn't work
       # Common symbols not allowed in MH_DYLIB files
       lt_prog_compiler_pic_GCJ='-fno-common'
+      lt_prog_compiler_static_GCJ=''
       ;;
 
     msdosdjgpp*)
