$OpenBSD: patch-configure_in,v 1.25 2005/09/17 00:38:15 pvalchev Exp $
--- configure.in.orig	Sun Aug 28 00:31:18 2005
+++ configure.in	Sat Sep 10 20:34:34 2005
@@ -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",
@@ -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
