$OpenBSD: patch-scripts_ltconfig,v 1.1 2001/06/03 21:39:30 brad Exp $
--- scripts/ltconfig.orig	Thu May  7 21:41:18 1998
+++ scripts/ltconfig	Sun Jun  3 17:07:16 2001
@@ -702,7 +702,7 @@ hardcode_shlibpath_var=unsupported
 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 @@ 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'
+	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*)
