summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-04-24 06:48:08 +0000
committerDana Jansens <danakj@orodu.net>2007-04-24 06:48:08 +0000
commit3d71bfd20857da4d42997da500f327b229bf9e80 (patch)
treecfb736b42a19d1f265276344581e6e8f50d7f851 /m4
parent6e83a82e5b5206c8199e392df5f089c0b4122fe1 (diff)
add check for the Sync extension
Diffstat (limited to 'm4')
-rw-r--r--m4/x11.m454
1 files changed, 54 insertions, 0 deletions
diff --git a/m4/x11.m4 b/m4/x11.m4
index 2eae1db5..fc7b36e1 100644
--- a/m4/x11.m4
+++ b/m4/x11.m4
@@ -397,6 +397,60 @@ AC_DEFUN([X11_EXT_XINERAMA],
fi
])
+# X11_EXT_SYNC()
+#
+# Check for the presence of the "Sync" X Window System extension.
+# Defines "SYNC", sets the $(SYNC) variable to "yes", and sets the $(LIBS)
+# appropriately if the extension is present.
+AC_DEFUN([X11_EXT_SYNC],
+[
+ AC_REQUIRE([X11_DEVEL])
+
+ # Store these
+ OLDLIBS=$LIBS
+ OLDCPPFLAGS=$CPPFLAGS
+
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ LIBS="$LIBS $X_LIBS"
+
+ AC_CHECK_LIB([Xext], [XSyncInitialize],
+ AC_MSG_CHECKING([for X11/extensions/sync.h])
+ AC_TRY_LINK(
+ [
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ #include <X11/extensions/sync.h>
+ ],
+ [
+ XSyncValueType foo;
+ ],
+ [
+ AC_MSG_RESULT([yes])
+ SYNC="yes"
+ AC_DEFINE([SYNC], [1], [Found the XSync extension])
+
+ XSYNC_CFLAGS=""
+ XSYNC_LIBS="-lXext"
+ AC_SUBST(XSYNC_CFLAGS)
+ AC_SUBST(XSYNC_LIBS)
+ ],
+ [
+ AC_MSG_RESULT([no])
+ SYNC="no"
+ ])
+ )
+
+ LIBS=$OLDLIBS
+ CPPFLAGS=$OLDCPPFLAGS
+
+ AC_MSG_CHECKING([for the Sync extension])
+ if test "$SYNC" = "yes"; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+])
+
# X11_SM()
#
# Check for the presence of SMlib for session management.