[PATCH:oclock] Enable the latent XKBStdBell code in oclock

Alan Coopersmith alan.coopersmith at oracle.com
Fri Oct 14 23:21:27 PDT 2011


This code has been unreachable since the switch from Imake lost -DXKB,
might as well hook it back up.   Sadly it relies on the nonsensical use
of libxkbfile for the Bell calls, but such is the state of our XKB Bell API.

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 Clock.c      |    4 ++++
 configure.ac |   12 +++++++++++-
 oclock.c     |    4 ++++
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/Clock.c b/Clock.c
index c5d7dbe..04d7dfd 100644
--- a/Clock.c
+++ b/Clock.c
@@ -30,6 +30,10 @@ in this Software without prior written authorization from The Open Group.
  * a NeWS clone clock
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <X11/IntrinsicP.h>
 #include <X11/StringDefs.h>
 #include <X11/Xmu/Converters.h>
diff --git a/configure.ac b/configure.ac
index 7fce961..dd1755a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,8 +37,18 @@ XORG_DEFAULT_OPTIONS
 
 AC_CONFIG_HEADERS([config.h])
 
+# Optional dependencies
+AC_ARG_WITH(xkb,
+	AS_HELP_STRING([--without-xkb],
+		[Disable use of XKB to sound bells (Default is with-xkb)]),
+	use_xkb="$withval", use_xkb="yes")
+if test x$use_xkb != xno ; then
+	XKBMODULE="xkbfile"
+        AC_DEFINE([XKB],1,[Define to use XkbStdBell])
+fi
+
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(OCLOCK, x11 xmu xext xt)
+PKG_CHECK_MODULES(OCLOCK, x11 xmu xext xt ${XKBMODULE})
 
 xt_appdefaultdir=`$PKG_CONFIG --variable=appdefaultdir xt`
 AC_ARG_WITH(appdefaultdir,
diff --git a/oclock.c b/oclock.c
index be7943e..e36d80c 100644
--- a/oclock.c
+++ b/oclock.c
@@ -24,6 +24,10 @@ in this Software without prior written authorization from The Open Group.
 
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <X11/Intrinsic.h>
 #include <X11/Xatom.h>
 #include <X11/StringDefs.h>
-- 
1.7.3.2



More information about the xorg-devel mailing list