--- ltconfig.orig	Tue May 18 20:17:36 1999
+++ ltconfig	Sun Feb 18 11:45:07 2001
@@ -702,7 +702,7 @@
 runpath_var=
 
 case "$host_os" in
-amigaos* | sunos4*)
+amigaos* | sunos4* | openbsd*)
   # On these operating systems, we should treat GNU ld like the system ld.
   gnu_ld_acts_native=yes
   ;;
@@ -815,10 +815,21 @@
     ;;
 
   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'
+	hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+      *)
+	archive_cmds='$CC -shared $pic_flag -o $lib$libobjs'
+	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*)
