6fe3e57c333f3fa298d5e48e6cbee79ffdeb1da5
[profile/ivi/libxcb.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.57)
5 AC_INIT([libxcb],
6         1.2,
7         [xcb@lists.freedesktop.org])
8 AC_CONFIG_SRCDIR([xcb.pc.in])
9 AM_INIT_AUTOMAKE([foreign dist-bzip2])
10
11 AM_PATH_PYTHON([2.5])
12
13 PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
14 AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xyes)
15
16 AC_CONFIG_HEADERS([src/config.h])
17
18 AC_PROG_LIBTOOL
19 AC_PROG_CC
20
21 AC_PATH_PROG(XSLTPROC, xsltproc, no)
22 if test "$XSLTPROC" = "no"; then
23    AC_MSG_ERROR([XCB requires xsltproc.])
24 fi
25
26 HTML_CHECK_RESULT=false
27 if test x"$HAVE_CHECK" = xyes; then
28         if test x"$XSLTPROC" != xno; then
29                 HTML_CHECK_RESULT=true
30         fi
31 fi
32 AC_SUBST(HTML_CHECK_RESULT)
33
34 # Checks for pkg-config packages
35 PKG_CHECK_MODULES(XCBPROTO, xcb-proto >= 1.1)
36 NEEDED="pthread-stubs xau >= 0.99.2"
37 PKG_CHECK_MODULES(NEEDED, $NEEDED)
38
39 have_xdmcp="no"
40 PKG_CHECK_MODULES(XDMCP, xdmcp,
41         AC_CHECK_LIB(Xdmcp, XdmcpWrap,
42                 [
43                 AC_DEFINE(HASXDMAUTH,1,[Has Wraphelp.c needed for XDM AUTH protocols])
44                 NEEDED="$NEEDED xdmcp"
45                 have_xdmcp="yes"
46                 ],
47                 [
48                 XDMCP_CFLAGS=
49                 XDMCP_LIBS=
50                 ], [$XDMCP_LIBS]),
51         [AC_MSG_RESULT(no)])
52
53 AC_SUBST(NEEDED)
54
55 # Find the xcb-proto protocol descriptions
56 AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
57 XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
58 AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
59 AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
60
61 # Find the xcbgen Python package
62 AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
63 XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
64 AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
65 AC_SUBST(XCBPROTO_XCBPYTHONDIR)
66
67 AC_HEADER_STDC
68 AC_SEARCH_LIBS(getaddrinfo, socket)
69 AC_SEARCH_LIBS(connect, socket)
70
71 case $host_os in
72 linux*)
73         AC_DEFINE([HAVE_ABSTRACT_SOCKETS], 1, [Define if your platform supports abstract sockets])
74         ;;
75 esac
76
77 dnl define buffer queue size
78 AC_ARG_WITH([queue-size],
79             AC_HELP_STRING([--with-queue-size=SIZE],
80             [Set the XCB buffer queue size (default is 16384)]),
81             [xcb_queue_buffer_size="$withval"],
82             [xcb_queue_buffer_size=16384])
83 AC_DEFINE_UNQUOTED(XCB_QUEUE_BUFFER_SIZE, [$xcb_queue_buffer_size],
84                    [XCB buffer queue size])
85
86 dnl check for the sockaddr_un.sun_len member
87 AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
88                 [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN,1,[Have the sockaddr_un.sun_len member.])],
89                 [],
90                 [ #include <sys/types.h>
91                   #include <sys/un.h>
92                 ])
93
94 xcbincludedir='${includedir}/xcb'
95 AC_SUBST(xcbincludedir)
96
97 if  test "x$GCC" = xyes ; then
98     CWARNFLAGS="-Wall -pedantic -Wpointer-arith \
99                 -Wstrict-prototypes -Wmissing-declarations -Wnested-externs"
100 else
101     AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
102     if test "x$SUNCC" = "xyes"; then
103         CWARNFLAGS="-v"
104     fi
105 fi
106 AC_SUBST(CWARNFLAGS)
107
108 XCB_CHECK_VISIBILITY()
109
110 # htmldir is not defined prior to autoconf 2.59c, so on earlier versions
111 # set an equivalent value.
112 AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME],
113           ['${datadir}/doc/${PACKAGE_TARNAME}'],
114           ['${datadir}/doc/${PACKAGE}'])
115 ])])
116
117 XCB_CHECK_DOXYGEN()
118
119 XCB_EXTENSION(Composite, "yes")
120 XCB_EXTENSION(Damage, "yes")
121 XCB_EXTENSION(DPMS, "yes")
122 XCB_EXTENSION(GLX, "yes")
123 XCB_EXTENSION(RandR, "yes")
124 XCB_EXTENSION(Record, "yes")
125 XCB_EXTENSION(Render, "yes")
126 XCB_EXTENSION(Resource, "yes")
127 XCB_EXTENSION(Screensaver, "yes")
128 XCB_EXTENSION(Shape, "yes")
129 XCB_EXTENSION(Shm, "yes")
130 XCB_EXTENSION(Sync, "yes")
131 XCB_EXTENSION(Xevie, "yes")
132 XCB_EXTENSION(XFixes, "yes")
133 XCB_EXTENSION(XFree86-DRI, "yes")
134 XCB_EXTENSION(Xinerama, "yes")
135 XCB_EXTENSION(XInput, "no")
136 XCB_EXTENSION(Xprint, "yes")
137 XCB_EXTENSION(SELinux, "no")
138 XCB_EXTENSION(XTest, "yes")
139 XCB_EXTENSION(Xv, "yes")
140 XCB_EXTENSION(XvMC, "yes")
141
142 AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
143 if test "x$LAUNCHD" = xauto; then
144         unset LAUNCHD
145         AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
146 fi
147
148 if test "x$LAUNCHD" = xyes ; then
149         AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
150 fi
151
152 AC_CONFIG_FILES([
153 Makefile
154 doc/Makefile
155 src/Makefile
156 tests/Makefile
157 ])
158
159 AC_CONFIG_FILES([
160 xcb.pc
161 xcb-composite.pc
162 xcb-damage.pc
163 xcb-dpms.pc
164 xcb-glx.pc
165 xcb-randr.pc
166 xcb-record.pc
167 xcb-render.pc
168 xcb-res.pc
169 xcb-screensaver.pc
170 xcb-shape.pc
171 xcb-shm.pc
172 xcb-sync.pc
173 xcb-xevie.pc
174 xcb-xf86dri.pc
175 xcb-xfixes.pc
176 xcb-xinerama.pc
177 xcb-xinput.pc
178 xcb-xprint.pc
179 xcb-xselinux.pc
180 xcb-xtest.pc
181 xcb-xv.pc
182 xcb-xvmc.pc
183 ])
184
185 AC_CONFIG_FILES([
186 doc/xcb.doxygen
187 ])
188
189 AC_OUTPUT
190
191 dnl Configuration output
192
193 echo ""
194 echo "  Package: ${PACKAGE_NAME} ${PACKAGE_VERSION}"
195 echo ""
196 echo "  Configuration"
197 echo "    XDM support.........: ${have_xdmcp}"
198 echo "    Build unit tests....: ${HAVE_CHECK}"
199 echo "    XCB buffer size.....: ${xcb_queue_buffer_size}"
200 echo ""
201 echo "  Used CFLAGS:"
202 echo "    CPPFLAGS............: ${CPPFLAGS}"
203 echo "    CFLAGS..............: ${CFLAGS}"
204 echo "    Warning CFLAGS......: ${CWARNFLAGS}"
205 echo ""
206 echo "  Installation:"
207 echo "    Prefix..............: ${prefix}"
208 echo ""