xserver-multidpi/configure.ac

2510 lines
90 KiB
Plaintext
Raw Normal View History

dnl Copyright © 2003-2007 Keith Packard, Daniel Stone
2005-07-01 22:29:53 +02:00
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
dnl and/or sell copies of the Software, and to permit persons to whom the
dnl Software is furnished to do so, subject to the following conditions:
2005-07-01 22:29:53 +02:00
dnl
dnl The above copyright notice and this permission notice (including the next
dnl paragraph) shall be included in all copies or substantial portions of the
dnl Software.
2005-07-01 22:29:53 +02:00
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
dnl DEALINGS IN THE SOFTWARE.
dnl
dnl Authors: Keith Packard <keithp@keithp.com>
dnl Daniel Stone <daniel@fooishbar.org>
dnl an unwitting cast of miscellaneous others
2005-07-01 22:29:53 +02:00
dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
AC_INIT([xorg-server], 1.20.99.1, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server)
RELEASE_DATE="2018-05-14"
RELEASE_NAME="Carrot and Ginger Soup"
2005-07-01 22:29:53 +02:00
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AC_USE_SYSTEM_EXTENSIONS
# Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.14 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.14)
XORG_DEFAULT_OPTIONS
XORG_WITH_DOXYGEN(1.6.1)
XORG_CHECK_SGML_DOCTOOLS(1.8)
XORG_ENABLE_DOCS
XORG_ENABLE_DEVEL_DOCS
XORG_WITH_XMLTO(0.0.20)
XORG_WITH_FOP
XORG_WITH_XSLTPROC
XORG_ENABLE_UNIT_TESTS
XORG_LD_WRAP([optional])
m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install font-util 1.1 or later before running autoconf/autogen])])
XORG_FONT_MACROS_VERSION(1.1)
2005-07-01 22:29:53 +02:00
dnl this gets generated by autoheader, and thus contains all the defines. we
dnl don't ever actually use it, internally.
AC_CONFIG_HEADERS(include/do-not-use-config.h)
dnl xorg-server.h is an external header, designed to be included by loadable
dnl drivers.
AC_CONFIG_HEADERS(include/xorg-server.h)
dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
dnl dix/).
AC_CONFIG_HEADERS(include/dix-config.h)
dnl xorg-config.h covers the Xorg DDX.
AC_CONFIG_HEADERS(include/xorg-config.h)
2005-07-14 05:32:09 +02:00
dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
AC_CONFIG_HEADERS(include/xkb-config.h)
dnl xwin-config.h covers the XWin DDX.
AC_CONFIG_HEADERS(include/xwin-config.h)
dnl xwayland-config.h covers Xwayland.
AC_CONFIG_HEADERS(include/xwayland-config.h)
dnl version-config.h covers the version numbers so they can be bumped without
dnl forcing an entire recompile.x
AC_CONFIG_HEADERS(include/version-config.h)
2005-07-01 22:29:53 +02:00
AM_PROG_AS
AC_PROG_LN_S
LT_PREREQ([2.2])
LT_INIT([disable-static win32-dll])
2005-07-01 22:29:53 +02:00
PKG_PROG_PKG_CONFIG
AC_PROG_LEX
AC_PROG_YACC
AC_SYS_LARGEFILE
XORG_PROG_RAWCPP
2005-07-01 22:29:53 +02:00
# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow
# easier overrides at build time.
XSERVER_CFLAGS='$(CWARNFLAGS)'
dnl Explicitly add -fno-strict-aliasing since this option should disappear
dnl from util-macros CWARNFLAGS
if test "x$GCC" = xyes ; then
XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
fi
dnl Check for dtrace program (needed to build Xserver dtrace probes)
dnl Also checks for <sys/sdt.h>, since some Linux distros have an
dnl ISDN trace program named dtrace
AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH],
[Enable dtrace probes (default: enabled if dtrace found)]),
[WDTRACE=$withval], [WDTRACE=auto])
if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then
AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin])
if test "x$DTRACE" = "xnot_found" ; then
if test "x$WDTRACE" = "xyes" ; then
AC_MSG_FAILURE([dtrace requested but not found])
fi
WDTRACE="no"
else
AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"])
if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then
WDTRACE="no"
fi
fi
fi
if test "x$WDTRACE" != "xno" ; then
AC_DEFINE(XSERVER_DTRACE, 1,
[Define to 1 if the DTrace Xserver provider probes should be built in.])
# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into
# object files, and require linking with those as relocatable objects, not .a
# archives. MacOS X handles all this in the normal compiler toolchain, and on
# some releases (like Tiger), will error out on dtrace -G. For now, other
# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux
# ports appear to, based on my web searches, but have not yet been tested).
case $host_os in
darwin*) SPECIAL_DTRACE_OBJECTS=no ;;
*) SPECIAL_DTRACE_OBJECTS=yes ;;
esac
fi
AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"])
AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"])
2005-07-01 22:29:53 +02:00
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h \
fnmatch.h sys/mkdev.h sys/sysmacros.h sys/utsname.h])
2005-07-01 22:29:53 +02:00
dnl Checks for typedefs, structures, and compiler characteristics.
2005-07-01 22:29:53 +02:00
AC_C_CONST
AC_C_TYPEOF
AC_C_BIGENDIAN(AC_DEFINE(X_BYTE_ORDER, X_BIG_ENDIAN, [byte order]),
AC_DEFINE(X_BYTE_ORDER, X_LITTLE_ENDIAN, [byte order]))
AC_CHECK_SIZEOF([unsigned long])
if test "$ac_cv_sizeof_unsigned_long" = 8; then
AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.])
fi
2005-07-01 22:29:53 +02:00
AC_TYPE_PID_T
dnl Check to see if dlopen is in default libraries (like Solaris, which
dnl has it in libc), or if libdl is needed to get it.
AC_CHECK_FUNC([dlopen], [],
AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl"))
AC_SUBST(DLOPEN_LIBS)
dnl Checks for library functions.
AC_CHECK_FUNCS([backtrace geteuid getuid issetugid getresuid \
getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
walkcontext setitimer poll epoll_create1 mkostemp memfd_create \
sigprocmask isastream])
AC_CONFIG_LIBOBJ_DIR([os])
AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\
timingsafe_memcmp])
AM_CONDITIONAL(POLL, [test "x$ac_cv_func_poll" = "xyes"])
AC_CHECK_LIB([bsd], [arc4random_buf])
AC_CHECK_FUNCS([arc4random_buf])
AC_CHECK_DECLS([program_invocation_short_name], [], [], [[#include <errno.h>]])
dnl Check for SO_PEERCRED #define
AC_CACHE_CHECK([for SO_PEERCRED in sys/socket.h],
[xorg_cv_sys_have_so_peercred],
[AC_EGREP_CPP(yes_have_so_peercred,[
#include <sys/types.h>
#include <sys/socket.h>
#ifdef SO_PEERCRED
yes_have_so_peercred
#endif
],
[xorg_cv_sys_have_so_peercred=yes],
[xorg_cv_sys_have_so_peercred=no])])
dnl define NO_LOCAL_CLIENT_CRED if no getpeereid, getpeerucred or SO_PEERCRED
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
AC_DEFINE([NO_LOCAL_CLIENT_CRED], 1, [Define to 1 if no local socket credentials interface exists])
fi
dnl Find the math library, then check for cbrt function in it.
2005-07-01 22:29:53 +02:00
AC_CHECK_LIB(m, sqrt)
AC_CHECK_FUNCS([cbrt])
2005-07-01 22:29:53 +02:00
dnl AGPGART headers
AC_ARG_ENABLE(agp, AS_HELP_STRING([--enable-agp],
[Enable AGP support (default: auto)]),
[AGP=$enableval], [AGP=auto])
if test "x$AGP" = "xauto" ; then
AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes)
fi
2005-10-16 05:02:53 +02:00
AM_CONDITIONAL(AGP, [test "x$AGP" = xyes])
2005-07-01 22:29:53 +02:00
dnl fbdev header
AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
2005-07-01 22:29:53 +02:00
dnl FreeBSD kldload support (sys/linker.h)
AC_CHECK_HEADERS([sys/linker.h],
[ac_cv_sys_linker_h=yes],
[ac_cv_sys_linker_h=no],
[#include <sys/param.h>])
2005-10-16 05:02:53 +02:00
AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes])
2005-07-01 22:29:53 +02:00
AC_CACHE_CHECK([for SYSV IPC],
ac_cv_sysv_ipc,
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
2008-05-19 06:12:04 +02:00
#include <sys/types.h>
#include <sys/ipc.h>
2005-07-01 22:29:53 +02:00
#include <sys/shm.h>
#include <sys/stat.h>
]],[[
{
2005-07-01 22:29:53 +02:00
int id;
id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR);
2005-07-01 22:29:53 +02:00
if (id < 0) return -1;
return shmctl(id, IPC_RMID, 0);
}]])],
[ac_cv_sysv_ipc=yes],
[ac_cv_sysv_ipc=no])])
if test "x$ac_cv_sysv_ipc" = xyes; then
AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
2005-07-01 22:29:53 +02:00
fi
dnl OpenBSD /dev/xf86 aperture driver
if test -c /dev/xf86 ; then
AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
fi
dnl glibc backtrace support check
AC_CHECK_HEADER([execinfo.h],[
AC_CHECK_LIB(c, backtrace, [
AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h])
])]
)
dnl ---------------------------------------------------------------------------
dnl Bus options and CPU capabilities. Replaces logic in
dnl hw/xfree86/os-support/bus/Makefile.am, among others.
dnl ---------------------------------------------------------------------------
DEFAULT_INT10="x86emu"
dnl Override defaults as needed for specific platforms:
2005-07-01 22:29:53 +02:00
case $host_cpu in
alpha*)
ALPHA_VIDEO=yes
case $host_os in
*freebsd*) SYS_LIBS=-lio ;;
*netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
esac
GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee"
;;
arm*)
ARM_VIDEO=yes
DEFAULT_INT10="stub"
2005-07-01 22:29:53 +02:00
;;
i*86)
I386_VIDEO=yes
case $host_os in
*freebsd*) AC_DEFINE(USE_DEV_IO) ;;
*dragonfly*) AC_DEFINE(USE_DEV_IO) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL)
SYS_LIBS=-li386
;;
*openbsd*) AC_DEFINE(USE_I386_IOPL)
SYS_LIBS=-li386
;;
esac
2005-07-01 22:29:53 +02:00
;;
powerpc*)
PPC_VIDEO=yes
case $host_os in
*freebsd*) DEFAULT_INT10=stub ;;
esac
;;
sparc*)
SPARC64_VIDEO=yes
BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
x86_64*|amd64*)
I386_VIDEO=yes
case $host_os in
*freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
*dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
*netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
SYS_LIBS=-lx86_64
;;
*openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
SYS_LIBS=-lamd64
;;
esac
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
ia64*)
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
s390*)
GLX_ARCH_DEFINES="-D__GLX_ALIGN64"
;;
esac
AC_SUBST(GLX_ARCH_DEFINES)
dnl BSD *_video.c selection
2005-10-16 05:02:53 +02:00
AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
DRI=no
dnl it would be nice to autodetect these *CONS_SUPPORTs
case $host_os in
*freebsd* | *dragonfly*)
case $host_os in
kfreebsd*-gnu) ;;
*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
esac
AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
DRI=yes
;;
*netbsd*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
DRI=yes
;;
*openbsd*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console])
AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
;;
*linux*)
DRI=yes
;;
*solaris*)
DRI=yes
;;
darwin*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
;;
cygwin*|mingw*)
CFLAGS="$CFLAGS -DFD_SETSIZE=512"
;;
2005-07-01 22:29:53 +02:00
esac
dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
dnl major number
PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1`
if test "x$PVS" = "x"; then
PVS="0"
fi
VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)"
VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}"
VENDOR_NAME="The X.Org Foundation"
VENDOR_NAME_SHORT="X.Org"
VENDOR_WEB="http://wiki.x.org"
2005-07-01 22:29:53 +02:00
dnl Build options.
AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror],
[Obsolete - use --enable-strict-compilation instead]),
AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation]))
AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
[Enable debugging (default: disabled)]),
[DEBUGGING=$enableval], [DEBUGGING=no])
AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
2005-07-01 22:29:53 +02:00
[INT10="$withval"],
[INT10="$DEFAULT_INT10"])
AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR],
[Vendor string reported by the server]),
[ VENDOR_NAME="$withval" ], [])
AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR],
[Short version of vendor string reported by the server]),
[ VENDOR_NAME_SHORT="$withval" ], [])
AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL],
[Vendor web address reported by the server]),
[ VENDOR_WEB="$withval" ], [])
AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR],
[Directory where modules are installed (default: $libdir/xorg/modules)]),
2005-07-01 22:29:53 +02:00
[ moduledir="$withval" ],
[ moduledir="${libdir}/xorg/modules" ])
AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR],
[Directory where log files are kept (default: $localstatedir/log)]),
[ logdir="$withval" ],
[ logdir="$localstatedir/log" ])
AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS],
[Builder address (default: xorg@lists.freedesktop.org)]),
2005-07-01 22:29:53 +02:00
[ BUILDERADDR="$withval" ],
[ BUILDERADDR="xorg@lists.freedesktop.org" ])
AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]),
[ BUILDERSTRING="$withval" ]
[ ])
AC_ARG_ENABLE(listen-tcp, AS_HELP_STRING([--enable-listen-tcp],
[Listen on TCP by default (default:disabled)]),
[LISTEN_TCP=$enableval], [LISTEN_TCP=no])
AC_ARG_ENABLE(listen-unix, AS_HELP_STRING([--disable-listen-unix],
[Listen on Unix by default (default:enabled)]),
[LISTEN_UNIX=$enableval], [LISTEN_UNIX=yes])
AC_ARG_ENABLE(listen-local, AS_HELP_STRING([--disable-listen-local],
[Listen on local by default (default:enabled)]),
[LISTEN_LOCAL=$enableval], [LISTEN_LOCAL=yes])
Allow compile-time selection of a fallback input driver A new --with-fallback-input-driver=foo option allows selecting a fallback driver for the server if the driver configured for the device is not found. Note that this only applies when the device has a driver assigned and that module fails to load, devices without a driver are ignored as usual. This avoids the situation where a configuration assigns e.g. the synaptics driver but that driver is not available on the system, resulting in a dead device. A fallback driver can at least provides some functionality. This becomes more important as we move towards making other driver true leaf nodes that can be installed/uninstalled as requested. Specifically, wacom and synaptics, a config that assigns either driver should be viable even when the driver itself is not (yet) installed on the system. It is up to the distributions to make sure that the fallback driver is always installed. The fallback driver can be disabled with --without-fallback-input-driver and is disabled by default on non-Linux systems because we don't have generic drivers on those platforms. Default driver on Linux is libinput, evdev is the only other serious candidate here. Sample log output: [ 3274.421] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event4) [ 3274.421] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad weird driver" [ 3274.421] (II) LoadModule: "banana" [ 3274.422] (WW) Warning, couldn't open module banana [ 3274.422] (II) UnloadModule: "banana" [ 3274.422] (II) Unloading banana [ 3274.422] (EE) Failed to load module "banana" (module does not exist, 0) [ 3274.422] (EE) No input driver matching `banana' [ 3274.422] (II) Falling back to input driver `libinput' .. server proceeds to assign libinput, init the device, world peace and rainbows everywhere, truly what a sight. Shame about the banana though. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-06-01 06:38:54 +02:00
case $host_os in
linux*)
FALLBACK_INPUT_DRIVER="libinput"
;;
*)
FALLBACK_INPUT_DRIVER=""
;;
esac
AC_ARG_WITH(fallback-input-driver,
AC_HELP_STRING([--with-fallback-input-driver=$FALLBACK_INPUT_DRIVER],
[Input driver fallback if the requested driver for a device is unavailable]),
[ FALLBACK_INPUT_DRIVER=$withval ], [])
if test "x$FALLBACK_INPUT_DRIVER" = "xno"; then
FALLBACK_INPUT_DRIVER=""
fi
AC_MSG_CHECKING([for fallback input driver])
AC_MSG_RESULT([$FALLBACK_INPUT_DRIVER])
AC_DEFINE_UNQUOTED(FALLBACK_INPUT_DRIVER, ["$FALLBACK_INPUT_DRIVER"], [ Fallback input driver ])
dnl Determine font path
XORG_FONTROOTDIR
XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc)
XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF)
XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF)
XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1)
XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi)
XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi)
dnl Uses --with-default-font-path if set, otherwise uses standard
dnl subdirectories of FONTROOTDIR. Some distros set the default font path to
dnl "catalogue:/etc/X11/fontpath.d,built-ins"
DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/"
case $host_os in
darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;;
esac
AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
[ FONTPATH="$withval" ],
[ FONTPATH="${DEFAULT_FONT_PATH}" ])
AC_MSG_CHECKING([for default font path])
AC_MSG_RESULT([$FONTPATH])
AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: auto)]),
[ XKBPATH="$withval" ],
[ XKBPATH="auto" ])
AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
[ XKBOUTPUT="$withval" ],
[ XKBOUTPUT="compiled" ])
AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
[Keyboard ruleset (default: base/evdev)]),
[ XKB_DFLT_RULES="$withval" ],
[ XKB_DFLT_RULES="" ])
AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL],
[Keyboard model (default: pc105)]),
[ XKB_DFLT_MODEL="$withval" ],
[ XKB_DFLT_MODEL="pc105" ])
AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT],
[Keyboard layout (default: us)]),
[ XKB_DFLT_LAYOUT="$withval" ],
[ XKB_DFLT_LAYOUT="us" ])
AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT],
[Keyboard variant (default: (none))]),
[ XKB_DFLT_VARIANT="$withval" ],
[ XKB_DFLT_VARIANT="" ])
AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS],
[Keyboard layout options (default: (none))]),
[ XKB_DFLT_OPTIONS="$withval" ],
[ XKB_DFLT_OPTIONS="" ])
AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH],
[Directory where ancillary server config files are installed (default: ${libdir}/xorg)]),
[ SERVERCONFIG="$withval" ],
[ SERVERCONFIG="${libdir}/xorg" ])
AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]),
[ APPLE_APPLICATIONS_DIR="${withval}" ],
[ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ])
AC_SUBST([APPLE_APPLICATIONS_DIR])
AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]),
[ APPLE_APPLICATION_NAME="${withval}" ],
[ APPLE_APPLICATION_NAME="X11" ])
AC_SUBST([APPLE_APPLICATION_NAME])
AC_ARG_WITH(bundle-id-prefix, AS_HELP_STRING([--with-bundle-id-prefix=RDNS_PREFIX], [Prefix to use for bundle identifiers (default: org.x)]),
[ BUNDLE_ID_PREFIX="${withval}" ])
AC_SUBST([BUNDLE_ID_PREFIX])
AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$BUNDLE_ID_PREFIX", [Prefix to use for bundle identifiers])
m4_define(DEFAULT_BUNDLE_VERSION, m4_esyscmd([echo ]AC_PACKAGE_VERSION[ | cut -f1-3 -d. | tr -d '\n']))
AC_ARG_WITH(bundle-version, AS_HELP_STRING([--with-bundle-version=VERSION], [Version to use for X11.app's CFBundleVersion (default: ]DEFAULT_BUNDLE_VERSION[)]),
[ BUNDLE_VERSION="${withval}" ],
[ BUNDLE_VERSION="DEFAULT_BUNDLE_VERSION" ])
AC_SUBST([BUNDLE_VERSION])
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[)]),
[ BUNDLE_VERSION_STRING="${withval}" ],
[ BUNDLE_VERSION_STRING="${PACKAGE_VERSION}" ])
AC_SUBST([BUNDLE_VERSION_STRING])
AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]),
[ XQUARTZ_SPARKLE="${enableval}" ],
[ XQUARTZ_SPARKLE="no" ])
AC_SUBST([XQUARTZ_SPARKLE])
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)]),
[ XQUARTZ_SPARKLE_FEED_URL="${withval}" ],
[ XQUARTZ_SPARKLE_FEED_URL="https://www.xquartz.org/releases/sparkle/release.xml" ])
AC_SUBST([XQUARTZ_SPARKLE_FEED_URL])
AC_ARG_ENABLE(visibility, AS_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
[SYMBOL_VISIBILITY=$enableval],
[SYMBOL_VISIBILITY=auto])
dnl GLX build options
AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Path to Khronos OpenGL registry database files (default: auto)]),
[KHRONOS_SPEC_DIR="${withval}"],
[KHRONOS_SPEC_DIR=auto])
dnl Extensions.
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto])
AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto])
AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto])
AC_ARG_ENABLE(dri3, AS_HELP_STRING([--enable-dri3], [Build DRI3 extension (default: auto)]), [DRI3=$enableval], [DRI3=auto])
AC_ARG_ENABLE(present, AS_HELP_STRING([--disable-present], [Build Present extension (default: enabled)]), [PRESENT=$enableval], [PRESENT=yes])
AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto])
AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes])
AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no])
AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no])
AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no])
AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes])
AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto])
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
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])
AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto])
AC_ARG_ENABLE(config-wscons, AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto])
AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes])
AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
Add Windows-DRI extension If windowsdriproto headers are available, build a Windows-DRI extension, which supports requests to enable local clients to directly render GL to a Windows drawable: - a query to check if WGL is being used on a screen - a query to map a fbconfigID to a native pixelformatindex - a query to map a drawable to a native handle Windows-DRI can only be useful if we are using WGL, so make an note if WGL is active on a screen. Make validGlxDrawable() public Adjust glxWinSetPixelFormat() so it doesn't require a context, just a screen and config. That enables factoring out the deferred drawable creation code as glxWinDeferredCreateDrawable() Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a file mapping, so they exist in memory which can be shared with the direct rendering process. Currently, this file mapping is accessed by a name generated from the XID. This will not be unique across multiple server instances. It would perhaps be better, although more complicated, to use an anonymous file mapping, and then duplicate the handle for the direct rendering process. Use glxWinDeferredCreateDrawable() to ensure the native handle exists for the Windows-DRI query to map a drawable to native handle. v2: Various printf format warning fixes v3: Fix format warnings on x86 Move some uninteresting windows-dri output to debug log level v4: check for windowsdriproto when --enable-windowsdri use windowsdriproto_CFLAGS Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-07-24 13:29:41 +02:00
AC_ARG_ENABLE(windowsdri, AS_HELP_STRING([--enable-windowsdri], [Build XWin with WindowsDRI extension (default: auto)]), [WINDOWSDRI=$enableval], [WINDOWSDRI=auto])
AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes])
AC_ARG_ENABLE(pciaccess, AS_HELP_STRING([--enable-pciaccess], [Build Xorg with pciaccess library (default: enabled)]), [PCI=$enableval], [PCI=yes])
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])
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])
AC_ARG_ENABLE(systemd-logind, AS_HELP_STRING([--enable-systemd-logind], [Build systemd-logind support (default: auto)]), [SYSTEMD_LOGIND=$enableval], [SYSTEMD_LOGIND=auto])
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])
dnl DDXes.
AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: no)]), [DMX=$enableval], [DMX=no])
AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto])
AC_ARG_ENABLE(xwayland, AS_HELP_STRING([--enable-xwayland], [Build Xwayland server (default: auto)]), [XWAYLAND=$enableval], [XWAYLAND=auto])
xwayland: Add glamor egl_backend for EGLStreams This adds initial support for displaying Xwayland applications through the use of EGLStreams and nvidia's custom wayland protocol by adding another egl_backend driver. This also adds some additional egl_backend hooks that are required to make things work properly. EGLStreams work a lot differently then the traditional way of handling buffers with wayland. Unfortunately, there are also a LOT of various pitfalls baked into it's design that need to be explained. This has a very large and unfortunate implication: direct rendering is, for the time being at least, impossible to do through EGLStreams. The main reason being that the EGLStream spec mandates that we lose the entire color buffer contents with each eglSwapBuffers(), which goes against X's requirement of not losing data with pixmaps. no way to use an allocated EGLSurface as the storage for glamor rendering like we do with GBM, we have to rely on blitting each pixmap to it's respective EGLSurface producer each frame. In order to pull this off, we add two different additional egl_backend hooks that GBM opts out of implementing: - egl_backend.allow_commits for holding off displaying any EGLStream backed pixmaps until the point where it's stream is completely initialized and ready for use - egl_backend.post_damage for blitting the content of the EGLStream surface producer before Xwayland actually damages and commits the wl_surface to the screen. The other big pitfall here is that using nvidia's wayland-eglstreams helper library is also not possible for the most part. All of it's API for creating and destroying streams rely on being able to perform a roundtrip in order to bring each stream to completion since the wayland compositor must perform it's job of connecting a consumer to each EGLstream. Because Xwayland has to potentially handle both responding to the wayland compositor and it's own X clients, the situation of the wayland compositor being one of our X clients must be considered. If we perform a roundtrip with the Wayland compositor, it's possible that the wayland compositor might currently be connected to us as an X client and thus hang while both Xwayland and the wayland compositor await responses from eachother. To avoid this, we work directly with the wayland protocol and use wl_display_sync() events along with release() events to set up and destroy EGLStreams asynchronously alongside handling X clients. Additionally, since setting up EGLStreams is not an atomic operation we have to take into consideration the fact that an EGLStream can potentially be created in response to a window resize, then immediately deleted due to another pending window resize in the same X client's pending reqests before Xwayland hits the part of it's event loop where we read from the wayland compositor. To make this even more painful, we also have to take into consideration that since EGLStreams are not atomic that it's possible we could delete wayland resources for an EGLStream before the compositor even finishes using them and thus run into errors. So, we use quite a bit of tracking logic to keep EGLStream objects alive until we know the compositor isn't using them (even if this means the stream outlives the pixmap it backed). While the default backend for glamor remains GBM, this patch exists for users who have had to deal with the reprecussion of their GPU manufacturers ignoring the advice of upstream and the standardization of GBM across most major GPU manufacturers. It is not intended to be a final solution to the GBM debate, but merely a baindaid so our users don't have to suffer from the consequences of companies avoiding working upstream. New drivers are strongly encouraged not to use this as a backend, and use GBM like everyone else. We even spit this out as an error from Xwayland when using the eglstream backend. Signed-off-by: Lyude Paul <lyude@redhat.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-20 20:38:05 +02:00
AC_ARG_ENABLE(xwayland-eglstream, AS_HELP_STRING([--enable-xwayland-eglstream], [Build Xwayland eglstream support (default: no)]), [XWAYLAND_EGLSTREAM=$enableval], [XWAYLAND_EGLSTREAM=no])
2009-06-02 19:49:09 +02:00
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])
AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
AC_ARG_ENABLE(glamor, AS_HELP_STRING([--enable-glamor], [Build glamor dix module (default: auto)]), [GLAMOR=$enableval], [GLAMOR=auto])
dnl kdrive and its subsystems
AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
2005-12-28 02:01:06 +01:00
AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
dnl kdrive options
AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"])
AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-xshmfence], [Disable xshmfence (default: auto)]), [XSHMFENCE="$enableval"], [XSHMFENCE="auto"])
dnl chown/chmod to be setuid root as part of build
dnl Replaces InstallXserverSetUID in imake
AC_ARG_ENABLE(install-setuid,
AS_HELP_STRING([--enable-install-setuid],
[Install Xorg server as owned by root with setuid bit (default: auto)]),
[SETUID=$enableval], [SETUID=auto])
AC_MSG_CHECKING([to see if we can install the Xorg server as root])
if test "x$SETUID" = "xauto" ; then
case $host_os in
cygwin*) SETUID="no" ;;
mingw*) SETUID="no" ;;
darwin*) SETUID="no" ;;
*)
case $host_cpu in
sparc) SETUID="no" ;;
*) SETUID="yes" ;;
esac
esac
if test "x$SETUID" = xyes; then
touch testfile
chown root testfile > /dev/null 2>&1 || SETUID="no"
rm -f testfile
fi
fi
AC_MSG_RESULT([$SETUID])
AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"])
dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
2006-07-19 23:01:20 +02:00
dnl was not expanded, since xorg-server with no transport types is rather useless.
dnl
dnl If you're seeing an error here, be sure you installed the lib/xtrans module
dnl first and if it's not in the default location, that you set the ACLOCAL
dnl environment variable to find it, such as:
dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$])
# Transport selection macro from xtrans.m4
XTRANS_CONNECTION_FLAGS
2005-07-01 22:29:53 +02:00
# Secure RPC detection macro from xtrans.m4
XTRANS_SECURE_RPC_FLAGS
AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes])
2005-07-12 03:20:36 +02:00
AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
2005-07-14 05:32:09 +02:00
dnl DDX Detection... Yes, it's ugly to have it here... but we need to
dnl handle this early on so that we don't require unsupported extensions
case $host_os in
cygwin* | mingw*)
CONFIG_HAL=no
CONFIG_UDEV=no
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
CONFIG_UDEV_KMS=no
DGA=no
DRM=no
DRI2=no
DRI3=no
INT10MODULE=no
PCI=no
VGAHW=no
XF86UTILS=no
XF86VIDMODE=no
XSELINUX=no
SYMBOL_VISIBILITY=no
;;
darwin*)
PCI=no
INT10MODULE=no
VGAHW=no
DRM=no
DRI2=no
DRI3=no
if test x$XQUARTZ = xauto; then
AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -framework Carbon"
AC_LINK_IFELSE([AC_LANG_SOURCE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}])],
[xorg_cv_Carbon_framework=yes],
[xorg_cv_Carbon_framework=no])
LDFLAGS=$save_LDFLAGS])
if test "X$xorg_cv_Carbon_framework" = Xyes; then
XQUARTZ=yes
else
XQUARTZ=no
fi
fi
AC_CHECK_FUNC(dispatch_async,
AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]),
[])
if test "x$XQUARTZ" = xyes ; then
XQUARTZ=yes
XVFB=no
XNEST=no
XWAYLAND=no
COMPOSITE=no
DGA=no
DPMSExtension=no
XF86VIDMODE=no
fi
;;
gnu*)
DRM=no
DRI2=no
DRI3=no
;;
*) XQUARTZ=no ;;
esac
dnl ---------------------------------------------------------------------------
dnl Extension section
dnl ---------------------------------------------------------------------------
XEXT_INC='-I$(top_srcdir)/Xext'
XEXT_LIB='$(top_builddir)/Xext/libXext.la'
dnl Optional modules
VIDEOPROTO="videoproto"
COMPOSITEPROTO="compositeproto >= 0.4"
RECORDPROTO="recordproto >= 1.13.99.1"
SCRNSAVERPROTO="scrnsaverproto >= 1.1"
RESOURCEPROTO="resourceproto >= 1.2.0"
DRIPROTO="xf86driproto >= 2.1.0"
DRI2PROTO="dri2proto >= 2.8"
DRI3PROTO="dri3proto >= 1.2"
XINERAMAPROTO="xineramaproto"
BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
DGAPROTO="xf86dgaproto >= 2.0.99.1"
GLPROTO="glproto >= 1.4.17"
DMXPROTO="dmxproto >= 2.2.99.1"
VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
APPLEWMPROTO="applewmproto >= 1.4"
LIBXSHMFENCE="xshmfence >= 1.1"
dnl Required modules
XPROTO="xproto >= 7.0.31"
RANDRPROTO="randrproto >= 1.6.0"
RENDERPROTO="renderproto >= 0.11"
XEXTPROTO="xextproto >= 7.2.99.901"
INPUTPROTO="inputproto >= 2.3"
KBPROTO="kbproto >= 1.0.3"
FONTSPROTO="fontsproto >= 2.1.3"
FIXESPROTO="fixesproto >= 5.0"
DAMAGEPROTO="damageproto >= 1.1"
XCMISCPROTO="xcmiscproto >= 1.2.0"
BIGREQSPROTO="bigreqsproto >= 1.1.0"
XTRANS="xtrans >= 1.3.5"
PRESENTPROTO="presentproto >= 1.2"
dnl List of libraries that require a specific version
LIBAPPLEWM="applewm >= 1.4"
LIBDMX="dmx >= 1.0.99.1"
LIBDRI="dri >= 7.8.0"
Add RandR leases with modesetting driver support [v6] This adds support for RandR CRTC/Output leases through the modesetting driver, creating a lease using new kernel infrastructure and returning that to a client through an fd which will have access to only those resources. v2: Restore CRTC mode when leases terminate When a lease terminates for a crtc we have saved data for, go ahead and restore the saved mode. v3: Report RR_Rotate_0 rotations for leased crtcs. Ignore leased CRTCs when selecting screen size. Stop leasing encoders, the kernel doesn't do that anymore. Turn off crtc->enabled while leased so that modesetting ignores them. Check lease status before calling any driver mode functions When starting a lease, mark leased CRTCs as disabled and hide their cursors. Also, check to see if there are other non-leased CRTCs which are driving leased Outputs and mark them as disabled as well. Sometimes an application will lease an idle crtc instead of the one already associated with the leased output. When terminating a lease, reset any CRTCs which are driving outputs that are no longer leased so that they start working again. This required splitting the DIX level lease termination code into two pieces, one to remove the lease from the system (RRLeaseTerminated) and a new function that frees the lease data structure (RRLeaseFree). v4: Report RR_Rotate_0 rotation for leased crtcs. v5: Terminate all leases on server reset. Leases hang around after the associated client exits so that the client doesn't need to occupy an X server client slot and consume a file descriptor once it has gotten the output resources necessary. Any leases still hanging around when the X server resets or shuts down need to be cleaned up by calling the kernel to terminate the lease and freeing any DIX structures. Note that we cannot simply use the existing drmmode_terminate_lease function on each lease as that wants to also reset the video mode, and during server shut down that modesetting: Validate leases on VT enter The kernel doesn't allow any master ioctls to run when another VT is active, including simple things like listing the active leases. To deal with that, we check the list of leases whenever the X server VT is activated. xfree86: hide disabled cursors when resetting after lease termination The lessee may well have played with cursors and left one active on our screen. Just tell the kernel to turn it off. v6: Add meson build infrastructure [Also bumped libdrm requirement - ajax] Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-02-12 22:51:56 +01:00
LIBDRM="libdrm >= 2.4.89"
LIBEGL="egl"
LIBGBM="gbm >= 10.2.0"
LIBGL="gl >= 1.2"
LIBXEXT="xext >= 1.0.99.4"
LIBXFONT="xfont2 >= 2.0.0"
LIBXI="xi >= 1.2.99.1"
LIBXTST="xtst >= 1.0.99.2"
LIBPCIACCESS="pciaccess >= 0.12.901"
LIBUDEV="libudev >= 143"
LIBSELINUX="libselinux >= 2.0.86"
LIBDBUS="dbus-1 >= 1.0"
Use new pixman_glyph_cache_t API that will be in pixman 0.28.0 This new API allows glyphs to be cached in a data structure in pixman, and entire glyph strings to be composited in one go. Also bump pixman dependency to 0.27.2. Results from the cairo peformance test suite running against Xvfb with a screen size of 1680x1050@32bpp: Speedups ======== xlib firefox-talos-gfx 12416.63 -> 3603.93 3.45x speedup ██▌ xlib xfce4-terminal-a1 1727.57 -> 1048.85: 1.65x speedup ▋ xlib evolution 1370.49 -> 869.34: 1.58x speedup ▋ xlib gnome-terminal-vim 1832.83 -> 1251.94: 1.46x speedup ▌ xlib poppler 1519.70 -> 1204.05: 1.26x speedup ▎ xlib firefox-planet-gnome 6982.55 -> 5598.16: 1.25x speedup ▎ xlib ocitysmap 1142.77 -> 1071.53: 1.07x speedup ▏ No slowdowns were reported. Results of x11perf -aa10text: Before: 8000000 reps @ 0.0007 msec (1450000.0/sec) 8000000 reps @ 0.0007 msec (1460000.0/sec) 8000000 reps @ 0.0007 msec (1460000.0/sec) 8000000 reps @ 0.0007 msec (1470000.0/sec) 8000000 reps @ 0.0007 msec (1480000.0/sec) 40000000 trep @ 0.0007 msec (1460000.0/sec) After: 32000000 reps @ 0.0002 msec (4910000.0/sec) 32000000 reps @ 0.0002 msec (4830000.0/sec) 32000000 reps @ 0.0002 msec (4890000.0/sec) 32000000 reps @ 0.0002 msec (4830000.0/sec) 32000000 reps @ 0.0002 msec (4900000.0/sec) 160000000 trep @ 0.0002 msec (4870000.0/sec) Version 2: Destroy the glyph cache at server regen time Acked-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2012-05-30 11:19:08 +02:00
LIBPIXMAN="pixman-1 >= 0.27.2"
dnl Pixman is always required, but we separate it out so we can link
dnl specific modules against it
PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN)
REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau"
dnl Core modules for most extensions, et al.
SDK_REQUIRED_MODULES="$XPROTO $RANDRPROTO $RENDERPROTO $XEXTPROTO $INPUTPROTO $KBPROTO $FONTSPROTO $LIBPIXMAN"
# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
AC_SUBST(SDK_REQUIRED_MODULES)
AC_CHECK_DECL([PTHREAD_MUTEX_RECURSIVE], [HAVE_RECURSIVE_MUTEX=yes], [HAVE_RECURSIVE_MUTEX=no], [[#include <pthread.h>]])
THREAD_DEFAULT=no
if test "x$HAVE_RECURSIVE_MUTEX" = "xyes" ; then
THREAD_DEFAULT=yes
fi
case $host_os in
mingw*) THREAD_DEFAULT=no ;;
*)
esac
AC_ARG_ENABLE(input-thread, AS_HELP_STRING([--enable-input-thread],
[Enable input threads]),
[INPUTTHREAD=$enableval], [INPUTTHREAD=$THREAD_DEFAULT])
if test "x$INPUTTHREAD" = "xyes" ; then
AX_PTHREAD(,AC_MSG_ERROR([threaded input requested but no pthread support has been found]))
SYS_LIBS="$SYS_LIBS $PTHREAD_LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
AC_DEFINE(INPUTTHREAD, 1, [Use a separate input thread])
save_LIBS="$LIBS"
LIBS="$LIBS $SYS_LIBS"
dnl MacOS X 10.6 & higher
AC_MSG_CHECKING(for pthread_setname_np(const char*))
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[pthread_setname_np("example")])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID,1,
[Have function pthread_setname_np(const char*)])],
[AC_MSG_RESULT(no)])
dnl GNU libc 2.12 & higher, Solaris 11.3 & higher
AC_MSG_CHECKING(for pthread_setname_np(pthread_t, const char*))
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[pthread_setname_np(pthread_self(), "example")])],
[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITH_TID,1,
[Have function pthread_setname_np(pthread_t, const char*)])],
[AC_MSG_RESULT(no)])
LIBS="$save_LIBS"
fi
REQUIRED_MODULES="$FIXESPROTO $DAMAGEPROTO $XCMISCPROTO $XTRANS $BIGREQSPROTO $SDK_REQUIRED_MODULES"
dnl systemd socket activation
dnl activate the code in libxtrans that grabs systemd's socket fds
dnl libsystemd-daemon was moved into libsystemd in version 209
LIBSYSTEMD="libsystemd >= 209"
AC_ARG_WITH([systemd-daemon],
AS_HELP_STRING([--with-systemd-daemon],
[support systemd socket activation (default: auto)]),
[WITH_SYSTEMD_DAEMON=$withval], [WITH_SYSTEMD_DAEMON=auto])
if test "x$WITH_SYSTEMD_DAEMON" = "xyes" -o "x$WITH_SYSTEMD_DAEMON" = "xauto" ; then
PKG_CHECK_MODULES([SYSTEMD_DAEMON], [$LIBSYSTEMD],
[HAVE_SYSTEMD_DAEMON=yes;
LIBSYSTEMD_DAEMON="$LIBSYSTEMD"],
[PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
[HAVE_SYSTEMD_DAEMON=yes;
LIBSYSTEMD_DAEMON=libsystemd-daemon],
[HAVE_SYSTEMD_DAEMON=no])])
if test "x$HAVE_SYSTEMD_DAEMON" = xyes; then
AC_DEFINE(HAVE_SYSTEMD_DAEMON, 1, [Define to 1 if libsystemd-daemon is available])
REQUIRED_LIBS="$REQUIRED_LIBS $LIBSYSTEMD_DAEMON"
elif test "x$WITH_SYSTEMD_DAEMON" = xyes; then
AC_MSG_ERROR([systemd support requested but no library has been found])
fi
fi
AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test "x$HAVE_SYSTEMD_DAEMON" = "xyes"])
if test "x$CONFIG_UDEV" = xyes && test "x$CONFIG_HAL" = xyes; then
AC_MSG_ERROR([Hotplugging through both libudev and hal not allowed])
fi
PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
if test "x$CONFIG_UDEV" = xauto; then
CONFIG_UDEV="$HAVE_LIBUDEV"
fi
AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes])
if test "x$CONFIG_UDEV" = xyes; then
CONFIG_HAL=no
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
if test "x$CONFIG_UDEV_KMS" = xauto; then
CONFIG_UDEV_KMS="$HAVE_LIBUDEV"
fi
if ! test "x$HAVE_LIBUDEV" = xyes; then
AC_MSG_ERROR([udev configuration API requested, but libudev is not installed])
fi
AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug])
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
if test "x$CONFIG_UDEV_KMS" = xyes; then
AC_DEFINE(CONFIG_UDEV_KMS, 1, [Use libudev for kms enumeration])
fi
SAVE_LIBS=$LIBS
SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $UDEV_CFLAGS"
LIBS=$UDEV_LIBS
AC_CHECK_FUNCS([udev_monitor_filter_add_match_tag])
AC_CHECK_FUNCS([udev_enumerate_add_match_tag])
LIBS=$SAVE_LIBS
CFLAGS=$SAVE_CFLAGS
fi
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
AM_CONDITIONAL(CONFIG_UDEV_KMS, [test "x$CONFIG_UDEV_KMS" = xyes])
PKG_CHECK_MODULES(DBUS, $LIBDBUS, [HAVE_DBUS=yes], [HAVE_DBUS=no])
if test "x$HAVE_DBUS" = xyes; then
AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support])
fi
AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes])
PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no])
if test "x$CONFIG_HAL" = xauto; then
CONFIG_HAL="$HAVE_HAL"
fi
if test "x$CONFIG_HAL" = xyes; then
if ! test "x$HAVE_HAL" = xyes; then
AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.])
fi
AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API])
NEED_DBUS="yes"
fi
AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes])
if test "x$SYSTEMD_LOGIND" = xauto; then
if test "x$HAVE_DBUS" = xyes -a "x$CONFIG_UDEV" = xyes ; then
SYSTEMD_LOGIND=yes
else
SYSTEMD_LOGIND=no
fi
fi
if test "x$SYSTEMD_LOGIND" = xyes; then
if ! test "x$HAVE_DBUS" = xyes; then
AC_MSG_ERROR([systemd-logind requested, but D-Bus is not installed.])
fi
if ! test "x$CONFIG_UDEV" = xyes ; then
AC_MSG_ERROR([systemd-logind is only supported in combination with udev configuration.])
fi
AC_DEFINE(SYSTEMD_LOGIND, 1, [Enable systemd-logind integration])
NEED_DBUS="yes"
fi
AM_CONDITIONAL(SYSTEMD_LOGIND, [test "x$SYSTEMD_LOGIND" = xyes])
Xorg: Add a suid root wrapper With the recent systemd-logind changes it is possible to install the Xorg binary without suid root rights and still have everything working as it should *if* the user only has cards which are supported by kms. This commit adds a little suid root wrapper, which is a bit weird, first we strip the suid-root bit of the Xorg binary, and then we add a wrapper ? The function of this wrapper is to see if a system still needs root-rights, if it does not (it supports kms and the kms drivers are properly loaded), then it will immediately drop all elevated rights before executing the real Xorg binary. If it finds (some) cards which don't support kms, or no cards at all, then it will execute the Xorg server with elevated rights so that ie the nvidia binary driver and the vesa driver can keep working normally. To make it possible for security concious users who don't need the root rights to completely remove the wrapper, Xorg is started in a 3 step process when the wrapper is enabled during build time: 1) A simple shell script which checks if the wrapper is there, if it is it executes the wrapper, if not it directly executes the real Xorg binary 2) The wrapper gets executed, does its checks, normally drops all elevated rights and then executes the real Xorg binary 3) The real Xorg binary does its thing This allows distributions to put the wrapper binary in a separate package, and will allow users to remove this package. IE the plan with Fedora is to make "legacy" drivers depend on the wrapper pkg, and since our default install contains some legacy drivers it will be part of the default install, but users can later yum remove it (which will also automatically remove the legacy driver packages as those won't work without it anyways). The wrapper is loosely modelled after the existing Debian Xwrapper, it uses the same config-file + config-file format, and also allows restricting Xserver execution (through the wrapper) to console users only. There also is a new needs_root_rights config file directive, which can be used to override the auto-detection the wrapper does. Hopefully this will allow Debian to replace their own wrapper with this upstream one. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 16:41:14 +01:00
if test "x$SUID_WRAPPER" = xyes; then
dnl This is a define so that if some platforms want to put the wrapper
dnl somewhere else this can be easily changed
AC_DEFINE_DIR(SUID_WRAPPER_DIR, libexecdir, [Where to install the Xorg binary and Xorg.wrap])
Xorg: Add a suid root wrapper With the recent systemd-logind changes it is possible to install the Xorg binary without suid root rights and still have everything working as it should *if* the user only has cards which are supported by kms. This commit adds a little suid root wrapper, which is a bit weird, first we strip the suid-root bit of the Xorg binary, and then we add a wrapper ? The function of this wrapper is to see if a system still needs root-rights, if it does not (it supports kms and the kms drivers are properly loaded), then it will immediately drop all elevated rights before executing the real Xorg binary. If it finds (some) cards which don't support kms, or no cards at all, then it will execute the Xorg server with elevated rights so that ie the nvidia binary driver and the vesa driver can keep working normally. To make it possible for security concious users who don't need the root rights to completely remove the wrapper, Xorg is started in a 3 step process when the wrapper is enabled during build time: 1) A simple shell script which checks if the wrapper is there, if it is it executes the wrapper, if not it directly executes the real Xorg binary 2) The wrapper gets executed, does its checks, normally drops all elevated rights and then executes the real Xorg binary 3) The real Xorg binary does its thing This allows distributions to put the wrapper binary in a separate package, and will allow users to remove this package. IE the plan with Fedora is to make "legacy" drivers depend on the wrapper pkg, and since our default install contains some legacy drivers it will be part of the default install, but users can later yum remove it (which will also automatically remove the legacy driver packages as those won't work without it anyways). The wrapper is loosely modelled after the existing Debian Xwrapper, it uses the same config-file + config-file format, and also allows restricting Xserver execution (through the wrapper) to console users only. There also is a new needs_root_rights config file directive, which can be used to override the auto-detection the wrapper does. Hopefully this will allow Debian to replace their own wrapper with this upstream one. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 16:41:14 +01:00
SETUID="no"
fi
AM_CONDITIONAL(SUID_WRAPPER, [test "x$SUID_WRAPPER" = xyes])
if test "x$NEED_DBUS" = xyes; then
AC_DEFINE(NEED_DBUS, 1, [Enable D-Bus core])
fi
AM_CONDITIONAL(NEED_DBUS, [test "x$NEED_DBUS" = xyes])
if test "x$CONFIG_WSCONS" = xauto; then
case $host_os in
*openbsd*)
CONFIG_WSCONS=yes;
;;
*)
CONFIG_WSCONS=no;
;;
esac
fi
AM_CONDITIONAL(CONFIG_WSCONS, [test "x$CONFIG_WSCONS" = xyes])
if test "x$CONFIG_WSCONS" = xyes; then
AC_DEFINE(CONFIG_WSCONS, 1, [Use wscons for input auto configuration])
fi
AC_MSG_CHECKING([for glibc...])
AC_PREPROC_IFELSE([AC_LANG_SOURCE([
#include <features.h>
#ifndef __GLIBC__
#error
#endif
])], glibc=yes, glibc=no)
AC_MSG_RESULT([$glibc])
AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
[AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
[have_clock_gettime=no])])
AC_MSG_CHECKING([for a useful monotonic clock ...])
if ! test "x$have_clock_gettime" = xno; then
if ! test "x$have_clock_gettime" = xyes; then
CLOCK_LIBS="$have_clock_gettime"
else
CLOCK_LIBS=""
fi
LIBS_SAVE="$LIBS"
LIBS="$CLOCK_LIBS"
CPPFLAGS_SAVE="$CPPFLAGS"
if test x"$glibc" = xyes; then
CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L"
fi
AC_RUN_IFELSE([AC_LANG_SOURCE([
#include <time.h>
int main(int argc, char *argv[[]]) {
struct timespec tp;
if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
return 0;
else
return 1;
}
])], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
[MONOTONIC_CLOCK="cross compiling"])
if test "$MONOTONIC_CLOCK" = "cross compiling"; then
AC_CHECK_DECL([CLOCK_MONOTONIC],[MONOTONIC_CLOCK="guessing yes"],[MONOTONIC_CLOCK=no],[#include <time.h>])
fi
LIBS="$LIBS_SAVE"
CPPFLAGS="$CPPFLAGS_SAVE"
else
MONOTONIC_CLOCK=no
fi
AC_MSG_RESULT([$MONOTONIC_CLOCK])
if test "$MONOTONIC_CLOCK" = "guessing yes"; then
MONOTONIC_CLOCK=yes
fi
if test "x$MONOTONIC_CLOCK" = xyes; then
AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
LIBS="$LIBS $CLOCK_LIBS"
fi
AM_CONDITIONAL(XV, [test "x$XV" = xyes])
if test "x$XV" = xyes; then
AC_DEFINE(XV, 1, [Support Xv extension])
AC_DEFINE(XvExtension, 1, [Build Xv extension])
REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO"
else
XVMC=no
fi
AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes])
if test "x$XVMC" = xyes; then
AC_DEFINE(XvMCExtension, 1, [Build XvMC extension])
fi
AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
if test "x$COMPOSITE" = xyes; then
AC_DEFINE(COMPOSITE, 1, [Support Composite Extension])
REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO"
COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la'
COMPOSITE_INC='-I$(top_srcdir)/composite'
2005-07-01 22:29:53 +02:00
fi
if test "x$MITSHM" = xauto; then
MITSHM="$ac_cv_sysv_ipc"
fi
AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
if test "x$MITSHM" = xyes; then
AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
AC_DEFINE(HAS_SHM, 1, [Support SHM])
2005-07-01 22:29:53 +02:00
fi
AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes])
if test "x$RECORD" = xyes; then
AC_DEFINE(XRECORD, 1, [Support Record extension])
REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO"
RECORD_LIB='$(top_builddir)/record/librecord.la'
2005-07-01 22:29:53 +02:00
fi
AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes])
if test "x$SCREENSAVER" = xyes; then
AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension])
REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $SCRNSAVERPROTO"
2005-07-01 22:29:53 +02:00
fi
AM_CONDITIONAL(RES, [test "x$RES" = xyes])
if test "x$RES" = xyes; then
AC_DEFINE(RES, 1, [Support X resource extension])
REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $RESOURCEPROTO"
2005-07-01 22:29:53 +02:00
fi
if test "x$LISTEN_TCP" = xyes; then
AC_DEFINE(LISTEN_TCP, 1, [Listen on TCP socket])
fi
if test "x$LISTEN_UNIX" = xyes; then
AC_DEFINE(LISTEN_UNIX, 1, [Listen on Unix socket])
fi
if test "x$LISTEN_LOCAL" = xyes; then
AC_DEFINE(LISTEN_LOCAL, 1, [Listen on local socket])
fi
# The XRes extension may support client ID tracking only if it has
# been specifically enabled. Client ID tracking is implicitly not
# supported if XRes extension is disabled.
AC_MSG_CHECKING([whether to track client ids])
if test "x$RES" = xyes && test "x$CLIENTIDS" = xyes; then
AC_DEFINE(CLIENTIDS, 1, [Support client ID tracking])
else
CLIENTIDS=no
fi
if test "x$CLIENTIDS" = xyes; then
case $host_os in
openbsd*)
SYS_LIBS="$SYS_LIBS -lkvm"
;;
esac
fi
AC_MSG_RESULT([$CLIENTIDS])
AM_CONDITIONAL(CLIENTIDS, [test "x$CLIENTIDS" = xyes])
AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
if test "x$DRI" = xyes; then
AC_DEFINE(XF86DRI, 1, [Build DRI extension])
REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI"
2005-07-01 22:29:53 +02:00
fi
PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO,
[HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no])
case "$DRI2,$HAVE_DRI2PROTO" in
yes,no)
AC_MSG_ERROR([DRI2 requested, but dri2proto not found.])
;;
yes,yes | auto,yes)
AC_DEFINE(DRI2, 1, [Build DRI2 extension])
DRI2=yes
LIBGL="gl >= 1.2"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
;;
esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
2008-02-04 17:58:24 +01:00
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])
case "x$XTRANS_SEND_FDS" in
xauto)
case "$host_os" in
linux*|solaris*|freebsd*|dragonfly*|openbsd*)
XTRANS_SEND_FDS=yes
;;
*)
XTRANS_SEND_FDS=no
;;
esac
esac
case "x$XTRANS_SEND_FDS" in
xyes)
AC_DEFINE(XTRANS_SEND_FDS, 1, [Enable xtrans fd passing support])
;;
esac
case "$DRI3,$XTRANS_SEND_FDS" in
yes,yes | auto,yes)
;;
yes,no)
AC_MSG_ERROR([DRI3 requested, but xtrans fd passing support not found.])
DRI3=no
;;
no,*)
;;
*)
AC_MSG_NOTICE([DRI3 disabled because xtrans fd passing support not found.])
DRI3=no
;;
esac
PKG_CHECK_MODULES([DRI3PROTO], $DRI3PROTO,
[HAVE_DRI3PROTO=yes], [HAVE_DRI3PROTO=no])
case "$DRI3,$HAVE_DRI3PROTO" in
yes,yes | auto,yes)
REQUIRED_MODULES="$REQUIRED_MODULES dri3proto"
;;
yes,no)
AC_MSG_ERROR([DRI3 requested, but dri3proto not found.])
DRI3=no
;;
no,*)
;;
*)
AC_MSG_NOTICE([DRI3 disabled because dri3proto not found.])
DRI3=no
;;
esac
AC_CHECK_FUNCS([sigaction])
BUSFAULT=no
case x"$ac_cv_func_sigaction" in
xyes)
AC_DEFINE(HAVE_SIGACTION, 1, [Have sigaction function])
BUSFAULT=yes
;;
esac
case x"$BUSFAULT" in
xyes)
AC_DEFINE(BUSFAULT, 1, [Include busfault OS API])
;;
esac
AM_CONDITIONAL(BUSFAULT, test x"$BUSFAULT" = xyes)
PKG_CHECK_MODULES([XSHMFENCE], $LIBXSHMFENCE, [HAVE_XSHMFENCE=yes], [HAVE_XSHMFENCE=no])
if test "x$XSHMFENCE" = "xauto"; then
XSHMFENCE="$HAVE_XSHMFENCE"
fi
if test "x$XSHMFENCE" = "xyes"; then
if test "x$HAVE_XSHMFENCE" != "xyes"; then
AC_MSG_ERROR([xshmfence requested but not installed.])
fi
AC_DEFINE(HAVE_XSHMFENCE, 1, [Have xshmfence support])
REQUIRED_LIBS="$REQUIRED_LIBS $LIBXSHMFENCE"
fi
AM_CONDITIONAL(XSHMFENCE, [test "x$XSHMFENCE" = xyes])
case "$DRI3,$XSHMFENCE" in
yes,yes | auto,yes)
;;
yes,no)
AC_MSG_ERROR([DRI3 requested, but xshmfence not found.])
DRI3=no
;;
no,*)
;;
*)
AC_MSG_NOTICE([DRI3 disabled because xshmfence not found.])
DRI3=no
;;
esac
case x"$DRI3" in
xyes|xauto)
DRI3=yes
AC_DEFINE(DRI3, 1, [Build DRI3 extension])
DRI3_LIB='$(top_builddir)/dri3/libdri3.la'
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI3PROTO"
AC_MSG_NOTICE([DRI3 enabled]);
;;
esac
AM_CONDITIONAL(DRI3, test "x$DRI3" = xyes)
if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes || test "x$XORG" = xyes; then
if test "x$DRM" = xyes; then
AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
PKG_CHECK_MODULES([LIBDRM], $LIBDRM)
fi
fi
if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([XLIB], [x11])
PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la $(top_builddir)/glx/libglxvnd.la'
GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
else
GLX=no
fi
AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
AC_SUBST([GLX_DEFINES])
AC_SUBST([GLX_SYS_LIBS])
AM_CONDITIONAL(PRESENT, [test "x$PRESENT" = xyes])
if test "x$PRESENT" = xyes; then
AC_DEFINE(PRESENT, 1, [Support Present extension])
REQUIRED_MODULES="$REQUIRED_MODULES $PRESENTPROTO"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $PRESENTPROTO"
PRESENT_INC='-I$(top_srcdir)/present'
PRESENT_LIB='$(top_builddir)/present/libpresent.la'
fi
AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
if test "x$XINERAMA" = xyes; then
AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama])
REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO"
2005-07-01 22:29:53 +02:00
fi
AM_CONDITIONAL(XACE, [test "x$XACE" = xyes])
if test "x$XACE" = xyes; then
AC_DEFINE(XACE, 1, [Build X-ACE extension])
fi
AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes])
if test "x$XSELINUX" = xyes; then
if test "x$XACE" != xyes; then
AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
fi
AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
PKG_CHECK_MODULES([SELINUX], $LIBSELINUX)
SELINUX_LIBS="$SELINUX_LIBS -laudit"
AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
fi
AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
if test "x$XCSECURITY" = xyes; then
if test "x$XACE" != xyes; then
AC_MSG_ERROR([cannot build Security extension without X-ACE])
fi
AC_DEFINE(XCSECURITY, 1, [Build Security extension])
2005-07-01 22:29:53 +02:00
fi
AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
if test "x$DBE" = xyes; then
AC_DEFINE(DBE, 1, [Support DBE extension])
DBE_LIB='$(top_builddir)/dbe/libdbe.la'
DBE_INC='-I$(top_srcdir)/dbe'
fi
AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
if test "x$XF86BIGFONT" = xyes; then
AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension])
REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $BIGFONTPROTO"
fi
AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes])
if test "x$DPMSExtension" = xyes; then
AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
fi
AC_DEFINE(RENDER, 1, [Support RENDER extension])
RENDER_LIB='$(top_builddir)/render/librender.la'
RENDER_INC='-I$(top_srcdir)/render'
AC_DEFINE(RANDR, 1, [Support RANDR extension])
RANDR_LIB='$(top_builddir)/randr/librandr.la'
RANDR_INC='-I$(top_srcdir)/randr'
AC_DEFINE(XFIXES,1,[Support XFixes extension])
FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la'
FIXES_INC='-I$(top_srcdir)/xfixes'
AC_DEFINE(DAMAGE,1,[Support Damage extension])
DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
DAMAGE_INC='-I$(top_srcdir)/damageext'
MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'
# XINPUT extension is integral part of the server
AC_DEFINE(XINPUT, 1, [Support X Input extension])
XI_LIB='$(top_builddir)/Xi/libXi.la'
XI_INC='-I$(top_srcdir)/Xi'
AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes)
AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes)
AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes)
AC_DEFINE(SHAPE, 1, [Support SHAPE extension])
if test "x$XKBPATH" = "xauto"; then
XKBPATH=$(pkg-config --variable datadir xkbcomp || echo ${datadir})/X11/xkb
fi
AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data])
AC_ARG_WITH(xkb-bin-directory,
AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program (default: auto)]),
[XKB_BIN_DIRECTORY="$withval"],
[XKB_BIN_DIRECTORY="auto"])
if test "x$XKB_BIN_DIRECTORY" = "xauto"; then
XKB_BIN_DIRECTORY=$(pkg-config --variable bindir xkbcomp)
if test -z $XKB_BIN_DIRECTORY; then
XKB_BIN_DIRECTORY="$bindir"
fi
fi
AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir])
dnl Make sure XKM_OUTPUT_DIR is an absolute path
XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1`
if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then
XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT"
fi
dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed
dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused
XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'`
XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'`
AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir])
AC_SUBST(XKB_COMPILED_DIR)
if test "x$XKB_DFLT_RULES" = x; then
case $host_os in
linux*)
dnl doesn't take AutoAddDevices into account, but whatever.
XKB_DFLT_RULES="evdev"
;;
*)
XKB_DFLT_RULES="base"
;;
esac
fi
AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset])
AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model])
AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout])
AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant])
AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options])
AC_SUBST([XKB_DFLT_RULES])
AC_SUBST([XKB_DFLT_MODEL])
AC_SUBST([XKB_DFLT_LAYOUT])
AC_SUBST([XKB_DFLT_VARIANT])
AC_SUBST([XKB_DFLT_OPTIONS])
XKB_LIB='$(top_builddir)/xkb/libxkb.la'
XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
2005-07-01 22:29:53 +02:00
PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
if test "x$XDMCP" = xauto; then
if test "x$have_libxdmcp" = xyes; then
2005-07-01 22:29:53 +02:00
XDMCP=yes
else
XDMCP=no
fi
fi
if test "x$XDMAUTH" = xauto; then
if test "x$have_libxdmcp" = xyes; then
2005-07-01 22:29:53 +02:00
XDMAUTH=yes
else
XDMAUTH=no
fi
fi
AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes])
if test "x$XDMCP" = xyes; then
AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol])
REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
XDMCP_MODULES="xdmcp"
2005-07-01 22:29:53 +02:00
fi
AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes])
if test "x$XDMAUTH" = xyes; then
2005-07-01 22:29:53 +02:00
AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1])
if ! test "x$XDMCP" = xyes; then
REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
XDMCP_MODULES="xdmcp"
2005-07-01 22:29:53 +02:00
fi
fi
if test "x$XF86VIDMODE" = xauto; then
PKG_CHECK_EXISTS($VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no])
fi
if test "x$XF86VIDMODE" = xyes; then
AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
fi
AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes])
AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path])
AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path])
dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path])
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name])
AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name])
AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
2005-07-01 22:29:53 +02:00
AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string])
AC_SUBST([VENDOR_NAME_SHORT])
AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name])
AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name])
AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release])
AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
2005-07-01 22:29:53 +02:00
if test "x$DEBUGGING" = xyes; then
AC_DEFINE(DEBUG, 1, [Enable debugging code])
fi
AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
AC_DEFINE(XTEST, 1, [Support XTest extension])
AC_DEFINE(XSYNC, 1, [Support XSync extension])
AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then
DIX_LIB='$(top_builddir)/dix/dix.O'
os: use libunwind to generate backtraces Libunwind generates backtraces much more reliably than glibc's "backtrace". Before: 0: /opt/xserver/bin/X (0x400000+0x18ce36) [0x58ce36] 1: /opt/xserver/bin/X (xorg_backtrace+0x9) [0x58d119] 2: /opt/xserver/bin/X (0x400000+0x190d69) [0x590d69] 3: /lib64/libpthread.so.0 (0x7fb904268000+0x10a90) [0x7fb904278a90] 4: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987] 5: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8] 6: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b] 7: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719] 8: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (0x7fb90220e000+0x76f3) [0x7fb9022156f3] 9: /opt/xserver/lib/xorg/modules/libexa.so (0x7fb9019c7000+0xbae0) [0x7fb9019d2ae0] 10: /opt/xserver/bin/X (0x400000+0x17d2b3) [0x57d2b3] 11: /opt/xserver/bin/X (0x400000+0xc9930) [0x4c9930] 12: /opt/xserver/bin/X (0x400000+0x3a81a) [0x43a81a] 13: /opt/xserver/bin/X (0x400000+0x3d6a1) [0x43d6a1] 14: /opt/xserver/bin/X (0x400000+0x2c2ca) [0x42c2ca] 15: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5] 16: /opt/xserver/bin/X (0x400000+0x2c60d) [0x42c60d] 17: ?? [0x0] After: 0: /opt/xserver/bin/X (OsSigHandler+0x39) [0x590d69] 1: /lib64/libpthread.so.0 (__restore_rt+0x0) [0x7fb904278a8f] 2: /lib64/libc.so.6 (ioctl+0x7) [0x7fb902fbf987] 3: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x7fb90405ffa8] 4: /usr/lib64/libdrm.so.2 (drmCommandWrite+0x1b) [0x7fb90406235b] 5: /usr/lib64/libdrm_nouveau.so.2 (nouveau_bo_wait+0x89) [0x7fb902009719] 6: /opt/xserver/lib/xorg/modules/drivers/nouveau_drv.so (nouveau_exa_download_from_screen+0x1a3) [0x7fb9022156f3] 7: /opt/xserver/lib/xorg/modules/libexa.so (exaGetImage+0x1f0) [0x7fb9019d2ae0] 8: /opt/xserver/bin/X (miSpriteGetImage+0x173) [0x57d2b3] 9: /opt/xserver/bin/X (compGetImage+0xb0) [0x4c9930] 10: /opt/xserver/bin/X (ProcGetImage+0x55a) [0x43a81a] 11: /opt/xserver/bin/X (Dispatch+0x341) [0x43d6a1] 12: /opt/xserver/bin/X (main+0x3ba) [0x42c2ca] 13: /lib64/libc.so.6 (__libc_start_main+0xf5) [0x7fb902f019b5] 14: /opt/xserver/bin/X (_start+0x29) [0x42c60d] 15: ? (?+0x29) [0x29] Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Knut Petersen <knut.petersen@t-online.de>
2013-02-21 00:02:44 +01:00
OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS) $(LIBUNWIND_LIBS)'
else
DIX_LIB='$(top_builddir)/dix/libdix.la'
OS_LIB='$(top_builddir)/os/libos.la'
fi
AC_SUBST([DIX_LIB])
AC_SUBST([OS_LIB])
MAIN_LIB='$(top_builddir)/dix/libmain.la'
AC_SUBST([MAIN_LIB])
2005-07-01 22:29:53 +02:00
MI_LIB='$(top_builddir)/mi/libmi.la'
MI_EXT_LIB='$(top_builddir)/mi/libmiext.la'
MI_INC='-I$(top_srcdir)/mi'
2005-07-12 03:20:36 +02:00
FB_LIB='$(top_builddir)/fb/libfb.la'
2005-07-01 22:29:53 +02:00
FB_INC='-I$(top_srcdir)/fb'
MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync'
MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la'
2005-07-03 14:17:04 +02:00
CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
2005-07-01 22:29:53 +02:00
# SHA1 hashing
AC_ARG_WITH([sha1],
[AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
[choose SHA1 implementation])])
AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
with_sha1=libc
fi
if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then
AC_MSG_ERROR([libc requested but not found])
fi
if test "x$with_sha1" = xlibc; then
AC_DEFINE([HAVE_SHA1_IN_LIBC], [1],
[Use libc SHA1 functions])
SHA1_LIBS=""
fi
AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes])
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then
with_sha1=CommonCrypto
fi
if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then
AC_MSG_ERROR([CommonCrypto requested but not found])
fi
if test "x$with_sha1" = xCommonCrypto; then
AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1],
[Use CommonCrypto SHA1 functions])
SHA1_LIBS=""
fi
dnl stdcall functions cannot be tested with AC_CHECK_LIB
AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include <windows.h>])
if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then
with_sha1=CryptoAPI
fi
if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then
AC_MSG_ERROR([CryptoAPI requested but not found])
fi
if test "x$with_sha1" = xCryptoAPI; then
AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1],
[Use CryptoAPI SHA1 functions])
SHA1_LIBS=""
fi
AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
with_sha1=libmd
fi
if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
AC_MSG_ERROR([libmd requested but not found])
fi
if test "x$with_sha1" = xlibmd; then
AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
[Use libmd SHA1 functions])
SHA1_LIBS=-lmd
fi
PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
with_sha1=libsha1
fi
if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then
AC_MSG_ERROR([libsha1 requested but not found])
fi
if test "x$with_sha1" = xlibsha1; then
AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1],
[Use libsha1 for SHA1])
SHA1_LIBS=-lsha1
fi
AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
with_sha1=libnettle
fi
if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
AC_MSG_ERROR([libnettle requested but not found])
fi
if test "x$with_sha1" = xlibnettle; then
AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
[Use libnettle SHA1 functions])
SHA1_LIBS=-lnettle
fi
AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
with_sha1=libgcrypt
fi
if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then
AC_MSG_ERROR([libgcrypt requested but not found])
fi
if test "x$with_sha1" = xlibgcrypt; then
AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1],
[Use libgcrypt SHA1 functions])
SHA1_LIBS=-lgcrypt
fi
# We don't need all of the OpenSSL libraries, just libcrypto
AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes])
PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes],
[HAVE_OPENSSL_PKC=no])
if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then
if test "x$with_sha1" = x; then
with_sha1=libcrypto
fi
else
if test "x$with_sha1" = xlibcrypto; then
AC_MSG_ERROR([OpenSSL libcrypto requested but not found])
fi
fi
if test "x$with_sha1" = xlibcrypto; then
if test "x$HAVE_LIBCRYPTO" = xyes; then
SHA1_LIBS=-lcrypto
else
SHA1_LIBS="$OPENSSL_LIBS"
SHA1_CFLAGS="$OPENSSL_CFLAGS"
fi
fi
AC_MSG_CHECKING([for SHA1 implementation])
if test "x$with_sha1" = x; then
AC_MSG_ERROR([No suitable SHA1 implementation found])
fi
AC_MSG_RESULT([$with_sha1])
AC_SUBST(SHA1_LIBS)
AC_SUBST(SHA1_CFLAGS)
PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
PKG_CHECK_MODULES(LIBUNWIND, libunwind, [HAVE_LIBUNWIND=yes], [HAVE_LIBUNWIND=no])
if test "x$LIBUNWIND" = "xauto"; then
LIBUNWIND="$HAVE_LIBUNWIND"
fi
if test "x$LIBUNWIND" = "xyes"; then
if test "x$HAVE_LIBUNWIND" != "xyes"; then
AC_MSG_ERROR([libunwind requested but not installed.])
fi
AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
fi
AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$LIBUNWIND" = xyes])
# Autotools has some unfortunate issues with library handling. In order to
# get a server to rebuild when a dependency in the tree is changed, it must
# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be
# listed there, or some versions of autotools will break (especially if a -L
# is required to find the library). So, we keep two sets of libraries
# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which
# will go into the _DEPENDENCIES and _LDADD of the server, and
# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The
# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in
# NAMESPACE_SYS_LIBS.
#
# XSERVER_LIBS is the set of in-tree libraries which all servers require.
# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers
# require.
#
XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB"
XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
AC_SUBST([XSERVER_LIBS])
AC_SUBST([XSERVER_SYS_LIBS])
UTILS_SYS_LIBS="${SYS_LIBS}"
AC_SUBST([UTILS_SYS_LIBS])
# The Xorg binary needs to export symbols so that they can be used from modules
# Some platforms require extra flags to do this. libtool should set the
# necessary flags for each platform when -export-dynamic is passed to it.
LD_EXPORT_SYMBOLS_FLAG="-export-dynamic"
LD_NO_UNDEFINED_FLAG=
XORG_DRIVER_LIBS=
case "$host_os" in
cygwin*)
LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a"
LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a"
XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined"
CYGWIN=yes
;;
solaris*)
# We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT
# that we can link against for testing if the system linker is new
# enough to support -z parent=<program> for verifying loadable modules
# are only calling functions defined in either the loading program or
# the libraries they're linked with.
AC_LINK_IFELSE(
[AC_LANG_SOURCE([int main(int argc, char **argv) { return 0; }])],
[mv conftest$EXEEXT conftest.parent
XORG_CHECK_LINKER_FLAGS([-Wl,-z,parent=conftest.parent -G],
[LD_NO_UNDEFINED_FLAG="-Wl,-z,defs -Wl,-z,parent=\$(top_builddir)/hw/xfree86/Xorg"
# Not set yet, since this gets exported in xorg-server.pc to all the drivers,
# and they're not all fixed to build correctly with it yet.
# XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg"
],[],
[AC_LANG_SOURCE([extern int main(int argc, char **argv);
int call_main(void) { return main(0, (void *)0); }])])
rm -f conftest.parent
])
;;
esac
AC_SUBST([LD_EXPORT_SYMBOLS_FLAG])
AC_SUBST([LD_NO_UNDEFINED_FLAG])
AC_SUBST([XORG_DRIVER_LIBS])
AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes])
AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x])
dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
dnl we need to replicate that here until those can all be fixed
AC_MSG_CHECKING([if SVR4 needs to be defined])
AC_EGREP_CPP([I_AM_SVR4],[
#if defined(SVR4) || defined(__svr4__) || defined(__SVR4)
I_AM_SVR4
#endif
],[
AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
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"
dnl ---------------------------------------------------------------------------
dnl DDX section.
dnl ---------------------------------------------------------------------------
dnl Xvfb DDX
AC_MSG_CHECKING([whether to build Xvfb DDX])
AC_MSG_RESULT([$XVFB])
AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])
if test "x$XVFB" = xyes; then
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"
XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XVFB_LIBS])
AC_SUBST([XVFB_SYS_LIBS])
fi
dnl Xnest DDX
PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
AC_MSG_CHECKING([whether to build Xnest DDX])
if test "x$XNEST" = xauto; then
XNEST="$have_xnest"
fi
AC_MSG_RESULT([$XNEST])
AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])
if test "x$XNEST" = xyes; then
if test "x$have_xnest" = xno; then
AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.])
fi
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"
XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XNEST_LIBS])
AC_SUBST([XNEST_SYS_LIBS])
fi
dnl Xorg DDX
AC_MSG_CHECKING([whether to build Xorg DDX])
if test "x$XORG" = xauto; then
XORG="yes"
case $host_os in
cygwin*) XORG="no" ;;
mingw*) XORG="no" ;;
darwin*) XORG="no" ;;
esac
fi
AC_MSG_RESULT([$XORG])
if test "x$XORG" = xyes; then
XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
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"
dnl ==================================================================
dnl symbol visibility
symbol_visibility=
have_visibility=disabled
if test x$SYMBOL_VISIBILITY != xno; then
AC_MSG_CHECKING(for symbol visibility support)
if test x$GCC = xyes; then
VISIBILITY_CFLAGS="-fvisibility=hidden"
else
if test x$SUNCC = xyes; then
VISIBILITY_CFLAGS="-xldscope=hidden"
else
have_visibility=no
fi
fi
if test x$have_visibility != xno; then
save_CFLAGS="$CFLAGS"
proto_inc=`$PKG_CONFIG --cflags xproto`
CFLAGS="$CFLAGS $VISIBILITY_CFLAGS $proto_inc"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#include <X11/Xfuncproto.h>
extern _X_HIDDEN int hidden_int;
extern _X_EXPORT int public_int;
extern _X_HIDDEN int hidden_int_func(void);
extern _X_EXPORT int public_int_func(void);]],
[])],
have_visibility=yes,
have_visibility=no)
CFLAGS=$save_CFLAGS
fi
AC_MSG_RESULT([$have_visibility])
if test x$have_visibility != xno; then
symbol_visibility=$VISIBILITY_CFLAGS
XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS"
XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS"
fi
fi
dnl added to xorg-server.pc
AC_SUBST([symbol_visibility])
dnl ===================================================================
dnl ===================================================================
dnl ================= beginning of PCI configuration ==================
dnl ===================================================================
xorg_bus_bsdpci=no
xorg_bus_sparc=no
AC_MSG_CHECKING([whether to build Xorg PCI functions])
if test "x$PCI" = xyes; then
PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS)
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS"
XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $LIBDRM_LIBS"
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS"
AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation])
AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path])
case $host_os in
gnu* | freebsd* | kfreebsd*-gnu | netbsd* | openbsd* | solaris* | dragonfly*)
xorg_bus_bsdpci="yes"
;;
esac
case $host_cpu in
sparc*)
xorg_bus_sparc="yes"
;;
esac
else
if test "x$CONFIG_UDEV_KMS" = xyes; then
AC_MSG_ERROR([Platform device enumeration requires libpciaccess])
fi
if test "x$INT10MODULE" = xyes && test "x$INT10" != xstub; then
AC_MSG_ERROR([Cannot build int10 without libpciaccess])
fi
fi
AC_MSG_RESULT([$PCI])
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
if test "x$CONFIG_UDEV_KMS" = xyes; then
AC_DEFINE(XSERVER_PLATFORM_BUS, 1, [X server supports platform device enumeration])
fi
AC_MSG_RESULT([$XSERVER_PLATFORM_BUS])
dnl ===================================================================
dnl ==================== end of PCI configuration =====================
dnl ===================================================================
case $host_os in
linux*)
XORG_OS_SUBDIR="linux"
linux_acpi="no"
case $host_cpu in
i*86|amd64*|x86_64*|ia64*)
linux_acpi=$enable_linux_acpi
;;
*)
;;
esac
dnl APM header
AC_CHECK_HEADERS([linux/apm_bios.h], [linux_apm=$enable_linux_apm])
;;
freebsd* | kfreebsd*-gnu | dragonfly*)
XORG_OS_SUBDIR="bsd"
;;
netbsd*)
XORG_OS_SUBDIR="bsd"
;;
openbsd*)
XORG_OS_SUBDIR="bsd"
;;
solaris*)
XORG_OS_SUBDIR="solaris"
AC_CHECK_HEADERS([sys/kd.h])
AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no])
# Check for minimum supported release
AC_MSG_CHECKING([Solaris version])
OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'`
if test "${OS_MINOR}" -ge 7 ; then
AC_MSG_RESULT(Solaris ${OS_MINOR})
else
AC_MSG_RESULT(Solaris `echo ${host_os}|$SED -e 's/^.*solaris//`)
fi
if test "${OS_MINOR}" -lt 8 ; then
AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.])
fi
AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
case $host_cpu in
sparc*)
SOLARIS_INOUT_ARCH="sparcv8plus"
;;
i*86|x86_64*)
if test x$SOLARIS_64 = xyes ; then
SOLARIS_INOUT_ARCH="amd64"
else
SOLARIS_INOUT_ARCH="ia32"
fi
;;
*)
AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \
are supported on Solaris in this release. If you are \
interested in porting Xorg to your platform, please email \
xorg@lists.freedesktop.org.]) ;;
esac
AC_SUBST([SOLARIS_INOUT_ARCH])
;;
gnu*)
XORG_OS_SUBDIR="hurd"
;;
cygwin*)
XORG_OS_SUBDIR="stub"
;;
*)
XORG_OS_SUBDIR="stub"
AC_MSG_NOTICE([m4_text_wrap(m4_join([ ],
[Your OS is unknown.],
[If you are interested in porting Xorg to your platform,],
[please email xorg@lists.freedesktop.org.]))])
;;
esac
2007-02-18 23:09:51 +01:00
if test "x$DGA" = xauto; then
PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no])
2007-02-18 23:09:51 +01:00
fi
if test "x$DGA" = xyes; then
XORG_MODULES="$XORG_MODULES $DGAPROTO"
PKG_CHECK_MODULES(DGA, $DGAPROTO)
2007-02-18 23:09:51 +01:00
AC_DEFINE(DGA, 1, [Support DGA extension])
AC_DEFINE(XFreeXDGA, 1, [Build XDGA support])
fi
if test "x$XF86VIDMODE" = xyes; then
XORG_MODULES="$XORG_MODULES $VIDMODEPROTO"
2007-02-18 23:09:51 +01:00
fi
if test -n "$XORG_MODULES"; then
PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES])
XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS"
XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS"
2007-02-18 23:09:51 +01:00
fi
if test "x$DRM" = xyes; then
XORG_DRIVER_MODESETTING=yes
fi
AC_SUBST([XORG_LIBS])
AC_SUBST([XORG_SYS_LIBS])
AC_SUBST([XORG_INCS])
AC_SUBST([XORG_OS_SUBDIR])
AC_SUBST([XORG_CFLAGS])
dnl these only go in xorg-config.h
XF86CONFIGFILE="xorg.conf"
XF86CONFIGDIR="xorg.conf.d"
AC_SUBST(XF86CONFIGDIR)
LOGPREFIX="Xorg."
XDG_DATA_HOME=".local/share"
XDG_DATA_HOME_LOGDIR="xorg"
AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
AC_DEFINE_DIR(XCONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file])
AC_DEFINE_DIR(XCONFIGDIR, XF86CONFIGDIR, [Name of configuration directory])
AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path])
AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path])
AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default logfile prefix])
AC_DEFINE_DIR(DEFAULT_XDG_DATA_HOME, XDG_DATA_HOME, [Default XDG_DATA dir under HOME])
AC_DEFINE_DIR(DEFAULT_XDG_DATA_HOME_LOGDIR, XDG_DATA_HOME_LOGDIR, [Default log dir under XDG_DATA_HOME])
AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
if test "x$VGAHW" = xyes; then
AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module])
fi
driverdir="$moduledir/drivers"
AC_SUBST([moduledir])
AC_SUBST([driverdir])
sdkdir="$includedir/xorg"
extdir="$includedir/X11/extensions"
sysconfigdir="$datadir/X11/$XF86CONFIGDIR"
AC_SUBST([sdkdir])
AC_SUBST([extdir])
AC_SUBST([sysconfigdir])
AC_SUBST([logdir])
# stuff the ABI versions into the pc file too
extract_abi() {
grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }'
}
abi_ansic=`extract_abi ANSIC`
abi_videodrv=`extract_abi VIDEODRV`
abi_xinput=`extract_abi XINPUT`
abi_extension=`extract_abi EXTENSION`
2008-04-10 21:36:19 +02:00
AC_SUBST([abi_ansic])
AC_SUBST([abi_videodrv])
AC_SUBST([abi_xinput])
AC_SUBST([abi_extension])
fi
AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
AM_CONDITIONAL([XORG_BUS_PCI], [test "x$PCI" = xyes])
AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes])
AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes])
AM_CONDITIONAL([LNXAPM], [test "x$linux_apm" = xyes])
AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes])
AM_CONDITIONAL([DGA], [test "x$DGA" = xyes])
xfree86: use udev to provide device enumeration for kms devices (v10) On Linux in order for future hotplug work, we are required to interface to udev to detect device creation/removal. In order to try and get some earlier testing on this, this patch adds the ability to use udev for device enumeration on Linux. At startup the list of drm/kms devices is probed and this info is used to load drivers. A new driver probing method is introduced that passes the udev device info to the driver for probing. The probing integrates with the pci probing code and will fallback to the pci probe and old school probe functions in turn. The flags parameter to the probe function will be used later to provide hotplug and gpu screen flags for the driver to behave in a different way. This patch changes the driver ABI, all drivers should at least be set with a NULL udev probe function after this commit. v2: rename to platform bus, now with 100% less udev specific, this version passes config_odev_attribs around which are an array of id/string pairs, then the udev code can attach the set of attribs it understands, the OS specific code can attach its attrib, and then the core/drivers can lookup the required attribs. also add MATCH_PCI_DEVICES macro. This version is mainly to address concerns raised by ajax. v3: Address comments from Peter. fix whitespace that snuck in. rework to use a linked list with some core functions that xf86 wraps. v4: add free list, fix struct whitespace. ajax this address most of your issues? v5: drop probe ifdef, fix logic issue v6: some overhaul after more testing. Implement primaryBus for platform devices. document hotplug.h dev attribs - drop sysname attrib fix build with udev kms disabled make probing work like the PCI probe code, match against bus id if one exists, or primary device. RFC: add new bus id support "PLAT:syspath". we probably want to match on this a bit different, or use a different property maybe. I was mainly wanting this for use with specifying usb devices in xorg.conf directly, but PLAT:path could also work I suppose. v6.1: add missing noop platform function v7: fix two interactions with pci probing and slot claiming, prevents pci and platform trying to load two drivers for same slot. v8: test with zaphod mode on -ati driver, fixup resulting issue clean up common probe code into another function, change busid matching to allow dropping end of strings. v9: fix platform probing logic so it actually works. v9.1: fix pdev init to NULL properly. v10: address most of Keith's concerns. v4 was thanks to Reviewed-by: Adam Jackson <ajax@redhat.com> v5 was Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-05-08 15:26:47 +02:00
AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes])
AM_CONDITIONAL([XORG_DRIVER_MODESETTING], [test "x$XORG_DRIVER_MODESETTING" = xyes])
dnl glamor
if test "x$GLAMOR" = xauto; then
if echo "$XORG" "$XEPHYR" "$XWAYLAND" | grep -q yes ; then
GLAMOR=yes
fi
fi
AM_CONDITIONAL([GLAMOR], [test "x$GLAMOR" = xyes])
if test "x$GLAMOR" = xyes; then
AC_DEFINE(GLAMOR, 1, [Build glamor])
PKG_CHECK_MODULES([GLAMOR], [epoxy])
PKG_CHECK_EXISTS(epoxy >= 1.4.4,
[AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DMABUF, 1, [Have GLAMOR_HAS_EGL_QUERY_DMABUF])],
[])
PKG_CHECK_EXISTS(epoxy >= 1.5.4,
[AC_DEFINE(GLAMOR_HAS_EGL_QUERY_DRIVER, 1, [Have GLAMOR_HAS_EGL_QUERY_DRIVER])],
[])
PKG_CHECK_MODULES(GBM, "$LIBGBM", [GBM=yes], [GBM=no])
if test "x$GBM" = xyes; then
AC_DEFINE(GLAMOR_HAS_GBM, 1,
[Build glamor with GBM-based EGL support])
AC_CHECK_DECL(GBM_BO_USE_LINEAR,
[AC_DEFINE(GLAMOR_HAS_GBM_LINEAR, 1, [Have GBM_BO_USE_LINEAR])], [],
[#include <stdlib.h>
#include <gbm.h>])
dnl 17.1.0 is required for gbm_bo_create_with_modifiers
PKG_CHECK_EXISTS(gbm >= 17.1.0,
[AC_DEFINE(GBM_BO_WITH_MODIFIERS, 1, [Have gbm_bo_create_with_modifiers])],
[])
else
if test "x$XORG" = xyes; then
AC_MSG_ERROR([Glamor for Xorg requires $LIBGBM])
fi
fi
fi
AM_CONDITIONAL([GLAMOR_EGL], [test "x$GBM" = xyes])
dnl XWin DDX
AC_MSG_CHECKING([whether to build XWin DDX])
if test "x$XWIN" = xauto; then
case $host_os in
cygwin*) XWIN="yes" ;;
mingw*) XWIN="yes" ;;
*) XWIN="no" ;;
esac
fi
AC_MSG_RESULT([$XWIN])
if test "x$XWIN" = xyes; then
AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location])
AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
AC_CHECK_TOOL(WINDRES, windres)
PKG_CHECK_MODULES([XWINMODULES],[xcb-aux xcb-composite xcb-image xcb-ewmh xcb-icccm xcb-xfixes])
Add Windows-DRI extension If windowsdriproto headers are available, build a Windows-DRI extension, which supports requests to enable local clients to directly render GL to a Windows drawable: - a query to check if WGL is being used on a screen - a query to map a fbconfigID to a native pixelformatindex - a query to map a drawable to a native handle Windows-DRI can only be useful if we are using WGL, so make an note if WGL is active on a screen. Make validGlxDrawable() public Adjust glxWinSetPixelFormat() so it doesn't require a context, just a screen and config. That enables factoring out the deferred drawable creation code as glxWinDeferredCreateDrawable() Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a file mapping, so they exist in memory which can be shared with the direct rendering process. Currently, this file mapping is accessed by a name generated from the XID. This will not be unique across multiple server instances. It would perhaps be better, although more complicated, to use an anonymous file mapping, and then duplicate the handle for the direct rendering process. Use glxWinDeferredCreateDrawable() to ensure the native handle exists for the Windows-DRI query to map a drawable to native handle. v2: Various printf format warning fixes v3: Fix format warnings on x86 Move some uninteresting windows-dri output to debug log level v4: check for windowsdriproto when --enable-windowsdri use windowsdriproto_CFLAGS Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-07-24 13:29:41 +02:00
if test "x$WINDOWSDRI" = xauto; then
PKG_CHECK_EXISTS([windowsdriproto], [WINDOWSDRI=yes], [WINDOWSDRI=no])
fi
if test "x$WINDOWSDRI" = xyes ; then
PKG_CHECK_MODULES(WINDOWSDRI, [windowsdriproto])
fi
case $host_os in
cygwin*)
XWIN_SERVER_NAME=XWin
AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages])
;;
mingw*)
XWIN_SERVER_NAME=Xming
AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location])
AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets])
XWIN_SYS_LIBS="-lpthread -lws2_32"
;;
esac
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"
XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS"
AC_SUBST(XWIN_LIBS)
AC_SUBST(XWIN_SERVER_NAME)
AC_SUBST(XWIN_SYS_LIBS)
if test "x$DEBUGGING" = xyes; then
AC_DEFINE(CYGDEBUG, 1, [Simple debug messages])
AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling])
AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager])
fi
AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF])
AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ])
dnl XWin requires OpenGL spec files in order to generate wrapper code for native GL functions
if [test "x$XWIN" = xyes && test "x$GLX" = xyes] ; then
AC_CHECK_PROG(PYTHON3, python3, python3)
if test -z "$PYTHON3"; then
AC_MSG_ERROR([python3 not found])
fi
AC_MSG_CHECKING(for python module lxml)
$PYTHON3 -c "import lxml;"
if test $? -ne 0 ; then
AC_MSG_ERROR([not found])
fi
AC_MSG_RESULT(yes)
if test "x$KHRONOS_SPEC_DIR" = "xauto" ; then
PKG_CHECK_MODULES([KHRONOS_OPENGL_REGISTRY], [khronos-opengl-registry])
KHRONOS_SPEC_DIR=`pkg-config khronos-opengl-registry --variable=specdir`
fi
AC_SUBST(KHRONOS_SPEC_DIR)
fi
fi
AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
Add Windows-DRI extension If windowsdriproto headers are available, build a Windows-DRI extension, which supports requests to enable local clients to directly render GL to a Windows drawable: - a query to check if WGL is being used on a screen - a query to map a fbconfigID to a native pixelformatindex - a query to map a drawable to a native handle Windows-DRI can only be useful if we are using WGL, so make an note if WGL is active on a screen. Make validGlxDrawable() public Adjust glxWinSetPixelFormat() so it doesn't require a context, just a screen and config. That enables factoring out the deferred drawable creation code as glxWinDeferredCreateDrawable() Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a file mapping, so they exist in memory which can be shared with the direct rendering process. Currently, this file mapping is accessed by a name generated from the XID. This will not be unique across multiple server instances. It would perhaps be better, although more complicated, to use an anonymous file mapping, and then duplicate the handle for the direct rendering process. Use glxWinDeferredCreateDrawable() to ensure the native handle exists for the Windows-DRI query to map a drawable to native handle. v2: Various printf format warning fixes v3: Fix format warnings on x86 Move some uninteresting windows-dri output to debug log level v4: check for windowsdriproto when --enable-windowsdri use windowsdriproto_CFLAGS Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-07-24 13:29:41 +02:00
AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])
dnl Darwin / OS X DDX
if test "x$XQUARTZ" = xyes; then
AC_DEFINE(XQUARTZ,1,[Have Quartz])
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
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"
AC_SUBST([XQUARTZ_LIBS])
AC_CHECK_LIB([Xplugin],[xp_init],[:])
CFLAGS="${CFLAGS} -DROOTLESS_WORKAROUND -DROOTLESS_SAFEALPHA -DNO_ALLOCA"
PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11)
if test "x$XQUARTZ_SPARKLE" = xyes ; then
AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.])
fi
if test "x$STANDALONE_XPBPROXY" = xyes ; then
AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy])
fi
fi
AM_CONDITIONAL(PSEUDORAMIX, [test "x$XQUARTZ" = xyes -o "x$XWIN" = xyes ])
# Support for objc in autotools is minimal and not documented.
OBJC='$(CC)'
OBJCLD='$(CCLD)'
OBJCLINK='$(LINK)'
OBJCFLAGS='$(CFLAGS)'
AC_SUBST([OBJC])
AC_SUBST([OBJCCLD])
AC_SUBST([OBJCLINK])
AC_SUBST([OBJCFLAGS])
# internal, undocumented automake func follows :(
_AM_DEPENDENCIES([OBJC])
AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes])
AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"])
AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes])
dnl DMX DDX
PKG_CHECK_MODULES(
[DMXMODULES],
[xmuu $LIBXEXT x11 >= 1.6 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES],
[PKG_CHECK_MODULES(
[XDMXCONFIG_DEP],
[xaw7 xmu xt xpm x11],
[have_dmx=yes],
[have_dmx=no])],
[have_dmx=no])
AC_MSG_CHECKING([whether to build Xdmx DDX])
2007-12-17 04:45:15 +01:00
if test "x$DMX" = xauto; then
DMX="$have_dmx"
case $host_os in
cygwin*) DMX="no" ;;
mingw*) DMX="no" ;;
darwin*) DMX="no" ;;
esac
2007-12-17 04:45:15 +01:00
fi
2007-12-15 23:00:19 +01:00
AC_MSG_RESULT([$DMX])
AM_CONDITIONAL(DMX, [test "x$DMX" = xyes])
2007-12-17 04:45:15 +01:00
if test "x$DMX" = xyes; then
if test "x$have_dmx" = xno; then
AC_MSG_ERROR([Xdmx build explicitly requested, but required
modules not found.])
fi
2008-06-25 15:52:36 +02:00
DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC"
XDMX_CFLAGS="$DMXMODULES_CFLAGS"
XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $RANDR_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB"
XDMX_SYS_LIBS="$DMXMODULES_LIBS"
AC_SUBST([XDMX_CFLAGS])
AC_SUBST([XDMX_LIBS])
AC_SUBST([XDMX_SYS_LIBS])
2007-12-17 04:45:15 +01:00
dnl USB sources in DMX require <linux/input.h>
AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes",
DMX_BUILD_USB="no")
AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
AC_SUBST(XDMXCONFIG_DEP_LIBS)
PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11])
AC_SUBST(DMXEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11])
AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11])
AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11])
AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11])
AC_SUBST(XRESEXAMPLES_DEP_LIBS)
PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11])
AC_SUBST(X11EXAMPLES_DEP_LIBS)
2007-12-17 04:45:15 +01:00
fi
AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes])
dnl kdrive DDX
XEPHYR_LIBS=
2005-12-28 02:01:06 +01:00
XEPHYR_INCS=
AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes])
if test "$KDRIVE" = yes; then
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"
if test "x$XV" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xcb-xv"
fi
2008-04-23 16:45:54 +02:00
if test "x$DRI" = xyes && test "x$GLX" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBDRM xcb-glx xcb-xf86dri > 1.6"
2008-04-23 16:45:54 +02:00
fi
if test "x$GLAMOR" = xyes; then
XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS x11-xcb"
fi
2008-04-23 16:45:54 +02:00
if test "x$XEPHYR" = xauto; then
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [XEPHYR="yes"], [XEPHYR="no"])
elif test "x$XEPHYR" = xyes ; then
PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS)
fi
# Xephyr needs nanosleep() which is in librt on Solaris
AC_CHECK_FUNC([nanosleep], [],
AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt"))
# damage shadow extension glx (NOTYET) fb mi
KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src'
KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC"
KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux'
2005-12-28 02:01:06 +01:00
KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC"
KDRIVE_CFLAGS="$XSERVER_CFLAGS"
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"
KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la'
KDRIVE_MAIN_LIB="$MAIN_LIB"
KDRIVE_LOCAL_LIBS="$DIX_LIB $KDRIVE_LIB"
KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS"
KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB"
KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS"
AC_SUBST([XEPHYR_LIBS])
AC_SUBST([XEPHYR_INCS])
fi
AC_SUBST([KDRIVE_INCS])
AC_SUBST([KDRIVE_PURE_INCS])
AC_SUBST([KDRIVE_CFLAGS])
AC_SUBST([KDRIVE_PURE_LIBS])
AC_SUBST([KDRIVE_MAIN_LIB])
AC_SUBST([KDRIVE_LOCAL_LIBS])
AC_SUBST([KDRIVE_LIBS])
AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])
2005-12-28 02:01:06 +01:00
dnl Xwayland DDX
XWAYLANDMODULES="wayland-client >= 1.3.0 wayland-protocols >= 1.18"
if test "x$XF86VIDMODE" = xyes; then
XWAYLANDMODULES="$XWAYLANDMODULES $VIDMODEPROTO"
fi
if test "x$DRM" = xyes; then
XWAYLANDMODULES="$XWAYLANDMODULES $LIBDRM"
fi
if test "x$GLAMOR" = xyes; then
XWAYLANDMODULES="$XWAYLANDMODULES epoxy"
fi
PKG_CHECK_MODULES(XWAYLANDMODULES, [$XWAYLANDMODULES], [have_xwayland=yes], [have_xwayland=no])
AC_MSG_CHECKING([whether to build Xwayland DDX])
if test "x$XWAYLAND" = xauto; then
XWAYLAND="$have_xwayland"
fi
AC_MSG_RESULT([$XWAYLAND])
AM_CONDITIONAL(XWAYLAND, [test "x$XWAYLAND" = xyes])
if test "x$XWAYLAND" = xyes; then
if test "x$have_xwayland" = xno; then
AC_MSG_ERROR([Xwayland build explicitly requested, but required modules not found.])
fi
if test "x$GLAMOR" = xyes && test "x$GBM" = xyes; then
AC_DEFINE(XWL_HAS_GLAMOR, 1,
[Build xwayland with glamor support])
fi
xwayland: Add glamor egl_backend for EGLStreams This adds initial support for displaying Xwayland applications through the use of EGLStreams and nvidia's custom wayland protocol by adding another egl_backend driver. This also adds some additional egl_backend hooks that are required to make things work properly. EGLStreams work a lot differently then the traditional way of handling buffers with wayland. Unfortunately, there are also a LOT of various pitfalls baked into it's design that need to be explained. This has a very large and unfortunate implication: direct rendering is, for the time being at least, impossible to do through EGLStreams. The main reason being that the EGLStream spec mandates that we lose the entire color buffer contents with each eglSwapBuffers(), which goes against X's requirement of not losing data with pixmaps. no way to use an allocated EGLSurface as the storage for glamor rendering like we do with GBM, we have to rely on blitting each pixmap to it's respective EGLSurface producer each frame. In order to pull this off, we add two different additional egl_backend hooks that GBM opts out of implementing: - egl_backend.allow_commits for holding off displaying any EGLStream backed pixmaps until the point where it's stream is completely initialized and ready for use - egl_backend.post_damage for blitting the content of the EGLStream surface producer before Xwayland actually damages and commits the wl_surface to the screen. The other big pitfall here is that using nvidia's wayland-eglstreams helper library is also not possible for the most part. All of it's API for creating and destroying streams rely on being able to perform a roundtrip in order to bring each stream to completion since the wayland compositor must perform it's job of connecting a consumer to each EGLstream. Because Xwayland has to potentially handle both responding to the wayland compositor and it's own X clients, the situation of the wayland compositor being one of our X clients must be considered. If we perform a roundtrip with the Wayland compositor, it's possible that the wayland compositor might currently be connected to us as an X client and thus hang while both Xwayland and the wayland compositor await responses from eachother. To avoid this, we work directly with the wayland protocol and use wl_display_sync() events along with release() events to set up and destroy EGLStreams asynchronously alongside handling X clients. Additionally, since setting up EGLStreams is not an atomic operation we have to take into consideration the fact that an EGLStream can potentially be created in response to a window resize, then immediately deleted due to another pending window resize in the same X client's pending reqests before Xwayland hits the part of it's event loop where we read from the wayland compositor. To make this even more painful, we also have to take into consideration that since EGLStreams are not atomic that it's possible we could delete wayland resources for an EGLStream before the compositor even finishes using them and thus run into errors. So, we use quite a bit of tracking logic to keep EGLStream objects alive until we know the compositor isn't using them (even if this means the stream outlives the pixmap it backed). While the default backend for glamor remains GBM, this patch exists for users who have had to deal with the reprecussion of their GPU manufacturers ignoring the advice of upstream and the standardization of GBM across most major GPU manufacturers. It is not intended to be a final solution to the GBM debate, but merely a baindaid so our users don't have to suffer from the consequences of companies avoiding working upstream. New drivers are strongly encouraged not to use this as a backend, and use GBM like everyone else. We even spit this out as an error from Xwayland when using the eglstream backend. Signed-off-by: Lyude Paul <lyude@redhat.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-20 20:38:05 +02:00
PKG_CHECK_MODULES(WAYLAND_EGLSTREAM, [wayland-eglstream-protocols >= 1.0.2], [have_wl_eglstream=yes], [have_wl_eglstream=no])
if test "x$XWAYLAND_EGLSTREAM" = xauto; then
if test "x$have_wl_eglstream" = xyes && test "x$GLAMOR" = xyes; then
XWAYLAND_EGLSTREAM=yes
fi
fi
if test "x$XWAYLAND_EGLSTREAM" = xyes; then
if test "x$GLAMOR" != xyes; then
AC_MSG_ERROR([Xwayland eglstream support explicitly requested, but required modules not found.])
fi
if test "x$have_wl_eglstream" = xno; then
AC_MSG_ERROR([Xwayland eglstream support requires wayland-eglstream-protocols >= 1.0.2])
fi
AC_SUBST(WAYLAND_EGLSTREAM_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-eglstream-protocols`)
AC_DEFINE(XWL_HAS_EGLSTREAM, 1,
[Build xwayland with eglstream support])
fi
XWAYLAND_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB $DIX_LIB $OS_LIB"
XWAYLAND_SYS_LIBS="$XWAYLANDMODULES_LIBS $GLX_SYS_LIBS"
AC_SUBST([XWAYLAND_LIBS])
AC_SUBST([XWAYLAND_SYS_LIBS])
if test "x$MONOTONIC_CLOCK" != xyes; then
AC_MSG_ERROR([Xwayland requires CLOCK_MONOTONIC support.])
fi
AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner])
if test "x$WAYLAND_SCANNER" = x; then
PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
AC_SUBST(WAYLAND_SCANNER, `$PKG_CONFIG --variable=wayland_scanner wayland-scanner`)
fi
PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner >= 1.14.91],
AC_SUBST(SCANNER_ARG, 'private-code'),
AC_SUBST(SCANNER_ARG, 'code'))
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, `$PKG_CONFIG --variable=pkgdatadir wayland-protocols`)
fi
xwayland: Add glamor egl_backend for EGLStreams This adds initial support for displaying Xwayland applications through the use of EGLStreams and nvidia's custom wayland protocol by adding another egl_backend driver. This also adds some additional egl_backend hooks that are required to make things work properly. EGLStreams work a lot differently then the traditional way of handling buffers with wayland. Unfortunately, there are also a LOT of various pitfalls baked into it's design that need to be explained. This has a very large and unfortunate implication: direct rendering is, for the time being at least, impossible to do through EGLStreams. The main reason being that the EGLStream spec mandates that we lose the entire color buffer contents with each eglSwapBuffers(), which goes against X's requirement of not losing data with pixmaps. no way to use an allocated EGLSurface as the storage for glamor rendering like we do with GBM, we have to rely on blitting each pixmap to it's respective EGLSurface producer each frame. In order to pull this off, we add two different additional egl_backend hooks that GBM opts out of implementing: - egl_backend.allow_commits for holding off displaying any EGLStream backed pixmaps until the point where it's stream is completely initialized and ready for use - egl_backend.post_damage for blitting the content of the EGLStream surface producer before Xwayland actually damages and commits the wl_surface to the screen. The other big pitfall here is that using nvidia's wayland-eglstreams helper library is also not possible for the most part. All of it's API for creating and destroying streams rely on being able to perform a roundtrip in order to bring each stream to completion since the wayland compositor must perform it's job of connecting a consumer to each EGLstream. Because Xwayland has to potentially handle both responding to the wayland compositor and it's own X clients, the situation of the wayland compositor being one of our X clients must be considered. If we perform a roundtrip with the Wayland compositor, it's possible that the wayland compositor might currently be connected to us as an X client and thus hang while both Xwayland and the wayland compositor await responses from eachother. To avoid this, we work directly with the wayland protocol and use wl_display_sync() events along with release() events to set up and destroy EGLStreams asynchronously alongside handling X clients. Additionally, since setting up EGLStreams is not an atomic operation we have to take into consideration the fact that an EGLStream can potentially be created in response to a window resize, then immediately deleted due to another pending window resize in the same X client's pending reqests before Xwayland hits the part of it's event loop where we read from the wayland compositor. To make this even more painful, we also have to take into consideration that since EGLStreams are not atomic that it's possible we could delete wayland resources for an EGLStream before the compositor even finishes using them and thus run into errors. So, we use quite a bit of tracking logic to keep EGLStream objects alive until we know the compositor isn't using them (even if this means the stream outlives the pixmap it backed). While the default backend for glamor remains GBM, this patch exists for users who have had to deal with the reprecussion of their GPU manufacturers ignoring the advice of upstream and the standardization of GBM across most major GPU manufacturers. It is not intended to be a final solution to the GBM debate, but merely a baindaid so our users don't have to suffer from the consequences of companies avoiding working upstream. New drivers are strongly encouraged not to use this as a backend, and use GBM like everyone else. We even spit this out as an error from Xwayland when using the eglstream backend. Signed-off-by: Lyude Paul <lyude@redhat.com> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2018-04-20 20:38:05 +02:00
AM_CONDITIONAL(XWAYLAND_EGLSTREAM, [test "x$XWAYLAND_EGLSTREAM" = "xyes"])
2005-07-01 22:29:53 +02:00
dnl and the rest of these are generic, so they're in config.h
dnl
dnl though, thanks to the passing of some significant amount of time, the
dnl above is probably a complete fallacy, and you should not rely on it.
dnl but this is still actually better than imake, honest. -daniels
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <features.h>
#ifndef __GLIBC__
#error not glibc
#endif
]], [])], [AC_DEFINE(_GNU_SOURCE, 1,
[ Enable GNU and other extensions to the C environment for glibc])])
2005-07-01 22:29:53 +02:00
AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
Xorg: Add a suid root wrapper With the recent systemd-logind changes it is possible to install the Xorg binary without suid root rights and still have everything working as it should *if* the user only has cards which are supported by kms. This commit adds a little suid root wrapper, which is a bit weird, first we strip the suid-root bit of the Xorg binary, and then we add a wrapper ? The function of this wrapper is to see if a system still needs root-rights, if it does not (it supports kms and the kms drivers are properly loaded), then it will immediately drop all elevated rights before executing the real Xorg binary. If it finds (some) cards which don't support kms, or no cards at all, then it will execute the Xorg server with elevated rights so that ie the nvidia binary driver and the vesa driver can keep working normally. To make it possible for security concious users who don't need the root rights to completely remove the wrapper, Xorg is started in a 3 step process when the wrapper is enabled during build time: 1) A simple shell script which checks if the wrapper is there, if it is it executes the wrapper, if not it directly executes the real Xorg binary 2) The wrapper gets executed, does its checks, normally drops all elevated rights and then executes the real Xorg binary 3) The real Xorg binary does its thing This allows distributions to put the wrapper binary in a separate package, and will allow users to remove this package. IE the plan with Fedora is to make "legacy" drivers depend on the wrapper pkg, and since our default install contains some legacy drivers it will be part of the default install, but users can later yum remove it (which will also automatically remove the legacy driver packages as those won't work without it anyways). The wrapper is loosely modelled after the existing Debian Xwrapper, it uses the same config-file + config-file format, and also allows restricting Xserver execution (through the wrapper) to console users only. There also is a new needs_root_rights config file directive, which can be used to override the auto-detection the wrapper does. Hopefully this will allow Debian to replace their own wrapper with this upstream one. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 16:41:14 +01:00
AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [sysconfdir])
2005-07-01 22:29:53 +02:00
AC_SUBST([RELEASE_DATE])
2005-07-01 22:29:53 +02:00
DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
AC_SUBST([DIX_CFLAGS])
2008-04-10 21:36:19 +02:00
AC_SUBST([libdir])
AC_SUBST([exec_prefix])
AC_SUBST([prefix])
2005-07-01 22:29:53 +02:00
AC_CONFIG_COMMANDS([sdksyms], [touch hw/xfree86/sdksyms.dep])
if test "x$CONFIG_HAL" = xno && test "x$CONFIG_UDEV" = xno; then
AC_MSG_WARN([
***********************************************
Neither HAL nor udev backend will be enabled.
Input device hotplugging will not be available!
***********************************************])
fi
AC_CONFIG_FILES([
2005-07-01 22:29:53 +02:00
Makefile
glx/Makefile
2005-07-01 22:29:53 +02:00
include/Makefile
composite/Makefile
damageext/Makefile
2005-07-13 23:41:02 +02:00
dbe/Makefile
2005-07-01 22:29:53 +02:00
dix/Makefile
doc/Makefile
doc/dtrace/Makefile
man/Makefile
2005-07-01 22:29:53 +02:00
fb/Makefile
glamor/Makefile
2005-07-01 22:29:53 +02:00
record/Makefile
config/Makefile
2005-07-01 22:29:53 +02:00
mi/Makefile
miext/Makefile
miext/sync/Makefile
2005-07-01 22:29:53 +02:00
miext/damage/Makefile
miext/shadow/Makefile
miext/rootless/Makefile
2005-07-01 22:29:53 +02:00
os/Makefile
pseudoramiX/Makefile
2005-07-01 22:29:53 +02:00
randr/Makefile
render/Makefile
xkb/Makefile
Xext/Makefile
Xi/Makefile
xfixes/Makefile
exa/Makefile
dri3/Makefile
present/Makefile
2005-07-01 22:29:53 +02:00
hw/Makefile
hw/xfree86/Makefile
Xorg: Add a suid root wrapper With the recent systemd-logind changes it is possible to install the Xorg binary without suid root rights and still have everything working as it should *if* the user only has cards which are supported by kms. This commit adds a little suid root wrapper, which is a bit weird, first we strip the suid-root bit of the Xorg binary, and then we add a wrapper ? The function of this wrapper is to see if a system still needs root-rights, if it does not (it supports kms and the kms drivers are properly loaded), then it will immediately drop all elevated rights before executing the real Xorg binary. If it finds (some) cards which don't support kms, or no cards at all, then it will execute the Xorg server with elevated rights so that ie the nvidia binary driver and the vesa driver can keep working normally. To make it possible for security concious users who don't need the root rights to completely remove the wrapper, Xorg is started in a 3 step process when the wrapper is enabled during build time: 1) A simple shell script which checks if the wrapper is there, if it is it executes the wrapper, if not it directly executes the real Xorg binary 2) The wrapper gets executed, does its checks, normally drops all elevated rights and then executes the real Xorg binary 3) The real Xorg binary does its thing This allows distributions to put the wrapper binary in a separate package, and will allow users to remove this package. IE the plan with Fedora is to make "legacy" drivers depend on the wrapper pkg, and since our default install contains some legacy drivers it will be part of the default install, but users can later yum remove it (which will also automatically remove the legacy driver packages as those won't work without it anyways). The wrapper is loosely modelled after the existing Debian Xwrapper, it uses the same config-file + config-file format, and also allows restricting Xserver execution (through the wrapper) to console users only. There also is a new needs_root_rights config file directive, which can be used to override the auto-detection the wrapper does. Hopefully this will allow Debian to replace their own wrapper with this upstream one. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-03-05 16:41:14 +01:00
hw/xfree86/Xorg.sh
2005-07-01 22:29:53 +02:00
hw/xfree86/common/Makefile
hw/xfree86/ddc/Makefile
hw/xfree86/dixmods/Makefile
hw/xfree86/doc/Makefile
hw/xfree86/dri/Makefile
2008-02-04 17:58:24 +01:00
hw/xfree86/dri2/Makefile
hw/xfree86/dri2/pci_ids/Makefile
hw/xfree86/drivers/Makefile
hw/xfree86/drivers/modesetting/Makefile
2005-08-07 01:34:09 +02:00
hw/xfree86/exa/Makefile
hw/xfree86/exa/man/Makefile
2005-07-01 22:29:53 +02:00
hw/xfree86/fbdevhw/Makefile
hw/xfree86/fbdevhw/man/Makefile
hw/xfree86/glamor_egl/Makefile
2005-07-01 22:29:53 +02:00
hw/xfree86/i2c/Makefile
hw/xfree86/int10/Makefile
hw/xfree86/loader/Makefile
hw/xfree86/man/Makefile
hw/xfree86/modes/Makefile
2005-07-01 22:29:53 +02:00
hw/xfree86/os-support/Makefile
hw/xfree86/os-support/bsd/Makefile
2005-07-01 22:29:53 +02:00
hw/xfree86/os-support/bus/Makefile
hw/xfree86/os-support/hurd/Makefile
2005-07-01 22:29:53 +02:00
hw/xfree86/os-support/misc/Makefile
hw/xfree86/os-support/linux/Makefile
2005-07-14 03:00:39 +02:00
hw/xfree86/os-support/solaris/Makefile
hw/xfree86/os-support/stub/Makefile
2005-07-01 22:29:53 +02:00
hw/xfree86/parser/Makefile
hw/xfree86/ramdac/Makefile
hw/xfree86/shadowfb/Makefile
hw/xfree86/vgahw/Makefile
2005-07-12 16:50:10 +02:00
hw/xfree86/x86emu/Makefile
hw/xfree86/xkb/Makefile
hw/xfree86/utils/Makefile
hw/xfree86/utils/man/Makefile
hw/xfree86/utils/cvt/Makefile
hw/xfree86/utils/gtf/Makefile
2005-07-12 03:20:36 +02:00
hw/dmx/config/Makefile
hw/dmx/config/man/Makefile
hw/dmx/doc/Makefile
hw/dmx/doxygen/doxygen.conf
hw/dmx/doxygen/Makefile
hw/dmx/examples/Makefile
2005-07-01 22:29:53 +02:00
hw/dmx/input/Makefile
hw/dmx/glxProxy/Makefile
hw/dmx/Makefile
hw/dmx/man/Makefile
2005-07-12 03:20:36 +02:00
hw/vfb/Makefile
hw/vfb/man/Makefile
2005-07-14 05:32:09 +02:00
hw/xnest/Makefile
hw/xnest/man/Makefile
hw/xwin/Makefile
Add Windows-DRI extension If windowsdriproto headers are available, build a Windows-DRI extension, which supports requests to enable local clients to directly render GL to a Windows drawable: - a query to check if WGL is being used on a screen - a query to map a fbconfigID to a native pixelformatindex - a query to map a drawable to a native handle Windows-DRI can only be useful if we are using WGL, so make an note if WGL is active on a screen. Make validGlxDrawable() public Adjust glxWinSetPixelFormat() so it doesn't require a context, just a screen and config. That enables factoring out the deferred drawable creation code as glxWinDeferredCreateDrawable() Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a file mapping, so they exist in memory which can be shared with the direct rendering process. Currently, this file mapping is accessed by a name generated from the XID. This will not be unique across multiple server instances. It would perhaps be better, although more complicated, to use an anonymous file mapping, and then duplicate the handle for the direct rendering process. Use glxWinDeferredCreateDrawable() to ensure the native handle exists for the Windows-DRI query to map a drawable to native handle. v2: Various printf format warning fixes v3: Fix format warnings on x86 Move some uninteresting windows-dri output to debug log level v4: check for windowsdriproto when --enable-windowsdri use windowsdriproto_CFLAGS Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-07-24 13:29:41 +02:00
hw/xwin/dri/Makefile
hw/xwin/glx/Makefile
hw/xwin/man/Makefile
hw/xwin/winclipboard/Makefile
hw/xquartz/Makefile
hw/xquartz/GL/Makefile
hw/xquartz/bundle/Makefile
hw/xquartz/man/Makefile
hw/xquartz/mach-startup/Makefile
hw/xquartz/pbproxy/Makefile
hw/xquartz/xpr/Makefile
hw/kdrive/Makefile
hw/kdrive/ephyr/Makefile
hw/kdrive/ephyr/man/Makefile
hw/kdrive/src/Makefile
hw/xwayland/Makefile
test/Makefile
xserver.ent
2005-07-01 22:29:53 +02:00
xorg-server.pc
])
AC_OUTPUT