2 # Process this file with autoconf to produce a configure script.
7 [xcb@lists.freedesktop.org])
8 AC_CONFIG_SRCDIR([xcb.pc.in])
9 AM_INIT_AUTOMAKE([foreign dist-bzip2])
11 PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=true], [HAVE_CHECK=false])
12 AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xtrue)
14 AC_CONFIG_HEADERS([src/config.h])
19 AC_PATH_PROG(XSLTPROC, xsltproc, no)
20 if test "$XSLTPROC" = "no"; then
21 AC_MSG_ERROR([XCB requires xsltproc.])
24 HTML_CHECK_RESULT=false
25 if test x"$HAVE_CHECK" = xtrue; then
26 if test x"$XSLTPROC" != xno; then
27 HTML_CHECK_RESULT=true
30 AC_SUBST(HTML_CHECK_RESULT)
32 # Checks for pkg-config packages
33 PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 0.9.93)
34 PKG_CHECK_MODULES(XAU, xau)
36 PKG_CHECK_MODULES(XDMCP, xdmcp,
37 AC_CHECK_LIB(Xdmcp, XdmcpWrap,
39 AC_DEFINE(HASXDMAUTH,1,[Has Wraphelp.c needed for XDM AUTH protocols])
47 # Find the xcb-proto protocol descriptions
48 AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
49 XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
50 AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
51 AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
54 AC_SEARCH_LIBS(gethostbyname, nsl)
55 AC_SEARCH_LIBS(connect, socket)
57 xcbincludedir='${includedir}/xcb'
58 AC_SUBST(xcbincludedir)
61 AC_HELP_STRING([--with-opt], [compile with reasonable optimizations])
62 AC_HELP_STRING([--with-opt=FLAGS], [compile with specified FLAGS])
63 AC_HELP_STRING([--with-opt=small], [compile for smallest code])
64 AC_HELP_STRING([--without-opt], [compile without optimization (default)]),
71 COPTFLAGS="-Os -fomit-frame-pointer -DNDEBUG"
81 AC_CACHE_CHECK([what compiler optimizations to apply], [COPTFLAGS], [COPTFLAGS=""])
85 AC_HELP_STRING([--with-debug], [compile with debugging (default)])
86 AC_HELP_STRING([--with-debug=FLAGS], [compile with specified debugging FLAGS])
87 AC_HELP_STRING([--without-debug], [compile without debugging]),
97 CDEBUGFLAGS="$withval"
101 AC_CACHE_CHECK([what debugging options to apply], [CDEBUGFLAGS], [CDEBUGFLAGS="-g"])
102 AC_SUBST(CDEBUGFLAGS)
104 if test "x$GCC" = xyes ; then
105 CWARNFLAGS="-Wall -pedantic -Wpointer-arith \
106 -Wstrict-prototypes -Wmissing-declarations -Wnested-externs"
108 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
109 if test "x$SUNCC" = "xyes"; then
115 GCC_CHECK_VISIBILITY()
119 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile doc/Makefile])
120 AC_CONFIG_FILES([xcb.pc xcb-xlib.pc xcb-composite.pc xcb-damage.pc xcb-dpms.pc xcb-glx.pc xcb-randr.pc xcb-record.pc xcb-render.pc xcb-res.pc xcb-screensaver.pc xcb-shape.pc xcb-shm.pc xcb-sync.pc xcb-xevie.pc xcb-xf86dri.pc xcb-xfixes.pc xcb-xinerama.pc xcb-xprint.pc xcb-xtest.pc xcb-xv.pc xcb-xvmc.pc])