$OpenBSD: patch-configure_in,v 1.28 2007/07/20 05:23:41 jakemsr Exp $
--- configure.in.orig	Sat Aug 27 23:31:18 2005
+++ configure.in	Sun Jul  8 01:07:57 2007
@@ -535,9 +535,6 @@ CheckNASM()
               win32)
                   NASMFLAGS="-f win32"
                   ;;
-              openbsd)
-                  NASMFLAGS="-f aoutb"
-                  ;;
               *)
                   NASMFLAGS="-f elf"
                   ;;
@@ -1082,9 +1079,6 @@ CheckOpenGL()
         AC_MSG_RESULT($video_opengl)
         if test x$video_opengl = xyes; then
             CFLAGS="$CFLAGS -DHAVE_OPENGL"
-            if test x$use_dlopen != xyes; then
-                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl")
-            fi
         fi
     fi
 }
@@ -1105,9 +1099,6 @@ CheckOpenGLQNX()
         if test x$video_opengl = xyes; then
             CFLAGS="$CFLAGS -DHAVE_OPENGL"
             SYSTEM_LIBS="$SYSTEM_LIBS -lGL"
-            if test x$use_dlopen != xyes; then
-                AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
-            fi
         fi
     fi
 }
@@ -1680,6 +1671,9 @@ CheckDLOPEN()
     AC_ARG_ENABLE(sdl-dlopen,
 [  --enable-sdl-dlopen     use dlopen for shared object loading [default=yes]],
                   , enable_sdl_dlopen=yes)
+    AC_ARG_ENABLE(ltdl,
+[  --enable-ltdl           use libtool for shared object loading [default=no]],
+		  , enable_ltdl=yes)
     if test x$enable_sdl_dlopen = xyes; then
         AC_MSG_CHECKING(for dlopen)
         use_dlopen=no
@@ -1691,7 +1685,7 @@ CheckDLOPEN()
         ])
         AC_MSG_RESULT($use_dlopen)
 
-        if test x$use_dlopen = xyes; then
+        if test x$use_dlopen = xyes -a x$enable_ltdl = xyes; then
             CFLAGS="$CFLAGS -DUSE_DLOPEN"
             AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
                AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
@@ -2115,9 +2109,9 @@ case "$target" in
         CheckRPATH
         # Set up files for the audio library
         if test x$enable_audio = xyes; then
-            CFLAGS="$CFLAGS -DOPENBSD_AUDIO_SUPPORT"
-            AUDIO_SUBDIRS="$AUDIO_SUBDIRS openbsd"
-            AUDIO_DRIVERS="$AUDIO_DRIVERS openbsd/libaudio_openbsd.la"
+            CFLAGS="$CFLAGS -DSUNAUDIO_SUPPORT"
+            AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun"
+            AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
         fi
         # OpenBSD needs linking with ossaudio emulation library
         if test x$have_oss = xyes; then
@@ -2764,6 +2758,9 @@ if test "x$enable_rpath" = "xyes"; then
 else
   SDL_RLD_FLAGS=""
 fi
+if test $ARCH = openbsd -a x$enable_video_x11 = xyes; then
+  SDL_RLD_FLAGS="-L${X11BASE}/lib"
+fi
 
 case "$ARCH" in
   openbsd | netbsd | bsdi)
@@ -2797,7 +2794,7 @@ esac
 STATIC_SYSTEM_LIBS="$SYSTEM_LIBS"
 
 dnl Output the video drivers we use
-if test x$enable_video = xtrue; then
+if test x$enable_video = xyes; then
     if test "$VIDEO_SUBDIRS" = ""; then
         AC_MSG_ERROR(*** No video drivers are enabled!)
     fi
