Search
lxdream.org :: lxdream/configure.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename configure.in
changeset 1287:dac8f363f1fe
prev1284:0db0a5e72698
author nkeynes
date Sun Jul 01 13:20:34 2012 +1000 (7 years ago)
permissions -rw-r--r--
last change Add support for Nokia N900
- Generic support for EGL with GTK
- Workaround for nokia bug with egl config
Based on patch from guinux, thanks!
file annotate diff log raw
1.1 --- a/configure.in Tue Apr 17 21:35:38 2012 +1000
1.2 +++ b/configure.in Sun Jul 01 13:20:34 2012 +1000
1.3 @@ -10,7 +10,6 @@
1.4
1.5 m4_include([m4/ccforbuild.m4])
1.6 m4_include([m4/android.m4])
1.7 -LX_ANDROID_BUILD
1.8
1.9 AC_ISC_POSIX
1.10 AC_PROG_CC
1.11 @@ -79,16 +78,30 @@
1.12 AC_ARG_WITH( sdl,
1.13 AS_HELP_STRING( [--with-sdl], [Build with support for SDL audio]) )
1.14
1.15 +AC_ARG_WITH( sysroot,
1.16 + AS_HELP_STRING( [--with-sysroot=SYSROOT], [Build using an alternate sysroot]),
1.17 + [ m4_pattern_allow([PKG_CONFIG_LIBDIR])
1.18 + if test -d "$with_sysroot/lib/pkgconfig"; then
1.19 + LDFLAGS="$LDFLAGS -L$with_sysroot/lib"
1.20 + CPPFLAGS="$CPPFLAGS -I$with_sysroot/include"
1.21 + BUILD_PKG_CONFIG_LIBDIR="$PKG_CONFIG_LIBDIR"
1.22 + TARGET_PKG_CONFIG_LIBDIR="$with_sysroot/lib/pkgconfig"
1.23 + PKG_CONFIG_LIBDIR="$TARGET_PKG_CONFIG_LIBDIR"
1.24 + export PKG_CONFIG_LIBDIR;
1.25 + else
1.26 + AC_MSG_FAILURE([pkg-config directory $with_sysroot/lib/pkgconfig not found, when using --with-sysroot=$with_sysroot option])
1.27 + fi
1.28 + ])
1.29 +
1.30 +LX_ANDROID_BUILD
1.31 +
1.32 dnl ------------ Check if we're building on Darwin or Android --------------
1.33
1.34 dnl For starters, do we have a working objective-c compiler?
1.35 if test "$ANDROID_BUILD" = "yes"; then
1.36 with_gtk=no;
1.37 EXTRA_OUTPUT_FILES="src/android/build.properties"
1.38 - LIBS="-lEGL -lGLESv2 $LIBS"
1.39 - AC_DEFINE(HAVE_GLES2, 1, [Using GLESv2])
1.40 UI_DRIVER="Android"
1.41 - VIDEO_DRIVERS="egl"
1.42 with_sdl=no
1.43 else
1.44 AC_HAVE_OBJC([
1.45 @@ -255,7 +268,17 @@
1.46 fi
1.47
1.48 AC_PUSH_CC_FOR_BUILD
1.49 +if test "$BUILD_PKG_CONFIG_LIBDIR" != "$TARGET_PKG_CONFIG_LIBDIR"; then
1.50 + PKG_CONFIG_LIBDIR="$BUILD_PKG_CONFIG_LIBDIR";
1.51 + if test "x$PKG_CONFIG_LIBDIR" = "x"; then
1.52 + export -n PKG_CONFIG_LIBDIR
1.53 + fi
1.54 +fi
1.55 PKG_CHECK_MODULES(GLIB_FOR_BUILD, glib-2.0)
1.56 +if test "$BUILD_PKG_CONFIG_LIBDIR" != "$TARGET_PKG_CONFIG_LIBDIR"; then
1.57 + PKG_CONFIG_LIBDIR="$TARGET_PKG_CONFIG_LIBDIR";
1.58 + export PKG_CONFIG_LIBDIR
1.59 +fi
1.60 AC_POP_CC_FOR_BUILD
1.61
1.62 AM_CONDITIONAL(GUI_GTK, [test "$HAVE_GTK" = 'yes'])
1.63 @@ -281,39 +304,45 @@
1.64
1.65 dnl Otherwise we want a real GL library (unless we're on darwin or android, in which case it's already
1.66 dnl taken care of above).
1.67 - if test "x$APPLE_BUILD" != 'xyes' -a "x$ANDROID_BUILD" != 'xyes'; then
1.68 - PKG_CHECK_MODULES(LIBGL, [gl] )
1.69 - dnl AC_CHECK_LIB(GL, glVertex3f, [], [
1.70 - dnl AC_MSG_FAILURE( ["The OpenGL library (libGL.so) could not be found, but is required."])])
1.71 - dnl AC_CHECK_HEADER([GL/gl.h], [], [
1.72 - dnl AC_MSG_FAILURE( ["The OpenGL header files (eg GL/gl.h) could not be found, but are required."])])
1.73 - LIBS="$LIBS $LIBGL_LIBS";
1.74 - CPPFLAGS="$CPPFLAGS $LIBGL_CFLAGS";
1.75 + if test "x$APPLE_BUILD" != 'xyes'; then
1.76 + PKG_CHECK_MODULES(LIBGL, [gl], [
1.77 + LIBS="$LIBS $LIBGL_LIBS";
1.78 + CPPFLAGS="$CPPFLAGS $LIBGL_CFLAGS";
1.79 + ], [
1.80 + dnl GL library not found, try for GLESv2 + EGL
1.81 + AC_CHECK_LIB(GLESv2, glEnable, [LIBS="-lGLESv2 $LIBS"; HAVE_GLES2='yes'],
1.82 + [ AC_MSG_FAILURE([Neither the OpenGL library (libGL.so) nor the OpenGL ES 2.0 library (libGLESv2.so) could be found, but one is required.]) ])
1.83 + ])
1.84 +
1.85 else
1.86 AC_CHECK_FUNC(NSOpenGLGetVersion, [
1.87 HAVE_NSGL='yes'
1.88 VIDEO_DRIVERS="$VIDEO_DRIVERS nsgl"
1.89 AC_DEFINE([HAVE_NSGL],1, [Have NSOpenGL support]) ] )
1.90 + if test "x$HAVE_GTK_X11" = "xyes"; then
1.91 + LIBS="$LIBS -L/usr/X11/lib -lGL"
1.92 + fi
1.93 fi
1.94
1.95 dnl Now work out how to get from the UI to GL - this is usually the painful part.
1.96 - if test "x$HAVE_GTK_X11" = "xyes"; then
1.97 - if test "x$APPLE_BUILD" = "xyes"; then
1.98 - LIBS="$LIBS -L/usr/X11/lib -lGL"
1.99 - fi
1.100 - AC_CHECK_FUNC(glXQueryVersion, [
1.101 - HAVE_GLX='yes'
1.102 - VIDEO_DRIVERS="$VIDEO_DRIVERS glx"
1.103 - AC_DEFINE([HAVE_GLX], 1, [Have GLX support]) ] )
1.104 - fi
1.105 -
1.106 + AC_CHECK_FUNC(glXQueryVersion, [
1.107 + HAVE_GLX='yes'
1.108 + VIDEO_DRIVERS="$VIDEO_DRIVERS glx"
1.109 + AC_DEFINE([HAVE_GLX], 1, [Have GLX support]) ] )
1.110 + AC_CHECK_LIB(EGL, eglGetDisplay, [
1.111 + LIBS="-lEGL $LIBS"
1.112 + HAVE_EGL='yes'
1.113 + VIDEO_DRIVERS="$VIDEO_DRIVERS egl"])
1.114 ])
1.115
1.116 -
1.117 +if test "x$HAVE_GLES2" = "xyes"; then
1.118 + AC_DEFINE(HAVE_GLES2, 1, [Using GLESv2])
1.119 +fi
1.120
1.121 AM_CONDITIONAL(VIDEO_OSMESA, [test "x$HAVE_OSMESA" = "xyes"])
1.122 AM_CONDITIONAL(VIDEO_GLX, [test "x$HAVE_GLX" = "xyes"])
1.123 AM_CONDITIONAL(VIDEO_NSGL, [test "x$HAVE_NSGL" = "xyes"])
1.124 +AM_CONDITIONAL(VIDEO_EGL, [test "x$HAVE_EGL" = "xyes"])
1.125
1.126 dnl Check for optional (but highly desireable) OpenGL features
1.127 AC_CHECK_FUNC(glGenFramebuffers, [ AC_DEFINE([HAVE_OPENGL_FBO],1,[Have 2.0 framebuffer_object support]) ], [])
.