3 # Check for the presence of the X Window System headers and libraries.
4 # Sets the CPPFLAGS and LIBS variables as appropriate.
9 test "$no_x" = "yes" && \
10 AC_MSG_ERROR([The X Window System could not be found.])
12 CPPFLAGS="$CPPFLAGS $X_CFLAGS"
13 LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
15 # Check for required functions in -lX11
17 [X11], [XOpenDisplay],
19 AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
26 if test "$XFT_MIN"; then
27 AC_MSG_ERROR([$PACKAGE requires the Xft font library >= $XFT_MIN.
28 See http://www.fontconfig.org/
31 AC_MSG_ERROR([$PACKAGE requires the Xft font library.
32 See http://www.fontconfig.org/
37 # XFT_DEVEL([required-version])
39 # Check for the XFT development package.
40 # You can use the optional argument to check for a library of at least the
42 # It provides the $(PYTHON_CFLAGS) $(PYTHON_LIBS) output variables.
45 AC_REQUIRE([X11_DEVEL])
49 XFT_MIN_MAJOR=${XFT_MIN%.*.*}
50 XFT_MIN_MINOR=${XFT_MIN%.*}
51 XFT_MIN_MINOR=${XFT_MIN_MINOR#*.}
52 XFT_MIN_REVISION=${XFT_MIN#*.*.}
53 XFT_MIN="$XFT_MIN_MAJOR.$XFT_MIN_MINOR.$XFT_MIN_REVISION"
58 if test -z "$XFT_MIN"; then
59 AC_MSG_CHECKING([for Xft])
60 if ! pkg-config xft; then
65 AC_MSG_CHECKING([for Xft version >= $XFT_MIN])
66 if ! pkg-config --atleast-version $XFT_MIN xft; then
78 XFT_CFLAGS="`pkg-config --cflags xft`"
79 XFT_LIBS="`pkg-config --libs xft`"
81 # Set these for checking with the tests below. They'll be restored after
82 LIBS="$LIBS $XFT_LIBS"
83 CPPFLAGS="$XFT_CFLAGS $CPPFLAGS"
85 AC_CHECK_LIB([Xft], [XftGetVersion], # this was not defined in < 2.0
86 if test "$XFT_MIN"; then
87 AC_MSG_CHECKING([for X11/Xft/Xft.h for Xft >= $XFT_MIN])
91 #include <X11/Xft/Xft.h>
94 #if !defined(XFT_MAJOR)
95 # error Xft.h is too old
97 #if XFT_MAJOR < $XFT_MIN_MAJOR
98 # error Xft.h is too old
100 #if XFT_MAJOR == $XFT_MIN_MAJOR
101 # if XFT_MINOR < $XFT_MIN_MINOR
102 # error Xft.h is too old
105 #if XFT_MAJOR == $XFT_MIN_MAJOR
106 # if XFT_MAJOR == $XFT_MIN_MINOR
107 # if XFT_REVISION < $XFT_MIN_REVISION
108 # error Xft.h is too old
124 AC_MSG_CHECKING([for X11/Xft/Xft.h])
127 #include <X11/Xlib.h>
128 #include <X11/Xft/Xft.h>
131 int i = XFT_MAJOR; /* make sure were using Xft 2, not 1 */
143 AC_MSG_CHECKING([if we can compile with Xft])
146 #include <X11/Xlib.h>
147 #include <X11/Xft/Xft.h>
158 AC_MSG_ERROR([Unable to compile with the Xft font library.
163 # Restore the old values. Use XFT_CFLAGS and XFT_LIBS in the Makefile.am's
165 CPPFLAGS=$OLDCPPFLAGS
167 AC_SUBST([XFT_CFLAGS])
174 # Check for the presence of the "Xkb" X Window System extension.
175 # Defines "XKB" and sets the $(XKB) variable to "yes" if the extension is
177 AC_DEFUN([X11_EXT_XKB],
179 AC_REQUIRE([X11_DEVEL])
181 AC_CHECK_LIB([X11], [XkbBell],
182 AC_MSG_CHECKING([for X11/XKBlib.h])
185 #include <X11/Xlib.h>
186 #include <X11/Xutil.h>
187 #include <X11/XKBlib.h>
197 AC_DEFINE([XKB], [1], [Found the XKB extension])
204 AC_MSG_CHECKING([for the Xkb extension])
205 if test "$XKB" = "yes"; then
214 # Check for the presence of the "Shape" X Window System extension.
215 # Defines "SHAPE", sets the $(SHAPE) variable to "yes", and sets the $(LIBS)
216 # appropriately if the extension is present.
217 AC_DEFUN([X11_EXT_SHAPE],
219 AC_REQUIRE([X11_DEVEL])
221 AC_CHECK_LIB([Xext], [XShapeCombineShape],
222 AC_MSG_CHECKING([for X11/extensions/shape.h])
225 #include <X11/Xlib.h>
226 #include <X11/Xutil.h>
227 #include <X11/extensions/shape.h>
235 AC_DEFINE([SHAPE], [1], [Found the XShape extension])
243 AC_MSG_CHECKING([for the Shape extension])
244 if test "$SHAPE" = "yes"; then
254 # Check for the presence of the "Xinerama" X Window System extension.
255 # Defines "XINERAMA", sets the $(XINERAMA) variable to "yes", and sets the
256 # $(LIBS) appropriately if the extension is present.
257 AC_DEFUN([X11_EXT_XINERAMA],
259 AC_REQUIRE([X11_DEVEL])
261 AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
263 AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
266 #include <X11/Xlib.h>
267 #include <X11/extensions/Xinerama.h>
270 XineramaScreenInfo foo;
275 AC_DEFINE([XINERAMA], [1], [Enable support of the Xinerama extension])
276 LIBS="$LIBS -lXinerama"
283 AC_MSG_CHECKING([for the Xinerama extension])
284 if test "$XINERAMA" = "yes"; then