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 dnl This ifdef has no useful effect prior to automake 1.9, but in 1.9
12 dnl it allows the user to not have check.m4 installed.
13 m4_ifdef([AM_PATH_CHECK],[
14 AM_PATH_CHECK(0.8.2, [HAVE_CHECK=true], [HAVE_CHECK=false])
16 AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xtrue)
18 AC_CONFIG_HEADERS([src/config.h])
23 AC_PATH_PROG(XSLTPROC, xsltproc, no)
24 if test "$XSLTPROC" = "no"; then
25 AC_MSG_ERROR([XCB requires xsltproc.])
28 HTML_CHECK_RESULT=false
29 if test x"$HAVE_CHECK" = xtrue; then
30 if test x"$XSLTPROC" != xno; then
31 HTML_CHECK_RESULT=true
34 AC_SUBST(HTML_CHECK_RESULT)
36 # Checks for pkg-config packages
37 PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 0.9)
38 PKG_CHECK_MODULES(XPROTO, xproto)
39 PKG_CHECK_MODULES(XAU, xau)
41 PKG_CHECK_MODULES(XDMCP, xdmcp,
42 AC_CHECK_LIB(Xdmcp, XdmcpWrap,
44 AC_DEFINE(HASXDMAUTH,1,[Has Wraphelp.c needed for XDM AUTH protocols])
52 # Find the xcb-proto protocol descriptions
53 AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
54 XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
55 AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
56 AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
59 AC_SEARCH_LIBS(gethostbyname, nsl)
60 AC_SEARCH_LIBS(connect, socket)
62 xcbincludedir='${includedir}/X11/XCB'
63 AC_SUBST(xcbincludedir)
66 AC_HELP_STRING([--with-opt], [compile with reasonable optimizations])
67 AC_HELP_STRING([--with-opt=FLAGS], [compile with specified FLAGS])
68 AC_HELP_STRING([--with-opt=small], [compile for smallest code])
69 AC_HELP_STRING([--without-opt], [compile without optimization (default)]),
76 COPTFLAGS="-Os -fomit-frame-pointer -DNDEBUG"
86 AC_CACHE_CHECK([what compiler optimizations to apply], [COPTFLAGS], [COPTFLAGS=""])
90 AC_HELP_STRING([--with-debug], [compile with debugging (default)])
91 AC_HELP_STRING([--with-debug=FLAGS], [compile with specified debugging FLAGS])
92 AC_HELP_STRING([--without-debug], [compile without debugging]),
102 CDEBUGFLAGS="$withval"
106 AC_CACHE_CHECK([what debugging options to apply], [CDEBUGFLAGS], [CDEBUGFLAGS="-g"])
107 AC_SUBST(CDEBUGFLAGS)
109 if test "x$GCC" = xyes ; then
110 CWARNFLAGS="-Wall -pedantic -Wpointer-arith \
111 -Wstrict-prototypes -Wmissing-declarations -Wnested-externs"
113 AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
114 if test "x$SUNCC" = "xyes"; then
120 GCC_CHECK_VISIBILITY()
122 AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile])
123 AC_CONFIG_FILES([xcb.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-xfree86dri.pc xcb-xfixes.pc xcb-xprint.pc xcb-xtest.pc xcb-xv.pc xcb-xvmc.pc])