$OpenBSD: patch-ltconfig,v 1.4 2002/01/24 04:24:09 brad Exp $
--- ltconfig.orig	Wed Mar 25 10:25:39 1998
+++ ltconfig	Wed Jan 23 20:19:34 2002
@@ -348,7 +348,14 @@ fi
 
 if test -n "$RANLIB"; then
   old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
-  old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
+  case "$host_os" in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib;$old_postinstall_cmds"
+  ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib;$old_postinstall_cmds"
+  ;;
+  esac
 fi
 
 # Check to see if we are using GCC.
@@ -706,6 +713,10 @@ amigaos* | sunos4*)
   # On these operating systems, we should treat GNU ld like the system ld.
   gnu_ld_acts_native=yes
   ;;
+openbsd*)
+  gnu_ld_acts_native=yes
+  with_gnu_ld=no
+  ;;
 *)
   gnu_ld_acts_native=no
   ;;
@@ -815,10 +826,24 @@ else
     ;;
 
   openbsd*)
-    archive_cmds='$LD -Bshareable -o $lib$libobjs'
-    hardcode_libdir_flag_spec='-R$libdir'
     hardcode_direct=yes
     hardcode_shlibpath_var=no
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      archive_cmds='$CC -shared $pic_flag -o $lib$libobjs'
+      hardcode_libdir_flag_spec='${wl}-R$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+    else
+      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}-R$libdir'
+	;;
+      esac
+    fi
     ;;
 
   os2*)
@@ -1179,11 +1204,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*)
