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