1 dnl Process this file with autoconf to create configure.
5 dnl Versioning - scrape the version from configs/default
6 m4_define([mesa_version],
7 [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n' | tr -d '\r'])])
8 m4_ifval(mesa_version,,
9 [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
11 dnl Tell the user about autoconf.html in the --help output
12 m4_divert_once([HELP_END], [
13 See docs/autoconf.html for more details on the options for Mesa.])
15 AC_INIT([Mesa],[mesa_version],
16 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
17 AC_CONFIG_AUX_DIR([bin])
19 AM_INIT_AUTOMAKE([foreign])
21 # Support silent build rules, requires at least automake-1.11. Disable
22 # by either passing --disable-silent-rules to configure or passing V=1
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
27 LT_INIT([disable-static])
29 dnl Save user CFLAGS and CXXFLAGS so one can override the default ones
31 USER_CXXFLAGS="$CXXFLAGS"
33 dnl Versions for external dependencies
34 LIBDRM_REQUIRED=2.4.24
35 LIBDRM_RADEON_REQUIRED=2.4.24
36 LIBDRM_INTEL_REQUIRED=2.4.30
37 LIBDRM_NOUVEAU_REQUIRED=0.6
38 DRI2PROTO_REQUIRED=2.6
39 GLPROTO_REQUIRED=1.4.14
40 LIBDRM_XORG_REQUIRED=2.4.24
41 LIBKMS_XORG_REQUIRED=1.0.0
47 AC_CHECK_PROGS([MAKE], [gmake make])
48 AC_CHECK_PROGS([PYTHON2], [python2 python])
51 AC_PATH_PROG([MKDEP], [makedepend])
53 if test "x$MKDEP" = "x"; then
54 AC_MSG_ERROR([makedepend is required to build Mesa])
57 AC_PATH_PROG([FLEX], [flex])
58 test "x$FLEX" = "x" && AC_MSG_ERROR([flex is needed to build Mesa])
60 AC_PATH_PROG([BISON], [bison])
61 test "x$BISON" = "x" && AC_MSG_ERROR([bison is needed to build Mesa])
63 dnl Our fallback install-sh is a symlink to minstall. Use the existing
64 dnl configuration in that case.
66 test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
68 dnl We need a POSIX shell for parts of the build. Assume we have one
72 # Solaris /bin/sh is too old/non-POSIX compliant
73 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
78 AC_PATH_PROG([GTESTCONFIG], [gtest-config])
79 if test "x$GTESTCONFIG" != "x"; then
80 GTEST_CFLAGS=`gtest-config --cppflags --cxxflags`
81 GTEST_LIBS=`gtest-config --ldflags --libs`
82 AC_SUBST([GTEST_CFLAGS])
83 AC_SUBST([GTEST_LIBS])
88 AM_CONDITIONAL(HAVE_GTEST, test x$HAVE_GTEST = xyes)
90 dnl clang is mostly GCC-compatible, but its version is much lower,
91 dnl so we have to check for it.
92 AC_MSG_CHECKING([if compiling with clang])
95 [AC_LANG_PROGRAM([], [[
100 [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
102 AC_MSG_RESULT([$acv_mesa_CLANG])
104 dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
105 dnl versions are explictly not supported.
106 if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
107 AC_MSG_CHECKING([whether gcc version is sufficient])
111 GCC_VERSION=`$CC -dumpversion`
112 if test $? -eq 0; then
113 major=`echo $GCC_VERSION | cut -d. -f1`
114 minor=`echo $GCC_VERSION | cut -d. -f2`
117 if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
119 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
126 MKDEP_OPTIONS=-fdepend
127 dnl Ask gcc where it's keeping its secret headers
128 if test "x$GCC" = xyes; then
129 for dir in include include-fixed; do
130 GCC_INCLUDES=`$CC -print-file-name=$dir`
131 if test "x$GCC_INCLUDES" != x && \
132 test "$GCC_INCLUDES" != "$dir" && \
133 test -d "$GCC_INCLUDES"; then
134 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
138 AC_SUBST([MKDEP_OPTIONS])
140 dnl Make sure the pkg-config macros are defined
141 m4_ifndef([PKG_PROG_PKG_CONFIG],
142 [m4_fatal([Could not locate the pkg-config autoconf macros.
143 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
144 are in a different location, try setting the environment variable
145 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
146 PKG_PROG_PKG_CONFIG()
148 dnl LIB_DIR - library basename
149 LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
152 dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
153 _SAVE_LDFLAGS="$LDFLAGS"
154 AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
155 AC_SUBST([EXTRA_LIB_PATH])
157 dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
158 _SAVE_CPPFLAGS="$CPPFLAGS"
159 AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
160 AC_SUBST([X11_INCLUDES])
167 DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
170 DEFINES="$DEFINES -DPTHREADS -DSVR4"
173 DEFINES="$DEFINES -DPTHREADS"
177 dnl Add flags for gcc and g++
178 if test "x$GCC" = xyes; then
179 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
181 # Enable -fvisibility=hidden if using a gcc that supports it
182 save_CFLAGS="$CFLAGS"
183 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
184 VISIBILITY_CFLAGS="-fvisibility=hidden"
185 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
186 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
187 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
189 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
192 # Work around aliasing bugs - developers should comment this out
193 CFLAGS="$CFLAGS -fno-strict-aliasing"
195 # gcc's builtin memcmp is slower than glibc's
196 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
197 CFLAGS="$CFLAGS -fno-builtin-memcmp"
199 if test "x$GXX" = xyes; then
200 CXXFLAGS="$CXXFLAGS -Wall"
202 # Enable -fvisibility=hidden if using a gcc that supports it
203 save_CXXFLAGS="$CXXFLAGS"
204 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
205 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
206 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
208 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
209 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
212 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
213 CXXFLAGS=$save_CXXFLAGS
215 # Work around aliasing bugs - developers should comment this out
216 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
218 # gcc's builtin memcmp is slower than glibc's
219 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
220 CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
223 dnl even if the compiler appears to support it, using visibility attributes isn't
224 dnl going to do anything useful currently on cygwin apart from emit lots of warnings
228 VISIBILITY_CXXFLAGS=""
232 AC_SUBST([VISIBILITY_CFLAGS])
233 AC_SUBST([VISIBILITY_CXXFLAGS])
235 dnl These should be unnecessary, but let the user set them if they want
236 AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
237 Default is to use CFLAGS.])
238 AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
239 compiler. Default is to use CFLAGS.])
240 AC_SUBST([OPT_FLAGS])
241 AC_SUBST([ARCH_FLAGS])
244 dnl Hacks to enable 32 or 64 bit build
246 AC_ARG_ENABLE([32-bit],
247 [AS_HELP_STRING([--enable-32-bit],
248 [build 32-bit libraries @<:@default=auto@:>@])],
249 [enable_32bit="$enableval"],
252 if test "x$enable_32bit" = xyes; then
253 if test "x$GCC" = xyes; then
254 CFLAGS="$CFLAGS -m32"
255 ARCH_FLAGS="$ARCH_FLAGS -m32"
257 if test "x$GXX" = xyes; then
258 CXXFLAGS="$CXXFLAGS -m32"
261 AC_ARG_ENABLE([64-bit],
262 [AS_HELP_STRING([--enable-64-bit],
263 [build 64-bit libraries @<:@default=auto@:>@])],
264 [enable_64bit="$enableval"],
267 if test "x$enable_64bit" = xyes; then
268 if test "x$GCC" = xyes; then
269 CFLAGS="$CFLAGS -m64"
271 if test "x$GXX" = xyes; then
272 CXXFLAGS="$CXXFLAGS -m64"
276 dnl Can't have static and shared libraries, default to static if user
277 dnl explicitly requested. If both disabled, set to static since shared
278 dnl was explicitly requested.
279 case "x$enable_static$enable_shared" in
281 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
285 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
293 AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
294 if test "$enable_static" = yes; then
295 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
297 AC_SUBST([MKLIB_OPTIONS])
300 dnl other compiler options
302 AC_ARG_ENABLE([debug],
303 [AS_HELP_STRING([--enable-debug],
304 [use debug compiler flags and macros @<:@default=disabled@:>@])],
305 [enable_debug="$enableval"],
308 if test "x$enable_debug" = xyes; then
309 DEFINES="$DEFINES -DDEBUG"
310 if test "x$GCC" = xyes; then
313 if test "x$GXX" = xyes; then
314 CXXFLAGS="$CXXFLAGS -g"
321 LIB_PREFIX_GLOB='lib'
322 LIB_VERSION_SEPARATOR='.'
323 if test "$enable_static" = yes; then
328 LIB_EXTENSION='dylib' ;;
330 dnl prefix can be 'cyg' or 'lib'
331 LIB_PREFIX_GLOB='???'
332 LIB_VERSION_SEPARATOR='-'
333 LIB_EXTENSION='dll' ;;
337 LIB_EXTENSION='so' ;;
342 dnl Mangled Mesa support
344 AC_ARG_ENABLE([mangling],
345 [AS_HELP_STRING([--enable-mangling],
346 [enable mangled symbols and library name @<:@default=disabled@:>@])],
347 [enable_mangling="${enableval}"],
353 if test "x${enable_mangling}" = "xyes" ; then
354 DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
357 OSMESA_LIB="MangledOSMesa"
361 AC_SUBST([OSMESA_LIB])
364 dnl potentially-infringing-but-nobody-knows-for-sure stuff
366 AC_ARG_ENABLE([texture-float],
367 [AS_HELP_STRING([--enable-texture-float],
368 [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
369 [enable_texture_float="$enableval"],
370 [enable_texture_float=no]
372 if test "x$enable_texture_float" = xyes; then
373 AC_MSG_WARN([Floating-point textures enabled.])
374 AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
375 DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
378 GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
379 GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
380 OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
381 EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
382 GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
383 GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
384 VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
385 GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
387 GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
388 GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
389 OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
390 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
391 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
392 GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
393 GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
394 VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
395 GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
397 AC_SUBST([GL_LIB_NAME])
398 AC_SUBST([GLU_LIB_NAME])
399 AC_SUBST([OSMESA_LIB_NAME])
400 AC_SUBST([EGL_LIB_NAME])
401 AC_SUBST([GLESv1_CM_LIB_NAME])
402 AC_SUBST([GLESv2_LIB_NAME])
403 AC_SUBST([VG_LIB_NAME])
404 AC_SUBST([GLAPI_LIB_NAME])
406 AC_SUBST([GL_LIB_GLOB])
407 AC_SUBST([GLU_LIB_GLOB])
408 AC_SUBST([OSMESA_LIB_GLOB])
409 AC_SUBST([EGL_LIB_GLOB])
410 AC_SUBST([GLESv1_CM_LIB_GLOB])
411 AC_SUBST([GLESv2_LIB_GLOB])
412 AC_SUBST([VG_LIB_GLOB])
413 AC_SUBST([GLAPI_LIB_GLOB])
416 dnl Arch/platform-specific settings
419 [AS_HELP_STRING([--disable-asm],
420 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
421 [enable_asm="$enableval"],
428 AC_MSG_CHECKING([whether to enable assembly])
429 test "x$enable_asm" = xno && AC_MSG_RESULT([no])
430 # disable if cross compiling on x86/x86_64 since we must run gen_matypes
431 if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
435 AC_MSG_RESULT([no, cross compiling])
439 # check for supported arches
440 if test "x$enable_asm" = xyes; then
444 linux* | *freebsd* | dragonfly* | *netbsd*)
445 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
451 linux* | *freebsd* | dragonfly* | *netbsd*)
452 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
474 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
475 MESA_ASM_SOURCES='$(X86_SOURCES)'
476 GLAPI_ASM_SOURCES='$(X86_API)'
477 AC_MSG_RESULT([yes, x86])
480 ASM_FLAGS="-DUSE_X86_64_ASM"
481 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
482 GLAPI_ASM_SOURCES='$(X86-64_API)'
483 AC_MSG_RESULT([yes, x86_64])
486 ASM_FLAGS="-DUSE_SPARC_ASM"
487 MESA_ASM_SOURCES='$(SPARC_SOURCES)'
488 GLAPI_ASM_SOURCES='$(SPARC_API)'
489 AC_MSG_RESULT([yes, sparc])
492 AC_MSG_RESULT([no, platform not supported])
496 AC_SUBST([ASM_FLAGS])
497 AC_SUBST([MESA_ASM_SOURCES])
498 AC_SUBST([GLAPI_ASM_SOURCES])
503 dnl Check to see if dlopen is in default libraries (like Solaris, which
504 dnl has it in libc), or if libdl is needed to get it.
505 AC_CHECK_FUNC([dlopen], [],
506 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
507 AC_SUBST([DLOPEN_LIBS])
509 dnl See if posix_memalign is available
510 AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
512 dnl SELinux awareness.
513 AC_ARG_ENABLE([selinux],
514 [AS_HELP_STRING([--enable-selinux],
515 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
516 [MESA_SELINUX="$enableval"],
518 if test "x$enable_selinux" = "xyes"; then
519 AC_CHECK_HEADER([selinux/selinux.h],[],
520 [AC_MSG_ERROR([SELinux headers not found])])
521 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
522 [AC_MSG_ERROR([SELinux library not found])])
523 SELINUX_LIBS="-lselinux"
524 DEFINES="$DEFINES -DMESA_SELINUX"
528 AC_ARG_ENABLE([opengl],
529 [AS_HELP_STRING([--disable-opengl],
530 [disable support for standard OpenGL API @<:@default=no@:>@])],
531 [enable_opengl="$enableval"],
533 AC_ARG_ENABLE([gles1],
534 [AS_HELP_STRING([--enable-gles1],
535 [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
536 [enable_gles1="$enableval"],
538 AC_ARG_ENABLE([gles2],
539 [AS_HELP_STRING([--enable-gles2],
540 [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
541 [enable_gles2="$enableval"],
543 AC_ARG_ENABLE([openvg],
544 [AS_HELP_STRING([--enable-openvg],
545 [enable support for OpenVG API @<:@default=no@:>@])],
546 [enable_openvg="$enableval"],
550 [AS_HELP_STRING([--enable-dri],
551 [enable DRI modules @<:@default=auto@:>@])],
552 [enable_dri="$enableval"],
555 [AS_HELP_STRING([--enable-glx],
556 [enable GLX library @<:@default=auto@:>@])],
557 [enable_glx="$enableval"],
559 AC_ARG_ENABLE([osmesa],
560 [AS_HELP_STRING([--enable-osmesa],
561 [enable OSMesa library @<:@default=auto@:>@])],
562 [enable_osmesa="$enableval"],
563 [enable_osmesa=auto])
565 [AS_HELP_STRING([--disable-egl],
566 [disable EGL library @<:@default=enabled@:>@])],
567 [enable_egl="$enableval"],
570 AC_ARG_ENABLE([xorg],
571 [AS_HELP_STRING([--enable-xorg],
572 [enable support for X.Org DDX API @<:@default=no@:>@])],
573 [enable_xorg="$enableval"],
576 [AS_HELP_STRING([--enable-xa],
577 [enable build of the XA X Acceleration API @<:@default=no@:>@])],
578 [enable_xa="$enableval"],
580 AC_ARG_ENABLE([d3d1x],
581 [AS_HELP_STRING([--enable-d3d1x],
582 [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
583 [enable_d3d1x="$enableval"],
586 [AS_HELP_STRING([--enable-gbm],
587 [enable gbm library @<:@default=auto@:>@])],
588 [enable_gbm="$enableval"],
591 AC_ARG_ENABLE([xvmc],
592 [AS_HELP_STRING([--enable-xvmc],
593 [enable xvmc library @<:@default=auto@:>@])],
594 [enable_xvmc="$enableval"],
596 AC_ARG_ENABLE([vdpau],
597 [AS_HELP_STRING([--enable-vdpau],
598 [enable vdpau library @<:@default=auto@:>@])],
599 [enable_vdpau="$enableval"],
602 [AS_HELP_STRING([--enable-va],
603 [enable va library @<:@default=auto@:>@])],
604 [enable_va="$enableval"],
607 AC_ARG_ENABLE([xlib_glx],
608 [AS_HELP_STRING([--enable-xlib-glx],
609 [make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
610 [enable_xlib_glx="$enableval"],
611 [enable_xlib_glx=auto])
612 AC_ARG_ENABLE([gallium_egl],
613 [AS_HELP_STRING([--enable-gallium-egl],
614 [enable optional EGL state tracker (not required
615 for EGL support in Gallium with OpenGL and OpenGL ES)
616 @<:@default=disable@:>@])],
617 [enable_gallium_egl="$enableval"],
618 [enable_gallium_egl=no])
619 AC_ARG_ENABLE([gallium_gbm],
620 [AS_HELP_STRING([--enable-gallium-gbm],
621 [enable optional gbm state tracker (not required for
622 gbm support in Gallium)
623 @<:@default=auto@:>@])],
624 [enable_gallium_gbm="$enableval"],
625 [enable_gallium_gbm=auto])
627 # Option for Gallium drivers
628 GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
630 AC_ARG_WITH([gallium-drivers],
631 [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
632 [comma delimited Gallium drivers list, e.g.
633 "i915,nouveau,r300,r600,svga,swrast"
634 @<:@default=r300,r600,swrast@:>@])],
635 [with_gallium_drivers="$withval"],
636 [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
638 # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
639 # here so that the script doesn't choke on an unknown driver name later.
640 case "$with_gallium_drivers" in
641 yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
642 no) with_gallium_drivers='' ;;
645 if test "x$enable_opengl" = xno -a \
646 "x$enable_gles1" = xno -a \
647 "x$enable_gles2" = xno -a \
648 "x$enable_openvg" = xno -a \
649 "x$enable_xorg" = xno -a \
650 "x$enable_xa" = xno -a \
651 "x$enable_d3d1x" = xno -a \
652 "x$enable_xvmc" = xno -a \
653 "x$enable_vdpau" = xno -a \
654 "x$enable_va" = xno; then
655 AC_MSG_ERROR([at least one API should be enabled])
659 if test "x$enable_opengl" = xno; then
660 API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
662 API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
664 if test "x$enable_gles1" = xyes; then
665 API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
667 if test "x$enable_gles2" = xyes; then
668 API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
670 AC_SUBST([API_DEFINES])
672 AC_ARG_ENABLE([shared-glapi],
673 [AS_HELP_STRING([--enable-shared-glapi],
674 [EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
675 [enable_shared_glapi="$enableval"],
676 [enable_shared_glapi=no])
679 if test "x$enable_shared_glapi" = xyes; then
682 AC_SUBST([SHARED_GLAPI])
685 dnl Driver configuration. Options are xlib, dri and osmesa right now.
686 dnl More later: fbdev, ...
688 default_driver="xlib"
693 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
696 *freebsd* | dragonfly* | *netbsd*)
698 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
703 if test "x$enable_opengl" = xno; then
707 AC_ARG_WITH([driver],
708 [AS_HELP_STRING([--with-driver=DRIVER], [DEPRECATED])],
709 [mesa_driver="$withval"],
711 dnl Check for valid option
712 case "x$mesa_driver" in
713 xxlib|xdri|xosmesa|xno)
714 if test "x$enable_dri" != xauto -o \
715 "x$enable_glx" != xauto -o \
716 "x$enable_osmesa" != xauto -o \
717 "x$enable_xlib_glx" != xauto; then
718 AC_MSG_ERROR([--with-driver=$mesa_driver is deprecated])
722 mesa_driver="$default_driver"
725 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
729 # map $mesa_driver to APIs
730 if test "x$enable_dri" = xauto; then
731 case "x$mesa_driver" in
732 xdri) enable_dri=yes ;;
737 if test "x$enable_glx" = xauto; then
738 case "x$mesa_driver" in
739 xdri|xxlib) enable_glx=yes ;;
744 if test "x$enable_osmesa" = xauto; then
745 case "x$mesa_driver" in
746 xxlib|xosmesa) enable_osmesa=yes ;;
747 *) enable_osmesa=no ;;
751 if test "x$enable_xlib_glx" = xauto; then
752 case "x$mesa_driver" in
753 xxlib) enable_xlib_glx=yes ;;
754 *) enable_xlib_glx=no ;;
758 if test "x$enable_glx" = xno; then
762 AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
765 dnl Driver specific build directories
768 dnl this variable will be prepended to SRC_DIRS and is not exported
773 GALLIUM_DIRS="auxiliary drivers state_trackers"
774 GALLIUM_TARGET_DIRS=""
775 GALLIUM_WINSYS_DIRS="sw"
776 GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
777 GALLIUM_STATE_TRACKERS_DIRS=""
779 # build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
780 case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
782 CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
786 # build glapi if OpenGL is enabled
787 if test "x$enable_opengl" = xyes; then
788 CORE_DIRS="$CORE_DIRS mapi/glapi"
791 # build es1api if OpenGL ES 1.x is enabled
792 if test "x$enable_gles1" = xyes; then
793 CORE_DIRS="$CORE_DIRS mapi/es1api"
796 # build es2api if OpenGL ES 2.x is enabled
797 if test "x$enable_gles2" = xyes; then
798 CORE_DIRS="$CORE_DIRS mapi/es2api"
801 # build glsl and mesa if OpenGL or OpenGL ES is enabled
802 case "x$enable_opengl$enable_gles1$enable_gles2" in
804 CORE_DIRS="$CORE_DIRS glsl mesa"
808 case "x$enable_glx$enable_xlib_glx" in
810 DRIVER_DIRS="$DRIVER_DIRS x11"
811 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
812 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
813 GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
814 HAVE_WINSYS_XLIB="yes"
818 SRC_DIRS="$SRC_DIRS glx"
822 if test "x$enable_dri" = xyes; then
823 DRIVER_DIRS="$DRIVER_DIRS dri"
825 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
826 GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
830 if test "x$enable_osmesa" = xyes; then
831 # the empty space matters for osmesa... (see src/mesa/Makefile)
832 if test -n "$DRIVER_DIRS"; then
833 DRIVER_DIRS="$DRIVER_DIRS osmesa"
841 AC_SUBST([DRIVER_DIRS])
842 AC_SUBST([GALLIUM_DIRS])
843 AC_SUBST([GALLIUM_TARGET_DIRS])
844 AC_SUBST([GALLIUM_WINSYS_DIRS])
845 AC_SUBST([GALLIUM_DRIVERS_DIRS])
846 AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
847 AC_SUBST([MESA_LLVM])
850 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
851 [have_libdrm=yes], [have_libdrm=no])
853 if test "x$enable_dri" = xyes; then
854 # DRI must be shared, I think
855 if test "$enable_static" = yes; then
856 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
859 # not a hard requirement as swrast does not depend on it
860 if test "x$have_libdrm" = xyes; then
861 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
866 dnl Find out if X is available. The variable have_x is set if libX11 is
867 dnl found to mimic AC_PATH_XTRA.
869 if test -n "$PKG_CONFIG"; then
870 AC_MSG_CHECKING([pkg-config files for X11 are available])
871 PKG_CHECK_EXISTS([x11],[
877 AC_MSG_RESULT([$x11_pkgconfig])
881 dnl Use the autoconf macro if no pkg-config files
882 if test "$x11_pkgconfig" = yes; then
883 PKG_CHECK_MODULES([X11], [x11])
886 test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
887 test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
888 AC_SUBST([X11_CFLAGS])
892 dnl Try to tell the user that the --x-* options are only used when
893 dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
894 m4_divert_once([HELP_BEGIN],
895 [These options are only used when the X libraries cannot be found by the
896 pkg-config utility.])
898 dnl We need X for xlib and dri, so bomb now if it's not found
899 if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
900 AC_MSG_ERROR([X11 development libraries needed for GLX])
903 if test "x$enable_glx" = xyes; then
904 DEFINES="$DEFINES -DUSE_XCB"
907 dnl Direct rendering or just indirect rendering
910 dnl Disable by default on GNU/Hurd
911 driglx_direct_default="no"
914 dnl Disable by default on cygwin
915 driglx_direct_default="no"
918 driglx_direct_default="yes"
921 AC_ARG_ENABLE([driglx-direct],
922 [AS_HELP_STRING([--disable-driglx-direct],
923 [enable direct rendering in GLX and EGL for DRI \
924 @<:@default=auto@:>@])],
925 [driglx_direct="$enableval"],
926 [driglx_direct="$driglx_direct_default"])
929 dnl libGL configuration per driver
931 case "x$enable_glx$enable_xlib_glx" in
934 if test "$x11_pkgconfig" = yes; then
935 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
936 GL_PC_REQ_PRIV="x11 xext"
937 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
938 GL_LIB_DEPS="$XLIBGL_LIBS"
940 # should check these...
941 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
942 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
943 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
944 GL_PC_CFLAGS="$X11_INCLUDES"
946 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
947 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
951 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
952 GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
953 if test x"$driglx_direct" = xyes; then
954 if test "x$have_libdrm" != xyes; then
955 AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
957 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
958 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
961 # find the DRI deps for libGL
962 if test "$x11_pkgconfig" = yes; then
963 dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx"
965 # add xf86vidmode if available
966 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
967 if test "$HAVE_XF86VIDMODE" = yes ; then
968 dri_modules="$dri_modules xxf86vm"
971 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
972 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
973 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
974 GL_LIB_DEPS="$DRIGL_LIBS"
976 # should check these...
977 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
978 if test "x$HAVE_XF86VIDMODE" == xyes; then
979 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
981 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXdamage -lXfixes"
983 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
984 GL_PC_CFLAGS="$X11_INCLUDES"
986 # XCB can only be used from pkg-config
987 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
988 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
989 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
990 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
993 # Check to see if the xcb-glx library is new enough to support
994 # GLX_ARB_create_context. This bit of hackery is necessary until XCB 1.8
996 save_CPPFLAGS="$CPPFLAGS"
997 save_LDFLAGS="$LDFLAGS"
998 CPPFLAGS="$CPPFLAGS $X11_INCLUDES"
999 LDFLAGS="$LDFLAGS $GL_LIB_DEPS"
1000 AC_CHECK_LIB(xcb-glx, xcb_glx_create_context_attribs_arb_checked,
1001 [HAVE_XCB_GLX_CREATE_CONTEXT=yes],
1002 [HAVE_XCB_GLX_CREATE_CONTEXT=no])
1003 CPPFLAGS="$save_CPPFLAGS"
1004 LDFLAGS="$save_LDFLAGS"
1006 if test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes; then
1007 X11_INCLUDES="$X11_INCLUDES -DHAVE_XCB_GLX_CREATE_CONTEXT"
1010 # need DRM libs, -lpthread, etc.
1011 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
1012 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
1016 # This is outside the case (above) so that it is invoked even for non-GLX
1018 AM_CONDITIONAL(HAVE_XCB_GLX_CREATE_CONTEXT,
1019 test x$HAVE_XCB_GLX_CREATE_CONTEXT = xyes)
1021 GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
1022 GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
1023 GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
1024 GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
1026 AC_SUBST([GL_LIB_DEPS])
1027 AC_SUBST([GL_PC_REQ_PRIV])
1028 AC_SUBST([GL_PC_LIB_PRIV])
1029 AC_SUBST([GL_PC_CFLAGS])
1030 AC_SUBST([DRI_PC_REQ_PRIV])
1031 AC_SUBST([GLESv1_CM_LIB_DEPS])
1032 AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
1033 AC_SUBST([GLESv2_LIB_DEPS])
1034 AC_SUBST([GLESv2_PC_LIB_PRIV])
1036 GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
1037 AC_SUBST([GLAPI_LIB_DEPS])
1040 dnl Setup default DRI CFLAGS
1041 DRI_CFLAGS='$(CFLAGS)'
1042 DRI_CXXFLAGS='$(CXXFLAGS)'
1043 DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
1044 MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
1046 if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then
1047 DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
1048 DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
1049 DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
1050 DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
1051 DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
1052 DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
1053 MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
1055 AC_SUBST([DRICORE_LIBS])
1056 AC_SUBST([DRICORE_GLSL_LIBS])
1057 AC_SUBST([DRICORE_LIB_DEPS])
1058 AC_SUBST([DRI_CXXFLAGS])
1059 AC_SUBST([DRI_CFLAGS])
1060 AC_SUBST([MESA_MODULES])
1062 AC_SUBST([HAVE_XF86VIDMODE])
1067 case "x$enable_glx$enable_xlib_glx" in
1069 DEFINES="$DEFINES -DUSE_XSHM"
1072 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
1073 if test "x$driglx_direct" = xyes; then
1074 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
1083 AC_ARG_ENABLE([glx-tls],
1084 [AS_HELP_STRING([--enable-glx-tls],
1085 [enable TLS support in GLX @<:@default=disabled@:>@])],
1086 [GLX_USE_TLS="$enableval"],
1088 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
1090 AS_IF([test "x$GLX_USE_TLS" = xyes],
1091 [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
1096 dnl Directory for DRI drivers
1097 AC_ARG_WITH([dri-driverdir],
1098 [AS_HELP_STRING([--with-dri-driverdir=DIR],
1099 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
1100 [DRI_DRIVER_INSTALL_DIR="$withval"],
1101 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
1102 AC_SUBST([DRI_DRIVER_INSTALL_DIR])
1103 dnl Extra search path for DRI drivers
1104 AC_ARG_WITH([dri-searchpath],
1105 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
1106 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
1107 [DRI_DRIVER_SEARCH_DIR="$withval"],
1108 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
1109 AC_SUBST([DRI_DRIVER_SEARCH_DIR])
1110 dnl Which drivers to build - default is chosen by platform
1111 AC_ARG_WITH([dri-drivers],
1112 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
1113 [comma delimited DRI drivers list, e.g.
1114 "swrast,i965,radeon" @<:@default=auto@:>@])],
1115 [with_dri_drivers="$withval"],
1116 [with_dri_drivers=yes])
1117 if test "x$with_dri_drivers" = x; then
1121 dnl If $with_dri_drivers is yes, directories will be added through
1124 case "$with_dri_drivers" in
1127 # classic DRI drivers require FEATURE_GL to build
1128 if test "x$enable_opengl" = xyes; then
1133 # verify the requested driver directories exist
1134 dri_drivers=`IFS=', '; echo $with_dri_drivers`
1135 for driver in $dri_drivers; do
1136 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
1137 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
1139 DRI_DIRS="$dri_drivers"
1140 if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
1141 AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
1146 dnl Set DRI_DIRS, DEFINES and LIB_DEPS
1147 if test "x$enable_dri" = xyes; then
1148 # Platform specific settings and drivers to build
1151 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
1152 DEFINES="$DEFINES -DHAVE_ALIAS"
1156 if test "x$DRI_DIRS" = "xyes"; then
1157 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
1161 # Build only the drivers for cards that exist on PowerPC.
1162 if test "x$DRI_DIRS" = "xyes"; then
1163 DRI_DIRS="r200 radeon swrast"
1167 # Build only the drivers for cards that exist on sparc
1168 if test "x$DRI_DIRS" = "xyes"; then
1169 DRI_DIRS="r200 radeon swrast"
1174 freebsd* | dragonfly* | *netbsd*)
1175 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
1176 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
1178 if test "x$DRI_DIRS" = "xyes"; then
1179 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
1183 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
1184 DEFINES="$DEFINES -DHAVE_ALIAS"
1187 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
1190 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
1191 if test "x$DRI_DIRS" = "xyes"; then
1198 if test "x$DRI_DIRS" = "xyes"; then
1199 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
1202 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1205 if test "x$enable_dri" = xyes; then
1208 AC_ARG_WITH([expat],
1209 [AS_HELP_STRING([--with-expat=DIR],
1210 [expat install directory])],[
1211 EXPAT_INCLUDES="-I$withval/include"
1212 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
1213 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
1214 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
1216 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
1218 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1219 [AC_MSG_ERROR([Expat required for DRI.])])
1223 # libdrm is required for all except swrast
1224 if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
1225 if test "x$have_libdrm" != xyes; then
1226 AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
1230 # put all the necessary libs together
1231 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
1233 AC_SUBST([DRI_DIRS])
1234 AC_SUBST([EXPAT_INCLUDES])
1235 AC_SUBST([DRI_LIB_DEPS])
1239 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1241 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1257 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
1258 HAVE_NOUVEAU_DRI=yes;
1264 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1266 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1269 HAVE_RADEON_DRI=yes;
1282 HAVE_SWRAST_DRI=yes;
1286 AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
1287 AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
1288 AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
1289 AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
1290 AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
1291 AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
1294 dnl OSMesa configuration
1297 dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
1298 AC_ARG_WITH([osmesa-bits],
1299 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1300 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
1301 [osmesa_bits="$withval"],
1303 if test "x$osmesa_bits" != x8; then
1304 if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
1305 AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
1309 case "x$osmesa_bits" in
1311 OSMESA_LIB="${OSMESA_LIB}"
1314 OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
1315 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1318 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1322 if test "x$enable_osmesa" = xyes; then
1323 # only link libraries with osmesa if shared
1324 if test "$enable_static" = no; then
1325 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
1330 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
1332 AC_SUBST([OSMESA_LIB_DEPS])
1333 AC_SUBST([OSMESA_MESA_DEPS])
1334 AC_SUBST([OSMESA_PC_REQ])
1335 AC_SUBST([OSMESA_PC_LIB_PRIV])
1338 dnl gbm configuration
1340 if test "x$enable_gbm" = xauto; then
1341 case "$with_egl_platforms" in
1348 if test "x$enable_gbm" = xyes; then
1349 SRC_DIRS="$SRC_DIRS gbm"
1351 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1352 AC_MSG_ERROR([gbm needs udev]))
1354 if test "x$enable_dri" = xyes; then
1355 GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
1356 if test "$SHARED_GLAPI" -eq 0; then
1357 AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
1361 GBM_PC_REQ_PRIV="libudev"
1362 GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
1363 AC_SUBST([GBM_PC_REQ_PRIV])
1364 AC_SUBST([GBM_PC_LIB_PRIV])
1367 dnl EGL configuration
1371 if test "x$enable_egl" = xyes; then
1372 SRC_DIRS="$SRC_DIRS egl"
1373 EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
1376 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
1378 if test "$enable_static" != yes; then
1379 # build egl_glx when libGL is built
1380 if test "x$enable_glx" = xyes; then
1381 EGL_DRIVERS_DIRS="glx"
1384 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1385 [have_libudev=yes],[have_libudev=no])
1386 if test "$have_libudev" = yes; then
1387 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1389 if test "x$enable_dri" = xyes; then
1390 # build egl_dri2 when xcb-dri2 is available
1391 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
1392 [have_xcb_dri2=yes],[have_xcb_dri2=no])
1394 if test "$have_xcb_dri2" = yes; then
1395 EGL_DRIVER_DRI2=dri2
1396 DEFINES="$DEFINES -DHAVE_XCB_DRI2"
1397 # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
1398 AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
1399 [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
1403 EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2"
1406 AC_SUBST([EGL_LIB_DEPS])
1407 AC_SUBST([EGL_DRIVERS_DIRS])
1410 dnl EGL Gallium configuration
1412 if test "x$enable_gallium_egl" = xyes; then
1413 if test "x$with_gallium_drivers" = x; then
1414 AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
1416 if test "x$enable_egl" = xno; then
1417 AC_MSG_ERROR([cannot enable egl_gallium without EGL])
1419 if test "x$have_libdrm" != xyes; then
1420 AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
1423 GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
1424 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
1429 dnl gbm Gallium configuration
1431 if test "x$enable_gallium_gbm" = xauto; then
1432 case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in
1434 enable_gallium_gbm=yes ;;
1436 enable_gallium_gbm=no ;;
1439 if test "x$enable_gallium_gbm" = xyes; then
1440 if test "x$with_gallium_drivers" = x; then
1441 AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
1443 if test "x$enable_gbm" = xno; then
1444 AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
1446 # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
1447 if test "x$enable_dri" = xno; then
1448 AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
1451 GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
1452 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
1457 dnl X.Org DDX configuration
1459 if test "x$enable_xorg" = xyes; then
1460 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1461 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1462 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1463 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1464 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1465 HAVE_XEXTPROTO_71="no")
1466 GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
1471 dnl XA configuration
1473 if test "x$enable_xa" = xyes; then
1476 AC_CHECK_PROG(NM, nm, "nm")
1477 if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
1478 AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
1482 if test "x$enable_xa" = xyes; then
1483 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
1491 dnl OpenVG configuration
1495 if test "x$enable_openvg" = xyes; then
1496 if test "x$enable_egl" = xno; then
1497 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1499 if test "x$with_gallium_drivers" = x; then
1500 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1502 if test "x$enable_gallium_egl" = xno; then
1503 AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
1506 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
1507 VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
1508 CORE_DIRS="$CORE_DIRS mapi/vgapi"
1509 GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
1514 dnl D3D1X configuration
1517 if test "x$enable_d3d1x" = xyes; then
1518 if test "x$with_gallium_drivers" = x; then
1519 AC_MSG_ERROR([cannot enable D3D1X without Gallium])
1522 GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
1527 dnl Gallium G3DVL configuration
1529 AC_ARG_ENABLE([gallium-g3dvl],
1530 [AS_HELP_STRING([--enable-gallium-g3dvl],
1531 [build gallium g3dvl @<:@default=disabled@:>@])],
1532 [enable_gallium_g3dvl="$enableval"],
1533 [enable_gallium_g3dvl=no])
1534 if test "x$enable_gallium_g3dvl" = xyes; then
1535 if test "x$with_gallium_drivers" = x; then
1536 AC_MSG_ERROR([cannot enable G3DVL without Gallium])
1539 if test "x$enable_xvmc" = xauto; then
1540 PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
1543 if test "x$enable_vdpau" = xauto; then
1544 PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
1547 if test "x$enable_va" = xauto; then
1548 #don't enable vaapi state tracker even if package exists
1549 #PKG_CHECK_EXISTS([libva], [enable_vdpau=yes], [enable_vdpau=no])
1554 if test "x$enable_xvmc" = xyes; then
1555 PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6])
1556 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg/xvmc"
1560 if test "x$enable_vdpau" = xyes; then
1561 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1])
1562 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
1566 if test "x$enable_va" = xyes; then
1567 PKG_CHECK_MODULES([LIBVA], [libva = 0.31.1])
1568 AC_MSG_WARN([vaapi state tracker currently unmaintained])
1569 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va"
1574 dnl GLU configuration
1576 AC_ARG_ENABLE([glu],
1577 [AS_HELP_STRING([--disable-glu],
1578 [enable OpenGL Utility library @<:@default=enabled@:>@])],
1579 [enable_glu="$enableval"],
1582 if test "x$enable_glu" = xyes; then
1583 if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
1584 AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
1589 if test "x$enable_glu" = xyes; then
1590 SRC_DIRS="$SRC_DIRS glu"
1592 if test "x$enable_glx" = xno; then
1593 # Link libGLU to libOSMesa instead of libGL
1596 if test "$enable_static" = no; then
1597 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
1602 # If static, empty GLU_LIB_DEPS and add libs for programs to link
1604 GLU_PC_LIB_PRIV="-lm"
1605 if test "$enable_static" = no; then
1607 GLU_MESA_DEPS='-l$(GL_LIB)'
1614 if test "$enable_static" = no; then
1615 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
1617 GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
1618 AC_SUBST([GLU_LIB_DEPS])
1619 AC_SUBST([GLU_MESA_DEPS])
1620 AC_SUBST([GLU_PC_REQ])
1621 AC_SUBST([GLU_PC_REQ_PRIV])
1622 AC_SUBST([GLU_PC_LIB_PRIV])
1623 AC_SUBST([GLU_PC_CFLAGS])
1625 AC_SUBST([PROGRAM_DIRS])
1628 dnl Gallium configuration
1630 if test "x$with_gallium_drivers" != x; then
1631 SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
1634 AC_SUBST([LLVM_CFLAGS])
1635 AC_SUBST([LLVM_LIBS])
1636 AC_SUBST([LLVM_LDFLAGS])
1637 AC_SUBST([LLVM_VERSION])
1639 case "x$enable_opengl$enable_gles1$enable_gles2" in
1641 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
1645 AC_SUBST([VG_LIB_DEPS])
1646 AC_SUBST([EGL_CLIENT_APIS])
1648 AC_ARG_WITH([egl-platforms],
1649 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1650 [comma delimited native platforms libEGL supports, e.g.
1651 "x11,drm" @<:@default=auto@:>@])],
1652 [with_egl_platforms="$withval"],
1653 [with_egl_platforms=yes])
1657 case "$with_egl_platforms" in
1659 if test "x$enable_egl" = xyes; then
1664 if test "x$enable_egl" != xyes; then
1665 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1667 # verify the requested driver directories exist
1668 egl_platforms=`IFS=', '; echo $with_egl_platforms`
1669 for plat in $egl_platforms; do
1670 test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
1671 AC_MSG_ERROR([EGL platform '$plat' does not exist])
1672 if test "$plat" = "fbdev"; then
1673 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
1675 if test "$plat" = "null"; then
1676 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
1678 if test "$plat" = "wayland"; then
1679 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
1680 [AC_MSG_ERROR([cannot find libwayland-client])])
1681 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
1683 m4_ifdef([WAYLAND_SCANNER_RULES],
1684 [WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])])
1686 if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
1687 AC_MSG_ERROR([EGL platform drm needs gbm])
1689 case "$plat$have_libudev" in
1691 AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
1694 EGL_PLATFORMS="$egl_platforms"
1697 AC_SUBST([EGL_PLATFORMS])
1699 AC_ARG_WITH([egl-driver-dir],
1700 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1701 [directory for EGL drivers [[default=${libdir}/egl]]])],
1702 [EGL_DRIVER_INSTALL_DIR="$withval"],
1703 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1704 AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1706 AC_ARG_WITH([xorg-driver-dir],
1707 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1708 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1709 [XORG_DRIVER_INSTALL_DIR="$withval"],
1710 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1711 AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1713 AC_ARG_WITH([max-width],
1714 [AS_HELP_STRING([--with-max-width=N],
1715 [Maximum framebuffer width (4096)])],
1716 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1717 AS_IF([test "${withval}" -gt "4096"],
1718 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1720 AC_ARG_WITH([max-height],
1721 [AS_HELP_STRING([--with-max-height=N],
1722 [Maximum framebuffer height (4096)])],
1723 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1724 AS_IF([test "${withval}" -gt "4096"],
1725 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1731 AC_ARG_ENABLE([gallium-llvm],
1732 [AS_HELP_STRING([--enable-gallium-llvm],
1733 [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
1734 [enable_gallium_llvm="$enableval"],
1735 [enable_gallium_llvm=auto])
1736 if test "x$with_gallium_drivers" = x; then
1737 enable_gallium_llvm=no
1739 if test "x$enable_gallium_llvm" = xauto; then
1741 i*86|x86_64) enable_gallium_llvm=yes;;
1744 if test "x$enable_gallium_llvm" = xyes; then
1745 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1747 if test "x$LLVM_CONFIG" != xno; then
1748 LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
1749 LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g'`
1750 LLVM_LIBS="`$LLVM_CONFIG --libs`"
1752 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
1753 DEFINES="$DEFINES -D__STDC_CONSTANT_MACROS"
1762 dnl Directory for VDPAU libs
1763 AC_ARG_WITH([vdpau-libdir],
1764 [AS_HELP_STRING([--with-vdpau-libdir=DIR],
1765 [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
1766 [VDPAU_LIB_INSTALL_DIR="$withval"],
1767 [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
1768 AC_SUBST([VDPAU_LIB_INSTALL_DIR])
1770 dnl Directory for VA libs
1771 AC_ARG_WITH([va-libdir],
1772 [AS_HELP_STRING([--with-va-libdir=DIR],
1773 [directory for the VA libraries @<:@default=${libdir}/va@:>@])],
1774 [VA_LIB_INSTALL_DIR="$withval"],
1775 [VA_LIB_INSTALL_DIR='${libdir}/va'])
1776 AC_SUBST([VA_LIB_INSTALL_DIR])
1779 dnl Gallium helper functions
1781 gallium_check_st() {
1782 if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
1783 test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
1784 test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
1785 if test "x$have_libdrm" != xyes; then
1786 AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
1788 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1790 if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
1791 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
1793 if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
1794 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1796 if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
1797 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
1799 if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
1800 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
1801 NEED_G3DVL_DRI="yes"
1803 if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
1804 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
1805 NEED_G3DVL_DRI="yes"
1807 if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then
1808 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
1809 NEED_G3DVL_DRI="yes"
1813 gallium_require_llvm() {
1814 if test "x$MESA_LLVM" = x0; then
1816 i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
1822 dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
1823 if test "x$with_gallium_drivers" != x; then
1824 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
1825 for driver in $gallium_drivers; do
1828 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
1829 gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
1832 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1833 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
1834 if test "x$MESA_LLVM" = x1; then
1835 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1837 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
1838 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1841 gallium_require_llvm "Gallium R300"
1842 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
1843 gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" "va-r300"
1846 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
1847 gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
1850 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
1851 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
1852 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
1855 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
1856 if test "x$MESA_LLVM" = x1; then
1857 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1860 if test "x$HAVE_ST_DRI" = xyes; then
1861 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1863 if test "x$HAVE_ST_VDPAU" = xyes; then
1864 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
1866 if test "x$HAVE_ST_XVMC" = xyes; then
1867 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
1869 if test "x$HAVE_ST_VA" = xyes; then
1870 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe"
1872 if test "x$HAVE_ST_VDPAU" = xyes ||
1873 test "x$HAVE_ST_XVMC" = xyes ||
1874 test "x$HAVE_ST_VA" = xyes; then
1875 if test "x$HAVE_WINSYS_XLIB" != xyes; then
1876 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
1881 AC_MSG_ERROR([Unknown Gallium driver: $driver])
1887 if test "x$NEED_G3DVL_DRI" = xyes; then
1888 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS g3dvl/dri"
1891 dnl prepend CORE_DIRS to SRC_DIRS
1892 SRC_DIRS="$CORE_DIRS $SRC_DIRS"
1894 dnl Restore LDFLAGS and CPPFLAGS
1895 LDFLAGS="$_SAVE_LDFLAGS"
1896 CPPFLAGS="$_SAVE_CPPFLAGS"
1898 dnl Add user CFLAGS and CXXFLAGS
1899 CFLAGS="$CFLAGS $USER_CFLAGS"
1900 CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
1902 dnl Substitute the config
1903 AC_CONFIG_FILES([configs/autoconf
1906 src/egl/wayland/Makefile
1907 src/egl/wayland/wayland-egl/Makefile
1908 src/egl/wayland/wayland-egl/wayland-egl.pc
1909 src/egl/wayland/wayland-drm/Makefile
1910 src/mesa/drivers/dri/dri.pc
1911 src/mesa/drivers/dri/Makefile
1912 src/mesa/drivers/dri/common/Makefile
1913 src/mesa/drivers/dri/i915/Makefile
1914 src/mesa/drivers/dri/i965/Makefile
1915 src/mesa/drivers/dri/nouveau/Makefile
1916 src/mesa/drivers/dri/r200/Makefile
1917 src/mesa/drivers/dri/radeon/Makefile
1918 src/mesa/drivers/dri/swrast/Makefile
1920 tests/glx/Makefile])
1922 dnl Replace the configs/current symlink
1923 AC_CONFIG_COMMANDS([configs],[
1924 if test -f configs/current || test -L configs/current; then
1925 rm -f configs/current
1927 ln -s autoconf configs/current
1930 dnl Sort the dirs alphabetically
1931 GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
1932 GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
1933 GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
1934 GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
1939 dnl Output some configuration info for the user
1942 echo " prefix: $prefix"
1943 echo " exec_prefix: $exec_prefix"
1944 echo " libdir: $libdir"
1945 echo " includedir: $includedir"
1949 echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
1950 echo " OpenVG: $enable_openvg"
1954 if test "x$enable_osmesa" != xno; then
1955 echo " OSMesa: lib$OSMESA_LIB"
1960 if test "x$enable_dri" != xno; then
1961 # cleanup the drivers var
1962 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1963 if test "x$DRI_DIRS" = x; then
1964 echo " DRI drivers: no"
1966 echo " DRI drivers: $dri_dirs"
1968 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
1971 case "x$enable_glx$enable_xlib_glx" in
1973 echo " GLX: Xlib-based"
1976 echo " GLX: DRI-based"
1979 echo " GLX: $enable_glx"
1984 echo " GLU: $enable_glu"
1988 echo " EGL: $enable_egl"
1989 if test "$enable_egl" = yes; then
1990 echo " EGL platforms: $EGL_PLATFORMS"
1993 for d in $EGL_DRIVERS_DIRS; do
1994 egl_drivers="$egl_drivers builtin:egl_$d"
1997 if test "x$HAVE_ST_EGL" = xyes; then
1998 echo " EGL drivers: ${egl_drivers} egl_gallium"
1999 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
2001 echo " EGL drivers: $egl_drivers"
2006 if test "x$MESA_LLVM" = x1; then
2008 echo " llvm-config: $LLVM_CONFIG"
2009 echo " llvm-version: $LLVM_VERSION"
2015 if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
2016 echo " Gallium: yes"
2017 echo " Gallium dirs: $GALLIUM_DIRS"
2018 echo " Target dirs: $GALLIUM_TARGET_DIRS"
2019 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
2020 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
2021 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
2029 echo " Shared libs: $enable_shared"
2030 echo " Static libs: $enable_static"
2032 dnl Compiler options
2033 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
2034 cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
2035 $SED 's/^ *//;s/ */ /;s/ *$//'`
2036 cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
2037 $SED 's/^ *//;s/ */ /;s/ *$//'`
2038 defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
2040 echo " CFLAGS: $cflags"
2041 echo " CXXFLAGS: $cxxflags"
2042 echo " Macros: $defines"
2044 echo " PYTHON2: $PYTHON2"
2047 echo " Run '${MAKE-make}' to build Mesa"