check for compositing manager support requested. require all the appropriate etension...
authorDana Jansens <danakj@orodu.net>
Fri, 1 Feb 2008 05:09:56 +0000 (00:09 -0500)
committerDana Jansens <danakj@orodu.net>
Mon, 4 Feb 2008 14:33:29 +0000 (09:33 -0500)
configure.ac

index 5d08040193ae79dec792036a8ab41774e745a467..3cdfea1313c3e15d18c67be952a1d20ae268d7cd 100644 (file)
@@ -184,66 +184,75 @@ else
   xcursor_found=no
 fi
 
-AC_ARG_ENABLE(xcomposite,
+AC_ARG_ENABLE(compositing,
   AC_HELP_STRING(
-    [--disable-xcomposite],
-    [disable use of the X Composite library. [[default=enabled]]]
+    [--disable-compositing],
+    [disable the built-in compositing manager [[default=enabled]]]
   ),
-  [enable_xcomposite=$enableval],
-  [enable_xcomposite=yes]
+  [enable_compositing=$enableval],
+  [enable_compositing=yes]
 )
 
-if test "$enable_xcomposite" = yes; then
-PKG_CHECK_MODULES(XRENDER, [xrender],
-  [
-    AC_DEFINE(USE_XRENDER, [1], [Use X Render library])
-    AC_SUBST(XRENDER_CFLAGS)
-    AC_SUBST(XRENDER_LIBS)
-    PKG_CHECK_MODULES(XDAMAGE, [xdamage],
-      [
-        AC_DEFINE(USE_XDAMAGE, [1], [Use X Damage library])
-        AC_SUBST(XDAMAGE_CFLAGS)
-        AC_SUBST(XDAMAGE_LIBS)
-        PKG_CHECK_MODULES(XCOMPOSITE, [xcomposite],
-          [
-            AC_DEFINE(USE_XCOMPOSITE, [1], [Use X Composite library])
-            AC_SUBST(XCOMPOSITE_CFLAGS)
-            AC_SUBST(XCOMPOSITE_LIBS)
-            xcomposite_found=yes
-          ],
-          [
-            xcomposite_found=no
-          ]
-        )
-      ],
-      [
-        xcomposite_found=no
-      ]
-    )
-  ],
-  [
-    xcomposite_found=no
-  ]
-)
+AC_MSG_CHECKING(if compositing manager support should be enabled)
+AC_MSG_RESULT($enable_compositing)
+
+if test "$enable_compositing" = yes; then
+  PKG_CHECK_MODULES(XCOMPOSITE, [xcomposite])
+  AC_SUBST(XCOMPOSITE_CFLAGS)
+  AC_SUBST(XCOMPOSITE_LIBS)
+
+  PKG_CHECK_MODULES([XRENDER], [xrender])
+  AC_SUBST(XRENDER_CFLAGS)
+  AC_SUBST(XRENDER_LIBS)
+
+  PKG_CHECK_MODULES(XDAMAGE, [xdamage])
+  AC_SUBST(XDAMAGE_CFLAGS)
+  AC_SUBST(XDAMAGE_LIBS)
+
+  PKG_CHECK_MODULES(XFIXES, [xfixes])
+  AC_SUBST(XDAMAGE_CFLAGS)
+  AC_SUBST(XDAMAGE_LIBS)
+
+  AC_MSG_CHECKING(for GL_CFLAGS)
+  AC_ARG_WITH(gl-cflags, [  --with-gl-cflags=CFLAGS ],
+                         [GL_CFLAGS="$withval"],
+                         [GL_CFLAGS=""])
+
+  AC_MSG_RESULT($GL_CFLAGS)
+  AC_MSG_CHECKING(for GL_LIBS)
+  AC_ARG_WITH(gl-libs, [  --with-gl-libs=LIBS ],
+                       [GL_LIBS="$withval"],
+                       [GL_LIBS="-lGL"])
+  AC_MSG_RESULT($GL_LIBS)
+
+  AC_CHECK_LIB([GL], [glPopMatrix], ,
+    AC_MSG_ERROR([Could not find glPopMatrix in -lGL.]))
+
+  AC_MSG_CHECKING([for GL/gl.h])
+  AC_TRY_COMPILE(
+    [#include <GL/gl.h>],
+    [GLenum e = GL_INVALID_ENUM;],
+    [AC_MSG_RESULT([yes])],
+    [AC_MSG_RESULT([no])
+     AC_MSG_ERROR([Could not compile with GL/gl.h])])
+
+  AC_MSG_CHECKING([for GL/glx.h])
+  AC_TRY_COMPILE(
+    [#include <GL/glx.h>],
+    [int i = GLX_USE_GL;],
+    [AC_MSG_RESULT([yes])],
+    [AC_MSG_RESULT([no])
+     AC_MSG_ERROR([Could not compile with GL/glx.h])])
+
+  AC_SUBST(GL_CFLAGS)
+  AC_SUBST(GL_LIBS)
+
+  AC_DEFINE(USE_COMPOSITING, [1], [Support being a compositing manager])
+  do_compositing="yes"
 else
-  xcomposite_found=no
+  do_compositing="no"
 fi
 
-AC_MSG_CHECKING(for GL_CFLAGS)
-AC_ARG_WITH(gl-cflags, [  --with-gl-cflags=CFLAGS ],
-                       [GL_CFLAGS="$withval"],
-                       [GL_CFLAGS=""])
-
-AC_MSG_RESULT($GL_CFLAGS)
-AC_MSG_CHECKING(for GL_LIBS)
-AC_ARG_WITH(gl-libs, [  --with-gl-libs=LIBS ],
-                     [GL_LIBS="$withval"],
-                     [GL_LIBS="-lGL"])
-AC_MSG_RESULT($GL_LIBS)
-
-AC_SUBST(GL_CFLAGS)
-AC_SUBST(GL_LIBS)
-
 dnl Check for session management
 X11_SM
 
@@ -280,7 +289,7 @@ AC_MSG_RESULT
 AC_MSG_RESULT([Compiling with these options:
                Startup Notification... $sn_found
                X Cursor Library... $xcursor_found
-               X Composite Library... $xcomposite_found
                Session Management... $SM
+              Compositing manager... $do_compositing
                ])
 AC_MSG_RESULT([configure complete, now type "make"])