diff configure.in @ 991:12b13601a544

Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
author Patrice Mandin <patmandin@gmail.com>
date Fri, 26 Nov 2004 16:16:50 +0000
parents 475166d13b44
children 027688378762
line wrap: on
line diff
--- a/configure.in	Fri Nov 26 16:13:24 2004 +0000
+++ b/configure.in	Fri Nov 26 16:16:50 2004 +0000
@@ -1133,20 +1133,34 @@
 CheckAtariOSMesa()
 {
     if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
+        AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
+        AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
+
+        # Static linking to -lOSMesa
         AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
         if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
-            AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
-            AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
+            # -lOSMesa is really the static library
             if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
     	        CFLAGS="$CFLAGS -DHAVE_OPENGL"
 		    	SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
             fi
         else
+            # -lOSMesa is a loader for OSMesa.ldg
             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
-        	CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
+            CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
             SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
         fi
+
+        AC_ARG_ENABLE(osmesa-shared,
+[  --enable-osmesa-shared  dynamically load OSMesa OpenGL support [default=yes]],
+                              , enable_osmesa_shared=yes)
+        if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
+            # Dynamic linking
+            if test "x$have_osmesa_hdr" = "xyes"; then
+                CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
+            fi
+		fi
     fi
 }