Search
lxdream.org :: lxdream/configure.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename configure.in
changeset 658:f5926310bfbe
prev657:c4143facbfcb
next660:d1b2695347c6
author nkeynes
date Wed Apr 16 12:43:52 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Start removing X11isms from gtkui into drivers
Overhaul the configure rules for figuring out the video driver
file annotate diff log raw
1.1 --- a/configure.in Wed Apr 16 10:12:12 2008 +0000
1.2 +++ b/configure.in Wed Apr 16 12:43:52 2008 +0000
1.3 @@ -26,23 +26,18 @@
1.4 AS_HELP_STRING( [--with-osmesa], [Build with the osmesa GL library (software rendering)]),
1.5 [], [with_osmesa=no])
1.6
1.7 -AS_IF([test "x$with_osmesa" != xno], [
1.8 - AC_CHECK_LIB([OSMesa], [OSMesaCreateContext], [],
1.9 - [AC_MSG_FAILURE( [--with-osmesa was given, but OSMesa library could not be found])])
1.10 - AC_CHECK_HEADER([GL/osmesa.h], [],
1.11 - [AC_MSG_FAILURE( [--with-osmesa was given, but osmesa.h could not be found])])
1.12 - ])
1.13 -AM_CONDITIONAL(OSMESA_DRIVER, [test "x$with_osmesa" != xno])
1.14
1.15 dnl ----------- Check for mandatory dependencies --------------
1.16 dnl Building on MAC?
1.17 -AC_CHECK_HEADER([Carbon/Carbon.h], [
1.18 - HAVE_CARBON='yes'
1.19 +AC_CHECK_HEADER([Cocoa/Cocoa.h], [
1.20 + HAVE_COCOA='yes'
1.21 APPLE_BUILD='yes'
1.22 - LIBS="$LIBS -framework OpenGL -framework AGL -framework Carbon -L/usr/X11R6/lib -lGL"
1.23 - AC_DEFINE(HAVE_CARBON,[1],[Have Carbon framework])
1.24 + LIBS="$LIBS -framework AppKit"
1.25 + LIBS="$LIBS -Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -framework OpenGL"
1.26 + AC_DEFINE(HAVE_COCOA,[1],[Have Cocoa framework])
1.27 AC_DEFINE(APPLE_BUILD,[1],[Building on an apple platform. Things are different...])
1.28 ])
1.29 +AM_CONDITIONAL(GUI_CARBON, [test "$HAVE_COCOA" = 'yes'])
1.30
1.31 dnl Check for libpng (required)
1.32 PKG_CHECK_MODULES(LIBPNG, [libpng] )
1.33 @@ -52,29 +47,74 @@
1.34 echo "Zlib (libz.so) could not be found, but is required."
1.35 exit 1])
1.36
1.37 -if test "$APPLE_BUILD" != 'yes'; then
1.38 -if test "x$with_osmesa" == "xno"; then
1.39 -AC_CHECK_LIB(GL, glXQueryVersion, [], [
1.40 - echo "The OpenGL library (libGL.so) could not be found, but is required."
1.41 - exit 1])
1.42 -AC_CHECK_HEADER([GL/gl.h], [], [
1.43 - echo "The OpenGL header files (eg GL/gl.h) could not be found, but are required."
1.44 - exit 1])
1.45 -fi
1.46 +
1.47 +dnl Check for GTK (currently compulsory)
1.48 +PKG_CHECK_MODULES(GTK, gtk+-2.0, [
1.49 + HAVE_GTK='yes'
1.50 + AC_DEFINE([HAVE_GTK],1,[Have GTK libraries])
1.51 +])
1.52 +AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
1.53 +
1.54 +dnl Which GTK port do we have?
1.55 +LIBS="$LIBS $GTK_LIBS"
1.56 +AC_CHECK_FUNC(gdk_x11_display_get_xdisplay, [
1.57 + HAVE_GTK_X11='yes'
1.58 + AC_DEFINE([HAVE_GTK_X11],1,[Building with GTK+X11]) ], [])
1.59 +AC_CHECK_FUNC(gdk_quartz_window_get_nsview, [
1.60 + HAVE_GTK_OSX='yes'
1.61 + AC_DEFINE([HAVE_GTK_OSX],1,[Building with GTK+Cocoa]) ], [])
1.62 +
1.63 +dnl ------------------ Video driver support -------------------
1.64 +AS_IF([test "x$with_osmesa" != xno], [
1.65 +
1.66 +dnl User requested OSMesa (ie pure software rendering)
1.67 + AC_CHECK_LIB([OSMesa], [OSMesaCreateContext], [],
1.68 + [AC_MSG_FAILURE( [--with-osmesa was given, but OSMesa library could not be found])])
1.69 + AC_CHECK_HEADER([GL/osmesa.h], [],
1.70 + [AC_MSG_FAILURE( [--with-osmesa was given, but osmesa.h could not be found])])
1.71 + HAVE_OSMESA='yes'
1.72 + AC_DEFINE([HAVE_OSMESA],1,[Building with the OSMesa video driver]) ], [
1.73 +
1.74 +dnl Otherwise we want a real GL library (unless we're on darwin, in which case it's already
1.75 +dnl taken care of above).
1.76 + if test "x$APPLE_BUILD" != 'xyes'; then
1.77 + AC_CHECK_LIB(GL, glVertex3f, [], [
1.78 + AC_MSG_FAILURE( ["The OpenGL library (libGL.so) could not be found, but is required."])])
1.79 + AC_CHECK_HEADER([GL/gl.h], [], [
1.80 + AC_MSG_FAILURE( ["The OpenGL header files (eg GL/gl.h) could not be found, but are required."])])
1.81 + fi
1.82 +
1.83 +dnl Now work out how to get from the UI to GL - this is usually the painful part.
1.84 + if test "x$HAVE_GTK_X11" = "xyes"; then
1.85 + if test "x$APPLE_BUILD" = "xyes"; then
1.86 + LIBS="$LIBS -L/usr/X11/lib -lGL"
1.87 + fi
1.88 + AC_CHECK_FUNC(glXQueryVersion, [
1.89 + HAVE_GLX='yes'
1.90 + AC_DEFINE([HAVE_GLX], 1, [Have GLX support]) ] )
1.91 + elif test "x$HAVE_GTK_OSX" = "xyes"; then
1.92 + AC_CHECK_FUNC(NSOpenGLGetVersion, [
1.93 + HAVE_NSGL='yes'
1.94 + AC_DEFINE([HAVE_NSGL],1, [Have NSOpenGL support]) ] )
1.95 + fi
1.96 +
1.97 +])
1.98 +
1.99 +
1.100 +dnl OK, now decide which video driver(s) we can build
1.101 +if test "x$HAVE_OSMESA" = "x" -a "x$HAVE_GLX" = "x" -a "x$HAVE_NSGL" = "x"; then
1.102 + echo "Warning: Building with no video support"
1.103 fi
1.104
1.105 +AM_CONDITIONAL(VIDEO_OSMESA, [test "x$HAVE_OSMESA" = "xyes"])
1.106 +AM_CONDITIONAL(VIDEO_GLX, [test "x$HAVE_GLX" = "xyes"])
1.107 +AM_CONDITIONAL(VIDEO_NSGL, [test "x$HAVE_NSGL" = "xyes"])
1.108 +
1.109 +dnl Check for optional (but highly desireable) OpenGL features
1.110 AC_CHECK_FUNC(glGenFramebuffersEXT, [ AC_DEFINE([HAVE_OPENGL_FBO],1,[Have EXT_framebuffer_object support]) ], [])
1.111 AC_CHECK_FUNC(glCreateShader, [ AC_DEFINE([HAVE_OPENGL_SHADER],1,[Have 2.0 shader support]) ], [])
1.112 AC_CHECK_FUNC(glCreateShaderObjectARB, [ AC_DEFINE([HAVE_OPENGL_SHADER_ARB],1,[Have ARB shader support]) ], [])
1.113
1.114 -dnl Check for GTK (required for unix systems)
1.115 -PKG_CHECK_MODULES(GTK, gtk+-2.0, [
1.116 - HAVE_GTK='yes'
1.117 - AC_DEFINE([HAVE_GTK],1,[Have GTK libraries])
1.118 -])
1.119 -
1.120 -AM_CONDITIONAL(GUI_CARBON, [test "$HAVE_CARBON" = 'yes'])
1.121 -AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
1.122
1.123 dnl Check for a supported cpu target for translation purposes
1.124 case $host_cpu in
1.125 @@ -118,7 +158,6 @@
1.126 echo "Linux CDROM support not found, building without it."] )
1.127 AM_CONDITIONAL(CDROM_LINUX, [test "$HAVE_LINUX_CDROM_H" = "yes"])
1.128
1.129 -
1.130 AC_CHECK_HEADER([linux/joystick.h], [
1.131 HAVE_LINUX_JOYSTICK_H=yes
1.132 AC_DEFINE([HAVE_LINUX_JOYSTICK], 1, [Have linux joystick support]) ],
.