$OpenBSD: patch-autoconf_ltconfig,v 1.2 2001/02/20 18:40:33 danh Exp $
--- autoconf/ltconfig.orig	Tue Jul  4 04:38:15 2000
+++ autoconf/ltconfig	Tue Feb 20 13:34:50 2001
@@ -707,6 +707,10 @@ amigaos* | beos* | sunos4*)
   # On these operating systems, we should treat GNU ld like the system ld.
   gnu_ld_acts_native=yes
   ;;
+openbsd*)
+  gnu_ld_acts_native=no
+  with_gnu_ld=no
+  ;;
 *)
   gnu_ld_acts_native=no
   ;;
@@ -826,10 +830,21 @@ else
     ;;
 
   openbsd*)
-    archive_cmds='$LD -Bshareable -o $lib$libobjs'
-    hardcode_libdir_flag_spec='-R$libdir'
     hardcode_direct=yes
     hardcode_shlibpath_var=no
+    case "$host_os" in
+      openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
+       hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+      *)
+       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linkopts'
+       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+       if [ "`/usr/bin/file /usr/lib/libc.so.* | grep ELF`" != "" ]; then
+         export_dynamic_flag_spec='${wl}-E'
+       fi
+      ;;
+    esac
     ;;
 
   os2*)
@@ -1199,11 +1214,19 @@ linux-gnu*)
   fi
   ;;
 
-netbsd* | openbsd*)
+netbsd*)
   version_type=sunos
   library_names_spec='${libname}${release}.so.$versuffix'
   finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+openbsd*)
+  version_type=sunos
+  library_names_spec='${libname}${release}.so.$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  deplibs_check_method='pass_all'
   ;;
 
 os2*)
