$OpenBSD: patch-configure,v 1.4 2002/06/16 20:02:19 pvalchev Exp $
--- configure.orig	Thu Nov 29 15:21:53 2001
+++ configure	Sun Jun 16 13:54:56 2002
@@ -2114,6 +2114,16 @@ newos6*)
   lt_cv_file_magic_test_file=/usr/lib/libnls.so
   ;;
 
+openbsd*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  else
+    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+  fi
+  ;;
+
 osf3* | osf4* | osf5*)
   # this will be overridden with pass_all, but let us keep it just in case
   lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
@@ -3118,7 +3128,14 @@ old_postuninstall_cmds=
 
 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
 
 # Allow CC to be a program name with arguments.
@@ -3641,7 +3658,9 @@ cygwin* | mingw* | pw32* )
     with_gnu_ld=no
   fi
   ;;
-
+openbsd*)
+  with_gnu_ld=no
+  ;;
 esac
 
 ld_shlibs=yes
@@ -4045,10 +4064,24 @@ else
     ;;
 
   openbsd*)
-    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-    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 $deplibs $compiler_flags'
+      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 $deplibs $linker_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       ;;
+      *)
+       archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='${wl}-R$libdir'
+       ;;
+      esac
+    fi
     ;;
 
   os2*)
@@ -4537,9 +4570,22 @@ newsos6)
 
 openbsd*)
   version_type=sunos
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-    need_version=no
+  need_lib_prefix=no
+  need_version=no
+  sys_lib_search_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec="/usr/lib /usr/local/lib"
+  if test "`echo __ELF__ | $CC -E - | grep __ELF__`" = "" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+    case "$host_os" in
+    openbsd2.[89] | openbsd2.[89].*)
+      shlibpath_overrides_runpath=no
+    ;;
+    *)
+      shlibpath_overrides_runpath=yes
+    ;;
+    esac
+  else
+    shlibpath_overrides_runpath=yes
   fi
   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
@@ -6425,27 +6471,6 @@ fi
 echo "$ac_t""$EXTRACPPFLAGS" 1>&6
 
 
-if test "x$prefix" = "xNONE"; then
-  prefix=/usr/local
-fi
-
-fch=`echo $prefix | sed 's/\(.\).*/\1/'`
-if test $fch != "/" ; then
-   prefix=`pwd`/$prefix
-   echo "adjusting prefix to $prefix"
-fi
-
-if test "x$exec_prefix" = "xNONE"; then
-  exec_prefix=$prefix
-fi
-
-fch=`echo $exec_prefix | sed 's/\(.\).*/\1/'`
-if test $fch != "/" ; then
-   exec_prefix=`pwd`/$exec_prefix
-   echo "adjusting exec_prefix to $exec_prefix"
-fi
-
-
 SNMPLIBPATH=""
 tmpset="$libdir/snmp"
 while test "x$tmpset" != "x$SNMPLIBPATH"; do
@@ -7345,6 +7370,7 @@ echo "configure:7345: checking for TCP w
 	cat > conftest.$ac_ext <<EOF
 #line 7347 "configure"
 #include "confdefs.h"
+#include <sys/types.h>
 #include <tcpd.h>
   int allow_severity = 0;
   int deny_severity  = 0;
@@ -7469,6 +7495,7 @@ echo "configure:7469: checking for TCP w
 	    cat > conftest.$ac_ext <<EOF
 #line 7471 "configure"
 #include "confdefs.h"
+#include <sys/types.h>
 #include <tcpd.h>
   int allow_severity = 0;
   int deny_severity  = 0;
@@ -8185,7 +8212,7 @@ if eval "test \"`echo '$''{'ac_cv_lib_$a
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lcrypto  $LIBS"
+LIBS="-lcrypto -ldes $LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 8191 "configure"
 #include "confdefs.h"
@@ -8219,7 +8246,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_l
 #define $ac_tr_lib 1
 EOF
 
-  LIBS="-lcrypto $LIBS"
+  LIBS="-lcrypto -ldes $LIBS"
 
 else
   echo "$ac_t""no" 1>&6
@@ -15237,6 +15264,7 @@ s%@AUTOCONF@%$AUTOCONF%g
 s%@AUTOHEADER@%$AUTOHEADER%g
 s%@UNAMEPROG@%$UNAMEPROG%g
 s%@VERSION@%$VERSION%g
+s%@VERSION_INFO@%$VERSION_INFO%g
 s%@target@%$target%g
 s%@target_alias@%$target_alias%g
 s%@target_cpu@%$target_cpu%g
