$OpenBSD: patch-configure,v 1.2 2004/08/13 08:09:23 pvalchev Exp $
--- configure.orig	Tue Feb  3 15:58:37 2004
+++ configure	Fri Aug 13 01:55:01 2004
@@ -3344,7 +3344,10 @@ else
   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
 case `$LD -v 2>&1 </dev/null` in
 *GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
+  case $host_os in
+    openbsd*) lt_cv_prog_gnu_ld=no ;;
+    *) lt_cv_prog_gnu_ld=yes ;;
+  esac
   ;;
 *)
   lt_cv_prog_gnu_ld=no
@@ -3574,12 +3577,10 @@ nto-qnx)
   ;;
 
 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'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
-    lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
   fi
   ;;
 
@@ -7902,7 +7903,7 @@ openbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
@@ -10114,6 +10115,19 @@ if test -z "$aix_libpath"; then aix_libp
     # Workaround some broken pre-1.5 toolchains
     output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
     ;;
+  openbsd*)
+      hardcode_direct_CXX=yes
+      hardcode_shlibpath_var_CXX=no
+      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+        archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${
+wl}-retain-symbols-file,$export_symbols -o $lib'
+        export_dynamic_flag_spec_CXX='${wl}-E'
+        whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      fi
+      output_verbose_link_cmd='echo'
+      ;;
   osf3*)
     case $cc_basename in
       KCC)
@@ -11466,7 +11480,7 @@ openbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
@@ -14492,7 +14506,7 @@ openbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
@@ -16802,7 +16816,7 @@ openbsd*)
   version_type=sunos
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='${libname}${shared_ext}$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
@@ -22483,10 +22497,10 @@ fi
 
 # FreeBSD and OpenBSD have neither -lpthread nor integrated pthreads in libc.
 # Instead -pthread is used to the compiler/linker to get pthreads working right.
-if test x$OS_ARCH = xFreeBSD -o x$OS_ARCH = xOpenBSD; then
-   CFLAGS="$CFLAGS -pthread"
-   CXXFLAGS="$CXXFLAGS -pthread"
-fi
+#if test x$OS_ARCH = xFreeBSD -o x$OS_ARCH = xOpenBSD; then
+#   CFLAGS="$CFLAGS -pthread"
+#   CXXFLAGS="$CXXFLAGS -pthread"
+#fi
 
 
 case "$HOSTTYPE" in
@@ -22965,13 +22979,13 @@ rm -f conftest.$ac_objext conftest$ac_ex
 
 
 have_pthread=false
-echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
-echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for pthread_create in -pthread" >&5
+echo $ECHO_N "checking for pthread_create in -pthread... $ECHO_C" >&6
 if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="-pthread  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 /* confdefs.h.  */
@@ -23020,7 +23034,7 @@ fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5
 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_create" >&6
 if test $ac_cv_lib_pthread_pthread_create = yes; then
-   PTHREAD_LIBS="-lpthread"
+   PTHREAD_LIBS="-pthread"
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_LIBPTHREAD 1
@@ -23570,6 +23584,7 @@ if test x$with_dv = x ; then
 fi
 
 have_dv=false
+if test x"$with_dv" != x"no"; then
 EXTRA_LIBS=" $LIBM_LIBS $GLIB_LIBS  $PTHREAD_LIBS"
 echo "$as_me:$LINENO: checking for dv_decoder_free in -ldv" >&5
 echo $ECHO_N "checking for dv_decoder_free in -ldv... $ECHO_C" >&6
@@ -23635,8 +23650,8 @@ _ACEOF
 
     have_dv=true
 fi
+fi  # with_dv != no
 
-
 have_dv_yv12=false
 if test x$with_dv_yv12 = xyes -a $have_dv = true; then
 
@@ -25852,7 +25867,7 @@ echo "$as_me:$LINENO: checking x86 sub-a
 echo $ECHO_N "checking x86 sub-architecture settings... $ECHO_C" >&6
 
   if test "$enable_cmov_extension" != "no" ; then
-    arch=`uname -m`
+    arch=i`sysctl hw.model | sed -e 's,.*\(.86\)-class.*,\1,' | grep '^[456]86$' || echo 386`
   else
     arch=i586
   fi
@@ -26013,9 +26028,10 @@ else
 fi
 
 
-
+if test "$enable_simd_accel" != "false" -a "$enable_simd_accel" != "no" ; then
 CFLAGS="$ARCHFLAGS $CFLAGS"
 CXXFLAGS="$ARCHFLAGS $CXXFLAGS"
+fi
 if test "x${GCC}" != "xyes" ; then
   enable_compile_warnings=no
 fi
