configure.in
changeset 2998 d364ee9b9c15
parent 2947 fec0db6c44b7
child 3007 b30409e106f2
--- a/configure.in	Sun Jan 04 23:41:09 2009 +0000
+++ b/configure.in	Sun Jan 04 23:43:33 2009 +0000
@@ -1311,7 +1311,7 @@
     if test x$enable_video = xyes -a x$enable_video_directfb = xyes; then
         video_directfb=no
 
-        DIRECTFB_REQUIRED_VERSION=0.9.15
+        DIRECTFB_REQUIRED_VERSION=1.0.0
 
         AC_PATH_PROG(DIRECTFBCONFIG, directfb-config, no)
         if test x$DIRECTFBCONFIG = xno; then
@@ -1321,6 +1321,7 @@
                 if $PKG_CONFIG --atleast-pkgconfig-version 0.7 && $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb; then
                     DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
                     DIRECTFB_LIBS=`$PKG_CONFIG --libs directfb`
+                    DIRECTFB_PREFIX=`$PKG_CONFIG --variable=prefix directfb`
                     video_directfb=yes
                 fi
             fi
@@ -1334,16 +1335,39 @@
             if test $HAVE_VERSION -ge $NEED_VERSION; then
                 DIRECTFB_CFLAGS=`$DIRECTFBCONFIG --cflags`
                 DIRECTFB_LIBS=`$DIRECTFBCONFIG --libs`
+                DIRECTFB_PREFIX=`$DIRECTFBCONFIG --prefix`
                 video_directfb=yes
             fi
             AC_MSG_RESULT($video_directfb)
         fi
 
         if test x$video_directfb = xyes; then
+            AC_ARG_ENABLE(directfb-shared,
+AC_HELP_STRING([--enable-directfb-shared], [dynamically load directfb support [[default=yes]]]),
+                              , enable_directfb_shared=yes)
+
             AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
             SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
             EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
-            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
+
+	        AC_MSG_CHECKING(for directfb dynamic loading support)
+			directfb_shared=no
+            directfb_lib_spec="$DIRECTFB_PREFIX/lib/libdirectfb.so*"
+            directfb_lib=`ls -- $directfb_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
+            dnl echo "-- $directfb_lib_spec -> $directfb_lib"
+
+            if test x$have_loadso != xyes && \
+               test x$enable_directfb_shared = xyes; then
+                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic directfb loading])
+            fi
+            if test x$have_loadso = xyes && \
+               test x$enable_directfb_shared = xyes && test x$directfb_lib != x; then
+				directfb_shared=yes
+                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC, "$directfb_lib")
+            else
+	            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
+            fi
+	        AC_MSG_RESULT($directfb_shared)
             have_video=yes
         fi
     fi