]> Dogcows Code - chaz/openbox/commitdiff
add --enable-gl support, and put the flags/libs in the appropriate makefiles
authorDana Jansens <danakj@orodu.net>
Fri, 23 May 2003 05:30:00 +0000 (05:30 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 23 May 2003 05:30:00 +0000 (05:30 +0000)
configure.ac
m4/gl.m4 [new file with mode: 0644]
openbox/Makefile.am
plugins/Makefile.am
plugins/keyboard/Makefile.am
plugins/mouse/Makefile.am
plugins/placement/Makefile.am
render/Makefile.am

index c924986c7ed8213b0ecdc29a8b843946ca78d4b6..811de5de5f989a61929310e8fd7c28dfd3d867b1 100644 (file)
@@ -71,6 +71,8 @@ X11_EXT_VIDMODE
 X11_EXT_SHAPE
 X11_EXT_XINERAMA
 
+GL_OPTION
+
 AC_CONFIG_FILES([Makefile
                  po/Makefile.in
                  themes/Makefile
diff --git a/m4/gl.m4 b/m4/gl.m4
new file mode 100644 (file)
index 0000000..e359271
--- /dev/null
+++ b/m4/gl.m4
@@ -0,0 +1,65 @@
+# X11_DEVEL()
+#
+# Check for the presence of the X Window System headers and libraries.
+# Sets the CPPFLAGS and LIBS variables as appropriate.
+AC_DEFUN([GL_OPTION],
+[
+  AC_REQUIRE([X11_DEVEL])
+
+  AC_ARG_ENABLE(gl, [  --enable-gl             enable support for OpenGL rendering default=no],
+                ,[enable_gl="no"])
+
+  # Store these
+  OLDLIBS=$LIBS
+  OLDCPPFLAGS=$CPPFLAGS
+
+  if test "$enable_gl" = "yes"; then
+    AC_CHECK_LIB([GL], [glXGetConfig],
+                 ,
+                 [
+                   enable_gl="no"
+                   AC_MSG_WARN([Disabling GL rendering support])
+                 ])
+  fi
+
+  if test "$enable_gl" = "yes"; then
+    CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+    LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
+
+    AC_MSG_CHECKING([if we can compile with GL])
+    AC_TRY_LINK(
+    [
+      #include <GL/gl.h>
+    ],
+    [
+      GLfloat f = 0.0;
+      glVertex3f(f, f, f);
+    ],
+    [
+      AC_MSG_RESULT([yes])
+    ],
+    [
+      AC_MSG_RESULT([no])
+      AC_MSG_WARN([Disabling GL rendering support])
+      enable_gl="no"
+    ])
+
+    GL_CFLAGS=""
+    GL_LIBS="-lGL"
+    AC_SUBST(GL_CFLAGS)
+    AC_SUBST(GL_LIBS)
+  fi
+
+  CPPFLAGS=$OLDCPPFLAGS
+  LIBS=$OLDLIBS
+
+  AC_MSG_CHECKING([if GL support is enabled])
+  if test "$enable_gl" = "yes"; then
+    AC_MSG_RESULT([yes])
+
+    AC_DEFINE(USE_GL)
+  else
+    AC_MSG_RESULT([no])
+  fi
+  AM_CONDITIONAL([USE_GL], [test "$enable_gl" = "yes"])
+])
index ac277c0155df233f86e07e71f0edd5d60030602b..4c83005ffacfd7c03ccd1f9ff8f66ec72228e5ea 100644 (file)
@@ -6,7 +6,7 @@ binary=openbox3
 url=http://icculus.org/openbox
 
 CPPFLAGS=$(X_CFLAGS) $(XFT_CFLAGS) $(GLIB_CFLAGS) $(GMODULE_CFLAGS) \
-         $(LIBSN_CFLAGS) @CPPFLAGS@ \
+         $(LIBSN_CFLAGS) $(GL_CFLAGS) @CPPFLAGS@ \
          -DLOCALEDIR=\"$(localedir)\" \
          -DRCDIR=\"$(rcdir)\" \
          -DPLUGINDIR=\"$(plugindir)\" \
index c08300d46400c0a9f16f7a8365b9626d40988011..4796307ab40545d9f4c5c991fc45b1de7a2d48de 100644 (file)
@@ -2,7 +2,7 @@ plugindir=$(libdir)/openbox/plugins
 
 SUBDIRS = keyboard mouse placement menu
 
-CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) @CPPFLAGS@ \
+CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) $(GL_CFLAGS) @CPPFLAGS@ \
 -DPLUGINDIR=\"$(plugindir)\"
 
 INCLUDES=-I..
index c5389c58be20045f98de234ba6099f49c0f2ea99..ffcd104b90d37f9cf985db773bb42c8b52a8f03a 100644 (file)
@@ -1,6 +1,6 @@
 plugindir=$(libdir)/openbox/plugins
 
-CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) @CPPFLAGS@ \
+CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) $(GL_CFLAGS) @CPPFLAGS@ \
          -DG_LOG_DOMAIN=\"Plugin-Keyboard\"
 
 INCLUDES=-I../..
index d89fd70e1cf1b4765ee4aa2349be1b2790b94c63..e4c897d53d30fcdfd3890e965541d7fd940e589a 100644 (file)
@@ -1,6 +1,6 @@
 plugindir=$(libdir)/openbox/plugins
 
-CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) @CPPFLAGS@ \
+CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) $(GL_CFLAGS) @CPPFLAGS@ \
          -DG_LOG_DOMAIN=\"Plugin-Mouse\"
 
 INCLUDES=-I../..
index 8942463d38e57956d35a427bcae6b2a6310c0c68..6b32800873a0cd69186b4739225b4dc6fe3b7cf3 100644 (file)
@@ -1,6 +1,6 @@
 plugindir=$(libdir)/openbox/plugins
 
-CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) @CPPFLAGS@ \
+CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) $(GL_CFLAGS) @CPPFLAGS@ \
          -DG_LOG_DOMAIN=\"Plugin-Placement\"
 
 INCLUDES=-I../..
index dffad8b34ccb58f86fae02389898c4404348c4a7..579ff681abb23463520399894f08e4abd88a1491 100644 (file)
@@ -2,13 +2,13 @@ themedir=$(datadir)/openbox/themes
 
 theme=operation
 
-CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) @CPPFLAGS@ \
+CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) $(GL_CFLAGS) @CPPFLAGS@ \
          -DG_LOG_DOMAIN=\"Render\" \
          -DDEFAULT_THEME=\"$(theme)\" \
          -DTHEMEDIR=\"$(themedir)\"
 
 INCLUDES=-I..
-LIBS=$(XFT_LIBS) $(GLIB_LIBS) @LIBS@
+LIBS=$(XFT_LIBS) $(GLIB_LIBS) $(GL_LIBS) @LIBS@
 
 noinst_PROGRAMS=rendertest
 rendertest_LDFLAGS=-lobrender -L.
This page took 0.031627 seconds and 4 git commands to generate.