configure.ac revision 13496ba1
18c7da7f0Smrg#  Copyright 2005 Adam Jackson.
28c7da7f0Smrg#
38c7da7f0Smrg#  Permission is hereby granted, free of charge, to any person obtaining a
48c7da7f0Smrg#  copy of this software and associated documentation files (the "Software"),
58c7da7f0Smrg#  to deal in the Software without restriction, including without limitation
68c7da7f0Smrg#  on the rights to use, copy, modify, merge, publish, distribute, sub
78c7da7f0Smrg#  license, and/or sell copies of the Software, and to permit persons to whom
88c7da7f0Smrg#  the Software is furnished to do so, subject to the following conditions:
98c7da7f0Smrg#
108c7da7f0Smrg#  The above copyright notice and this permission notice (including the next
118c7da7f0Smrg#  paragraph) shall be included in all copies or substantial portions of the
128c7da7f0Smrg#  Software.
138c7da7f0Smrg#
148c7da7f0Smrg#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158c7da7f0Smrg#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168c7da7f0Smrg#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
178c7da7f0Smrg#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
188c7da7f0Smrg#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
198c7da7f0Smrg#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
208c7da7f0Smrg#
218c7da7f0Smrg# Process this file with autoconf to produce a configure script
228c7da7f0Smrg
2303b705cfSriastradh# Initialize Autoconf
2403b705cfSriastradhAC_PREREQ([2.60])
258c7da7f0SmrgAC_INIT([xf86-video-intel],
2613496ba1Ssnj        [2.99.917],
278c7da7f0Smrg        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
2803b705cfSriastradh        [xf86-video-intel])
298c7da7f0SmrgAC_CONFIG_SRCDIR([Makefile.am])
3003b705cfSriastradhAC_CONFIG_HEADERS([config.h])
3103b705cfSriastradhAC_CONFIG_MACRO_DIR([m4])
328c7da7f0SmrgAC_CONFIG_AUX_DIR(.)
338c7da7f0Smrg
3403b705cfSriastradh# Initialize Automake
3503b705cfSriastradhAM_INIT_AUTOMAKE([foreign dist-bzip2])
3603b705cfSriastradh
3703b705cfSriastradh# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
3803b705cfSriastradhm4_ifndef([XORG_MACROS_VERSION],
3903b705cfSriastradh          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen.
4003b705cfSriastradh  Hint: either install from source, git://anongit.freedesktop.org/xorg/util/macros or,
4103b705cfSriastradh  depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])])
428c7da7f0Smrg
4303b705cfSriastradhXORG_MACROS_VERSION(1.8)
4403b705cfSriastradhXORG_DEFAULT_OPTIONS
4503b705cfSriastradh
4603b705cfSriastradh# And disable a few very noisy warnings
4703b705cfSriastradhm4_ifdef([XORG_TESTSET_CFLAG], [
4803b705cfSriastradhXORG_TESTSET_CFLAG([NOWARNFLAGS], [-Wno-cast-qual])
4903b705cfSriastradhXORG_TESTSET_CFLAG([NOWARNFLAGS], [-Wno-redundant-decls])
5003b705cfSriastradhXORG_TESTSET_CFLAG([NOWARNFLAGS], [-Wno-maybe-uninitialized])
5103b705cfSriastradh])
5203b705cfSriastradhAC_SUBST(NOWARNFLAGS)
538c7da7f0Smrg
5403b705cfSriastradh# Require X.Org server macros (i.e. XORG_DRIVER_CHECK_EXT) to check for required modules 
5503b705cfSriastradhm4_ifndef([XORG_DRIVER_CHECK_EXT],
5603b705cfSriastradh          [m4_fatal([must install xorg-server macros before running autoconf/autogen.
5703b705cfSriastradh  Hint: either install from source, git://anongit.freedesktop.org/xorg/xserver or,
5803b705cfSriastradh  depending on your distribution, try package 'xserver-xorg-dev' or 'xorg-x11-server-devel'])])
5903b705cfSriastradh
6003b705cfSriastradh# Initialize libtool
618c7da7f0SmrgAC_DISABLE_STATIC
628c7da7f0SmrgAC_PROG_LIBTOOL
6303b705cfSriastradhAC_SYS_LARGEFILE
6403b705cfSriastradh
6542542f5fSchristos# Check for common libc routines redefined by os.h
6642542f5fSchristosAC_CHECK_FUNCS([strlcpy strlcat strndup], [], [])
6742542f5fSchristos
6842542f5fSchristos# Platform specific settings
6942542f5fSchristoscase $host_os in
7042542f5fSchristos  *linux*)
7142542f5fSchristos    backlight_helper=yes
7242542f5fSchristos    ;;
7342542f5fSchristosesac
7442542f5fSchristos
7542542f5fSchristosAC_ARG_ENABLE(backlight,
7642542f5fSchristos              AS_HELP_STRING([--disable-backlight],
7742542f5fSchristos			     [Enable control over the backlight [default=yes]]),
7842542f5fSchristos              [backlight="$enableval"],
7942542f5fSchristos              [backlight="yes"])
8042542f5fSchristosif test "x$backlight" = "xyes"; then
8142542f5fSchristos	AC_DEFINE(USE_BACKLIGHT, 1, [Enable control of the backlight])
8242542f5fSchristosfi
8342542f5fSchristos
8442542f5fSchristosAC_ARG_ENABLE(backlight-helper,
8542542f5fSchristos              AS_HELP_STRING([--disable-backlight-helper],
8642542f5fSchristos			     [Enable building the backlight helper executable for running X under a normal user [default=auto]]),
8742542f5fSchristos              [backlight_helper="$enableval"],)
8842542f5fSchristosAM_CONDITIONAL(BUILD_BACKLIGHT_HELPER, [test "x$backlight" = "xyes" -a "x$backlight_helper" = "xyes"])
8942542f5fSchristosif test "x$backlight_helper" = "xyes"; then
9042542f5fSchristos	tools_msg="$tools_msg xf86-video-intel-backlight-helper"
9142542f5fSchristos	AC_DEFINE(USE_BACKLIGHT_HELPER, 1, [Enable use of the backlight helper interfaces])
9242542f5fSchristosfi
9342542f5fSchristos
9403b705cfSriastradh# Are we in a git checkout?
9503b705cfSriastradhdot_git=no
9603b705cfSriastradhif test -e .git; then
9703b705cfSriastradh	AC_DEFINE(HAVE_DOT_GIT, 1, [Are we in a git checkout?])
9803b705cfSriastradh	dot_git=yes
9903b705cfSriastradhfi
10042542f5fSchristosAM_CONDITIONAL(HAVE_DOT_GIT, test "x$dot_git" = "xyes")
1018c7da7f0Smrg
10203b705cfSriastradh# If so, we include the git description in our logs for sanity checking.
10303b705cfSriastradh#
10403b705cfSriastradh# However, for people not running their own drivers this is just noise.
10503b705cfSriastradh# So we copy the xserver's builderstring idiom to allow for this to be
10603b705cfSriastradh# overridden and perhaps replaced with something more useful.
10703b705cfSriastradhAC_ARG_WITH(builderstring,
10803b705cfSriastradh	    AS_HELP_STRING([--with-builderstring=BUILDERSTRING],
10903b705cfSriastradh			   [Additional builder string (default: use git describe)]),
11003b705cfSriastradh	    [BUILDERSTRING="$withval"],
11103b705cfSriastradh	    [BUILDERSTRING="x-magic-git-describe"])
11203b705cfSriastradh
11342542f5fSchristosif test "x$BUILDERSTRING" = "xx-magic-git-describe" -a "x$dot_git" = "xyes"; then
11403b705cfSriastradh	AC_DEFINE(USE_GIT_DESCRIBE, 1, [Use automagic builder description])
11503b705cfSriastradhelse
11642542f5fSchristos  if test "x$BUILDERSTRING" != x -a "x$BUILDERSTRING" != "xno" -a "x$BUILDERSTRING" != xx-magic-git-describe; then
11703b705cfSriastradh	  AC_DEFINE_UNQUOTED(BUILDER_DESCRIPTION, ["$BUILDERSTRING"], [Builder description])
11803b705cfSriastradh  fi
11903b705cfSriastradhfi
12003b705cfSriastradh
12103b705cfSriastradhAC_ARG_ENABLE(gen4asm,
12203b705cfSriastradh              AS_HELP_STRING([--enable-gen4asm],
12303b705cfSriastradh			     [Enable rebuilding the gen4 assembly files [default=no]]),
12403b705cfSriastradh              [ASM="$enableval"],
12542542f5fSchristos              [ASM="no"])
12603b705cfSriastradh
12703b705cfSriastradhgen4asm=no
12842542f5fSchristosif test "x$ASM" != "xno"; then
12942542f5fSchristos	AC_ARG_WITH(gen4asm,
13042542f5fSchristos		    AS_HELP_STRING([--with-gen4asm=PATH],
13142542f5fSchristos				   [Path to intel-gen4asm binary]),
13242542f5fSchristos		    [path="$withval"],
13342542f5fSchristos		    [path=""])
13442542f5fSchristos	if test -n "$path" ; then
13542542f5fSchristos		gen4asm=yes
13642542f5fSchristos	else
13742542f5fSchristos		PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no])
13842542f5fSchristos		if test "x$ASM" = "xyes" -a "x$gen4asm" != "xyes"; then
13942542f5fSchristos			AC_MSG_ERROR([intel-gen4asm support requested but not found])
14042542f5fSchristos		fi
14103b705cfSriastradh	fi
14242542f5fSchristos	if test "x$gen4asm" = "xyes"; then
14303b705cfSriastradh		AC_MSG_CHECKING([path to use for intel-gen4asm])
14442542f5fSchristos		if test -n "$path" ; then
14542542f5fSchristos			INTEL_GEN4ASM="$path"
14642542f5fSchristos		else
14742542f5fSchristos			INTEL_GEN4ASM="`pkg-config intel-gen4asm --variable=exec_prefix`/bin/intel-gen4asm"
14842542f5fSchristos		fi
14903b705cfSriastradh		if ! test -e "$INTEL_GEN4ASM"; then
15003b705cfSriastradh			AC_MSG_ERROR([intel-gen4asm enabled, but not found. Tried '$INTEL_GEN4ASM'.])
15103b705cfSriastradh		fi
15203b705cfSriastradh		AC_MSG_RESULT([$INTEL_GEN4ASM])
15303b705cfSriastradh		AC_SUBST([INTEL_GEN4ASM])
15403b705cfSriastradh	fi
15503b705cfSriastradhfi
15642542f5fSchristosAM_CONDITIONAL(HAVE_GEN4ASM, test "x$gen4asm" = "xyes")
1578c7da7f0Smrg
15803b705cfSriastradh# Check for atomic intrinsics
15903b705cfSriastradhAC_CACHE_CHECK([for native atomic primitives], intel_cv_atomic_primitives,
16003b705cfSriastradh[
16103b705cfSriastradh    intel_cv_atomic_primitives="none"
16203b705cfSriastradh
16303b705cfSriastradh    AC_LINK_IFELSE([AC_LANG_PROGRAM([[
16403b705cfSriastradhint atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }
16503b705cfSriastradhint atomic_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap (&i, j, k); }
16603b705cfSriastradh				    ]],[[]])],
16703b705cfSriastradh		   [intel_cv_atomic_primitives="Intel"],[])
16803b705cfSriastradh
16903b705cfSriastradh    if test "x$intel_cv_atomic_primitives" = "xnone"; then
17003b705cfSriastradh	    AC_CHECK_HEADER([atomic_ops.h], intel_cv_atomic_primitives="libatomic-ops")
17103b705cfSriastradh    fi
17203b705cfSriastradh
17303b705cfSriastradh    # atomic functions defined in <atomic.h> & libc on Solaris
17403b705cfSriastradh    if test "x$intel_cv_atomic_primitives" = "xnone"; then
17503b705cfSriastradh	    AC_CHECK_FUNC([atomic_cas_uint],
17603b705cfSriastradh			  intel_cv_atomic_primitives="Solaris")
17703b705cfSriastradh    fi
17803b705cfSriastradh
17903b705cfSriastradh])
18042542f5fSchristosif test "x$intel_cv_atomic_primitives" = "xIntel"; then
18103b705cfSriastradh    AC_DEFINE(HAVE_ATOMIC_PRIMITIVES, 1,
18203b705cfSriastradh	      [Enable if your compiler supports the Intel __sync_* atomic primitives])
18303b705cfSriastradhfi
18403b705cfSriastradhif test "x$intel_cv_atomic_primitives" = "xlibatomic-ops"; then
18503b705cfSriastradh    AC_DEFINE(HAVE_LIB_ATOMIC_OPS, 1, [Enable if you have libatomic-ops-dev installed])
18603b705cfSriastradhfi
18703b705cfSriastradh
18803b705cfSriastradhif test "x$intel_cv_atomic_primitives" = "xnone"; then
18903b705cfSriastradh		AC_MSG_ERROR([xf86-video-intel depends upon atomic operations, which were not found for your compiler/cpu. Try compiling with -march=native, or install the libatomics-op-dev package.])
19003b705cfSriastradhfi
19103b705cfSriastradh
19203b705cfSriastradhAC_ARG_ENABLE(udev,
19303b705cfSriastradh              AS_HELP_STRING([--disable-udev],
19403b705cfSriastradh                             [Disable udev-based monitor hotplug detection [default=auto]]),
19503b705cfSriastradh              [UDEV="$enableval"],
19603b705cfSriastradh              [UDEV=auto])
19703b705cfSriastradh
19842542f5fSchristosif test "x$UDEV" != "xno"; then
19942542f5fSchristos	PKG_CHECK_MODULES(UDEV, [libudev], [udev="yes"], [udev="no"])
20042542f5fSchristos	if test "x$UDEV" = "xyes" -a "x$udev" != "xyes"; then
20103b705cfSriastradh		AC_MSG_ERROR([udev support requested but not found (libudev)])
20203b705cfSriastradh	fi
20342542f5fSchristos	if test "x$udev" = "xyes"; then
20403b705cfSriastradh		AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
20503b705cfSriastradh	fi
20603b705cfSriastradhfi
20703b705cfSriastradh
20842542f5fSchristosPKG_CHECK_MODULES(X11, [x11 xrender xrandr xext xfixes cairo cairo-xlib-xrender pixman-1 libpng], [x11="yes"], [x11="no"])
20942542f5fSchristosAM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes")
21042542f5fSchristos
21142542f5fSchristoscpuid="yes"
21242542f5fSchristosAC_TRY_LINK([
21342542f5fSchristos	#include <cpuid.h>
21442542f5fSchristos	#include <stddef.h>
21542542f5fSchristos	],
21642542f5fSchristos	[
21742542f5fSchristos	int eax, ebx, ecx, edx;
21842542f5fSchristos	if (__get_cpuid_max(0, NULL) < 4)
21942542f5fSchristos		return 0;
22042542f5fSchristos	__cpuid_count(4, 0, eax, ebx, ecx, edx);
22142542f5fSchristos	],
22242542f5fSchristos	[cpuid="yes"],
22342542f5fSchristos	[cpuid="no"]
22442542f5fSchristos)
22542542f5fSchristosif test "x$cpuid" = "xyes"; then
22642542f5fSchristos	AC_DEFINE(HAVE_CPUID_H,1,[Found a useable cpuid.h])
22742542f5fSchristosfi
22842542f5fSchristos
22942542f5fSchristosshm=yes
23042542f5fSchristosAC_CHECK_HEADERS([sys/ipc.h sys/ipc.h], [], [shm="no"])
23142542f5fSchristosAC_CHECK_HEADERS([X11/extensions/XShm.h], [], [shm="no"], [
23242542f5fSchristos#include <X11/Xlibint.h>
23342542f5fSchristos#include <X11/Xproto.h>
23442542f5fSchristos])
23542542f5fSchristosAC_CHECK_HEADERS([X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [], [
23642542f5fSchristos#include <X11/Xlibint.h>
23742542f5fSchristos#include <X11/Xproto.h>
23842542f5fSchristos])
23942542f5fSchristosif test "x$ac_cv_header_X11_extensions_shmproto_h" != "xyes" -a "x$ac_cv_header_X11_extensions_shmstr_h" != "xyes"; then
24042542f5fSchristos	shm="no"
24142542f5fSchristosfi
24242542f5fSchristos
24342542f5fSchristosif test "x$shm" = "xyes"; then
24442542f5fSchristos	AC_MSG_CHECKING(whether shmctl IPC_RMID allows subsequent attaches)
24542542f5fSchristos	AC_TRY_RUN([
24642542f5fSchristos		  #include <sys/types.h>
24742542f5fSchristos		  #include <sys/ipc.h>
24842542f5fSchristos		  #include <sys/shm.h>
24942542f5fSchristos		  int main()
25042542f5fSchristos		  {
25142542f5fSchristos		      char *shmaddr;
25242542f5fSchristos		      int id = shmget (IPC_PRIVATE, 4, IPC_CREAT | 0600);
25342542f5fSchristos		      if (id == -1) return 2;
25442542f5fSchristos		      shmaddr = shmat (id, 0, 0);
25542542f5fSchristos		      shmctl (id, IPC_RMID, 0);
25642542f5fSchristos		      if ((char*) shmat (id, 0, 0) == (char*) -1) {
25742542f5fSchristos			  shmdt (shmaddr);
25842542f5fSchristos			  return 1;
25942542f5fSchristos		      }
26042542f5fSchristos		      shmdt (shmaddr);
26142542f5fSchristos		      shmdt (shmaddr);
26242542f5fSchristos		      return 0;
26342542f5fSchristos		  }
26442542f5fSchristos		  ],
26542542f5fSchristos		  AC_DEFINE(IPC_RMID_DEFERRED_RELEASE, 1,
26642542f5fSchristos			    [Define to 1 if shared memory segments are released deferred.])
26742542f5fSchristos		  AC_MSG_RESULT(yes),
26842542f5fSchristos		  AC_MSG_RESULT(no),
26942542f5fSchristos		  AC_MSG_RESULT(assuming no))
27042542f5fSchristos	AC_DEFINE([HAVE_MIT_SHM], 1, [Define to 1 if MIT-SHM is available])
27142542f5fSchristosfi
27242542f5fSchristos
27342542f5fSchristosPKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
27442542f5fSchristosAM_CONDITIONAL(X11_DRI3, test "x$x11_dri3" = "xyes" -a "x$shm" = "xyes")
27542542f5fSchristosAM_CONDITIONAL(X11_SHM, test "x$shm" = "xyes")
27642542f5fSchristos
27742542f5fSchristosAC_ARG_ENABLE(tools,
27842542f5fSchristos              AS_HELP_STRING([--disable-tools],
27942542f5fSchristos			     [Enable building and installing the miscellaneous tools [default=auto]]),
28042542f5fSchristos              [tools="$enableval"], [tools="auto"])
28142542f5fSchristosif test "x$shm" != "xyes"; then
28242542f5fSchristos	if test "x$tools" = "xyes"; then
28342542f5fSchristos		AC_MSG_ERROR([Incomplete requirements for extra tools, X11 MIT-SHM extension required])
28442542f5fSchristos	fi
28542542f5fSchristos	tools="no"
28642542f5fSchristosfi
28742542f5fSchristosif test "x$tools" != "xno"; then
28842542f5fSchristos	ivo_requires="xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1"
28942542f5fSchristos	extra_cflags=""
29042542f5fSchristos
29142542f5fSchristos	ignore="xinerama"
29242542f5fSchristos	PKG_CHECK_MODULES(IVO_EXTRA, [$ignore],
29342542f5fSchristos			  [AC_CHECK_HEADERS([X11/extensions/Xinerama.h], [ivo_requires="$ignore $ivo_requires"], [],
29442542f5fSchristos					    [#include <X11/Xlibint.h>
29542542f5fSchristos					     #include <X11/Xproto.h>
29642542f5fSchristos					    ])], [ignore=""])
29742542f5fSchristos
29842542f5fSchristos	ignore="xcb-dri3 xcb-sync x11-xcb xshmfence x11"
29942542f5fSchristos	PKG_CHECK_MODULES(IVO_EXTRA, [$ignore], [ivo_requires="$ivo_requires $ignore"; extra_cflags="-DDRI3"], [ignore=""])
30042542f5fSchristos
30142542f5fSchristos	PKG_CHECK_MODULES(IVO, [$ivo_requires], [ivo="yes"], [ivo="no"])
30242542f5fSchristos	AC_CHECK_HEADER([sys/timerfd.h], [], [ivo="no"])
30342542f5fSchristos	if test "x$ivo" = "xno"; then
30442542f5fSchristos		if test "x$tools" = "xyes"; then
30542542f5fSchristos			AC_MSG_ERROR([Incomplete requirements for intel-virtual-output, requires $ivo_requires])
30642542f5fSchristos		fi
30742542f5fSchristos		tools="no"
30842542f5fSchristos	fi
3098c7da7f0Smrg
31042542f5fSchristos	IVO_CFLAGS="$IVO_CFLAGS $extra_cflags"
31142542f5fSchristosfi
31242542f5fSchristosif test "x$tools" != "xno"; then
31342542f5fSchristos      tools_msg="$tools_msg intel-virtual-output"
31442542f5fSchristosfi
31542542f5fSchristosAC_MSG_CHECKING([whether to build additional tools])
31642542f5fSchristosAC_MSG_RESULT([$tools])
31742542f5fSchristosAM_CONDITIONAL(BUILD_TOOLS, test "x$tools" != "xno")
3188c7da7f0Smrg
31903b705cfSriastradh# Define a configure option for an alternate module directory
3208c7da7f0SmrgAC_ARG_WITH(xorg-module-dir,
32103b705cfSriastradh            AS_HELP_STRING([--with-xorg-module-dir=DIR],
3228c7da7f0Smrg                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
3238c7da7f0Smrg            [moduledir="$withval"],
3248c7da7f0Smrg            [moduledir="$libdir/xorg/modules"])
3258c7da7f0Smrg
32642542f5fSchristosAC_ARG_ENABLE(dri,
32742542f5fSchristos	      AS_HELP_STRING([--disable-dri],
32842542f5fSchristos			     [Disable DRI support [[default=auto]]]),
32942542f5fSchristos	      [DRI=$enableval],
33042542f5fSchristos	      [DRI=auto])
33142542f5fSchristosAC_ARG_ENABLE(dri1,
33242542f5fSchristos	      AS_HELP_STRING([--disable-dri1],
33342542f5fSchristos			     [Disable DRI1 support [[default=yes]]]),
33442542f5fSchristos	      [DRI1=$enableval],
33542542f5fSchristos	      [DRI1=yes])
33642542f5fSchristosAC_ARG_ENABLE(dri2,
33742542f5fSchristos	      AS_HELP_STRING([--disable-dri2],
33842542f5fSchristos			     [Disable DRI2 support [[default=yes]]]),
33942542f5fSchristos	      [DRI2=$enableval],
34042542f5fSchristos	      [DRI2=yes])
34142542f5fSchristosAC_ARG_ENABLE(dri3,
34213496ba1Ssnj	      AS_HELP_STRING([--enable-dri3],
34313496ba1Ssnj			     [Enable DRI3 support [[default=no]]]),
34442542f5fSchristos	      [DRI3=$enableval],
34513496ba1Ssnj	      [DRI3=no])
3468c7da7f0Smrg
34703b705cfSriastradhAC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc],
34803b705cfSriastradh                                  [Disable XvMC support [[default=yes]]]),
3498c7da7f0Smrg              [XVMC="$enableval"],
35042542f5fSchristos              [XVMC="yes"])
35142542f5fSchristos
35242542f5fSchristosAC_ARG_ENABLE(kms,
35342542f5fSchristos	      AS_HELP_STRING([--enable-kms],
35442542f5fSchristos			     [Assume KMS support [[default=yes]]]),
35542542f5fSchristos              [KMS="$enableval"],
35642542f5fSchristos              [KMS="yes"])
35742542f5fSchristosAC_ARG_ENABLE(ums,
35842542f5fSchristos	      AS_HELP_STRING([--enable-ums],
35942542f5fSchristos			     [Assume UMS support [[default=auto]]]),
36042542f5fSchristos              [UMS="$enableval"],
36142542f5fSchristos              [UMS="auto"])
36242542f5fSchristos
36342542f5fSchristosAC_ARG_ENABLE(kms-only,
36442542f5fSchristos	      AS_HELP_STRING([--enable-kms-only],
36542542f5fSchristos			     [Only assume KMS support (no UMS) [[default=no]]]),
36642542f5fSchristos              [ONLY_KMS="$enableval"],
36742542f5fSchristos              [ONLY_KMS="no"])
36842542f5fSchristos
36942542f5fSchristosAC_ARG_ENABLE(ums-only,
37042542f5fSchristos	      AS_HELP_STRING([--enable-ums-only],
37142542f5fSchristos			     [Only assume UMS support (no KMS) [[default=no]]]),
37242542f5fSchristos              [ONLY_UMS="$enableval"],
37342542f5fSchristos              [ONLY_UMS="no"])
37403b705cfSriastradh
37503b705cfSriastradhrequired_xorg_server_version=1.6
37603b705cfSriastradhrequired_pixman_version=0.16
37703b705cfSriastradh
37803b705cfSriastradhif pkg-config --exists 'pixman-1 >= 0.27.1'; then
37903b705cfSriastradh	AC_DEFINE([HAS_PIXMAN_GLYPHS], 1, [Enable pixman glyph cache])
38003b705cfSriastradhfi
3818c7da7f0Smrg
38203b705cfSriastradhif pkg-config --exists 'pixman-1 >= 0.24.0'; then
38303b705cfSriastradh	AC_DEFINE([HAS_PIXMAN_TRIANGLES], 1, [Enable pixman triangle rasterisation])
38403b705cfSriastradhfi
3852e76d66dSmrg
38642542f5fSchristos# Store the list of server defined optional extensions in REQUIRED_MODULES
38742542f5fSchristosXORG_DRIVER_CHECK_EXT(RANDR, randrproto)
38842542f5fSchristosXORG_DRIVER_CHECK_EXT(RENDER, renderproto)
38942542f5fSchristosXORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
39042542f5fSchristos
39142542f5fSchristos# Obtain compiler/linker options for the driver dependencies
39242542f5fSchristosPKG_CHECK_MODULES(DRM, [libdrm >= 2.4.20]) # libdrm_intel is checked separately
39342542f5fSchristosPKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
39442542f5fSchristos
39503b705cfSriastradhAC_ARG_ENABLE(sna,
39603b705cfSriastradh	      AS_HELP_STRING([--enable-sna],
39742542f5fSchristos			     [Enable SandyBridge\'s New Acceleration (SNA) [default=auto]]),
39803b705cfSriastradh	      [SNA="$enableval"],
39903b705cfSriastradh	      [SNA=auto])
4002e76d66dSmrg
40103b705cfSriastradhif test "x$SNA" != "xno"; then
40203b705cfSriastradh	AC_DEFINE(USE_SNA, 1, [Enable SNA support])
40303b705cfSriastradh	AC_CHECK_HEADERS([sys/sysinfo.h], AC_CHECK_MEMBERS([struct sysinfo.totalram], [], [], [[#include <sys/sysinfo.h>]]))
40403b705cfSriastradhfi
40503b705cfSriastradh
40642542f5fSchristosuxa_requires_libdrm=2.4.52
40703b705cfSriastradhAC_ARG_ENABLE(uxa,
40803b705cfSriastradh	      AS_HELP_STRING([--enable-uxa],
40942542f5fSchristos			     [Enable Unified Acceleration Architecture (UXA) [default=auto]]),
41003b705cfSriastradh	      [UXA="$enableval"],
41103b705cfSriastradh	      [UXA=auto])
41203b705cfSriastradhif test "x$UXA" = "xauto"; then
41342542f5fSchristos	if ! pkg-config --exists "libdrm_intel >= $uxa_requires_libdrm"; then
41403b705cfSriastradh		UXA=no
41503b705cfSriastradh	fi
41603b705cfSriastradh	if ! pkg-config --exists 'pixman-1 >= 0.24.0'; then
41703b705cfSriastradh		UXA=no
41803b705cfSriastradh	fi
41903b705cfSriastradhfi
42003b705cfSriastradhif test "x$UXA" != "xno"; then
42103b705cfSriastradh	AC_DEFINE(USE_UXA, 1, [Enable UXA support])
42242542f5fSchristos	PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= $uxa_requires_libdrm])
42303b705cfSriastradh	required_pixman_version=0.24
42403b705cfSriastradh	UXA=yes
42503b705cfSriastradhfi
42603b705cfSriastradh
42703b705cfSriastradhPKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_server_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
42842542f5fSchristosABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server`
42942542f5fSchristos
43042542f5fSchristosif test "x$ONLY_UMS" = "xyes"; then
43142542f5fSchristos	UMS="yes"
43242542f5fSchristos	KMS="no"
43342542f5fSchristosfi
43442542f5fSchristos
43542542f5fSchristosif test "x$ONLY_KMS" = "xyes"; then
43642542f5fSchristos	UMS="no"
43742542f5fSchristos	KMS="yes"
43842542f5fSchristosfi
43942542f5fSchristos
44042542f5fSchristossave_CPPFLAGS=$CPPFLAGS
44142542f5fSchristosCPPFLAGS=$XORG_CFLAGS
44242542f5fSchristosAC_CHECK_HEADERS([vgaHW.h], legacy="yes", legacy="no")
44342542f5fSchristosCPPFLAGS=$save_CPPFLAGS
44442542f5fSchristosif test "x$UMS" = "xauto"; then
44542542f5fSchristos	UMS="$legacy"
44642542f5fSchristosfi
44742542f5fSchristosif test "x$UMS" = "xyes" -a "x$legacy" = "xno"; then
44842542f5fSchristos	AC_MSG_ERROR([vgaHW support required for UMS (i810) driver])
44942542f5fSchristosfi
45042542f5fSchristos
45142542f5fSchristosif test "x$UMS" = "xyes"; then
45242542f5fSchristos	AC_ARG_ENABLE(xaa,
45342542f5fSchristos		      AS_HELP_STRING([--enable-xaa],
45442542f5fSchristos				     [Enable legacy X Acceleration Architecture (XAA) for i810 chipsets [default=auto]]),
45542542f5fSchristos		      [XAA="$enableval"],
45642542f5fSchristos		      [XAA="auto"])
45742542f5fSchristos	if test "x$XAA" != "xno"; then
45842542f5fSchristos		save_CPPFLAGS=$CPPFLAGS
45942542f5fSchristos		CPPFLAGS=$XORG_CFLAGS
46042542f5fSchristos		AC_CHECK_HEADERS([xaa.h], XAA="yes", XAA="no")
46142542f5fSchristos		CPPFLAGS=$save_CPPFLAGS
46242542f5fSchristos	fi
46342542f5fSchristos	AC_MSG_CHECKING([whether to include XAA support])
46442542f5fSchristos	AC_MSG_RESULT([$XAA])
46542542f5fSchristos
46642542f5fSchristos	AC_ARG_ENABLE(dga,
46742542f5fSchristos		      AS_HELP_STRING([--enable-dga],
46842542f5fSchristos				     [Enable legacy Direct Graphics Access (DGA) for i810 chipsets [default=auto]]),
46942542f5fSchristos		      [DGA="$enableval"],
47042542f5fSchristos		      [DGA="auto"])
47142542f5fSchristos	if test "x$DGA" != "xno"; then
47242542f5fSchristos		save_CFLAGS=$CFLAGS
47342542f5fSchristos		CFLAGS=$XORG_CFLAGS
47442542f5fSchristos		AC_CHECK_HEADERS([dgaproc.h], DGA="yes", DGA="no", [#include <dixstruct.h>])
47542542f5fSchristos		CFLAGS=$save_CFLAGS
47642542f5fSchristos	fi
47742542f5fSchristos	AC_MSG_CHECKING([whether to include DGA support])
47842542f5fSchristos	AC_MSG_RESULT([$DGA])
47942542f5fSchristosfi
48042542f5fSchristosAM_CONDITIONAL(DGA, test "x$DGA" = "xyes")
48142542f5fSchristosAM_CONDITIONAL(XAA, test "x$XAA" = "xyes")
48242542f5fSchristos
48342542f5fSchristosAM_CONDITIONAL(KMS, test "x$KMS" = "xyes")
48442542f5fSchristosif test "x$KMS" = "xyes"; then
48542542f5fSchristos	AC_DEFINE(KMS,1,[Assume KMS support])
48642542f5fSchristosfi
48742542f5fSchristosAM_CONDITIONAL(UMS, test "x$UMS" = "xyes")
48842542f5fSchristosif test "x$UMS" = "xyes"; then
48942542f5fSchristos	AC_DEFINE(UMS,1,[Assume UMS support])
49042542f5fSchristosfi
49142542f5fSchristos
49242542f5fSchristoshave_dri1=no
49342542f5fSchristosXORG_DRIVER_CHECK_EXT(XF86DRI, xf86driproto)
49442542f5fSchristosif test "x$_EXT_CHECK" != "xno" -a "x$DRI" != "xno" -a "x$DRI1" != "xno" -a "x$UMS" = "xyes"; then
49542542f5fSchristos	PKG_CHECK_MODULES(DRI1, [xf86driproto], [have_dri1=$DRI], [have_dri1=no])
49642542f5fSchristos        save_CFLAGS="$CFLAGS"
49742542f5fSchristos        save_CPPFLAGS="$CPPFLAGS"
49842542f5fSchristos        CFLAGS="$CFLAGS $XORG_CFLAGS $DRI1_CFLAGS $DRM_CFLAGS"
49942542f5fSchristos        CPPFLAGS="$CPPFLAGS $XORG_CFLAGS $DRI1_CFLAGS $DRM_CFLAGS"
50042542f5fSchristos        AC_CHECK_HEADERS([dri.h sarea.h dristruct.h], [], [have_dri1=no],
50142542f5fSchristos                [/* for dri.h */
50242542f5fSchristos                 #include <xf86str.h>
50342542f5fSchristos                 /* for dristruct.h */
50442542f5fSchristos                 #include <xorg-server.h>
50542542f5fSchristos                 #ifdef HAVE_DRI_H
50642542f5fSchristos                 # include <dri.h>
50742542f5fSchristos                 #endif
50842542f5fSchristos                 #ifdef HAVE_SAREA_H
50942542f5fSchristos                 # include <sarea.h>
51042542f5fSchristos                 #endif
51142542f5fSchristos                ])
51242542f5fSchristos        CFLAGS="$save_CFLAGS"
51342542f5fSchristos        CPPFLAGS="$save_CPPFLAGS"
51442542f5fSchristosfi
51542542f5fSchristos
51642542f5fSchristosAC_MSG_CHECKING([whether to include DRI1 support])
51742542f5fSchristosAC_MSG_RESULT([$have_dri1])
51842542f5fSchristos
51942542f5fSchristosAM_CONDITIONAL(DRI1, test "x$have_dri1" != "xno")
52042542f5fSchristosif test "x$have_dri1" != "xno"; then
52142542f5fSchristos        AC_DEFINE(HAVE_DRI1,1,[Enable DRI1 driver support])
52242542f5fSchristos	dri_msg="$dri_msg DRI1"
52342542f5fSchristoselse
52442542f5fSchristos        DRI1_CFLAGS=""
52542542f5fSchristos        DRI1_LIBS=""
52642542f5fSchristos
52742542f5fSchristos        if test "x$DRI" = "xyes" -a "x$UMS" = "xyes" -a "x$DRI1" != "xno"; then
52842542f5fSchristos                AC_MSG_ERROR([DRI1 requested but prerequisites not found])
52942542f5fSchristos        fi
53042542f5fSchristosfi
53142542f5fSchristos
53242542f5fSchristoshave_dri2=no
53342542f5fSchristoshave_dri3=no
53442542f5fSchristosif test "x$DRI" != "xno"; then
53542542f5fSchristos	if test "x$DRI2" != "xno"; then
53642542f5fSchristos		PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6], [have_dri2=$DRI], [have_dri2=no])
53742542f5fSchristos	fi
53842542f5fSchristos	if test "x$have_dri2" != "xno"; then
53942542f5fSchristos		save_CFLAGS=$CFLAGS
54042542f5fSchristos		CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI1_CFLAGS $DRI2_CFLAGS"
54142542f5fSchristos		AC_CHECK_HEADERS([dri2.h], [], [have_dri2=no], [
54242542f5fSchristos#include <dixstruct.h>
54342542f5fSchristos#include <drm.h>
54442542f5fSchristos])
54542542f5fSchristos		CFLAGS=$save_CFLAGS
54642542f5fSchristos	fi
54742542f5fSchristos	if test "x$have_dri2" != "xno"; then
54842542f5fSchristos		dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri`
54942542f5fSchristos		if test "x$dridriverdir" = "x"; then
55042542f5fSchristos			dridriverdir="$libdir/dri"
55142542f5fSchristos		fi
55242542f5fSchristos		AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default have_dri2 driver path])
55342542f5fSchristos	fi
55442542f5fSchristos
55542542f5fSchristos	if test "x$DRI3" != "xno"; then
55642542f5fSchristos		XORG_DRIVER_CHECK_EXT(DRI3, dri3proto)
55742542f5fSchristos		if test "x$_EXT_CHECK" != "xno"; then
55842542f5fSchristos			PKG_CHECK_MODULES(DRI3, [dri3proto], [have_dri3=$DRI], [])
55942542f5fSchristos		fi
56042542f5fSchristos	fi
56142542f5fSchristos	if test "x$have_dri3" != "xno"; then
56242542f5fSchristos		save_CFLAGS=$CFLAGS
56342542f5fSchristos		CFLAGS="$XORG_CFLAGS $DRI3_CFLAGS"
56442542f5fSchristos		AC_CHECK_DECL(DRI3, [], [have_dri3=no], [#include <xorg-server.h>])
56542542f5fSchristos		AC_CHECK_HEADERS([misyncstr.h misyncshm.h], [], [have_dri3=no], [
56642542f5fSchristos#include <xorg-server.h>
56742542f5fSchristos#include <xf86str.h>
56842542f5fSchristos#include <misync.h>
56942542f5fSchristos])
57042542f5fSchristos		CFLAGS=$save_CFLAGS
57142542f5fSchristos	fi
57242542f5fSchristosfi
57342542f5fSchristos
57442542f5fSchristosAC_MSG_CHECKING([whether to include DRI2 support])
57542542f5fSchristosAM_CONDITIONAL(DRI2, test "x$have_dri2" != "xno")
57642542f5fSchristosAC_MSG_RESULT([$have_dri2])
57742542f5fSchristosif test "x$have_dri2" != "xno"; then
57842542f5fSchristos        AC_DEFINE(HAVE_DRI2,1,[Enable DRI2 driver support])
57942542f5fSchristos	dri_msg="$dri_msg DRI2"
58042542f5fSchristoselse
58142542f5fSchristos	if test "x$DRI" = "xyes" -a "x$DRI2" != "xno" -a "x$KMS" = "xyes"; then
58242542f5fSchristos		AC_MSG_ERROR([DRI2 requested but prerequisites not found])
58342542f5fSchristos	fi
58442542f5fSchristos
58542542f5fSchristos	# UXA doesn't build without DRI2 headers, too late to fix
58642542f5fSchristos	UXA=no
58742542f5fSchristosfi
58842542f5fSchristos
58942542f5fSchristosAC_MSG_CHECKING([whether to include DRI3 support])
59042542f5fSchristosAM_CONDITIONAL(DRI3, test "x$have_dri3" != "xno")
59142542f5fSchristosAC_MSG_RESULT([$have_dri3])
59242542f5fSchristosif test "x$have_dri3" != "xno"; then
59342542f5fSchristos        AC_DEFINE(HAVE_DRI3,1,[Enable DRI3 driver support])
59442542f5fSchristos	dri_msg="$dri_msg DRI3"
59542542f5fSchristoselse
59642542f5fSchristos	if test "x$DRI" = "xyes" -a "x$DRI3" != "xno" -a "x$KMS" = "xyes"; then
59742542f5fSchristos		AC_MSG_ERROR([DRI3 requested but prerequisites not found])
59842542f5fSchristos	fi
59942542f5fSchristosfi
60042542f5fSchristos
60142542f5fSchristosAC_CHECK_HEADERS([X11/extensions/dpmsconst.h])
60242542f5fSchristos
60342542f5fSchristosPRESENT="no"
60442542f5fSchristosXORG_DRIVER_CHECK_EXT(PRESENT, presentproto)
60542542f5fSchristosif test "x$_EXT_CHECK" != "xno"; then
60642542f5fSchristos	PKG_CHECK_MODULES(PRESENT, [presentproto], [PRESENT="yes"], [])
60742542f5fSchristosfi
60842542f5fSchristosif test "x$PRESENT" != "xno"; then
60942542f5fSchristos	save_CFLAGS=$CFLAGS
61042542f5fSchristos	CFLAGS="$XORG_CFLAGS $PRESENT_CFLAGS"
61142542f5fSchristos	AC_CHECK_HEADERS([present.h], [], [PRESENT="no"], [
61242542f5fSchristos#include <xorg-server.h>
61342542f5fSchristos#include <xf86str.h>
61442542f5fSchristos])
61542542f5fSchristos	CFLAGS=$save_CFLAGS
61642542f5fSchristosfi
61742542f5fSchristosAC_MSG_CHECKING([whether to include PRESENT support])
61842542f5fSchristosAM_CONDITIONAL(PRESENT, test "x$PRESENT" != "xno")
61942542f5fSchristosAC_MSG_RESULT([$PRESENT])
62042542f5fSchristosif test "x$PRESENT" != "xno"; then
62142542f5fSchristos        AC_DEFINE(HAVE_PRESENT,1,[Enable PRESENT driver support])
62242542f5fSchristos	dri_msg="$dri_msg Present"
62342542f5fSchristosfi
62442542f5fSchristos
62542542f5fSchristosAC_MSG_CHECKING([whether to include UXA support])
62642542f5fSchristosAC_MSG_RESULT([$UXA])
62742542f5fSchristosAM_CONDITIONAL(UXA, test "x$UXA" != "xno")
62842542f5fSchristos
62942542f5fSchristosAC_MSG_CHECKING([whether to include SNA support])
63042542f5fSchristosAM_CONDITIONAL(SNA, test "x$SNA" != "xno")
63142542f5fSchristosAC_MSG_RESULT([$SNA])
63242542f5fSchristos
63342542f5fSchristosif test "$XVMC" = "yes"; then
63442542f5fSchristos	PKG_CHECK_MODULES(XVMCLIB, [xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel], [], [XVMC="no"])
63542542f5fSchristosfi
63642542f5fSchristosAC_MSG_CHECKING([whether to include XvMC support])
63742542f5fSchristosAC_MSG_RESULT([$XVMC])
63842542f5fSchristosAM_CONDITIONAL(XVMC, test "x$XVMC" = "xyes")
63942542f5fSchristosif test "x$XVMC" = "xyes"; then
64042542f5fSchristos	AC_DEFINE(ENABLE_XVMC,1,[Enable XvMC support])
64142542f5fSchristos	xvmc_msg=" yes"
64242542f5fSchristoselse
64342542f5fSchristos	xvmc_msg=" no"
64442542f5fSchristosfi
6458c7da7f0Smrg
64603b705cfSriastradh
64703b705cfSriastradhAC_ARG_WITH(default-accel,
64803b705cfSriastradh	    AS_HELP_STRING([--with-default-accel],
64913496ba1Ssnj			   [Select the default acceleration method out of none, sna, or uxa  [default is sna if enabled, otherwise uxa]]),
65003b705cfSriastradh			   [accel="$withval"],
65142542f5fSchristos			   [accel="auto"])
65242542f5fSchristosif test "x$accel" = "xyes"; then
65303b705cfSriastradh	AC_MSG_WARN([No default acceleration specified, choosing automatic selection])
65403b705cfSriastradh	accel="auto"
6558c7da7f0Smrgfi
65603b705cfSriastradh
65703b705cfSriastradhAC_MSG_CHECKING([which acceleration method to use by default])
65842542f5fSchristosif test "x$accel" = "xauto"; then
65942542f5fSchristos	if test "x$SNA" != "xno"; then
66042542f5fSchristos		accel="sna"
6618c7da7f0Smrg	else
66242542f5fSchristos		if test "x$UXA" != "xno"; then
66342542f5fSchristos			accel="uxa"
66403b705cfSriastradh		fi
66503b705cfSriastradh	fi
66642542f5fSchristos	if test "x$accel" = "xauto" -a "x$KMS" = "xyes"; then
66703b705cfSriastradh		AC_MSG_ERROR([No default acceleration option])
6688c7da7f0Smrg	fi
66903b705cfSriastradhfi
67003b705cfSriastradh
67142542f5fSchristoshave_accel="none"
67242542f5fSchristosif test "x$accel" = "xsna"; then
67303b705cfSriastradh	if test "x$SNA" != "xno"; then
67403b705cfSriastradh		AC_DEFINE(DEFAULT_ACCEL_METHOD, SNA, [Default acceleration method])
67542542f5fSchristos		have_accel="yes"
6768c7da7f0Smrg	else
67703b705cfSriastradh		AC_MSG_ERROR([SNA requested as default, but is not enabled])
6788c7da7f0Smrg	fi
6798c7da7f0Smrgfi
6808c7da7f0Smrg
68142542f5fSchristosif test "x$accel" = "xuxa"; then
68203b705cfSriastradh	if test "x$UXA" != "xno"; then
68303b705cfSriastradh		AC_DEFINE(DEFAULT_ACCEL_METHOD, UXA, [Default acceleration method])
68442542f5fSchristos		have_accel="yes"
6858c7da7f0Smrg	else
68603b705cfSriastradh		AC_MSG_ERROR([UXA requested as default, but is not enabled])
6878c7da7f0Smrg	fi
68803b705cfSriastradhfi
68942542f5fSchristos
69042542f5fSchristosif test "x$have_accel" = "xnone"; then
69142542f5fSchristos	if test "x$KMS" = "xyes"; then
69242542f5fSchristos		if test "x$SNA" != "xno" -o "x$UXA" != "xno"; then
69342542f5fSchristos			AC_DEFINE(DEFAULT_ACCEL_METHOD, NOACCEL, [Default acceleration method])
69442542f5fSchristos		else
69542542f5fSchristos			AC_MSG_ERROR([Invalid default acceleration option])
69642542f5fSchristos		fi
69742542f5fSchristos	fi
69842542f5fSchristos	accel="none"
69942542f5fSchristosfi
70042542f5fSchristosAC_MSG_RESULT($accel)
70142542f5fSchristos
70203b705cfSriastradhxp_msg=""
70303b705cfSriastradh
70442542f5fSchristosAC_ARG_ENABLE(tear-free,
70542542f5fSchristos	      AS_HELP_STRING([--enable-tear-free],
70642542f5fSchristos			     [Enable use of TearFree by default [default=no]]),
70742542f5fSchristos	      [TEARFREE="$enableval"],
70842542f5fSchristos	      [TEARFREE="no"])
70942542f5fSchristosif test "x$TEARFREE" = "xyes"; then
71042542f5fSchristos	AC_DEFINE(TEARFREE,1,[Enable "TearFree" by default])
71142542f5fSchristos	xp_msg="$xp_msg TearFree"
71242542f5fSchristosfi
71342542f5fSchristos
71442542f5fSchristosAC_ARG_ENABLE(rendernode,
71542542f5fSchristos	      AS_HELP_STRING([--enable-rendernode],
71642542f5fSchristos			     [Enable use of render nodes (experimental) [default=no]]),
71742542f5fSchristos	      [RENDERNODE="$enableval"],
71842542f5fSchristos	      [RENDERNODE="no"])
71942542f5fSchristosAM_CONDITIONAL(USE_RENDERNODE, test "x$RENDERNODE" = "xyes")
72042542f5fSchristosif test "x$RENDERNODE" = "xyes"; then
72142542f5fSchristos	AC_DEFINE(USE_RENDERNODE,1,[Assume "rendernode" support])
72242542f5fSchristos	xp_msg="$xp_msg rendernode"
72342542f5fSchristosfi
72442542f5fSchristos
72513496ba1SsnjAC_ARG_ENABLE(wc-mmap,
72613496ba1Ssnj	      AS_HELP_STRING([--enable-wc-mmap],
72713496ba1Ssnj			     [Enable use of WriteCombining mmaps [default=no]]),
72813496ba1Ssnj	      [WC_MMAP="$enableval"],
72913496ba1Ssnj	      [WC_MMAP="no"])
73013496ba1Ssnjif test "x$WC_MMAP" = "xyes"; then
73113496ba1Ssnj	AC_DEFINE(USE_WC_MMAP,1,[Enable use of WriteCombining mmaps])
73213496ba1Ssnj	xp_msg="$xp_msg mmap(wc)"
73313496ba1Ssnjfi
73413496ba1Ssnj
73503b705cfSriastradhAC_ARG_ENABLE(create2,
73603b705cfSriastradh	      AS_HELP_STRING([--enable-create2],
73703b705cfSriastradh			     [Enable use of create2 ioctl (experimental) [default=no]]),
73803b705cfSriastradh	      [CREATE2="$enableval"],
73942542f5fSchristos	      [CREATE2="no"])
74042542f5fSchristosAM_CONDITIONAL(USE_CREATE2, test "x$CREATE2" = "xyes")
74142542f5fSchristosif test "x$CREATE2" = "xyes"; then
74203b705cfSriastradh	AC_DEFINE(USE_CREATE2,1,[Assume "create2" support])
74303b705cfSriastradh	xp_msg="$xp_msg create2"
74403b705cfSriastradhfi
7458c7da7f0Smrg
74603b705cfSriastradhAC_ARG_ENABLE(async-swap,
74703b705cfSriastradh	      AS_HELP_STRING([--enable-async-swap],
74803b705cfSriastradh			     [Enable use of asynchronous swaps (experimental) [default=no]]),
74903b705cfSriastradh	      [ASYNC_SWAP="$enableval"],
75042542f5fSchristos	      [ASYNC_SWAP="no"])
75142542f5fSchristosAM_CONDITIONAL(USE_ASYNC_SWAP, test "x$ASYNC_SWAP" = "xyes")
75242542f5fSchristosif test "x$ASYNC_SWAP" = "xyes"; then
75303b705cfSriastradh	AC_DEFINE(USE_ASYNC_SWAP,1,[Assume asynchronous swap support])
75403b705cfSriastradh	xp_msg="$xp_msg async-swap"
75503b705cfSriastradhfi
7568c7da7f0Smrg
75703b705cfSriastradhAC_ARG_ENABLE(debug,
75803b705cfSriastradh	      AS_HELP_STRING([--enable-debug],
75903b705cfSriastradh			     [Enables internal debugging [default=no]]),
76003b705cfSriastradh              [DEBUG="$enableval"],
76142542f5fSchristos              [DEBUG="no"])
76203b705cfSriastradhAC_ARG_ENABLE(valgrind,
76303b705cfSriastradh	      AS_HELP_STRING([--enable-valgrind],
76403b705cfSriastradh			     [Enables valgrindified ioctls for debugging [default=no]]),
76503b705cfSriastradh              [VG="$enableval"],
76642542f5fSchristos              [VG="no"])
76703b705cfSriastradh
76803b705cfSriastradhLIBS=""
76903b705cfSriastradhAC_SEARCH_LIBS(clock_gettime, rt, [CLOCK_GETTIME_LIBS=$LIBS])
77003b705cfSriastradhAC_SUBST(CLOCK_GETTIME_LIBS)
77103b705cfSriastradh
77203b705cfSriastradhsdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
77303b705cfSriastradh
77442542f5fSchristosAM_CONDITIONAL(DEBUG, test "x$DEBUG" != "xno")
77542542f5fSchristosAM_CONDITIONAL(FULL_DEBUG, test "x$DEBUG" = "xfull")
77642542f5fSchristosif test "x$DEBUG" = "xno"; then
77703b705cfSriastradh	AC_DEFINE(NDEBUG,1,[Disable internal debugging])
77803b705cfSriastradhelse
77942542f5fSchristos	if test "x$VG" != "xyes"; then
78003b705cfSriastradh		VG=auto
78103b705cfSriastradh	fi
78203b705cfSriastradhfi
78303b705cfSriastradhdebug_msg=""
78442542f5fSchristoshave_valgrind="no"
78542542f5fSchristosif test "x$VG" != "xno"; then
78642542f5fSchristos	PKG_CHECK_MODULES(VALGRIND, [valgrind], have_valgrind="yes", have_valgrind="no")
78703b705cfSriastradh	AC_MSG_CHECKING([whether to include valgrind support])
78842542f5fSchristos	if test "x$have_valgrind" = "xyes"; then
78903b705cfSriastradh		AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
79003b705cfSriastradh	else
79142542f5fSchristos		if test "x$VG" = "xyes"; then
79203b705cfSriastradh			AC_MSG_ERROR([valgrind support requested, but valgrind-dev headers not found])
79303b705cfSriastradh		fi
79403b705cfSriastradh	fi
79503b705cfSriastradh	AC_MSG_RESULT([$have_valgrind ($VG)])
79603b705cfSriastradhfi
79742542f5fSchristosAM_CONDITIONAL(VALGRIND, test "x$have_valgrind" = "xyes")
79842542f5fSchristosif test "x$have_valgrind" = "xyes"; then
79903b705cfSriastradh	debug_msg="$debug_msg valgrind"
80003b705cfSriastradhfi
80142542f5fSchristosif test "x$DEBUG" = "xsync"; then
80203b705cfSriastradh	AC_DEFINE(DEBUG_SYNC,1,[Enable synchronous rendering for debugging])
80303b705cfSriastradh	debug_msg="$debug_msg sync"
80403b705cfSriastradhfi
80542542f5fSchristosif test "x$DEBUG" = "xmemory"; then
80603b705cfSriastradh	AC_DEFINE(DEBUG_MEMORY,1,[Enable memory debugging])
80703b705cfSriastradh	debug_msg="$debug_msg memory"
80803b705cfSriastradhfi
80942542f5fSchristosif test "x$DEBUG" = "xpixmap"; then
81003b705cfSriastradh	AC_DEFINE(DEBUG_PIXMAP,1,[Enable pixmap debugging])
81103b705cfSriastradh	debug_msg="$debug_msg pixmaps"
81203b705cfSriastradhfi
81342542f5fSchristosif test "x$DEBUG" = "xfull"; then
81403b705cfSriastradh	AC_DEFINE(DEBUG_MEMORY,1,[Enable memory debugging])
81503b705cfSriastradh	AC_DEFINE(DEBUG_PIXMAP,1,[Enable pixmap debugging])
81603b705cfSriastradh	AC_DEFINE(HAS_DEBUG_FULL,1,[Enable all debugging])
81703b705cfSriastradh        CFLAGS="$CFLAGS -O0 -ggdb3"
81803b705cfSriastradh	debug_msg=" full"
81903b705cfSriastradhfi
82042542f5fSchristosif test "x$debug_msg" = "x"; then
82103b705cfSriastradh	debug_msg=" none"
82203b705cfSriastradhfi
8238c7da7f0Smrg
82442542f5fSchristosAC_CONFIG_LIBOBJ_DIR(libobj)
82542542f5fSchristosAC_REPLACE_FUNCS(getline)
82642542f5fSchristos
82742542f5fSchristosDRIVER_NAME="intel"
8288c7da7f0SmrgAC_SUBST([DRIVER_NAME])
82903b705cfSriastradhAC_SUBST([moduledir])
83042542f5fSchristosAC_DEFINE_DIR([PREFIX_PATH], prefix, [installation prefix])
83142542f5fSchristosAC_DEFINE_DIR([LIBEXEC_PATH], libexecdir, [libexec directory])
8328c7da7f0Smrg
83303b705cfSriastradhAC_CONFIG_FILES([
83403b705cfSriastradh                Makefile
83503b705cfSriastradh                man/Makefile
83642542f5fSchristos		libobj/Makefile
83703b705cfSriastradh                src/Makefile
83803b705cfSriastradh                src/legacy/Makefile
83903b705cfSriastradh                src/legacy/i810/Makefile
84003b705cfSriastradh                src/legacy/i810/xvmc/Makefile
84103b705cfSriastradh                src/render_program/Makefile
84203b705cfSriastradh                src/sna/Makefile
84303b705cfSriastradh                src/sna/brw/Makefile
84403b705cfSriastradh                src/sna/fb/Makefile
84503b705cfSriastradh                src/uxa/Makefile
84603b705cfSriastradh                xvmc/Makefile
84703b705cfSriastradh                xvmc/shader/Makefile
84803b705cfSriastradh                xvmc/shader/mc/Makefile
84903b705cfSriastradh                xvmc/shader/vld/Makefile
85003b705cfSriastradh		test/Makefile
85142542f5fSchristos		tools/Makefile
85242542f5fSchristos		tools/org.x.xf86-video-intel.backlight-helper.policy
8538c7da7f0Smrg])
85403b705cfSriastradhAC_OUTPUT
85503b705cfSriastradh
85642542f5fSchristosecho ""
85742542f5fSchristosecho ""
85842542f5fSchristostest -e `pwd $0`/README && cat `pwd $0`/README
85942542f5fSchristos
86003b705cfSriastradhaccel_msg=""
86103b705cfSriastradhif test "x$SNA" != "xno"; then
86242542f5fSchristos	if test "$accel" = "none"; then
86342542f5fSchristos		accel_msg="$accel_msg *none"
86442542f5fSchristos	else
86542542f5fSchristos		accel_msg="$accel_msg none"
86642542f5fSchristos	fi
86703b705cfSriastradh	if test "$accel" = "sna"; then
86803b705cfSriastradh		accel_msg="$accel_msg *sna"
86903b705cfSriastradh	else
87003b705cfSriastradh		accel_msg="$accel_msg sna"
87103b705cfSriastradh	fi
87203b705cfSriastradhfi
87303b705cfSriastradhif test "x$UXA" != "xno"; then
87442542f5fSchristos	if test "x$SNA" = "xno"; then
87542542f5fSchristos		if test "$accel" = "none"; then
87642542f5fSchristos			accel_msg="$accel_msg *none"
87742542f5fSchristos		else
87842542f5fSchristos			accel_msg="$accel_msg none"
87942542f5fSchristos		fi
88042542f5fSchristos	fi
88103b705cfSriastradh	if test "$accel" = "uxa"; then
88203b705cfSriastradh		accel_msg="$accel_msg *uxa"
88303b705cfSriastradh	else
88403b705cfSriastradh		accel_msg="$accel_msg uxa"
88503b705cfSriastradh	fi
88603b705cfSriastradhfi
88703b705cfSriastradh
88842542f5fSchristosif test "x$dri_msg" = "x"; then
88903b705cfSriastradh	dri_msg=" none"
89003b705cfSriastradhfi
89103b705cfSriastradh
89242542f5fSchristosif test "x$tools_msg" = "x"; then
89342542f5fSchristos	tools_msg=" none"
89442542f5fSchristosfi
89542542f5fSchristos
89603b705cfSriastradhecho ""
89703b705cfSriastradhecho "AC_PACKAGE_STRING will be compiled with:"
89842542f5fSchristosecho "  Xorg Video ABI version: $ABI_VERSION"
89903b705cfSriastradhecho "  Acceleration backends:$accel_msg"
90003b705cfSriastradhecho "  Additional debugging support?$debug_msg"
90142542f5fSchristosecho "  Support for Kernel Mode Setting? $KMS"
90242542f5fSchristosecho "  Support for legacy User Mode Setting (for i810)? $UMS"
90303b705cfSriastradhecho "  Support for Direct Rendering Infrastructure:$dri_msg"
90403b705cfSriastradhecho "  Support for Xv motion compensation (XvMC and libXvMC):$xvmc_msg"
90542542f5fSchristosecho "  Build additional tools and utilities?$tools_msg"
90603b705cfSriastradhif test -n "$xp_msg"; then
90703b705cfSriastradhecho "  Experimental support:$xp_msg"
90803b705cfSriastradhfi
90903b705cfSriastradhecho ""
910