Add patch that contain Mali fixes.
[deb_xorg-server.git] / configure.ac
CommitLineData
a09e091a
JB
1dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
2dnl
3dnl Permission is hereby granted, free of charge, to any person obtaining a
4dnl copy of this software and associated documentation files (the "Software"),
5dnl to deal in the Software without restriction, including without limitation
6dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
7dnl and/or sell copies of the Software, and to permit persons to whom the
8dnl Software is furnished to do so, subject to the following conditions:
9dnl
10dnl The above copyright notice and this permission notice (including the next
11dnl paragraph) shall be included in all copies or substantial portions of the
12dnl Software.
13dnl
14dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20dnl DEALINGS IN THE SOFTWARE.
21dnl
22dnl Authors: Keith Packard <keithp@keithp.com>
23dnl Daniel Stone <daniel@fooishbar.org>
24dnl an unwitting cast of miscellaneous others
25dnl
26dnl Process this file with autoconf to create configure.
27
28AC_PREREQ(2.60)
29AC_INIT([xorg-server], 1.15.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
30RELEASE_DATE="2014-04-13"
31RELEASE_NAME="Heart Candy"
32AC_CONFIG_SRCDIR([Makefile.am])
33AM_INIT_AUTOMAKE([foreign dist-bzip2])
34AC_USE_SYSTEM_EXTENSIONS
35
36# Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS
37m4_ifndef([XORG_MACROS_VERSION],
38 [m4_fatal([must install xorg-macros 1.14 or later before running autoconf/autogen])])
39XORG_MACROS_VERSION(1.14)
40XORG_DEFAULT_OPTIONS
41XORG_WITH_DOXYGEN(1.6.1)
42XORG_CHECK_SGML_DOCTOOLS(1.8)
43XORG_ENABLE_DOCS
44XORG_ENABLE_DEVEL_DOCS
45XORG_WITH_XMLTO(0.0.20)
46XORG_WITH_FOP
47XORG_WITH_XSLTPROC
48XORG_ENABLE_UNIT_TESTS
49XORG_LD_WRAP([optional])
50
51m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])])
52XORG_FONT_MACROS_VERSION(1.1)
53
54dnl this gets generated by autoheader, and thus contains all the defines. we
55dnl don't ever actually use it, internally.
56AC_CONFIG_HEADERS(include/do-not-use-config.h)
57dnl xorg-server.h is an external header, designed to be included by loadable
58dnl drivers.
59AC_CONFIG_HEADERS(include/xorg-server.h)
60dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
61dnl dix/).
62AC_CONFIG_HEADERS(include/dix-config.h)
63dnl xorg-config.h covers the Xorg DDX.
64AC_CONFIG_HEADERS(include/xorg-config.h)
65dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
66AC_CONFIG_HEADERS(include/xkb-config.h)
67dnl xwin-config.h covers the XWin DDX.
68AC_CONFIG_HEADERS(include/xwin-config.h)
69dnl kdrive-config.h covers the kdrive DDX
70AC_CONFIG_HEADERS(include/kdrive-config.h)
71dnl version-config.h covers the version numbers so they can be bumped without
72dnl forcing an entire recompile.x
73AC_CONFIG_HEADERS(include/version-config.h)
74
75AM_PROG_AS
76AC_PROG_LN_S
77AC_LIBTOOL_WIN32_DLL
78AC_DISABLE_STATIC
79AC_PROG_LIBTOOL
80PKG_PROG_PKG_CONFIG
81AC_PROG_LEX
82AC_PROG_YACC
83AC_SYS_LARGEFILE
84XORG_PROG_RAWCPP
85
86# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow
87# easier overrides at build time.
88XSERVER_CFLAGS='$(CWARNFLAGS)'
89
90dnl Explicitly add -fno-strict-aliasing since this option should disappear
91dnl from util-macros CWARNFLAGS
92if test "x$GCC" = xyes ; then
93 XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
94fi
95
96dnl Check for dtrace program (needed to build Xserver dtrace probes)
97dnl Also checks for <sys/sdt.h>, since some Linux distros have an
98dnl ISDN trace program named dtrace
99AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
100 [Enable dtrace probes (default: enabled if dtrace found)]),
101 [WDTRACE=$withval], [WDTRACE=auto])
102if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
103 AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
104 if test "x$DTRACE" = "xnot_found" ; then
105 if test "x$WDTRACE" = "xyes" ; then
106 AC_MSG_FAILURE([dtrace requested but not found])
107 fi
108 WDTRACE="no"
109 else
110 AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"])
111 if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then
112 WDTRACE="no"
113 fi
114 fi
115fi
116if test "x$WDTRACE" != "xno" ; then
117 AC_DEFINE(XSERVER_DTRACE, 1,
118 [Define to 1 if the DTrace Xserver provider probes should be built in.])
119
120# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
121# object files, and require linking with those as relocatable objects, not .a
122# archives. MacOS X handles all this in the normal compiler toolchain, and on
123# some releases (like Tiger), will error out on dtrace -G. For now, other
124# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
125# ports appear to, based on my web searches, but have not yet been tested).
126 case $host_os in
127 darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
128 *) SPECIAL_DTRACE_OBJECTS=yes ;;
129 esac
130fi
131AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
132AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
133
134AC_HEADER_DIRENT
135AC_HEADER_STDC
136AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h sys/utsname.h])
137
138dnl Checks for typedefs, structures, and compiler characteristics.
139AC_C_CONST
140AC_C_TYPEOF
141AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])
142
143AC_CHECK_SIZEOF([unsigned long])
144if test "$ac_cv_sizeof_unsigned_long" = 8; then
145 AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.])
146fi
147
148AC_TYPE_PID_T
149
150# Checks for headers/macros for byte swapping
151# Known variants:
152# <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc)
153# <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD)
154# <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's)
155# and a fallback to local macros if none of the above are found
156
157# if <byteswap.h> is found, assume it's the correct version
158AC_CHECK_HEADERS([byteswap.h])
159
160# if <sys/endian.h> is found, have to check which version
161AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"])
162
163if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then
164 AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros])
165 AC_LINK_IFELSE([AC_LANG_PROGRAM([
166#include <sys/types.h>
167#include <sys/endian.h>
168 ], [
169int a = 1, b;
170b = __swap16(a);
171 ])
172], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no'])
173 AC_MSG_RESULT([$SYS_ENDIAN__SWAP])
174
175 AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros])
176 AC_LINK_IFELSE([AC_LANG_PROGRAM([
177#include <sys/types.h>
178#include <sys/endian.h>
179 ], [
180int a = 1, b;
181b = bswap16(a);
182 ])
183], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no'])
184 AC_MSG_RESULT([$SYS_ENDIAN_BSWAP])
185
186 if test "$SYS_ENDIAN_BSWAP" = "yes" ; then
187 USE_SYS_ENDIAN_H=yes
188 BSWAP=bswap
189 else
190 if test "$SYS_ENDIAN__SWAP" = "yes" ; then
191 USE_SYS_ENDIAN_H=yes
192 BSWAP=__swap
193 else
194 USE_SYS_ENDIAN_H=no
195 fi
196 fi
197
198 if test "$USE_SYS_ENDIAN_H" = "yes" ; then
199 AC_DEFINE([USE_SYS_ENDIAN_H], 1,
200 [Define to use byteswap macros from <sys/endian.h>])
201 AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16,
202 [Define to 16-bit byteswap macro])
203 AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32,
204 [Define to 32-bit byteswap macro])
205 AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64,
206 [Define to 64-bit byteswap macro])
207 fi
208fi
209
210dnl Check to see if dlopen is in default libraries (like Solaris, which
211dnl has it in libc), or if libdl is needed to get it.
212AC_CHECK_FUNC([dlopen], [],
213 AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
214AC_SUBST(DLOPEN_LIBS)
215
216dnl Checks for library functions.
217AC_CHECK_FUNCS([backtrace ffs geteuid getuid issetugid getresuid \
218 getdtablesize getifaddrs getpeereid getpeerucred getzoneid \
219 mmap seteuid shmctl64 strncasecmp vasprintf vsnprintf walkcontext])
220AC_REPLACE_FUNCS([strcasecmp strcasestr strlcat strlcpy strndup])
221
222dnl Find the math libary, then check for cbrt function in it.
223AC_CHECK_LIB(m, sqrt)
224AC_CHECK_FUNCS([cbrt])
225
226AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])
227
228dnl AGPGART headers
229AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes)
230AM_CONDITIONAL(AGP, [test "x$AGP" = xyes])
231
232dnl fbdev header
233AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
234AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
235
236dnl MTRR header
237AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes)
238if test "x$ac_cv_asm_mtrr_h" = xyes; then
239 HAVE_MTRR=yes
240fi
241
242dnl BSD MTRR header
243AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes)
244if test "x$ac_cv_memrange_h" = xyes; then
245 HAVE_MTRR=yes
246fi
247
248if test "x$HAVE_MTRR" = xyes; then
249 AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available])
250fi
251
252dnl A NetBSD MTRR header
253AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes)
254if test "x$ac_cv_machine_mtrr_h" = xyes; then
255 AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR
256 support is available])
257fi
258
259dnl FreeBSD kldload support (sys/linker.h)
260AC_CHECK_HEADERS([sys/linker.h],
261 [ac_cv_sys_linker_h=yes],
262 [ac_cv_sys_linker_h=no],
263 [#include <sys/param.h>])
264AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes])
265
266AC_CACHE_CHECK([for SYSV IPC],
267 ac_cv_sysv_ipc,
268 [AC_TRY_LINK([
269#include <sys/types.h>
270#include <sys/ipc.h>
271#include <sys/shm.h>
272#include <sys/stat.h>
273],[
274{
275 int id;
276 id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
277 if (id < 0) return -1;
278 return shmctl(id, IPC_RMID, 0);
279}],
280 [ac_cv_sysv_ipc=yes],
281 [ac_cv_sysv_ipc=no])])
282if test "x$ac_cv_sysv_ipc" = xyes; then
283 AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
284fi
285
286dnl OpenBSD /dev/xf86 aperture driver
287if test -c /dev/xf86 ; then
288 AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
289fi
290
291dnl BSD APM support
292AC_CHECK_HEADER([machine/apmvar.h],[
293 AC_CHECK_HEADER([sys/event.h],
294 ac_cv_BSD_KQUEUE_APM=yes,
295 ac_cv_BSD_APM=yes)])
296
297AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes])
298AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes])
299
300dnl glibc backtrace support check
301AC_CHECK_HEADER([execinfo.h],[
302 AC_CHECK_LIB(c, backtrace, [
303 AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
304 AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h])
305 ])]
306)
307
308dnl ---------------------------------------------------------------------------
309dnl Bus options and CPU capabilities. Replaces logic in
310dnl hw/xfree86/os-support/bus/Makefile.am, among others.
311dnl ---------------------------------------------------------------------------
312DEFAULT_INT10="x86emu"
313
314dnl Override defaults as needed for specific platforms:
315
316case $host_cpu in
317 alpha*)
318 ALPHA_VIDEO=yes
319 case $host_os in
320 *freebsd*) SYS_LIBS=-lio ;;
321 *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
322 esac
323 GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
324 ;;
325 arm*)
326 ARM_VIDEO=yes
327 ;;
328 i*86)
329 I386_VIDEO=yes
330 case $host_os in
331 *freebsd*) AC_DEFINE(USE_DEV_IO) ;;
332 *dragonfly*) AC_DEFINE(USE_DEV_IO) ;;
333 *netbsd*) AC_DEFINE(USE_I386_IOPL)
334 SYS_LIBS=-li386
335 ;;
336 *openbsd*) AC_DEFINE(USE_I386_IOPL)
337 SYS_LIBS=-li386
338 ;;
339 esac
340 ;;
341 powerpc*)
342 PPC_VIDEO=yes
343 case $host_os in
344 *freebsd*) DEFAULT_INT10=stub ;;
345 esac
346 ;;
347 sparc*)
348 SPARC64_VIDEO=yes
349 BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
350 GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
351 ;;
352 x86_64*|amd64*)
353 I386_VIDEO=yes
354 case $host_os in
355 *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
356 *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
357 *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
358 SYS_LIBS=-lx86_64
359 ;;
360 *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
361 SYS_LIBS=-lamd64
362 ;;
363 esac
364 GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
365 ;;
366 ia64*)
367 GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
368 ;;
369 s390*)
370 GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
371 ;;
372esac
373AC_SUBST(GLX_ARCH_DEFINES)
374
375dnl BSD *_video.c selection
376AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
377AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
378AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
379AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
380AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
381
382DRI=no
383USE_SIGIO_BY_DEFAULT="yes"
384dnl it would be nice to autodetect these *CONS_SUPPORTs
385case $host_os in
386 *freebsd* | *dragonfly*)
387 case $host_os in
388 kfreebsd*-gnu) ;;
389 *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
390 esac
391 AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
392 AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
393 AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
394 DRI=yes
395 ;;
396 *netbsd*)
397 AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
398 AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
399 AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
400 AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
401 DRI=yes
402 ;;
403 *openbsd*)
404 AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
405 AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console])
406 AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
407 ;;
408 *linux*)
409 DRI=yes
410 ;;
411 *solaris*)
412 PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no)
413 # Disable use of SIGIO by default until some system bugs are
414 # fixed - see Sun/OpenSolaris bug id 6879897
415 USE_SIGIO_BY_DEFAULT="no"
416 ;;
417 darwin*)
418 AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
419 ;;
420 cygwin*|mingw*)
421 CFLAGS="$CFLAGS -DFD_SETSIZE=256"
422 ;;
423esac
424
425dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
426dnl major number
427PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
428PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1`
429if test "x$PVS" = "x"; then
430 PVS="0"
431fi
432
433VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)"
434VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
435
436VENDOR_NAME="The X.Org Foundation"
437VENDOR_NAME_SHORT="X.Org"
438VENDOR_WEB="http://wiki.x.org"
439
440m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
441
442dnl Build options.
443AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],
444 [Obsolete - use --enable-strict-compilation instead]),
445 AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation]))
446
447AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
448 [Enable debugging (default: disabled)]),
449 [DEBUGGING=$enableval], [DEBUGGING=no])
450AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default]
451 [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]),
452 [USE_SIGIO_BY_DEFAULT=$enableval], [])
453AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
454 [INT10="$withval"],
455 [INT10="$DEFAULT_INT10"])
456AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR],
457 [Vendor string reported by the server]),
458 [ VENDOR_NAME="$withval" ], [])
459AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR],
460 [Short version of vendor string reported by the server]),
461 [ VENDOR_NAME_SHORT="$withval" ], [])
462AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL],
463 [Vendor web address reported by the server]),
464 [ VENDOR_WEB="$withval" ], [])
465AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR],
466 [Directory where modules are installed (default: $libdir/xorg/modules)]),
467 [ moduledir="$withval" ],
468 [ moduledir="${libdir}/xorg/modules" ])
469AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR],
470 [Directory where log files are kept (default: $localstatedir/log)]),
471 [ logdir="$withval" ],
472 [ logdir="$localstatedir/log" ])
473AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS],
474 [Builder address (default: xorg@lists.freedesktop.org)]),
475 [ BUILDERADDR="$withval" ],
476 [ BUILDERADDR="xorg@lists.freedesktop.org" ])
477AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]),
478 [ OSNAME="$withval" ],
479 [ OSNAME=`uname -srm` ])
480AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]),
481 [ OSVENDOR="$withval" ],
482 [ OSVENDOR="" ])
483AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]),
484 [ BUILDERSTRING="$withval" ]
485 [ ])
486
487dnl Determine font path
488XORG_FONTROOTDIR
489XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc)
490XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF)
491XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF)
492XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1)
493XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi)
494XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi)
495
496dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d,
497dnl otherwise uses standard subdirectories of FONTROOTDIR. When cross
498dnl compiling, assume default font path uses standard FONTROOTDIR directories.
499DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
500if test "$cross_compiling" != yes; then
501 AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d],
502 [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'],
503 [case $host_os in
504 darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
505 esac])
506fi
507AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
508 [ FONTPATH="$withval" ],
509 [ FONTPATH="${DEFAULT_FONT_PATH}" ])
510
511AC_MSG_CHECKING([for default font path])
512AC_MSG_RESULT([$FONTPATH])
513
514AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
515 [ XKBPATH="$withval" ],
516 [ XKBPATH="${datadir}/X11/xkb" ])
517AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
518 [ XKBOUTPUT="$withval" ],
519 [ XKBOUTPUT="compiled" ])
520AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
521 [Keyboard ruleset (default: base/evdev)]),
522 [ XKB_DFLT_RULES="$withval" ],
523 [ XKB_DFLT_RULES="" ])
524AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL],
525 [Keyboard model (default: pc105)]),
526 [ XKB_DFLT_MODEL="$withval" ],
527 [ XKB_DFLT_MODEL="pc105" ])
528AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT],
529 [Keyboard layout (default: us)]),
530 [ XKB_DFLT_LAYOUT="$withval" ],
531 [ XKB_DFLT_LAYOUT="us" ])
532AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT],
533 [Keyboard variant (default: (none))]),
534 [ XKB_DFLT_VARIANT="$withval" ],
535 [ XKB_DFLT_VARIANT="" ])
536AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS],
537 [Keyboard layout options (default: (none))]),
538 [ XKB_DFLT_OPTIONS="$withval" ],
539 [ XKB_DFLT_OPTIONS="" ])
540AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH],
541 [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]),
542 [ SERVERCONFIG="$withval" ],
543 [ SERVERCONFIG="${libdir}/xorg" ])
544AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]),
545 [ APPLE_APPLICATIONS_DIR="${withval}" ],
546 [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
547AC_SUBST([APPLE_APPLICATIONS_DIR])
548AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]),
549 [ APPLE_APPLICATION_NAME="${withval}" ],
550 [ APPLE_APPLICATION_NAME="X11" ])
551AC_SUBST([APPLE_APPLICATION_NAME])
552AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Deprecated: Use --with-bundle-id-prefix.]),
553 [ BUNDLE_ID_PREFIX="${withval}" ],
554 [ BUNDLE_ID_PREFIX="org.x" ])
555AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=PATH], [Prefix to use for bundle identifiers (default: org.x)]),
556 [ BUNDLE_ID_PREFIX="${withval}" ])
557AC_SUBST([BUNDLE_ID_PREFIX])
558AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers])
559AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
560 [ XQUARTZ_SPARKLE="${enableval}" ],
561 [ XQUARTZ_SPARKLE="no" ])
562AC_SUBST([XQUARTZ_SPARKLE])
563AC_ARG_ENABLE(install-libxf86config,
564 AS_HELP_STRING([--enable-install-libxf86config],
565 [Install libxf86config (default: disabled)]),
566 [INSTALL_LIBXF86CONFIG=$enableval],
567 [INSTALL_LIBXF86CONFIG=no])
568AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
569 [SYMBOL_VISIBILITY=$enableval],
570 [SYMBOL_VISIBILITY=auto])
571
572dnl GLX build options
573AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
574 [AIGLX=$enableval],
575 [AIGLX=yes])
576XORG_TLS
577AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]),
578 [GLX_USE_TLS=$enableval
579 if test "x$GLX_USE_TLS" = "xyes" && test "${ac_cv_tls}" = "none" ; then
580 AC_MSG_ERROR([GLX with TLS support requested, but the compiler does not support it.])
581 fi],
582 [GLX_USE_TLS=no
583 if test "${ac_cv_tls}" != "none" ; then
584 GLX_USE_TLS=yes
585 fi])
586AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
587AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]),
588 [KHRONOS_SPEC_DIR="${withval}"],
589 [KHRONOS_SPEC_DIR=auto])
590
591dnl Extensions.
592AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
593AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
594AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto])
595AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
596AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
597AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
598AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
599AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
600AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
601AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
602AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
603AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
604AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
605AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto])
606AC_ARG_ENABLE(dri3, AS_HELP_STRING([--enable-dri3], [Build DRI3 extension (default: auto)]), [DRI3=$enableval], [DRI3=auto])
607AC_ARG_ENABLE(present, AS_HELP_STRING([--disable-present], [Build Present extension (default: enabled)]), [PRESENT=$enableval], [PRESENT=yes])
608AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
609AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
610AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
611AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no])
612AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no])
613AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no])
614AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
615AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
616AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
617AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
618AC_ARG_ENABLE(config-udev-kms, AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto])
619AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no])
620AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
621AC_ARG_ENABLE(config-wscons, AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto])
622AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
623AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
624AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
625AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
626AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
627AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
628AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes])
629AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes])
630AC_ARG_ENABLE(linux_acpi, AC_HELP_STRING([--disable-linux-acpi], [Disable building ACPI support on Linux (if available).]), [enable_linux_acpi=$enableval], [enable_linux_acpi=yes])
631AC_ARG_ENABLE(linux_apm, AC_HELP_STRING([--disable-linux-apm], [Disable building APM support on Linux (if available).]), [enable_linux_apm=$enableval], [enable_linux_apm=yes])
632
633dnl DDXes.
634AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
635AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
636AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
637AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
638AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
639AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no])
640AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
641dnl kdrive and its subsystems
642AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
643AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
644AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto])
645AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto])
646dnl kdrive options
647AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto])
648AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto])
649AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto])
650AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"])
651
652
653dnl chown/chmod to be setuid root as part of build
654dnl Replaces InstallXserverSetUID in imake
655AC_ARG_ENABLE(install-setuid,
656 AS_HELP_STRING([--enable-install-setuid],
657 [Install Xorg server as owned by root with setuid bit (default: auto)]),
658 [SETUID=$enableval], [SETUID=auto])
659AC_MSG_CHECKING([to see if we can install the Xorg server as root])
660if test "x$SETUID" = "xauto" ; then
661 case $host_os in
662 cygwin*) SETUID="no" ;;
663 mingw*) SETUID="no" ;;
664 darwin*) SETUID="no" ;;
665 *)
666 case $host_cpu in
667 sparc) SETUID="no" ;;
668 *) SETUID="yes" ;;
669 esac
670 esac
671 if test "x$SETUID" = xyes; then
672 touch testfile
673 chown root testfile > /dev/null 2>&1 || SETUID="no"
674 rm -f testfile
675 fi
676fi
677AC_MSG_RESULT([$SETUID])
678AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"])
679
680dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
681dnl was not expanded, since xorg-server with no transport types is rather useless.
682dnl
683dnl If you're seeing an error here, be sure you installed the lib/xtrans module
684dnl first and if it's not in the default location, that you set the ACLOCAL
685dnl environment variable to find it, such as:
686dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
687m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$])
688
689# Transport selection macro from xtrans.m4
690XTRANS_CONNECTION_FLAGS
691
692# Secure RPC detection macro from xtrans.m4
693XTRANS_SECURE_RPC_FLAGS
694AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes])
695
696AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
697AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
698AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
699
700dnl Handle installing libxf86config
701AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
702
703dnl DDX Detection... Yes, it's ugly to have it here... but we need to
704dnl handle this early on so that we don't require unsupported extensions
705case $host_os in
706 cygwin* | mingw*)
707 CONFIG_DBUS_API=no
708 CONFIG_HAL=no
709 CONFIG_UDEV=no
710 CONFIG_UDEV_KMS=no
711 DGA=no
712 DRI2=no
713 DRI3=no
714 INT10MODULE=no
715 PCI=no
716 VGAHW=no
717 VBE=no
718 XF86UTILS=no
719 XF86VIDMODE=no
720 XSELINUX=no
721 XV=no
722 SYMBOL_VISIBILITY=no
723 ;;
724 darwin*)
725 PCI=no
726 INT10MODULE=no
727 VGAHW=no
728 VBE=no
729 DRM=no
730 DRI2=no
731 DRI3=no
732
733 if test x$XQUARTZ = xauto; then
734 AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
735 save_LDFLAGS=$LDFLAGS
736 LDFLAGS="$LDFLAGS -framework Carbon"
737 AC_LINK_IFELSE([AC_LANG_SOURCE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}])],
738 [xorg_cv_Carbon_framework=yes],
739 [xorg_cv_Carbon_framework=no])
740 LDFLAGS=$save_LDFLAGS])
741
742 if test "X$xorg_cv_Carbon_framework" = Xyes; then
743 XQUARTZ=yes
744 else
745 XQUARTZ=no
746 fi
747 fi
748
749 AC_CHECK_FUNC(dispatch_async,
750 AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]),
751 [])
752
753 if test "x$XQUARTZ" = xyes ; then
754 XQUARTZ=yes
755 XVFB=no
756 XNEST=no
757
758 COMPOSITE=no
759 DGA=no
760 DPMSExtension=no
761 XF86VIDMODE=no
762 fi
763 ;;
764 *) XQUARTZ=no ;;
765esac
766
767dnl ---------------------------------------------------------------------------
768dnl Extension section
769dnl ---------------------------------------------------------------------------
770XEXT_INC='-I$(top_srcdir)/Xext'
771XEXT_LIB='$(top_builddir)/Xext/libXext.la'
772
773dnl Optional modules
774VIDEOPROTO="videoproto"
775COMPOSITEPROTO="compositeproto >= 0.4"
776RECORDPROTO="recordproto >= 1.13.99.1"
777SCRNSAVERPROTO="scrnsaverproto >= 1.1"
778RESOURCEPROTO="resourceproto >= 1.2.0"
779DRIPROTO="xf86driproto >= 2.1.0"
780DRI2PROTO="dri2proto >= 2.8"
781DRI3PROTO="dri3proto >= 1.0"
782XINERAMAPROTO="xineramaproto"
783BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
784DGAPROTO="xf86dgaproto >= 2.0.99.1"
785GLPROTO="glproto >= 1.4.17"
786DMXPROTO="dmxproto >= 2.2.99.1"
787VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
788WINDOWSWMPROTO="windowswmproto"
789APPLEWMPROTO="applewmproto >= 1.4"
790XSHMFENCE="xshmfence >= 1.1"
791
792dnl Required modules
793XPROTO="xproto >= 7.0.22"
794RANDRPROTO="randrproto >= 1.4.0"
795RENDERPROTO="renderproto >= 0.11"
796XEXTPROTO="xextproto >= 7.2.99.901"
797INPUTPROTO="inputproto >= 2.3"
798KBPROTO="kbproto >= 1.0.3"
799FONTSPROTO="fontsproto"
800FIXESPROTO="fixesproto >= 5.0"
801DAMAGEPROTO="damageproto >= 1.1"
802XCMISCPROTO="xcmiscproto >= 1.2.0"
803BIGREQSPROTO="bigreqsproto >= 1.1.0"
804XTRANS="xtrans >= 1.3.2"
805PRESENTPROTO="presentproto >= 1.0"
806
807dnl List of libraries that require a specific version
808LIBAPPLEWM="applewm >= 1.4"
809LIBDMX="dmx >= 1.0.99.1"
810LIBDRI="dri >= 7.8.0"
811LIBDRM="libdrm >= 2.3.0"
812LIBGL="gl >= 7.1.0"
813LIBXEXT="xext >= 1.0.99.4"
814LIBXFONT="xfont >= 1.4.2"
815LIBXI="xi >= 1.2.99.1"
816LIBXTST="xtst >= 1.0.99.2"
817LIBPCIACCESS="pciaccess >= 0.12.901"
818LIBUDEV="libudev >= 143"
819LIBSELINUX="libselinux >= 2.0.86"
820LIBDBUS="dbus-1 >= 1.0"
821LIBPIXMAN="pixman-1 >= 0.27.2"
822
823dnl Pixman is always required, but we separate it out so we can link
824dnl specific modules against it
825PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN)
826REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau"
827
828dnl Core modules for most extensions, et al.
829SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $KBPROTO $FONTSPROTO $LIBPIXMAN"
830# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
831AC_SUBST(SDK_REQUIRED_MODULES)
832
833REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES"
834
835if test "x$CONFIG_UDEV" = xyes &&
836 { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then
837 AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not allowed])
838fi
839
840PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
841if test "x$CONFIG_UDEV" = xauto; then
842 CONFIG_UDEV="$HAVE_LIBUDEV"
843fi
844AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
845if test "x$CONFIG_UDEV" = xyes; then
846 CONFIG_DBUS_API=no
847 CONFIG_HAL=no
848 if test "x$CONFIG_UDEV_KMS" = xauto; then
849 CONFIG_UDEV_KMS="$HAVE_LIBUDEV"
850 fi
851 if ! test "x$HAVE_LIBUDEV" = xyes; then
852 AC_MSG_ERROR([udev configuration API requested, but libudev is not installed])
853 fi
854 AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
855 if test "x$CONFIG_UDEV_KMS" = xyes; then
856 AC_DEFINE(CONFIG_UDEV_KMS, 1, [Use libudev for kms enumeration])
857 fi
858 SAVE_LIBS=$LIBS
859 SAVE_CFLAGS=$CFLAGS
860 CFLAGS=$UDEV_CFLAGS
861 LIBS=$UDEV_LIBS
862 AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag])
863 AC_CHECK_FUNCS([udev_enumerate_add_match_tag])
864 LIBS=$SAVE_LIBS
865 CFLAGS=$SAVE_CFLAGS
866fi
867AM_CONDITIONAL(CONFIG_UDEV_KMS, [test "x$CONFIG_UDEV_KMS" = xyes])
868
869dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
870dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
871dnl API.
872PKG_CHECK_MODULES(DBUS, $LIBDBUS, [HAVE_DBUS=yes], [HAVE_DBUS=no])
873if test "x$HAVE_DBUS" = xyes; then
874 AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support])
875fi
876AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes])
877
878if test "x$CONFIG_DBUS_API" = xauto; then
879 CONFIG_DBUS_API="$HAVE_DBUS"
880fi
881if test "x$CONFIG_DBUS_API" = xyes; then
882 if ! test "x$HAVE_DBUS" = xyes; then
883 AC_MSG_ERROR([D-Bus configuration API requested, but D-Bus is not installed.])
884 fi
885
886 AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API])
887 CONFIG_NEED_DBUS="yes"
888fi
889AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes])
890
891PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no])
892if test "x$CONFIG_HAL" = xauto; then
893 CONFIG_HAL="$HAVE_HAL"
894fi
895if test "x$CONFIG_HAL" = xyes; then
896 if ! test "x$HAVE_HAL" = xyes; then
897 AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.])
898 fi
899
900 AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
901 CONFIG_NEED_DBUS="yes"
902fi
903AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
904
905if test "x$CONFIG_NEED_DBUS" = xyes; then
906 AC_DEFINE(CONFIG_NEED_DBUS, 1, [Use D-Bus for input hotplug])
907fi
908AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes])
909
910if test "x$CONFIG_WSCONS" = xauto; then
911 case $host_os in
912 *openbsd*)
913 CONFIG_WSCONS=yes;
914 ;;
915 *)
916 CONFIG_WSCONS=no;
917 ;;
918 esac
919fi
920AM_CONDITIONAL(CONFIG_WSCONS, [test "x$CONFIG_WSCONS" = xyes])
921if test "x$CONFIG_WSCONS" = xyes; then
922 AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration])
923fi
924
925if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then
926 USE_SIGIO_BY_DEFAULT_VALUE=TRUE
927else
928 USE_SIGIO_BY_DEFAULT_VALUE=FALSE
929fi
930AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE],
931 [Use SIGIO handlers for input device events by default])
932
933AC_MSG_CHECKING([for glibc...])
934AC_PREPROC_IFELSE([AC_LANG_SOURCE([
935#include <features.h>
936#ifndef __GLIBC__
937#error
938#endif
939])], glibc=yes, glibc=no)
940AC_MSG_RESULT([$glibc])
941
942AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
943 [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
944 [have_clock_gettime=no])])
945
946AC_MSG_CHECKING([for a useful monotonic clock ...])
947
948if ! test "x$have_clock_gettime" = xno; then
949 if ! test "x$have_clock_gettime" = xyes; then
950 CLOCK_LIBS="$have_clock_gettime"
951 else
952 CLOCK_LIBS=""
953 fi
954
955 LIBS_SAVE="$LIBS"
956 LIBS="$CLOCK_LIBS"
957 CPPFLAGS_SAVE="$CPPFLAGS"
958
959 if test x"$glibc" = xyes; then
960 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
961 fi
962
963 AC_RUN_IFELSE([AC_LANG_SOURCE([
964#include <time.h>
965
966int main(int argc, char *argv[[]]) {
967 struct timespec tp;
968
969 if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
970 return 0;
971 else
972 return 1;
973}
974 ])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
975 [MONOTONIC_CLOCK="cross compiling"])
976
977 LIBS="$LIBS_SAVE"
978 CPPFLAGS="$CPPFLAGS_SAVE"
979else
980 MONOTONIC_CLOCK=no
981fi
982
983AC_MSG_RESULT([$MONOTONIC_CLOCK])
984
985if test "x$MONOTONIC_CLOCK" = xyes; then
986 AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
987 LIBS="$LIBS $CLOCK_LIBS"
988fi
989
990AM_CONDITIONAL(XV, [test "x$XV" = xyes])
991if test "x$XV" = xyes; then
992 AC_DEFINE(XV, 1, [Support Xv extension])
993 AC_DEFINE(XvExtension, 1, [Build Xv extension])
994 REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO"
995 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO"
996else
997 XVMC=no
998fi
999
1000AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes])
1001if test "x$XVMC" = xyes; then
1002 AC_DEFINE(XvMCExtension, 1, [Build XvMC extension])
1003fi
1004
1005AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes])
1006if test "x$XREGISTRY" = xyes; then
1007 AC_DEFINE(XREGISTRY, 1, [Build registry module])
1008fi
1009
1010AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
1011if test "x$COMPOSITE" = xyes; then
1012 AC_DEFINE(COMPOSITE, 1, [Support Composite Extension])
1013 REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO"
1014 COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la'
1015 COMPOSITE_INC='-I$(top_srcdir)/composite'
1016fi
1017
1018if test "x$MITSHM" = xauto; then
1019 MITSHM="$ac_cv_sysv_ipc"
1020fi
1021AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
1022if test "x$MITSHM" = xyes; then
1023 AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
1024 AC_DEFINE(HAS_SHM, 1, [Support SHM])
1025fi
1026
1027AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes])
1028if test "x$RECORD" = xyes; then
1029 AC_DEFINE(XRECORD, 1, [Support Record extension])
1030 REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO"
1031 RECORD_LIB='$(top_builddir)/record/librecord.la'
1032fi
1033
1034AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes])
1035if test "x$SCREENSAVER" = xyes; then
1036 AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension])
1037 REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO"
1038 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $SCRNSAVERPROTO"
1039fi
1040
1041AM_CONDITIONAL(RES, [test "x$RES" = xyes])
1042if test "x$RES" = xyes; then
1043 AC_DEFINE(RES, 1, [Support X resource extension])
1044 REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO"
1045 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $RESOURCEPROTO"
1046fi
1047
1048# The XRes extension may support client ID tracking only if it has
1049# been specifically enabled. Client ID tracking is implicitly not
1050# supported if XRes extension is disabled.
1051AC_MSG_CHECKING([whether to track client ids])
1052if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then
1053 AC_DEFINE(CLIENTIDS, 1, [Support client ID tracking])
1054else
1055 CLIENTIDS=no
1056fi
1057if test "x$CLIENTIDS" = xyes; then
1058 case $host_os in
1059 openbsd*)
1060 SYS_LIBS="$SYS_LIBS -lkvm"
1061 ;;
1062 esac
1063fi
1064AC_MSG_RESULT([$CLIENTIDS])
1065AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes])
1066
1067AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
1068if test "x$DRI" = xyes; then
1069 AC_DEFINE(XF86DRI, 1, [Build DRI extension])
1070 REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
1071 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
1072fi
1073
1074PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
1075 [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no])
1076case "$DRI2,$HAVE_DRI2PROTO" in
1077 yes,no)
1078 AC_MSG_ERROR([DRI2 requested, but dri2proto not found.])
1079 ;;
1080 yes,yes | auto,yes)
1081 AC_DEFINE(DRI2, 1, [Build DRI2 extension])
1082 DRI2=yes
1083 LIBGL="gl >= 9.2.0"
1084 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
1085 ;;
1086esac
1087AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
1088
1089dnl
1090dnl Locate a suitable tmp file system for creating shared memeory files
1091dnl
1092
1093AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]),
1094[],
1095[with_shared_memory_dir=yes])
1096
1097shmdirs="/run/shm /var/tmp /tmp"
1098
1099case x"$with_shared_memory_dir" in
1100xyes)
1101 for dir in $shmdirs; do
1102 case x"$with_shared_memory_dir" in
1103 xyes)
1104 echo Checking temp dir "$dir"
1105 if test -d "$dir"; then
1106 with_shared_memory_dir="$dir"
1107 fi
1108 ;;
1109 esac
1110 done
1111 ;;
1112x/*)
1113 ;;
1114xno)
1115 ;;
1116*)
1117 AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir])
1118 ;;
1119esac
1120
1121case x"$with_shared_memory_dir" in
1122xyes)
1123 AC_MSG_ERROR([No directory found for shared memory temp files.])
1124 ;;
1125xno)
1126 ;;
1127*)
1128 AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files])
1129 ;;
1130esac
1131
1132AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto])
1133
1134case "x$XTRANS_SEND_FDS" in
1135xauto)
1136 case "$host_os" in
1137 linux*|solaris*)
1138 XTRANS_SEND_FDS=yes
1139 ;;
1140 *)
1141 XTRANS_SEND_FDS=no
1142 ;;
1143 esac
1144esac
1145
1146case "x$XTRANS_SEND_FDS" in
1147xyes)
1148 AC_DEFINE(XTRANS_SEND_FDS, 1, [Enable xtrans fd passing support])
1149 ;;
1150esac
1151
1152case "$DRI3,$XTRANS_SEND_FDS" in
1153 yes,yes | auto,yes)
1154 ;;
1155 yes,no)
1156 AC_MSG_ERROR([DRI3 requested, but xtrans fd passing support not found.])
1157 DRI3=no
1158 ;;
1159 no,*)
1160 ;;
1161 *)
1162 AC_MSG_NOTICE([DRI3 disabled because xtrans fd passing support not found.])
1163 DRI3=no
1164 ;;
1165esac
1166
1167PKG_CHECK_MODULES([DRI3PROTO], $DRI3PROTO,
1168 [HAVE_DRI3PROTO=yes], [HAVE_DRI3PROTO=no])
1169
1170case "$DRI3,$HAVE_DRI3PROTO" in
1171 yes,yes | auto,yes)
1172 ;;
1173 yes,no)
1174 AC_MSG_ERROR([DRI3 requested, but dri3proto not found.])
1175 DRI3=no
1176 ;;
1177 no,*)
1178 ;;
1179 *)
1180 AC_MSG_NOTICE([DRI3 disabled because dri3proto not found.])
1181 DRI3=no
1182 ;;
1183esac
1184
1185AC_CHECK_FUNCS([sigaction])
1186
1187BUSFAULT=no
1188
1189case x"$ac_cv_func_sigaction" in
1190 xyes)
1191 AC_DEFINE(HAVE_SIGACTION, 1, [Have sigaction function])
1192 BUSFAULT=yes
1193 ;;
1194esac
1195
1196case x"$BUSFAULT" in
1197 xyes)
1198 AC_DEFINE(BUSFAULT, 1, [Include busfault OS API])
1199 ;;
1200esac
1201
1202AM_CONDITIONAL(BUSFAULT, test x"$BUSFAULT" = xyes)
1203
1204PKG_CHECK_MODULES([XSHMFENCE], $XSHMFENCE,
1205 [HAVE_XSHMFENCE=yes], [HAVE_XSHMFENCE=no])
1206
1207AM_CONDITIONAL(XSHMFENCE, test "x$HAVE_XSHMFENCE" = xyes)
1208
1209case x"$HAVE_XSHMFENCE" in
1210 xyes)
1211 AC_DEFINE(HAVE_XSHMFENCE, 1, [Have X Shared Memory Fence library])
1212 REQUIRED_LIBS="$REQUIRED_LIBS xshmfence"
1213 ;;
1214esac
1215
1216
1217case "$DRI3,$HAVE_XSHMFENCE" in
1218 yes,yes | auto,yes)
1219 ;;
1220 yes,no)
1221 AC_MSG_ERROR([DRI3 requested, but xshmfence not found.])
1222 DRI3=no
1223 ;;
1224 no,*)
1225 ;;
1226 *)
1227 AC_MSG_NOTICE([DRI3 disabled because xshmfence not found.])
1228 DRI3=no
1229 ;;
1230esac
1231
1232case x"$DRI3" in
1233 xyes|xauto)
1234 DRI3=yes
1235 AC_DEFINE(DRI3, 1, [Build DRI3 extension])
1236 DRI3_LIB='$(top_builddir)/dri3/libdri3.la'
1237 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI3PROTO"
1238 AC_MSG_NOTICE([DRI3 enabled]);
1239 ;;
1240esac
1241
1242AM_CONDITIONAL(DRI3, test "x$DRI3" = xyes)
1243
1244if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
1245 if test "x$DRM" = xyes; then
1246 AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
1247 PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
1248 fi
1249fi
1250
1251if test "x$DRI2" = xyes; then
1252 save_CFLAGS=$CFLAGS
1253 CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS"
1254 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <GL/gl.h>
1255#include <GL/internal/dri_interface.h>
1256#ifndef __DRI_DRI2
1257#error DRI2 extension not available.
1258#endif]])],
1259 [HAVE_DRI2EXTENSION=yes],
1260 [HAVE_DRI2EXTENSION=no])
1261 CFLAGS=$save_CFLAGS
1262 if test "x$HAVE_DRI2EXTENSION" = xyes; then
1263 AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader])
1264 DRI2_AIGLX=yes
1265 else
1266 AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.])
1267 DRI2_AIGLX=no
1268 fi
1269fi
1270AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes)
1271
1272if test "x$GLX" = xyes; then
1273 PKG_CHECK_MODULES([XLIB], [x11])
1274 PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
1275 AC_SUBST(XLIB_CFLAGS)
1276 AC_DEFINE(GLXEXT, 1, [Build GLX extension])
1277 GLX_LIBS='$(top_builddir)/glx/libglx.la'
1278 GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
1279else
1280 GLX=no
1281fi
1282AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
1283
1284if test "x$GLX" = xno; then
1285 AIGLX=no
1286fi
1287
1288if test "x$AIGLX" = xyes -a \( "x$DRI2" = xyes \); then
1289 AC_DEFINE(AIGLX, 1, [Build AIGLX loader])
1290fi
1291AM_CONDITIONAL(AIGLX_DRI_LOADER, { test "x$DRI2" = xyes; } && test "x$AIGLX" = xyes)
1292
1293if test "x$GLX_USE_TLS" = xyes ; then
1294 GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
1295 GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread"
1296fi
1297AC_SUBST([GLX_DEFINES])
1298AC_SUBST([GLX_SYS_LIBS])
1299
1300AM_CONDITIONAL(PRESENT, [test "x$PRESENT" = xyes])
1301if test "x$PRESENT" = xyes; then
1302 AC_DEFINE(PRESENT, 1, [Support Present extension])
1303 REQUIRED_MODULES="$REQUIRED_MODULES $PRESENTPROTO"
1304 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $PRESENTPROTO"
1305 PRESENT_INC='-I$(top_srcdir)/present'
1306 PRESENT_LIB='$(top_builddir)/present/libpresent.la'
1307fi
1308
1309AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
1310if test "x$XINERAMA" = xyes; then
1311 AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
1312 AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama])
1313 REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO"
1314 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO"
1315fi
1316
1317AM_CONDITIONAL(XACE, [test "x$XACE" = xyes])
1318if test "x$XACE" = xyes; then
1319 AC_DEFINE(XACE, 1, [Build X-ACE extension])
1320fi
1321
1322AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes])
1323if test "x$XSELINUX" = xyes; then
1324 if test "x$XACE" != xyes; then
1325 AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
1326 fi
1327 AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
1328 AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
1329 PKG_CHECK_MODULES([SELINUX], $LIBSELINUX)
1330 SELINUX_LIBS="$SELINUX_LIBS -laudit"
1331 AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
1332fi
1333
1334AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
1335if test "x$XCSECURITY" = xyes; then
1336 if test "x$XACE" != xyes; then
1337 AC_MSG_ERROR([cannot build Security extension without X-ACE])
1338 fi
1339 AC_DEFINE(XCSECURITY, 1, [Build Security extension])
1340fi
1341
1342AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
1343if test "x$DBE" = xyes; then
1344 AC_DEFINE(DBE, 1, [Support DBE extension])
1345 DBE_LIB='$(top_builddir)/dbe/libdbe.la'
1346 DBE_INC='-I$(top_srcdir)/dbe'
1347fi
1348
1349AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
1350if test "x$XF86BIGFONT" = xyes; then
1351 AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension])
1352 REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO"
1353 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $BIGFONTPROTO"
1354fi
1355
1356AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes])
1357if test "x$DPMSExtension" = xyes; then
1358 AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
1359fi
1360
1361AC_DEFINE(RENDER, 1, [Support RENDER extension])
1362RENDER_LIB='$(top_builddir)/render/librender.la'
1363RENDER_INC='-I$(top_srcdir)/render'
1364
1365AC_DEFINE(RANDR, 1, [Support RANDR extension])
1366RANDR_LIB='$(top_builddir)/randr/librandr.la'
1367RANDR_INC='-I$(top_srcdir)/randr'
1368
1369AC_DEFINE(XFIXES,1,[Support XFixes extension])
1370FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la'
1371FIXES_INC='-I$(top_srcdir)/xfixes'
1372
1373AC_DEFINE(DAMAGE,1,[Support Damage extension])
1374DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
1375DAMAGE_INC='-I$(top_srcdir)/damageext'
1376MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
1377MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
1378
1379# XINPUT extension is integral part of the server
1380AC_DEFINE(XINPUT, 1, [Support X Input extension])
1381XI_LIB='$(top_builddir)/Xi/libXi.la'
1382XI_INC='-I$(top_srcdir)/Xi'
1383
1384AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
1385AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes)
1386AM_CONDITIONAL(VBE, test "x$VBE" = xyes)
1387AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes)
1388
1389AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
1390
1391AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
1392AC_ARG_WITH(xkb-bin-directory,
1393 AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]),
1394 [XKB_BIN_DIRECTORY="$withval"],
1395 [XKB_BIN_DIRECTORY="$bindir"])
1396
1397AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir])
1398
1399dnl Make sure XKM_OUTPUT_DIR is an absolute path
1400XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
1401if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
1402 XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
1403fi
1404
1405dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
1406dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused
1407
1408XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'`
1409XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'`
1410AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir])
1411AC_SUBST(XKB_COMPILED_DIR)
1412
1413if test "x$XKB_DFLT_RULES" = x; then
1414 case $host_os in
1415 linux*)
1416 dnl doesn't take AutoAddDevices into account, but whatever.
1417 XKB_DFLT_RULES="evdev"
1418 ;;
1419 *)
1420 XKB_DFLT_RULES="base"
1421 ;;
1422 esac
1423fi
1424AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset])
1425AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model])
1426AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout])
1427AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant])
1428AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options])
1429AC_SUBST([XKB_DFLT_RULES])
1430AC_SUBST([XKB_DFLT_MODEL])
1431AC_SUBST([XKB_DFLT_LAYOUT])
1432AC_SUBST([XKB_DFLT_VARIANT])
1433AC_SUBST([XKB_DFLT_OPTIONS])
1434
1435XKB_LIB='$(top_builddir)/xkb/libxkb.la'
1436XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
1437REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
1438
1439PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
1440if test "x$have_libxdmcp" = xyes; then
1441 AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS])
1442fi
1443if test "x$XDMCP" = xauto; then
1444 if test "x$have_libxdmcp" = xyes; then
1445 XDMCP=yes
1446 else
1447 XDMCP=no
1448 fi
1449fi
1450if test "x$XDMAUTH" = xauto; then
1451 if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then
1452 XDMAUTH=yes
1453 else
1454 XDMAUTH=no
1455 fi
1456fi
1457
1458AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes])
1459if test "x$XDMCP" = xyes; then
1460 AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol])
1461 REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
1462 XDMCP_MODULES="xdmcp"
1463fi
1464
1465AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes])
1466if test "x$XDMAUTH" = xyes; then
1467 AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1])
1468 if ! test "x$XDMCP" = xyes; then
1469 REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
1470 XDMCP_MODULES="xdmcp"
1471 fi
1472fi
1473
1474AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
1475AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
1476AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
1477dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
1478AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path])
1479AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
1480AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name])
1481AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
1482AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
1483AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
1484
1485if test -z "$OSNAME"; then
1486 OSNAME="UNKNOWN"
1487fi
1488
1489AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name])
1490AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor])
1491AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string])
1492
1493AC_SUBST([VENDOR_NAME_SHORT])
1494AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name])
1495AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name])
1496AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release])
1497AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
1498
1499AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
1500
1501if test "x$DEBUGGING" = xyes; then
1502 AC_DEFINE(DEBUG, 1, [Enable debugging code])
1503fi
1504AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
1505
1506AC_DEFINE(XTEST, 1, [Support XTest extension])
1507AC_DEFINE(XSYNC, 1, [Support XSync extension])
1508AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
1509AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
1510
1511if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
1512 DIX_LIB='$(top_builddir)/dix/dix.O'
1513 OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
1514else
1515 DIX_LIB='$(top_builddir)/dix/libdix.la'
1516 OS_LIB='$(top_builddir)/os/libos.la'
1517fi
1518AC_SUBST([DIX_LIB])
1519AC_SUBST([OS_LIB])
1520
1521MAIN_LIB='$(top_builddir)/dix/libmain.la'
1522AC_SUBST([MAIN_LIB])
1523
1524MI_LIB='$(top_builddir)/mi/libmi.la'
1525MI_EXT_LIB='$(top_builddir)/mi/libmiext.la'
1526MI_INC='-I$(top_srcdir)/mi'
1527FB_LIB='$(top_builddir)/fb/libfb.la'
1528FB_INC='-I$(top_srcdir)/fb'
1529MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
1530MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
1531MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync'
1532MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la'
1533CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
1534
1535# SHA1 hashing
1536AC_ARG_WITH([sha1],
1537 [AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
1538 [choose SHA1 implementation])])
1539AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
1540if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
1541 with_sha1=libc
1542fi
1543if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then
1544 AC_MSG_ERROR([libc requested but not found])
1545fi
1546if test "x$with_sha1" = xlibc; then
1547 AC_DEFINE([HAVE_SHA1_IN_LIBC], [1],
1548 [Use libc SHA1 functions])
1549 SHA1_LIBS=""
1550fi
1551AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes])
1552if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then
1553 with_sha1=CommonCrypto
1554fi
1555if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then
1556 AC_MSG_ERROR([CommonCrypto requested but not found])
1557fi
1558if test "x$with_sha1" = xCommonCrypto; then
1559 AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1],
1560 [Use CommonCrypto SHA1 functions])
1561 SHA1_LIBS=""
1562fi
1563dnl stdcall functions cannot be tested with AC_CHECK_LIB
1564AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
1565if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
1566 with_sha1=CryptoAPI
1567fi
1568if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
1569 AC_MSG_ERROR([CryptoAPI requested but not found])
1570fi
1571if test "x$with_sha1" = xCryptoAPI; then
1572 AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
1573 [Use CryptoAPI SHA1 functions])
1574 SHA1_LIBS=""
1575fi
1576AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
1577if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
1578 with_sha1=libmd
1579fi
1580if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
1581 AC_MSG_ERROR([libmd requested but not found])
1582fi
1583if test "x$with_sha1" = xlibmd; then
1584 AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
1585 [Use libmd SHA1 functions])
1586 SHA1_LIBS=-lmd
1587fi
1588PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
1589if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
1590 with_sha1=libsha1
1591fi
1592if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then
1593 AC_MSG_ERROR([libsha1 requested but not found])
1594fi
1595if test "x$with_sha1" = xlibsha1; then
1596 AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
1597 [Use libsha1 for SHA1])
1598 SHA1_LIBS=-lsha1
1599fi
1600AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
1601if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
1602 with_sha1=libnettle
1603fi
1604if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
1605 AC_MSG_ERROR([libnettle requested but not found])
1606fi
1607if test "x$with_sha1" = xlibnettle; then
1608 AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
1609 [Use libnettle SHA1 functions])
1610 SHA1_LIBS=-lnettle
1611fi
1612AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
1613if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
1614 with_sha1=libgcrypt
1615fi
1616if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then
1617 AC_MSG_ERROR([libgcrypt requested but not found])
1618fi
1619if test "x$with_sha1" = xlibgcrypt; then
1620 AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
1621 [Use libgcrypt SHA1 functions])
1622 SHA1_LIBS=-lgcrypt
1623fi
1624# We don't need all of the OpenSSL libraries, just libcrypto
1625AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
1626PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
1627 [HAVE_OPENSSL_PKC=no])
1628if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then
1629 if test "x$with_sha1" = x; then
1630 with_sha1=libcrypto
1631 fi
1632else
1633 if test "x$with_sha1" = xlibcrypto; then
1634 AC_MSG_ERROR([OpenSSL libcrypto requested but not found])
1635 fi
1636fi
1637if test "x$with_sha1" = xlibcrypto; then
1638 if test "x$HAVE_LIBCRYPTO" = xyes; then
1639 SHA1_LIBS=-lcrypto
1640 else
1641 SHA1_LIBS="$OPENSSL_LIBS"
1642 SHA1_CFLAGS="$OPENSSL_CFLAGS"
1643 fi
1644fi
1645AC_MSG_CHECKING([for SHA1 implementation])
1646if test "x$with_sha1" = x; then
1647 AC_MSG_ERROR([No suitable SHA1 implementation found])
1648fi
1649AC_MSG_RESULT([$with_sha1])
1650AC_SUBST(SHA1_LIBS)
1651AC_SUBST(SHA1_CFLAGS)
1652
1653PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
1654PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
1655
1656PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
1657if test "x$LIBUNWIND" = "xauto"; then
1658 LIBUNWIND="$HAVE_LIBUNWIND"
1659fi
1660
1661if test "x$LIBUNWIND" = "xyes"; then
1662 if test "x$HAVE_LIBUNWIND" != "xyes"; then
1663 AC_MSG_ERROR([libunwind requested but not installed.])
1664 fi
1665 AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
1666fi
1667
1668AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$LIBUNWIND" = xyes])
1669
1670# Autotools has some unfortunate issues with library handling. In order to
1671# get a server to rebuild when a dependency in the tree is changed, it must
1672# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be
1673# listed there, or some versions of autotools will break (especially if a -L
1674# is required to find the library). So, we keep two sets of libraries
1675# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which
1676# will go into the _DEPENDENCIES and _LDADD of the server, and
1677# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The
1678# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in
1679# NAMESPACE_SYS_LIBS.
1680#
1681# XSERVER_LIBS is the set of in-tree libraries which all servers require.
1682# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers
1683# require.
1684#
1685XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
1686XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
1687XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
1688AC_SUBST([XSERVER_LIBS])
1689AC_SUBST([XSERVER_SYS_LIBS])
1690
1691UTILS_SYS_LIBS="${SYS_LIBS}"
1692AC_SUBST([UTILS_SYS_LIBS])
1693
1694# The Xorg binary needs to export symbols so that they can be used from modules
1695# Some platforms require extra flags to do this. libtool should set the
1696# necessary flags for each platform when -export-dynamic is passed to it.
1697LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
1698LD_NO_UNDEFINED_FLAG=
1699XORG_DRIVER_LIBS=
1700case "$host_os" in
1701 cygwin*)
1702 LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a"
1703 LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a"
1704 XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined"
1705 CYGWIN=yes
1706 ;;
1707 solaris*)
1708 # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT
1709 # that we can link against for testing if the system linker is new
1710 # enough to support -z parent=<program> for verifying loadable modules
1711 # are only calling functions defined in either the loading program or
1712 # the libraries they're linked with.
1713 AC_LINK_IFELSE(
1714 [AC_LANG_SOURCE([int main(int argc, char **argv) { return 0; }])],
1715 [mv conftest$EXEEXT conftest.parent
1716 XORG_CHECK_LINKER_FLAGS([-Wl,-z,parent=conftest.parent -G],
1717 [LD_NO_UNDEFINED_FLAG="-Wl,-z,defs -Wl,-z,parent=\$(top_builddir)/hw/xfree86/Xorg"
1718# Not set yet, since this gets exported in xorg-server.pc to all the drivers,
1719# and they're not all fixed to build correctly with it yet.
1720# XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg"
1721 ],[],
1722 [AC_LANG_SOURCE([extern int main(int argc, char **argv);
1723 int call_main(void) { return main(0, NULL); }])])
1724 rm -f conftest.parent
1725 ])
1726 ;;
1727esac
1728AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
1729AC_SUBST([LD_NO_UNDEFINED_FLAG])
1730AC_SUBST([XORG_DRIVER_LIBS])
1731AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes])
1732AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x])
1733
1734dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
1735dnl we need to replicate that here until those can all be fixed
1736AC_MSG_CHECKING([if SVR4 needs to be defined])
1737AC_EGREP_CPP([I_AM_SVR4],[
1738#if defined(SVR4) || defined(__svr4__) || defined(__SVR4)
1739 I_AM_SVR4
1740#endif
1741],[
1742AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
1743AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
1744
1745XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC $DBE_INC $PRESENT_INC"
1746
1747dnl ---------------------------------------------------------------------------
1748dnl DDX section.
1749dnl ---------------------------------------------------------------------------
1750
1751dnl Xvfb DDX
1752
1753AC_MSG_CHECKING([whether to build Xvfb DDX])
1754AC_MSG_RESULT([$XVFB])
1755AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
1756
1757if test "x$XVFB" = xyes; then
1758 XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB"
1759 XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
1760 AC_SUBST([XVFB_LIBS])
1761 AC_SUBST([XVFB_SYS_LIBS])
1762fi
1763
1764
1765dnl Xnest DDX
1766
1767PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
1768AC_MSG_CHECKING([whether to build Xnest DDX])
1769if test "x$XNEST" = xauto; then
1770 XNEST="$have_xnest"
1771fi
1772AC_MSG_RESULT([$XNEST])
1773AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
1774
1775if test "x$XNEST" = xyes; then
1776 if test "x$have_xnest" = xno; then
1777 AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
1778 fi
1779 XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
1780 XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
1781 AC_SUBST([XNEST_LIBS])
1782 AC_SUBST([XNEST_SYS_LIBS])
1783fi
1784
1785
1786dnl Xorg DDX
1787
1788AC_MSG_CHECKING([whether to build Xorg DDX])
1789if test "x$XORG" = xauto; then
1790 XORG="yes"
1791 case $host_os in
1792 cygwin*) XORG="no" ;;
1793 mingw*) XORG="no" ;;
1794 darwin*) XORG="no" ;;
1795 esac
1796fi
1797AC_MSG_RESULT([$XORG])
1798
1799if test "x$XORG" = xyes; then
1800 XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
1801 XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
1802 XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
1803 XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
1804 XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB"
1805
1806 dnl ==================================================================
1807 dnl symbol visibility
1808 symbol_visibility=
1809 have_visibility=disabled
1810 if test x$SYMBOL_VISIBILITY != xno; then
1811 AC_MSG_CHECKING(for symbol visibility support)
1812 if test x$GCC = xyes; then
1813 VISIBILITY_CFLAGS="-fvisibility=hidden"
1814 else
1815 if test x$SUNCC = xyes; then
1816 VISIBILITY_CFLAGS="-xldscope=hidden"
1817 else
1818 have_visibility=no
1819 fi
1820 fi
1821 if test x$have_visibility != xno; then
1822 save_CFLAGS="$CFLAGS"
1823 proto_inc=`$PKG_CONFIG --cflags xproto`
1824 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc"
1825 AC_TRY_COMPILE(
1826 [#include <X11/Xfuncproto.h>
1827 extern _X_HIDDEN int hidden_int;
1828 extern _X_EXPORT int public_int;
1829 extern _X_HIDDEN int hidden_int_func(void);
1830 extern _X_EXPORT int public_int_func(void);],
1831 [],
1832 have_visibility=yes,
1833 have_visibility=no)
1834 CFLAGS=$save_CFLAGS
1835 fi
1836 AC_MSG_RESULT([$have_visibility])
1837 if test x$have_visibility != xno; then
1838 symbol_visibility=$VISIBILITY_CFLAGS
1839 XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS"
1840 XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS"
1841 fi
1842 fi
1843 dnl added to xorg-server.pc
1844 AC_SUBST([symbol_visibility])
1845 dnl ===================================================================
1846
1847 dnl ===================================================================
1848 dnl ================= beginning of PCI configuration ==================
1849 dnl ===================================================================
1850 xorg_bus_bsdpci=no
1851 xorg_bus_sparc=no
1852
1853 AC_MSG_CHECKING([whether to build Xorg PCI functions])
1854 if test "x$PCI" = xyes; then
1855 PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
1856 SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
1857 XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS"
1858 XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
1859
1860 AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
1861 AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
1862 case $host_os in
1863 gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*)
1864 xorg_bus_bsdpci="yes"
1865 ;;
1866 esac
1867 case $host_cpu in
1868 sparc*)
1869 xorg_bus_sparc="yes"
1870 ;;
1871 esac
1872 else
1873 if test "x$CONFIG_UDEV_KMS" = xyes; then
1874 AC_MSG_ERROR([Platform device enumeration requires libpciaccess])
1875 fi
1876 if test "x$INT10MODULE" = xyes && test "x$INT10" != xstub; then
1877 AC_MSG_ERROR([Cannot build int10 without libpciaccess])
1878 fi
1879 fi
1880 AC_MSG_RESULT([$PCI])
1881
1882 if test "x$CONFIG_UDEV_KMS" = xyes; then
1883 AC_DEFINE(XSERVER_PLATFORM_BUS, 1, [X server supports platform device enumeration])
1884 fi
1885 AC_MSG_RESULT([$XSERVER_PLATFORM_BUS])
1886 dnl ===================================================================
1887 dnl ==================== end of PCI configuration =====================
1888 dnl ===================================================================
1889
1890 case $host_os in
1891 linux*)
1892 XORG_OS_SUBDIR="linux"
1893 linux_acpi="no"
1894 case $host_cpu in
1895 alpha*)
1896 linux_alpha=yes
1897 ;;
1898 i*86|amd64*|x86_64*|ia64*)
1899 linux_acpi=$enable_linux_acpi
1900 ;;
1901 *)
1902 ;;
1903 esac
1904 dnl APM header
1905 AC_CHECK_HEADERS([linux/apm_bios.h], [linux_apm=$enable_linux_apm])
1906 if test "x$linux_apm" = xyes -o "x$linux_acpi" = xyes; then
1907 AC_DEFINE(XF86PM, 1, [Support APM/ACPI power management in the server])
1908 fi
1909 ;;
1910 freebsd* | kfreebsd*-gnu | dragonfly*)
1911 XORG_OS_SUBDIR="bsd"
1912 ;;
1913 netbsd*)
1914 XORG_OS_SUBDIR="bsd"
1915 ;;
1916 openbsd*)
1917 if test "x$ac_cv_BSD_APM" = xyes \
1918 -o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then
1919 XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
1920 fi
1921 XORG_OS_SUBDIR="bsd"
1922 ;;
1923 solaris*)
1924 XORG_OS_SUBDIR="solaris"
1925 XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
1926 AC_CHECK_HEADERS([sys/kd.h])
1927 AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no])
1928 # Check for minimum supported release
1929 AC_MSG_CHECKING([Solaris version])
1930 OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'`
1931 if test "${OS_MINOR}" -ge 7 ; then
1932 AC_MSG_RESULT(Solaris ${OS_MINOR})
1933 else
1934 AC_MSG_RESULT(Solaris `echo ${host_os}|$SED -e 's/^.*solaris//`)
1935 fi
1936 if test "${OS_MINOR}" -lt 8 ; then
1937 AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.])
1938 fi
1939 AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
1940
1941 case $host_cpu in
1942 sparc*)
1943 SOLARIS_INOUT_ARCH="sparcv8plus"
1944 ;;
1945 i*86)
1946 if test x$SOLARIS_64 = xyes ; then
1947 SOLARIS_INOUT_ARCH="amd64"
1948 else
1949 SOLARIS_INOUT_ARCH="ia32"
1950 fi
1951 ;;
1952 *)
1953 AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \
1954 are supported on Solaris in this release. If you are \
1955 interested in porting Xorg to your platform, please email \
1956 xorg@lists.freedesktop.org.]) ;;
1957 esac
1958 AC_SUBST([SOLARIS_INOUT_ARCH])
1959 ;;
1960 gnu*)
1961 XORG_OS_SUBDIR="hurd"
1962 ;;
1963 *)
1964 XORG_OS_SUBDIR="stub"
1965 AC_MSG_NOTICE([m4_text_wrap(m4_join([ ],
1966 [Your OS is unknown. Xorg currently only supports Linux,],
1967 [Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.],
1968 [If you are interested in porting Xorg to your platform,],
1969 [please email xorg@lists.freedesktop.org.]))])
1970 ;;
1971 esac
1972
1973 case $host_cpu in
1974 i*86)
1975 ;;
1976 esac
1977
1978 if test "x$DGA" = xauto; then
1979 PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no])
1980 fi
1981 if test "x$DGA" = xyes; then
1982 XORG_MODULES="$XORG_MODULES $DGAPROTO"
1983 PKG_CHECK_MODULES(DGA, $DGAPROTO)
1984 AC_DEFINE(DGA, 1, [Support DGA extension])
1985 AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
1986 fi
1987
1988 if test "x$XF86VIDMODE" = xauto; then
1989 PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no])
1990 fi
1991 if test "x$XF86VIDMODE" = xyes; then
1992 XORG_MODULES="$XORG_MODULES $VIDMODEPROTO"
1993 PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO)
1994 AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
1995 fi
1996
1997 if test -n "$XORG_MODULES"; then
1998 PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES])
1999 XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS"
2000 XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS"
2001 fi
2002
2003 AC_SUBST([XORG_LIBS])
2004 AC_SUBST([XORG_SYS_LIBS])
2005 AC_SUBST([XORG_INCS])
2006 AC_SUBST([XORG_OS_SUBDIR])
2007 AC_SUBST([XORG_CFLAGS])
2008
2009 dnl these only go in xorg-config.h
2010 XF86CONFIGFILE="xorg.conf"
2011 XF86CONFIGDIR="xorg.conf.d"
2012 AC_SUBST(XF86CONFIGDIR)
2013 CONFIGFILE="$sysconfdir/$XF86CONFIGFILE"
2014 LOGPREFIX="$logdir/Xorg."
2015 AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
2016 AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
2017 AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
2018 AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
2019 AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
2020 AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
2021 AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
2022 AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file])
2023 AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
2024 AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory])
2025 AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
2026 AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
2027 AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location])
2028 AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
2029 if test "x$VGAHW" = xyes; then
2030 AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module])
2031 fi
2032
2033 driverdir="$moduledir/drivers"
2034 AC_SUBST([moduledir])
2035 AC_SUBST([driverdir])
2036 sdkdir="$includedir/xorg"
2037 extdir="$includedir/X11/extensions"
2038 sysconfigdir="$datadir/X11/$XF86CONFIGDIR"
2039 AC_SUBST([sdkdir])
2040 AC_SUBST([extdir])
2041 AC_SUBST([sysconfigdir])
2042 AC_SUBST([logdir])
2043
2044 # stuff the ABI versions into the pc file too
2045 extract_abi() {
2046 grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }'
2047 }
2048 abi_ansic=`extract_abi ANSIC`
2049 abi_videodrv=`extract_abi VIDEODRV`
2050 abi_xinput=`extract_abi XINPUT`
2051 abi_extension=`extract_abi EXTENSION`
2052 AC_SUBST([abi_ansic])
2053 AC_SUBST([abi_videodrv])
2054 AC_SUBST([abi_xinput])
2055 AC_SUBST([abi_extension])
2056fi
2057AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
2058AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes])
2059AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
2060AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
2061AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes])
2062AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
2063AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = xyes])
2064AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
2065AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
2066AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
2067AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes])
2068dnl XWin DDX
2069
2070AC_MSG_CHECKING([whether to build XWin DDX])
2071if test "x$XWIN" = xauto; then
2072 case $host_os in
2073 cygwin*) XWIN="yes" ;;
2074 mingw*) XWIN="yes" ;;
2075 *) XWIN="no" ;;
2076 esac
2077fi
2078AC_MSG_RESULT([$XWIN])
2079
2080if test "x$XWIN" = xyes; then
2081 AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc])
2082 AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
2083 AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
2084 AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
2085 AC_CHECK_TOOL(WINDRES, windres)
2086
2087 PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau])
2088
2089 if test "x$WINDOWSWM" = xauto; then
2090 PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
2091 fi
2092 if test "x$WINDOWSWM" = xyes ; then
2093 PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO)
2094 XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS"
2095 AC_DEFINE(ROOTLESS,1,[Build Rootless code])
2096 fi
2097
2098 case $host_os in
2099 cygwin*)
2100 XWIN_SERVER_NAME=XWin
2101 AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages])
2102 ;;
2103 mingw*)
2104 XWIN_SERVER_NAME=Xming
2105 AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location])
2106 AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets])
2107 XWIN_SYS_LIBS="-lpthread -lws2_32"
2108 ;;
2109 esac
2110
2111 XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB"
2112 XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
2113 AC_SUBST(XWIN_LIBS)
2114 AC_SUBST(XWIN_SERVER_NAME)
2115 AC_SUBST(XWIN_SYS_LIBS)
2116
2117 if test "x$DEBUGGING" = xyes; then
2118 AC_DEFINE(CYGDEBUG, 1, [Simple debug messages])
2119 AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling])
2120 AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager])
2121 fi
2122
2123 AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF])
2124 AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ])
2125
2126dnl XWin with AIGLX requires OpenGL spec files in order to generate wrapper code for native GL functions
2127 if [test "x$XWIN" = xyes && test "x$AIGLX" = xyes] ; then
2128 AC_CHECK_PROG(PYTHON3, python3, python3)
2129 if test -z "$PYTHON3"; then
2130 AC_MSG_ERROR([python3 not found])
2131 fi
2132 AC_MSG_CHECKING(for python module lxml)
2133 $PYTHON3 -c "import lxml;"
2134 if test $? -ne 0 ; then
2135 AC_MSG_ERROR([not found])
2136 fi
2137 AC_MSG_RESULT(yes)
2138 if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then
2139 PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry])
2140 KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir`
2141 fi
2142 AC_SUBST(KHRONOS_SPEC_DIR)
2143 fi
2144
2145fi
2146AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
2147AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
2148AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
2149AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
2150AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$AIGLX" = xyes])
2151AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes])
2152AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes])
2153AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
2154AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes])
2155
2156dnl Darwin / OS X DDX
2157if test "x$XQUARTZ" = xyes; then
2158 AC_DEFINE(XQUARTZ,1,[Have Quartz])
2159 AC_DEFINE(ROOTLESS,1,[Build Rootless code])
2160
2161 XQUARTZ_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $PRESENT_LIB"
2162 AC_SUBST([XQUARTZ_LIBS])
2163
2164 AC_CHECK_LIB([Xplugin],[xp_init],[:])
2165
2166 CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
2167
2168 PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
2169
2170 if test "x$XQUARTZ_SPARKLE" = xyes ; then
2171 AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.])
2172 fi
2173
2174 if test "x$STANDALONE_XPBPROXY" = xyes ; then
2175 AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy])
2176 fi
2177fi
2178
2179# Support for objc in autotools is minimal and not documented.
2180OBJC='$(CC)'
2181OBJCLD='$(CCLD)'
2182OBJCLINK='$(LINK)'
2183OBJCFLAGS='$(CFLAGS)'
2184AC_SUBST([OBJC])
2185AC_SUBST([OBJCCLD])
2186AC_SUBST([OBJCLINK])
2187AC_SUBST([OBJCFLAGS])
2188# internal, undocumented automake func follows :(
2189_AM_DEPENDENCIES([OBJC])
2190AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
2191AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
2192AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
2193
2194dnl DMX DDX
2195PKG_CHECK_MODULES(
2196 [DMXMODULES],
2197 [xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES],
2198 [PKG_CHECK_MODULES(
2199 [XDMXCONFIG_DEP],
2200 [xaw7 xmu xt xpm x11],
2201 [have_dmx=yes],
2202 [have_dmx=no])],
2203 [have_dmx=no])
2204AC_MSG_CHECKING([whether to build Xdmx DDX])
2205if test "x$DMX" = xauto; then
2206 DMX="$have_dmx"
2207 case $host_os in
2208 cygwin*) DMX="no" ;;
2209 mingw*) DMX="no" ;;
2210 darwin*) DMX="no" ;;
2211 esac
2212fi
2213AC_MSG_RESULT([$DMX])
2214AM_CONDITIONAL(DMX, [test "x$DMX" = xyes])
2215
2216if test "x$DMX" = xyes; then
2217 if test "x$have_dmx" = xno; then
2218 AC_MSG_ERROR([Xdmx build explicitly requested, but required
2219 modules not found.])
2220 fi
2221 DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
2222 XDMX_CFLAGS="$DMXMODULES_CFLAGS"
2223 XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
2224 XDMX_SYS_LIBS="$DMXMODULES_LIBS"
2225 AC_SUBST([XDMX_CFLAGS])
2226 AC_SUBST([XDMX_LIBS])
2227 AC_SUBST([XDMX_SYS_LIBS])
2228
2229dnl USB sources in DMX require <linux/input.h>
2230 AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes",
2231 DMX_BUILD_USB="no")
2232dnl Linux sources in DMX require <linux/keyboard.h>
2233 AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
2234 DMX_BUILD_LNX="no")
2235 AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
2236 AC_SUBST(XDMXCONFIG_DEP_LIBS)
2237 PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
2238 AC_SUBST(DMXEXAMPLES_DEP_LIBS)
2239 PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11])
2240 AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
2241 PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11])
2242 AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
2243 PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11])
2244 AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
2245 PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11])
2246 AC_SUBST(XRESEXAMPLES_DEP_LIBS)
2247 PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11])
2248 AC_SUBST(X11EXAMPLES_DEP_LIBS)
2249
2250fi
2251AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes])
2252AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes])
2253
2254dnl kdrive DDX
2255
2256XEPHYR_LIBS=
2257XEPHYR_INCS=
2258
2259AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes])
2260
2261if test "$KDRIVE" = yes; then
2262 AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server])
2263 AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx])
2264
2265 AC_CHECK_HEADERS([linux/fb.h])
2266 if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then
2267 XFBDEV=yes
2268 fi
2269
2270 if test "x$XFBDEV" = xyes; then
2271 KDRIVEFBDEVLIB=yes
2272 AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server])
2273 fi
2274
2275
2276 PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])
2277 if test "x$HAVE_TSLIB" = xno; then
2278 AC_CHECK_LIB(ts, ts_open, [
2279 HAVE_TSLIB="yes"
2280 TSLIB_LIBS="-lts"
2281 ])
2282 fi
2283
2284 if test "xTSLIB" = xauto; then
2285 TSLIB="$HAVE_TSLIB"
2286 fi
2287
2288 if test "x$TSLIB" = xyes; then
2289 if ! test "x$HAVE_TSLIB" = xyes; then
2290 AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/])
2291 else
2292 AC_DEFINE(TSLIB, 1, [Have tslib support])
2293 fi
2294 fi
2295
2296 if test "x$KDRIVE_KBD" = xyes; then
2297 AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver])
2298 fi
2299 if test "x$KDRIVE_EVDEV" = xyes; then
2300 AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver])
2301 fi
2302 if test "x$KDRIVE_MOUSE" = xyes; then
2303 AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver])
2304 fi
2305
2306 XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms"
2307 if test "x$XV" = xyes; then
2308 XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv"
2309 fi
2310 if test "x$DRI" = xyes && test "x$GLX" = xyes; then
2311 XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS libdrm xcb-glx xcb-xf86dri > 1.6"
2312 fi
2313
2314 if test "x$XEPHYR" = xauto; then
2315 PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [XEPHYR="yes"], [XEPHYR="no"])
2316 elif test "x$XEPHYR" = xyes ; then
2317 PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS)
2318 fi
2319
2320 # Xephyr needs nanosleep() which is in librt on Solaris
2321 AC_CHECK_FUNC([nanosleep], [],
2322 AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt"))
2323
2324 # damage shadow extension glx (NOTYET) fb mi
2325 KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src'
2326 KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC"
2327 KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux'
2328 KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
2329
2330 KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS"
2331
2332 KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB"
2333 KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
2334 case $host_os in
2335 *linux*)
2336 KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la'
2337 KDRIVELINUX=yes
2338 if test "x$KDRIVE_EVDEV" = xauto; then
2339 KDRIVE_EVDEV=yes
2340 fi
2341 if test "x$KDRIVE_KBD" = xauto; then
2342 KDRIVE_KBD=yes
2343 fi
2344 if test "x$KDRIVE_MOUSE" = xauto; then
2345 KDRIVE_MOUSE=yes
2346 fi
2347 ;;
2348 *)
2349 if test "x$KDRIVE_EVDEV" = xauto; then
2350 KDRIVE_EVDEV=no
2351 fi
2352 if test "x$KDRIVE_KBD" = xauto; then
2353 KDRIVE_KBD=no
2354 fi
2355 if test "x$KDRIVE_MOUSE" = xauto; then
2356 KDRIVE_MOUSE=no
2357 fi
2358 ;;
2359 esac
2360 KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la'
2361 KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB"
2362 KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
2363 KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB"
2364 KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS"
2365
2366 AC_SUBST([XEPHYR_LIBS])
2367 AC_SUBST([XEPHYR_INCS])
2368fi
2369AC_SUBST([KDRIVE_INCS])
2370AC_SUBST([KDRIVE_PURE_INCS])
2371AC_SUBST([KDRIVE_CFLAGS])
2372AC_SUBST([KDRIVE_PURE_LIBS])
2373AC_SUBST([KDRIVE_LOCAL_LIBS])
2374AC_SUBST([KDRIVE_LIBS])
2375AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes])
2376AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes])
2377AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes])
2378AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes])
2379AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes])
2380AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes])
2381AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
2382AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes])
2383AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
2384
2385dnl and the rest of these are generic, so they're in config.h
2386dnl
2387dnl though, thanks to the passing of some significant amount of time, the
2388dnl above is probably a complete fallacy, and you should not rely on it.
2389dnl but this is still actually better than imake, honest. -daniels
2390
2391AC_TRY_COMPILE([
2392#include <features.h>
2393#ifndef __GLIBC__
2394#error not glibc
2395#endif
2396], [], [AC_DEFINE(_GNU_SOURCE, 1,
2397 [ Enable GNU and other extensions to the C environment for glibc])])
2398
2399AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
2400
2401AC_SUBST([RELEASE_DATE])
2402BUILD_DATE="`date +'%Y%m%d'`"
2403AC_SUBST([BUILD_DATE])
2404BUILD_TIME="`date +'1%H%M%S'`"
2405AC_SUBST([BUILD_TIME])
2406
2407DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
2408
2409AC_SUBST([DIX_CFLAGS])
2410
2411AC_SUBST([libdir])
2412AC_SUBST([exec_prefix])
2413AC_SUBST([prefix])
2414
2415AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
2416
2417if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
2418 AC_WARN([
2419 ***********************************************
2420 Neither HAL nor udev backend will be enabled.
2421 Input device hotplugging will not be available!
2422 ***********************************************])
2423fi
2424
2425AC_CONFIG_FILES([
2426Makefile
2427glx/Makefile
2428include/Makefile
2429composite/Makefile
2430damageext/Makefile
2431dbe/Makefile
2432dix/Makefile
2433doc/Makefile
2434doc/dtrace/Makefile
2435man/Makefile
2436fb/Makefile
2437record/Makefile
2438config/Makefile
2439mi/Makefile
2440miext/Makefile
2441miext/sync/Makefile
2442miext/damage/Makefile
2443miext/shadow/Makefile
2444miext/rootless/Makefile
2445os/Makefile
2446pseudoramiX/Makefile
2447randr/Makefile
2448render/Makefile
2449xkb/Makefile
2450Xext/Makefile
2451Xi/Makefile
2452xfixes/Makefile
2453exa/Makefile
2454dri3/Makefile
2455present/Makefile
2456hw/Makefile
2457hw/xfree86/Makefile
2458hw/xfree86/common/Makefile
2459hw/xfree86/common/xf86Build.h
2460hw/xfree86/ddc/Makefile
2461hw/xfree86/dixmods/Makefile
2462hw/xfree86/doc/Makefile
2463hw/xfree86/dri/Makefile
2464hw/xfree86/dri2/Makefile
2465hw/xfree86/exa/Makefile
2466hw/xfree86/exa/man/Makefile
2467hw/xfree86/fbdevhw/Makefile
2468hw/xfree86/fbdevhw/man/Makefile
2469hw/xfree86/i2c/Makefile
2470hw/xfree86/int10/Makefile
2471hw/xfree86/loader/Makefile
2472hw/xfree86/man/Makefile
2473hw/xfree86/modes/Makefile
2474hw/xfree86/os-support/Makefile
2475hw/xfree86/os-support/bsd/Makefile
2476hw/xfree86/os-support/bus/Makefile
2477hw/xfree86/os-support/hurd/Makefile
2478hw/xfree86/os-support/misc/Makefile
2479hw/xfree86/os-support/linux/Makefile
2480hw/xfree86/os-support/solaris/Makefile
2481hw/xfree86/os-support/stub/Makefile
2482hw/xfree86/parser/Makefile
2483hw/xfree86/ramdac/Makefile
2484hw/xfree86/shadowfb/Makefile
2485hw/xfree86/vbe/Makefile
2486hw/xfree86/vgahw/Makefile
2487hw/xfree86/x86emu/Makefile
2488hw/xfree86/utils/Makefile
2489hw/xfree86/utils/man/Makefile
2490hw/xfree86/utils/cvt/Makefile
2491hw/xfree86/utils/gtf/Makefile
2492hw/dmx/config/Makefile
2493hw/dmx/config/man/Makefile
2494hw/dmx/doc/Makefile
2495hw/dmx/doxygen/doxygen.conf
2496hw/dmx/doxygen/Makefile
2497hw/dmx/examples/Makefile
2498hw/dmx/input/Makefile
2499hw/dmx/glxProxy/Makefile
2500hw/dmx/Makefile
2501hw/dmx/man/Makefile
2502hw/vfb/Makefile
2503hw/vfb/man/Makefile
2504hw/xnest/Makefile
2505hw/xnest/man/Makefile
2506hw/xwin/Makefile
2507hw/xwin/glx/Makefile
2508hw/xwin/man/Makefile
2509hw/xquartz/Makefile
2510hw/xquartz/GL/Makefile
2511hw/xquartz/bundle/Makefile
2512hw/xquartz/man/Makefile
2513hw/xquartz/mach-startup/Makefile
2514hw/xquartz/pbproxy/Makefile
2515hw/xquartz/xpr/Makefile
2516hw/kdrive/Makefile
2517hw/kdrive/ephyr/Makefile
2518hw/kdrive/ephyr/man/Makefile
2519hw/kdrive/fake/Makefile
2520hw/kdrive/fbdev/Makefile
2521hw/kdrive/linux/Makefile
2522hw/kdrive/src/Makefile
2523test/Makefile
2524test/xi2/Makefile
2525xserver.ent
2526xorg-server.pc
2527])
2528AC_OUTPUT