$OpenBSD: patch-scripts_ltconfig,v 1.2 2002/02/18 21:37:41 pvalchev Exp $
--- scripts/ltconfig.orig	Fri Oct 27 17:10:06 2000
+++ scripts/ltconfig	Mon Feb 18 13:20:49 2002
@@ -706,7 +706,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
   ;;
@@ -819,10 +819,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*)
