1 # Copyright 2005 Adam Jackson.
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # on the rights to use, copy, modify, merge, publish, distribute, sub
7 # license, and/or sell copies of the Software, and to permit persons to whom
8 # the Software is furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 # ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18 # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 # Process this file with autoconf to produce a configure script
25 AC_INIT([xf86-video-intel],
27 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
29 AC_CONFIG_SRCDIR([Makefile.am])
30 AC_CONFIG_HEADERS([config.h])
34 AM_INIT_AUTOMAKE([foreign dist-bzip2])
37 # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
38 m4_ifndef([XORG_MACROS_VERSION],
39 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen.
40 Hint: either install from source, git://anongit.freedesktop.org/xorg/util/macros or,
41 depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])])
43 XORG_MACROS_VERSION(1.8)
46 # Require X.Org server macros (i.e. XORG_DRIVER_CHECK_EXT) to check for required modules
47 m4_ifndef([XORG_DRIVER_CHECK_EXT],
48 [m4_fatal([must install xorg-server macros before running autoconf/autogen.
49 Hint: either install from source, git://anongit.freedesktop.org/xorg/xserver or,
50 depending on your distribution, try package 'xserver-xorg-dev' or 'xorg-x11-server-devel'])])
57 # Are we in a git checkout?
60 AC_DEFINE(HAVE_DOT_GIT, 1, [Are we in a git checkout?])
63 AM_CONDITIONAL(HAVE_DOT_GIT, test x$dot_git = xyes)
65 # If so, we include the git description in our logs for sanity checking.
67 # However, for people not running their own drivers this is just noise.
68 # So we copy the xserver's builderstring idiom to allow for this to be
69 # overridden and perhaps replaced with something more useful.
70 AC_ARG_WITH(builderstring,
71 AS_HELP_STRING([--with-builderstring=BUILDERSTRING],
72 [Additional builder string (default: use git describe)]),
73 [BUILDERSTRING="$withval"],
74 [BUILDERSTRING="x-magic-git-describe"])
76 if test "x$BUILDERSTRING" = xx-magic-git-describe -a x$dot_git = xyes; then
77 AC_DEFINE(USE_GIT_DESCRIBE, 1, [Use automagic builder description])
79 if test "x$BUILDERSTRING" != x -a "x$BUILDERSTRING" != xno -a "x$BUILDERSTRING" != xx-magic-git-describe; then
80 AC_DEFINE_UNQUOTED(BUILDER_DESCRIPTION, ["$BUILDERSTRING"], [Builder description])
85 PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.2], [gen4asm=yes], [gen4asm=no])
86 AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
89 AS_HELP_STRING([--disable-udev],
90 [Disable udev-based monitor hotplug detection [default=auto]]),
94 if test x$UDEV != "xno"; then
95 PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no])
96 if test x$UDEV == xyes -a x$udev != xyes; then
97 AC_MSG_ERROR([udev support requested but not found (libudev)])
99 if test x$udev = xyes; then
100 AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
104 PKG_CHECK_MODULES(X11, [x11 xrender xext pixman-1], [x11=yes], [x11=no])
105 AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
107 AH_TOP([#include "xorg-server.h"])
109 # Define a configure option for an alternate module directory
110 AC_ARG_WITH(xorg-module-dir,
111 AS_HELP_STRING([--with-xorg-module-dir=DIR],
112 [Default xorg module directory [[default=$libdir/xorg/modules]]]),
113 [moduledir="$withval"],
114 [moduledir="$libdir/xorg/modules"])
116 AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
117 [Disable DRI support [[default=auto]]]))
119 AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc],
120 [Disable XvMC support [[default=yes]]]),
124 AC_ARG_ENABLE(kms-only, AS_HELP_STRING([--enable-kms-only],
125 [Assume KMS support [[default=no]]]),
126 [KMS_ONLY="$enableval"],
128 AC_ARG_ENABLE(ums-only, AS_HELP_STRING([--enable-ums-only],
129 [Assume only UMS (no KMS) support [[default=no]]]),
130 [UMS_ONLY="$enableval"],
133 required_xorg_xserver_version=1.6
134 required_pixman_version=0.24
136 if pkg-config --exists 'pixman-1 >= 0.27.1'; then
137 AC_DEFINE([HAS_PIXMAN_GLYPHS], 1, [Enable pixman glyph cache])
141 AS_HELP_STRING([--enable-sna],
142 [Enable SandyBridge's New Acceleration (SNA) [default=auto]]),
146 AC_CHECK_HEADERS([sys/sysinfo.h], , SNA=no)
147 if test "x$SNA" = "xauto" && pkg-config --exists "xorg-server >= 1.10"; then
150 if test "x$SNA" != "xno"; then
151 required_xorg_xserver_version=1.10
152 AC_DEFINE(USE_SNA, 1, [Enable SNA support])
154 AC_MSG_CHECKING([whether to include SNA support])
155 AM_CONDITIONAL(SNA, test x$SNA != xno)
156 AC_MSG_RESULT([$SNA])
159 AS_HELP_STRING([--enable-uxa],
160 [Enable Unified Acceleration Architecture (UXA) [default=yes]]),
163 AC_MSG_CHECKING([whether to include UXA support])
164 AM_CONDITIONAL(UXA, test x$UXA != xno)
165 AC_MSG_RESULT([$UXA])
166 if test "x$UXA" != "xno"; then
167 AC_DEFINE(USE_UXA, 1, [Enable UXA support])
168 PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= 2.4.29])
171 AC_MSG_CHECKING([whether to include GLAMOR support])
172 AC_ARG_ENABLE(glamor,
173 AS_HELP_STRING([--enable-glamor],
174 [Enable glamor, a new GL-based acceleration [default=no]]),
175 [GLAMOR="$enableval"],
177 AC_MSG_RESULT([$GLAMOR])
178 AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
179 if test "x$GLAMOR" != "xno"; then
180 PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
181 PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
182 AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
186 PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
189 AS_HELP_STRING([--enable-xaa],
190 [Enable legacy X Acceleration Architecture (XAA) [default=auto]]),
193 if test "x$XAA" != xno; then
196 AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
199 AC_MSG_CHECKING([whether to include XAA support])
200 AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
201 AC_MSG_RESULT([$XAA])
204 AS_HELP_STRING([--enable-dga],
205 [Enable legacy Direct Graphics Access (DGA) [default=auto]]),
208 if test "x$DGA" != xno; then
211 AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no, [#include <dixstruct.h>])
214 AC_MSG_CHECKING([whether to include DGA support])
215 AM_CONDITIONAL(DGA, test "x$DGA" = xyes)
216 AC_MSG_RESULT([$DGA])
218 AC_ARG_WITH(default-accel,
219 AS_HELP_STRING([--with-default-accel],
220 [Select the default acceleration method [default=uxa if enabled, otherwise sna]]),
223 if test "x$accel" = xyes; then
224 AC_MSG_WARN([No default acceleration specified, choosing automatic selection])
228 AC_MSG_CHECKING([which acceleration method to use by default])
229 if test "x$accel" = xauto; then
230 if test "x$UXA" != "xno"; then
233 if test "x$SNA" != "xno"; then
237 if test "x$accel" = xauto -a "x$UMS_ONLY" != "xyes"; then
238 AC_MSG_ERROR([No default acceleration option])
243 if test "x$accel" = xsna; then
244 if test "x$SNA" != "xno"; then
245 AC_DEFINE(DEFAULT_ACCEL_METHOD, SNA, [Default acceleration method])
248 AC_MSG_ERROR([SNA requested as default, but is not enabled])
252 if test "x$accel" = xuxa; then
253 if test "x$UXA" != "xno"; then
254 AC_DEFINE(DEFAULT_ACCEL_METHOD, UXA, [Default acceleration method])
257 AC_MSG_ERROR([UXA requested as default, but is not enabled])
260 AC_MSG_RESULT($accel)
261 if test "x$accel" = xnone -a "x$UMS_ONLY" != "xyes"; then
262 AC_MSG_ERROR([No default acceleration option])
265 AC_ARG_ENABLE(userptr,
266 AS_HELP_STRING([--enable-userptr],
267 [Enable use of userptr (experimental) [default=no]]),
268 [USERPTR="$enableval"],
270 AM_CONDITIONAL(USE_USERPTR, test x$USERPTR = xyes)
271 if test "x$USERPTR" = xyes; then
272 AC_DEFINE(USE_USERPTR,1,[Assume USERPTR support])
275 AC_ARG_ENABLE(async-swap,
276 AS_HELP_STRING([--enable-async-swap],
277 [Enable use of asynchronous swaps (experimental) [default=no]]),
278 [ASYNC_SWAP="$enableval"],
280 AM_CONDITIONAL(USE_ASYNC_SWAP, test x$ASYNC_SWAP = xyes)
281 if test "x$ASYNC_SWAP" = xyes; then
282 AC_DEFINE(USE_ASYNC_SWAP,1,[Assume asynchronous swap support])
286 AS_HELP_STRING([--enable-debug],
287 [Enables internal debugging [default=no]]),
288 [DEBUG="$enableval"],
290 # Store the list of server defined optional extensions in REQUIRED_MODULES
291 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
292 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
293 XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
294 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
296 # Obtain compiler/linker options for the driver dependencies
297 PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.24]) # libdrm_intel is checked separately
298 PKG_CHECK_MODULES(DRI, [xf86driproto], , DRI=no)
299 PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6],, DRI2=no)
300 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
302 sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
304 if test "x$enable_dri" != "xno"; then
305 save_CFLAGS="$CFLAGS"
306 save_CPPFLAGS="$CPPFLAGS"
307 CFLAGS="$CFLAGS $XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"
308 CPPFLAGS="$CPPFLAGS $XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"
309 AC_CHECK_HEADERS([dri.h sarea.h dristruct.h],, [DRI=no],
312 /* for dristruct.h */
313 #include <xorg-server.h>
321 CFLAGS="$save_CFLAGS $DEBUGFLAGS"
322 CPPFLAGS="$save_CPPFLAGS"
327 AC_MSG_CHECKING([whether to include DRI support])
328 AC_MSG_RESULT([${DRI-yes}])
330 AM_CONDITIONAL(DRI, test x$DRI != xno)
331 if test "x$DRI" != "xno"; then
332 AC_DEFINE(HAVE_DRI1,1,[Enable DRI driver support])
337 if test "x$enable_dri" = "xyes"; then
338 AC_MSG_ERROR([DRI requested but prerequisites not found])
342 if test "x$DRI2" != "xno"; then
344 CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI_CFLAGS $DRI2_CFLAGS"
345 AC_CHECK_HEADERS([dri2.h], DRI2=yes, DRI2=no, [#include <dixstruct.h>])
348 AC_MSG_CHECKING([whether to include DRI2 support])
349 AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
350 AC_MSG_RESULT([$DRI2])
352 if test "$XVMC" = yes; then
353 PKG_CHECK_MODULES(XVMCLIB,
354 [xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux],
355 [XVMC=yes], [XVMC=no])
357 AC_MSG_CHECKING([whether to include XvMC support])
358 AC_MSG_RESULT([$XVMC])
359 AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
360 if test "x$XVMC" = xyes; then
361 AC_DEFINE(ENABLE_XVMC,1,[Enable XvMC support])
364 AM_CONDITIONAL(KMS_ONLY, test x$KMS_ONLY = xyes)
365 if test "x$KMS_ONLY" = xyes; then
366 AC_DEFINE(KMS_ONLY,1,[Assume KMS support])
368 AM_CONDITIONAL(UMS_ONLY, test x$UMS_ONLY = xyes)
369 if test "x$UMS_ONLY" = xyes; then
370 AC_DEFINE(UMS_ONLY,1,[Assume only UMS (no KMS) support])
373 AM_CONDITIONAL(DEBUG, test x$DEBUG != xno)
374 AM_CONDITIONAL(FULL_DEBUG, test x$FULL_DEBUG == xfull)
375 if test "x$DEBUG" = xno; then
376 AC_DEFINE(NDEBUG,1,[Disable internal debugging])
378 if test "x$DEBUG" != xno; then
379 PKG_CHECK_MODULES(VALGRIND, [valgrind], have_valgrind=yes, have_valgrind=no)
380 if test x$have_valgrind = xyes; then
381 AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
384 if test "x$DEBUG" = xmemory; then
385 AC_DEFINE(DEBUG_MEMORY,1,[Enable memory debugging])
387 if test "x$DEBUG" = xpixmap; then
388 AC_DEFINE(DEBUG_PIXMAP,1,[Enable pixmap debugging])
390 if test "x$DEBUG" = xfull; then
391 AC_DEFINE(DEBUG_MEMORY,1,[Enable memory debugging])
392 AC_DEFINE(DEBUG_PIXMAP,1,[Enable pixmap debugging])
393 AC_DEFINE(HAS_DEBUG_FULL,1,[Enable all debugging])
394 CFLAGS="$CFLAGS -O0 -ggdb3"
398 AC_SUBST([DRIVER_NAME])
399 AC_SUBST([moduledir])
406 src/xvmc/shader/Makefile
407 src/xvmc/shader/mc/Makefile
408 src/xvmc/shader/vld/Makefile
410 src/legacy/i810/Makefile
411 src/legacy/i810/xvmc/Makefile
416 src/render_program/Makefile