configure.in
changeset 991 12b13601a544
parent 989 475166d13b44
child 1009 027688378762
     1.1 --- a/configure.in	Fri Nov 26 16:13:24 2004 +0000
     1.2 +++ b/configure.in	Fri Nov 26 16:16:50 2004 +0000
     1.3 @@ -1133,20 +1133,34 @@
     1.4  CheckAtariOSMesa()
     1.5  {
     1.6      if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
     1.7 +        AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
     1.8 +        AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
     1.9 +
    1.10 +        # Static linking to -lOSMesa
    1.11          AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
    1.12          if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
    1.13 -            AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
    1.14 -            AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
    1.15 +            # -lOSMesa is really the static library
    1.16              if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
    1.17      	        CFLAGS="$CFLAGS -DHAVE_OPENGL"
    1.18  		    	SYSTEM_LIBS="$SYSTEM_LIBS -lOSMesa"
    1.19              fi
    1.20          else
    1.21 +            # -lOSMesa is a loader for OSMesa.ldg
    1.22              OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
    1.23              OSMESA_LIBS=`$OSMESA_CONFIG --libs`
    1.24 -        	CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
    1.25 +            CFLAGS="$CFLAGS -DHAVE_OPENGL $OSMESA_CFLAGS"
    1.26              SYSTEM_LIBS="$SYSTEM_LIBS $OSMESA_LIBS"
    1.27          fi
    1.28 +
    1.29 +        AC_ARG_ENABLE(osmesa-shared,
    1.30 +[  --enable-osmesa-shared  dynamically load OSMesa OpenGL support [default=yes]],
    1.31 +                              , enable_osmesa_shared=yes)
    1.32 +        if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
    1.33 +            # Dynamic linking
    1.34 +            if test "x$have_osmesa_hdr" = "xyes"; then
    1.35 +                CFLAGS="$CFLAGS -DENABLE_OSMESA_SHARED"
    1.36 +            fi
    1.37 +		fi
    1.38      fi
    1.39  }
    1.40