$OpenBSD: patch-aclocal_m4,v 1.2 2004/06/24 19:27:00 sturm Exp $
--- aclocal.m4.orig	2004-01-06 12:38:09.000000000 -0800
+++ aclocal.m4	2004-06-19 00:17:02.000000000 -0700
@@ -473,11 +473,11 @@ if test x$with_vorbis = "x"yes ; then
 
 	AC_CHECK_LIB(vorbis, vorbis_info_init,
        	[VORBIS_CFLAGS="-I$with_vorbis_i -I/usr/local/include" 
-         VORBIS_LIBS="-L$with_vorbis_l -lvorbis -lm"
+         VORBIS_LIBS="-L$with_vorbis_l -lvorbis -logg -lm"
        	AC_DEFINE(HAVE_VORBIS) 
 	hav_vorbis=yes
 	have_vorbis=yes], [have_vorbis=no], 
-       	-L$with_vorbis_l -lvorbis)
+       	-L$with_vorbis_l -lvorbis -logg -lm)
 fi   
 AC_CHECK_FILE($with_vorbis_i/vorbis/codec.h, [vorbis_inc=yes])
 if test x"$vorbis_inc" != xyes; then 
@@ -679,8 +679,8 @@ AC_ARG_WITH(dv-libs,AC_HELP_STRING([--wi
 	  dv_libs="$withval", dv_libs="")
 
 
-EXTRA_LIBS="$LIBS $GLIB_LIBS -ldl -lm"
-DV_EXTRA_LIBS="$GLIB_LIBS -ldl -lm"
+EXTRA_LIBS="$LIBS $GLIB_LIBS -lm"
+DV_EXTRA_LIBS="$GLIB_LIBS -lm"
 
 if test x$with_dv = "x"yes ; then
 
@@ -747,8 +747,8 @@ AC_ARG_WITH(lzo-libs,AC_HELP_STRING([--w
 	  lzo_libs="$withval", lzo_libs="")
 
 
-EXTRA_LIBS="$LIBS $GLIB_LIBS -ldl -lm"
-LZO_EXTRA_LIBS="$GLIB_LIBS -ldl -lm"
+EXTRA_LIBS="$LIBS $GLIB_LIBS -lm"
+LZO_EXTRA_LIBS="$GLIB_LIBS -lm"
 
 if test x$with_lzo = "x"yes ; then
 
@@ -1024,7 +1024,7 @@ AC_ARG_WITH(qt-includes,AC_HELP_STRING([
 AC_ARG_WITH(qt-libs,AC_HELP_STRING([--with-qt-libs=PFX],[prefix where local quicktime libs are installed (optional)]),
 	  qt_libs="$withval", qt_libs="")
 
-EXTRA_LIBS="-lpng -lz -lpthread -lglib -ldl -lm -ldv"
+EXTRA_LIBS="-lpng -lz $pthread_lib -lglib -lm -ldv"
 
 if test x$with_qt = "x"yes ; then
 
@@ -1078,7 +1078,7 @@ AC_ARG_WITH(openqt-includes,AC_HELP_STRI
 AC_ARG_WITH(openqt-libs,AC_HELP_STRING([--with-openqt-libs=PFX],[prefix where local openquicktime libs are installed (optional)]),
 	  openqt_libs="$withval", openqt_libs="")
 
-EXTRA_LIBS="-lpng -lz -lpthread -lglib -ldl -lm"
+EXTRA_LIBS="-lpng -lz $pthread_lib -lglib -lm"
 
 if test x$with_openqt = "x"yes ; then
 
@@ -5023,7 +5023,10 @@ AC_CACHE_CHECK([if the linker ($LD) is G
 [# 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
@@ -5196,15 +5199,13 @@ nto-qnx)
   lt_cv_deplibs_check_method=unknown
   ;;
 
-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
-  ;;
+ openbsd*)
+   if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+   else
+     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+   fi
+   ;;
 
 osf3* | osf4* | osf5*)
   # this will be overridden with pass_all, but let us keep it just in case
@@ -6165,6 +6166,20 @@ case $host_os in
     # 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::"'
     ;;
+  openbsd2*)
+      # C++ shared libraries are fairly broken
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+  openbsd*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      fi
+      output_verbose_link_cmd='echo'
+      ;;
   osf3*)
     case $cc_basename in
       KCC)
@@ -8486,6 +8501,7 @@ EOF
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
       if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
 	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
 	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
 	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
       else
