1 dnl Process this file with autoconf to create configure.
5 dnl Tell the user about autoconf.html in the --help output
6 m4_divert_once([HELP_END], [
7 See docs/autoconf.html for more details on the options for Mesa.])
9 m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
10 AC_INIT([Mesa], [MESA_VERSION],
11 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
12 AC_CONFIG_AUX_DIR([bin])
13 AC_CONFIG_MACRO_DIR([m4])
15 AM_INIT_AUTOMAKE([foreign])
17 dnl http://people.gnome.org/~walters/docs/build-api.txt
18 dnl We don't support srcdir != builddir.
19 echo \#buildapi-variable-no-builddir >/dev/null
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])],
25 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
27 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
29 dnl Set internal versions
31 AC_SUBST([OSMESA_VERSION])
33 dnl Versions for external dependencies
34 LIBDRM_REQUIRED=2.4.24
35 LIBDRM_RADEON_REQUIRED=2.4.46
36 LIBDRM_INTEL_REQUIRED=2.4.38
37 LIBDRM_NVVIEUX_REQUIRED=2.4.33
38 LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
39 LIBDRM_FREEDRENO_REQUIRED=2.4.39
40 DRI2PROTO_REQUIRED=2.6
41 GLPROTO_REQUIRED=1.4.14
42 LIBDRM_XORG_REQUIRED=2.4.24
43 LIBKMS_XORG_REQUIRED=1.0.0
53 AC_CHECK_PROGS([MAKE], [gmake make])
54 AC_CHECK_PROGS([PYTHON2], [python2 python])
55 AX_PYTHON_MODULE([libxml2], [needed])
60 LT_INIT([disable-static])
63 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
64 [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
66 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
67 [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
69 AC_PATH_PROG([PERL], [perl])
71 AC_CHECK_PROG(INDENT, indent, indent, cat)
72 if test "x$INDENT" != "xcat"; then
73 AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
78 dnl We need a POSIX shell for parts of the build. Assume we have one
82 # Solaris /bin/sh is too old/non-POSIX compliant
83 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
88 dnl clang is mostly GCC-compatible, but its version is much lower,
89 dnl so we have to check for it.
90 AC_MSG_CHECKING([if compiling with clang])
93 [AC_LANG_PROGRAM([], [[
98 [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
100 AC_MSG_RESULT([$acv_mesa_CLANG])
102 dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
103 dnl versions are explictly not supported.
105 if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
106 AC_MSG_CHECKING([whether gcc version is sufficient])
110 GCC_VERSION=`$CC -dumpversion`
111 if test $? -eq 0; then
112 GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
113 GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
116 if test $GCC_VERSION_MAJOR -lt 3 -o $GCC_VERSION_MAJOR -eq 3 -a $GCC_VERSION_MINOR -lt 3 ; then
118 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
123 if test "x$cross_compiling" = xyes; then
127 AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
129 dnl Make sure the pkg-config macros are defined
130 m4_ifndef([PKG_PROG_PKG_CONFIG],
131 [m4_fatal([Could not locate the pkg-config autoconf macros.
132 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
133 are in a different location, try setting the environment variable
134 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
135 PKG_PROG_PKG_CONFIG()
137 dnl LIB_DIR - library basename
138 LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
141 dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
142 _SAVE_LDFLAGS="$LDFLAGS"
143 _SAVE_CPPFLAGS="$CPPFLAGS"
145 dnl build host compiler macros
147 AC_SUBST([DEFINES_FOR_BUILD])
150 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -D_GNU_SOURCE"
153 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DSVR4"
156 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD"
165 DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
168 DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
171 DEFINES="$DEFINES -DHAVE_PTHREAD"
175 dnl Add flags for gcc and g++
176 if test "x$GCC" = xyes; then
179 CFLAGS="$CFLAGS -Wall -std=gnu99"
182 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -Wall -std=c99"
183 CFLAGS="$CFLAGS -Wall -std=c99"
187 # Enable -Werror=implicit-function-declaration and
188 # -Werror=missing-prototypes, if available, or otherwise, just
189 # -Wmissing-prototypes. This is particularly useful to avoid
190 # generating a loadable driver module that has undefined symbols.
191 save_CFLAGS="$CFLAGS"
192 AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
193 CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
194 CFLAGS="$CFLAGS -Werror=missing-prototypes"
195 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
196 AC_MSG_RESULT([yes]),
197 [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
198 AC_MSG_RESULT([no])]);
200 # Enable -fvisibility=hidden if using a gcc that supports it
201 save_CFLAGS="$CFLAGS"
202 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
203 VISIBILITY_CFLAGS="-fvisibility=hidden"
204 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
205 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
206 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
208 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
211 # Work around aliasing bugs - developers should comment this out
212 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-strict-aliasing"
213 CFLAGS="$CFLAGS -fno-strict-aliasing"
215 # gcc's builtin memcmp is slower than glibc's
216 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
217 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-builtin-memcmp"
218 CFLAGS="$CFLAGS -fno-builtin-memcmp"
220 if test "x$GXX" = xyes; then
221 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -Wall"
222 CXXFLAGS="$CXXFLAGS -Wall"
224 # Enable -fvisibility=hidden if using a gcc that supports it
225 save_CXXFLAGS="$CXXFLAGS"
226 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
227 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
228 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
230 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
231 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
234 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
235 CXXFLAGS=$save_CXXFLAGS
237 # Work around aliasing bugs - developers should comment this out
238 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-strict-aliasing"
239 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
241 # gcc's builtin memcmp is slower than glibc's
242 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
243 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-builtin-memcmp"
244 CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
247 dnl even if the compiler appears to support it, using visibility attributes isn't
248 dnl going to do anything useful currently on cygwin apart from emit lots of warnings
252 VISIBILITY_CXXFLAGS=""
256 AC_SUBST([VISIBILITY_CFLAGS])
257 AC_SUBST([VISIBILITY_CXXFLAGS])
260 dnl Hacks to enable 32 or 64 bit build
262 AC_ARG_ENABLE([32-bit],
263 [AS_HELP_STRING([--enable-32-bit],
264 [build 32-bit libraries @<:@default=auto@:>@])],
265 [enable_32bit="$enableval"],
268 if test "x$enable_32bit" = xyes; then
269 if test "x$GCC" = xyes; then
270 CFLAGS="$CFLAGS -m32"
271 CCASFLAGS="$CCASFLAGS -m32"
273 if test "x$GXX" = xyes; then
274 CXXFLAGS="$CXXFLAGS -m32"
277 AC_ARG_ENABLE([64-bit],
278 [AS_HELP_STRING([--enable-64-bit],
279 [build 64-bit libraries @<:@default=auto@:>@])],
280 [enable_64bit="$enableval"],
283 if test "x$enable_64bit" = xyes; then
284 if test "x$GCC" = xyes; then
285 CFLAGS="$CFLAGS -m64"
287 if test "x$GXX" = xyes; then
288 CXXFLAGS="$CXXFLAGS -m64"
292 dnl Can't have static and shared libraries, default to static if user
293 dnl explicitly requested. If both disabled, set to static since shared
294 dnl was explicitly requested.
295 case "x$enable_static$enable_shared" in
297 AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
301 AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
306 AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
309 dnl other compiler options
311 AC_ARG_ENABLE([debug],
312 [AS_HELP_STRING([--enable-debug],
313 [use debug compiler flags and macros @<:@default=disabled@:>@])],
314 [enable_debug="$enableval"],
317 if test "x$enable_debug" = xyes; then
318 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DDEBUG"
319 if test "x$GCC_FOR_BUILD" = xyes; then
320 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -g -O0"
322 if test "x$GXX_FOR_BUILD" = xyes; then
323 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -g -O0"
326 DEFINES="$DEFINES -DDEBUG"
327 if test "x$GCC" = xyes; then
328 CFLAGS="$CFLAGS -g -O0"
330 if test "x$GXX" = xyes; then
331 CXXFLAGS="$CXXFLAGS -g -O0"
338 LIB_PREFIX_GLOB='lib'
339 LIB_VERSION_SEPARATOR='.'
340 if test "$enable_static" = yes; then
345 LIB_EXTENSION='dylib' ;;
347 dnl prefix can be 'cyg' or 'lib'
348 LIB_PREFIX_GLOB='???'
349 LIB_VERSION_SEPARATOR='-'
350 LIB_EXTENSION='dll' ;;
354 LIB_EXTENSION='so' ;;
357 AC_ARG_WITH([gl-lib-name],
358 [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
359 [specify GL library name @<:@default=GL@:>@])],
362 AC_ARG_WITH([osmesa-lib-name],
363 [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
364 [specify OSMesa library name @<:@default=OSMesa@:>@])],
365 [OSMESA_LIB=$withval],
367 AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
368 AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
371 dnl Mangled Mesa support
373 AC_ARG_ENABLE([mangling],
374 [AS_HELP_STRING([--enable-mangling],
375 [enable mangled symbols and library name @<:@default=disabled@:>@])],
376 [enable_mangling="${enableval}"],
379 if test "x${enable_mangling}" = "xyes" ; then
380 DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
381 GL_LIB="Mangled${GL_LIB}"
382 OSMESA_LIB="Mangled${OSMESA_LIB}"
385 AC_SUBST([OSMESA_LIB])
388 dnl potentially-infringing-but-nobody-knows-for-sure stuff
390 AC_ARG_ENABLE([texture-float],
391 [AS_HELP_STRING([--enable-texture-float],
392 [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
393 [enable_texture_float="$enableval"],
394 [enable_texture_float=no]
396 if test "x$enable_texture_float" = xyes; then
397 AC_MSG_WARN([Floating-point textures enabled.])
398 AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
399 DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
402 GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
403 OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
404 EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
405 GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
406 GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
407 VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
408 GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
410 GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
411 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
412 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
413 GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
414 GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
415 VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
416 GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
418 AC_SUBST([GL_LIB_NAME])
419 AC_SUBST([OSMESA_LIB_NAME])
420 AC_SUBST([EGL_LIB_NAME])
421 AC_SUBST([GLESv1_CM_LIB_NAME])
422 AC_SUBST([GLESv2_LIB_NAME])
423 AC_SUBST([VG_LIB_NAME])
424 AC_SUBST([GLAPI_LIB_NAME])
426 AC_SUBST([GL_LIB_GLOB])
427 AC_SUBST([EGL_LIB_GLOB])
428 AC_SUBST([GLESv1_CM_LIB_GLOB])
429 AC_SUBST([GLESv2_LIB_GLOB])
430 AC_SUBST([VG_LIB_GLOB])
431 AC_SUBST([GLAPI_LIB_GLOB])
434 dnl Arch/platform-specific settings
437 [AS_HELP_STRING([--disable-asm],
438 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
439 [enable_asm="$enableval"],
443 AC_MSG_CHECKING([whether to enable assembly])
444 test "x$enable_asm" = xno && AC_MSG_RESULT([no])
445 # disable if cross compiling on x86/x86_64 since we must run gen_matypes
446 if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
448 i?86 | x86_64 | amd64)
450 AC_MSG_RESULT([no, cross compiling])
454 # check for supported arches
455 if test "x$enable_asm" = xyes; then
459 linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
460 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
469 linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
470 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
485 DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
486 AC_MSG_RESULT([yes, x86])
489 DEFINES="$DEFINES -DUSE_X86_64_ASM"
490 AC_MSG_RESULT([yes, x86_64])
493 DEFINES="$DEFINES -DUSE_SPARC_ASM"
494 AC_MSG_RESULT([yes, sparc])
497 AC_MSG_RESULT([no, platform not supported])
502 dnl Check to see if dlopen is in default libraries (like Solaris, which
503 dnl has it in libc), or if libdl is needed to get it.
504 AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
505 [AC_CHECK_LIB([dl], [dlopen],
506 [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
507 AC_SUBST([DLOPEN_LIBS])
513 AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
514 [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
515 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
516 AC_SUBST([CLOCK_LIB])
520 dnl See if posix_memalign is available
521 AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
523 dnl Check for pthreads
525 dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
526 dnl to -pthread, which causes problems if we need -lpthread to appear in
528 test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
530 dnl SELinux awareness.
531 AC_ARG_ENABLE([selinux],
532 [AS_HELP_STRING([--enable-selinux],
533 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
534 [MESA_SELINUX="$enableval"],
536 if test "x$enable_selinux" = "xyes"; then
537 AC_CHECK_HEADER([selinux/selinux.h],[],
538 [AC_MSG_ERROR([SELinux headers not found])])
539 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
540 [AC_MSG_ERROR([SELinux library not found])])
541 SELINUX_LIBS="-lselinux"
542 DEFINES="$DEFINES -DMESA_SELINUX"
544 AC_SUBST([SELINUX_LIBS])
547 AC_ARG_ENABLE([opengl],
548 [AS_HELP_STRING([--disable-opengl],
549 [disable support for standard OpenGL API @<:@default=no@:>@])],
550 [enable_opengl="$enableval"],
552 AC_ARG_ENABLE([gles1],
553 [AS_HELP_STRING([--enable-gles1],
554 [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
555 [enable_gles1="$enableval"],
557 AC_ARG_ENABLE([gles2],
558 [AS_HELP_STRING([--enable-gles2],
559 [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
560 [enable_gles2="$enableval"],
562 AC_ARG_ENABLE([openvg],
563 [AS_HELP_STRING([--enable-openvg],
564 [enable support for OpenVG API @<:@default=no@:>@])],
565 [enable_openvg="$enableval"],
569 [AS_HELP_STRING([--enable-dri],
570 [enable DRI modules @<:@default=enabled@:>@])],
571 [enable_dri="$enableval"],
574 [AS_HELP_STRING([--enable-glx],
575 [enable GLX library @<:@default=enabled@:>@])],
576 [enable_glx="$enableval"],
578 AC_ARG_ENABLE([osmesa],
579 [AS_HELP_STRING([--enable-osmesa],
580 [enable OSMesa library @<:@default=disabled@:>@])],
581 [enable_osmesa="$enableval"],
583 AC_ARG_ENABLE([gallium-osmesa],
584 [AS_HELP_STRING([--enable-gallium-osmesa],
585 [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
586 [enable_gallium_osmesa="$enableval"],
587 [enable_gallium_osmesa=no])
589 [AS_HELP_STRING([--disable-egl],
590 [disable EGL library @<:@default=enabled@:>@])],
591 [enable_egl="$enableval"],
594 AC_ARG_ENABLE([xorg],
595 [AS_HELP_STRING([--enable-xorg],
596 [enable support for X.Org DDX API @<:@default=no@:>@])],
597 [enable_xorg="$enableval"],
600 [AS_HELP_STRING([--enable-xa],
601 [enable build of the XA X Acceleration API @<:@default=no@:>@])],
602 [enable_xa="$enableval"],
605 [AS_HELP_STRING([--enable-gbm],
606 [enable gbm library @<:@default=auto@:>@])],
607 [enable_gbm="$enableval"],
610 AC_ARG_ENABLE([xvmc],
611 [AS_HELP_STRING([--enable-xvmc],
612 [enable xvmc library @<:@default=auto@:>@])],
613 [enable_xvmc="$enableval"],
615 AC_ARG_ENABLE([vdpau],
616 [AS_HELP_STRING([--enable-vdpau],
617 [enable vdpau library @<:@default=auto@:>@])],
618 [enable_vdpau="$enableval"],
620 AC_ARG_ENABLE([opencl],
621 [AS_HELP_STRING([--enable-opencl],
622 [enable OpenCL library NOTE: Enabling this option will also enable
623 --with-llvm-shared-libs
624 @<:@default=no@:>@])],
627 AC_ARG_ENABLE([xlib-glx],
628 [AS_HELP_STRING([--enable-xlib-glx],
629 [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
630 [enable_xlib_glx="$enableval"],
631 [enable_xlib_glx=no])
632 AC_ARG_ENABLE([gallium-egl],
633 [AS_HELP_STRING([--enable-gallium-egl],
634 [enable optional EGL state tracker (not required
635 for EGL support in Gallium with OpenGL and OpenGL ES)
636 @<:@default=disable@:>@])],
637 [enable_gallium_egl="$enableval"],
638 [enable_gallium_egl=no])
639 AC_ARG_ENABLE([gallium-gbm],
640 [AS_HELP_STRING([--enable-gallium-gbm],
641 [enable optional gbm state tracker (not required for
642 gbm support in Gallium)
643 @<:@default=auto@:>@])],
644 [enable_gallium_gbm="$enableval"],
645 [enable_gallium_gbm=auto])
647 AC_ARG_ENABLE([r600-llvm-compiler],
648 [AS_HELP_STRING([--enable-r600-llvm-compiler],
649 [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
650 [enable_r600_llvm="$enableval"],
651 [enable_r600_llvm=no])
653 AC_ARG_ENABLE([gallium-tests],
654 [AS_HELP_STRING([--enable-gallium-tests],
655 [Enable optional Gallium tests) @<:@default=disable@:>@])],
656 [enable_gallium_tests="$enableval"],
657 [enable_gallium_tests=no])
659 # Option for Gallium drivers
661 # Keep this in sync with the --with-gallium-drivers help string default value
662 GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
664 AC_ARG_WITH([gallium-drivers],
665 [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
666 [comma delimited Gallium drivers list, e.g.
667 "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
668 @<:@default=r300,r600,svga,swrast@:>@])],
669 [with_gallium_drivers="$withval"],
670 [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
672 # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
673 # here so that the script doesn't choke on an unknown driver name later.
674 case "$with_gallium_drivers" in
675 yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
676 no) with_gallium_drivers='' ;;
679 if test "x$enable_opengl" = xno -a \
680 "x$enable_gles1" = xno -a \
681 "x$enable_gles2" = xno -a \
682 "x$enable_openvg" = xno -a \
683 "x$enable_xorg" = xno -a \
684 "x$enable_xa" = xno -a \
685 "x$enable_xvmc" = xno -a \
686 "x$enable_vdpau" = xno -a \
687 "x$enable_opencl" = xno; then
688 AC_MSG_ERROR([at least one API should be enabled])
691 # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
692 if test "x$enable_opengl" = xno -a \
693 "x$enable_gles1" = xyes; then
694 AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
697 if test "x$enable_opengl" = xno -a \
698 "x$enable_gles2" = xyes; then
699 AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
702 AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
703 AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
704 AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
705 AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
706 "x$enable_gles1" = xyes -o \
707 "x$enable_gles2" = xyes)
709 if test "x$enable_glx" = xno; then
710 AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
714 if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
715 AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
718 if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
719 AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
722 # Disable GLX if OpenGL is not enabled
723 if test "x$enable_glx$enable_opengl" = xyesno; then
724 AC_MSG_WARN([OpenGL not enabled, disabling GLX])
728 # Disable GLX if DRI and Xlib-GLX are not enabled
729 if test "x$enable_glx" = xyes -a \
730 "x$enable_dri" = xno -a \
731 "x$enable_xlib_glx" = xno; then
732 AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
736 AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \
737 "x$enable_dri" = xyes)
738 AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
739 AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
740 "x$enable_osmesa" = xyes)
742 AC_ARG_ENABLE([shared-glapi],
743 [AS_HELP_STRING([--enable-shared-glapi],
744 [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
745 [enable_shared_glapi="$enableval"],
746 [enable_shared_glapi="$enable_dri"])
748 # Shared GLAPI is only useful for DRI
749 if test "x$enable_dri" = xno; then
750 AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
751 enable_shared_glapi=no
754 AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
757 dnl Driver specific build directories
759 GALLIUM_TARGET_DIRS=""
760 GALLIUM_WINSYS_DIRS="sw"
761 GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
762 GALLIUM_STATE_TRACKERS_DIRS=""
764 case "x$enable_glx$enable_xlib_glx" in
766 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
767 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
768 GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
769 NEED_WINSYS_XLIB="yes"
773 if test "x$enable_dri" = xyes; then
774 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
775 GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
778 if test "x$enable_gallium_osmesa" = xyes; then
779 if test -z "$with_gallium_drivers"; then
780 AC_MSG_ERROR([Cannot enable gallium_osmesa without Gallium])
782 if test "x$enable_osmesa" = xyes; then
783 AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
785 GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
786 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
789 AC_SUBST([MESA_LLVM])
792 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
793 [have_libdrm=yes], [have_libdrm=no])
795 if test "x$enable_dri" = xyes; then
796 # DRI must be shared, I think
797 if test "$enable_static" = yes; then
798 AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
801 # not a hard requirement as swrast does not depend on it
802 if test "x$have_libdrm" = xyes; then
803 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
807 dnl Direct rendering or just indirect rendering
810 dnl Disable by default on GNU/Hurd
811 driglx_direct_default="no"
814 dnl Disable by default on cygwin
815 driglx_direct_default="no"
818 driglx_direct_default="yes"
821 AC_ARG_ENABLE([driglx-direct],
822 [AS_HELP_STRING([--disable-driglx-direct],
823 [disable direct rendering in GLX and EGL for DRI \
824 @<:@default=auto@:>@])],
825 [driglx_direct="$enableval"],
826 [driglx_direct="$driglx_direct_default"])
829 dnl libGL configuration per driver
831 case "x$enable_glx$enable_xlib_glx" in
834 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
835 GL_PC_REQ_PRIV="x11 xext"
836 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
837 GL_LIB_DEPS="$XLIBGL_LIBS"
838 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
839 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
843 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
844 if test x"$driglx_direct" = xyes; then
845 if test "x$have_libdrm" != xyes; then
846 AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
848 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
849 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
852 # find the DRI deps for libGL
853 dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
855 # add xf86vidmode if available
856 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
857 if test "$HAVE_XF86VIDMODE" = yes ; then
858 dri_modules="$dri_modules xxf86vm"
861 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
862 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
863 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
864 GL_LIB_DEPS="$DRIGL_LIBS"
866 # need DRM libs, $PTHREAD_LIBS, etc.
867 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
868 GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
872 # This is outside the case (above) so that it is invoked even for non-GLX
874 AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
876 GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
877 GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
878 GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
879 GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
881 AC_SUBST([X11_INCLUDES])
882 AC_SUBST([GL_LIB_DEPS])
883 AC_SUBST([GL_PC_REQ_PRIV])
884 AC_SUBST([GL_PC_LIB_PRIV])
885 AC_SUBST([GL_PC_CFLAGS])
886 AC_SUBST([DRI_PC_REQ_PRIV])
887 AC_SUBST([GLESv1_CM_LIB_DEPS])
888 AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
889 AC_SUBST([GLESv2_LIB_DEPS])
890 AC_SUBST([GLESv2_PC_LIB_PRIV])
892 DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
894 AC_SUBST([HAVE_XF86VIDMODE])
899 case "x$enable_glx$enable_xlib_glx" in
901 DEFINES="$DEFINES -DUSE_XSHM"
904 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
905 if test "x$driglx_direct" = xyes; then
906 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
915 AC_ARG_ENABLE([glx-tls],
916 [AS_HELP_STRING([--enable-glx-tls],
917 [enable TLS support in GLX @<:@default=disabled@:>@])],
918 [GLX_USE_TLS="$enableval"],
920 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
922 AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
923 [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
928 dnl Directory for DRI drivers
929 AC_ARG_WITH([dri-driverdir],
930 [AS_HELP_STRING([--with-dri-driverdir=DIR],
931 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
932 [DRI_DRIVER_INSTALL_DIR="$withval"],
933 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
934 AC_SUBST([DRI_DRIVER_INSTALL_DIR])
935 dnl Extra search path for DRI drivers
936 AC_ARG_WITH([dri-searchpath],
937 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
938 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
939 [DRI_DRIVER_SEARCH_DIR="$withval"],
940 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
941 AC_SUBST([DRI_DRIVER_SEARCH_DIR])
942 dnl Which drivers to build - default is chosen by platform
943 AC_ARG_WITH([dri-drivers],
944 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
945 [comma delimited DRI drivers list, e.g.
946 "swrast,i965,radeon" @<:@default=auto@:>@])],
947 [with_dri_drivers="$withval"],
948 [with_dri_drivers=yes])
949 if test "x$with_dri_drivers" = x; then
953 dnl If $with_dri_drivers is yes, directories will be added through
956 case "$with_dri_drivers" in
959 # classic DRI drivers
960 if test "x$enable_opengl" = xyes; then
965 # verify the requested driver directories exist
966 dri_drivers=`IFS=', '; echo $with_dri_drivers`
967 for driver in $dri_drivers; do
968 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
969 AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
971 DRI_DIRS="$dri_drivers"
972 if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
973 AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
978 dnl Set DRI_DIRS, DEFINES and LIB_DEPS
979 if test "x$enable_dri" = xyes; then
980 # Platform specific settings and drivers to build
983 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
984 DEFINES="$DEFINES -DHAVE_ALIAS"
988 if test "x$DRI_DIRS" = "xyes"; then
989 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
993 # Build only the drivers for cards that exist on PowerPC.
994 if test "x$DRI_DIRS" = "xyes"; then
995 DRI_DIRS="r200 radeon swrast"
999 # Build only the drivers for cards that exist on sparc
1000 if test "x$DRI_DIRS" = "xyes"; then
1001 DRI_DIRS="r200 radeon swrast"
1006 freebsd* | dragonfly* | *netbsd* | openbsd*)
1007 DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
1008 DEFINES="$DEFINES -DHAVE_ALIAS"
1010 if test "x$DRI_DIRS" = "xyes"; then
1011 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
1015 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
1016 DEFINES="$DEFINES -DHAVE_ALIAS"
1019 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
1022 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
1023 if test "x$DRI_DIRS" = "xyes"; then
1030 if test "x$DRI_DIRS" = "xyes"; then
1031 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
1034 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1039 AC_ARG_WITH([expat],
1040 [AS_HELP_STRING([--with-expat=DIR],
1041 [expat install directory])],[
1042 EXPAT_INCLUDES="-I$withval/include"
1043 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
1044 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
1045 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
1047 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
1049 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1050 [AC_MSG_ERROR([Expat required for DRI.])])
1053 # If we are building any DRI driver other than swrast.
1054 if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
1055 # ... libdrm is required
1056 if test "x$have_libdrm" != xyes; then
1057 AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
1059 # ... and build dricommon
1063 # put all the necessary libs together
1064 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
1065 GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
1067 AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
1068 AC_SUBST([EXPAT_INCLUDES])
1069 AC_SUBST([DRI_LIB_DEPS])
1070 AC_SUBST([GALLIUM_DRI_LIB_DEPS])
1074 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1076 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1092 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
1093 HAVE_NOUVEAU_DRI=yes;
1099 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1101 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1104 HAVE_RADEON_DRI=yes;
1117 HAVE_SWRAST_DRI=yes;
1122 dnl OSMesa configuration
1125 dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
1126 AC_ARG_WITH([osmesa-bits],
1127 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1128 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
1129 [osmesa_bits="$withval"],
1131 if test "x$osmesa_bits" != x8; then
1132 if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
1133 AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
1137 case "x$osmesa_bits" in
1139 OSMESA_LIB="${OSMESA_LIB}"
1142 OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
1143 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1146 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1150 if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
1151 # only link libraries with osmesa if shared
1152 if test "$enable_static" = no; then
1153 OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
1158 OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
1161 AC_SUBST([OSMESA_LIB_DEPS])
1162 AC_SUBST([OSMESA_MESA_DEPS])
1163 AC_SUBST([OSMESA_PC_REQ])
1164 AC_SUBST([OSMESA_PC_LIB_PRIV])
1167 dnl gbm configuration
1169 if test "x$enable_gbm" = xauto; then
1170 case "$with_egl_platforms" in
1177 if test "x$enable_gbm" = xyes; then
1178 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1179 AC_MSG_ERROR([gbm needs udev]))
1181 if test "x$enable_dri" = xyes; then
1182 GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
1183 if test "x$enable_shared_glapi" = xno; then
1184 AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
1188 AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
1189 GBM_PC_REQ_PRIV="libudev"
1190 GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
1191 AC_SUBST([GBM_PC_REQ_PRIV])
1192 AC_SUBST([GBM_PC_LIB_PRIV])
1195 dnl EGL configuration
1199 if test "x$enable_egl" = xyes; then
1200 EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
1202 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
1204 if test "$enable_static" != yes; then
1205 # build egl_glx when libGL is built
1206 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1207 [have_libudev=yes],[have_libudev=no])
1208 if test "$have_libudev" = yes; then
1209 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1212 if test "x$enable_dri" = xyes; then
1213 HAVE_EGL_DRIVER_DRI2=1
1218 AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
1219 AC_SUBST([EGL_LIB_DEPS])
1222 dnl EGL Gallium configuration
1224 if test "x$enable_gallium_egl" = xyes; then
1225 if test "x$with_gallium_drivers" = x; then
1226 AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
1228 if test "x$enable_egl" = xno; then
1229 AC_MSG_ERROR([cannot enable egl_gallium without EGL])
1231 if test "x$have_libdrm" != xyes; then
1232 AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
1235 GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
1236 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
1238 AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes)
1241 dnl gbm Gallium configuration
1243 if test "x$enable_gallium_gbm" = xauto; then
1244 case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in
1246 enable_gallium_gbm=yes ;;
1248 enable_gallium_gbm=no ;;
1251 if test "x$enable_gallium_gbm" = xyes; then
1252 if test "x$with_gallium_drivers" = x; then
1253 AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
1255 if test "x$enable_gbm" = xno; then
1256 AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
1258 # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
1259 if test "x$enable_dri" = xno; then
1260 AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
1263 GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
1264 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
1265 enable_gallium_loader=yes
1267 AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
1270 dnl X.Org DDX configuration
1272 if test "x$enable_xorg" = xyes; then
1273 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1274 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1275 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1276 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1277 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1278 HAVE_XEXTPROTO_71="no")
1279 GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
1281 AM_CONDITIONAL(HAVE_ST_XORG, test "x$enable_xorg" = xyes)
1284 dnl XA configuration
1286 if test "x$enable_xa" = xyes; then
1289 AC_CHECK_PROG(NM, nm, "nm")
1290 if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
1291 AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
1295 if test "x$enable_xa" = xyes; then
1296 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
1301 AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
1304 dnl OpenVG configuration
1308 if test "x$enable_openvg" = xyes; then
1309 if test "x$enable_egl" = xno; then
1310 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1312 if test "x$with_gallium_drivers" = x; then
1313 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1315 if test "x$enable_gallium_egl" = xno; then
1316 AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
1319 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
1320 VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
1321 GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
1322 VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
1323 AC_SUBST([VG_PC_LIB_PRIV])
1325 AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
1328 dnl Gallium G3DVL configuration
1330 if test -n "$with_gallium_drivers"; then
1331 if test "x$enable_xvmc" = xauto; then
1332 PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
1335 if test "x$enable_vdpau" = xauto; then
1336 PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
1340 if test "x$enable_xvmc" = xyes; then
1341 PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
1342 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
1344 AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
1346 if test "x$enable_vdpau" = xyes; then
1347 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
1348 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
1350 AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
1353 dnl OpenCL configuration
1356 AC_ARG_WITH([libclc-path],
1357 [AS_HELP_STRING([--with-libclc-path],
1358 [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
1359 [LIBCLC_PATH="$withval"],
1362 if test "x$LIBCLC_PATH" != x; then
1363 AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
1364 Please review the updated build instructions for clover:
1365 http://dri.freedesktop.org/wiki/GalliumCompute])
1369 AC_ARG_WITH([clang-libdir],
1370 [AS_HELP_STRING([--with-clang-libdir],
1371 [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
1372 [CLANG_LIBDIR="$withval"],
1375 LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
1376 LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
1377 AC_SUBST([LIBCLC_INCLUDEDIR])
1378 AC_SUBST([LIBCLC_LIBEXECDIR])
1380 if test "x$enable_opencl" = xyes; then
1381 if test "x$with_gallium_drivers" = x; then
1382 AC_MSG_ERROR([cannot enable OpenCL without Gallium])
1385 if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
1386 AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
1389 if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
1390 AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
1393 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
1394 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
1395 enable_gallium_loader=yes
1397 AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
1400 dnl Gallium configuration
1402 AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
1404 AC_SUBST([LLVM_BINDIR])
1405 AC_SUBST([LLVM_CFLAGS])
1406 AC_SUBST([LLVM_CPPFLAGS])
1407 AC_SUBST([LLVM_CXXFLAGS])
1408 AC_SUBST([LLVM_LIBDIR])
1409 AC_SUBST([LLVM_LIBS])
1410 AC_SUBST([LLVM_LDFLAGS])
1411 AC_SUBST([LLVM_INCLUDEDIR])
1412 AC_SUBST([LLVM_VERSION])
1413 AC_SUBST([CLANG_RESOURCE_DIR])
1415 case "x$enable_opengl$enable_gles1$enable_gles2" in
1417 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
1421 AC_SUBST([VG_LIB_DEPS])
1422 AC_SUBST([EGL_CLIENT_APIS])
1425 dnl EGL Platforms configuration
1427 AC_ARG_WITH([egl-platforms],
1428 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1429 [comma delimited native platforms libEGL supports, e.g.
1430 "x11,drm" @<:@default=auto@:>@])],
1431 [with_egl_platforms="$withval"],
1432 [if test "x$enable_egl" = xyes; then
1433 with_egl_platforms="x11"
1435 with_egl_platforms=""
1438 if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
1439 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1442 # Do per-EGL platform setups and checks
1443 egl_platforms=`IFS=', '; echo $with_egl_platforms`
1444 for plat in $egl_platforms; do
1447 PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.2.0 wayland-server >= 1.2.0])
1448 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
1450 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
1451 AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
1452 [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
1456 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= 1.8 xcb-xfixes])
1458 if test "x$enable_glx" = xyes; then
1459 HAVE_EGL_DRIVER_GLX=1
1464 test "x$enable_gbm" = "xno" &&
1465 AC_MSG_ERROR([EGL platform drm needs gbm])
1468 android|fbdev|gdi|null)
1472 AC_MSG_ERROR([EGL platform '$plat' does not exist])
1476 case "$plat$have_libudev" in
1478 AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
1482 # libEGL wants to default to the first platform specified in
1483 # ./configure. parse that here.
1484 if test "x$egl_platforms" != "x"; then
1485 FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
1486 EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
1488 EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
1491 if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
1492 NEED_WINSYS_XLIB=yes
1494 AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
1495 AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
1496 AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
1497 AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
1498 AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
1500 AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
1501 AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
1503 AC_SUBST([EGL_NATIVE_PLATFORM])
1504 AC_SUBST([EGL_CFLAGS])
1506 # If we don't have the X11 platform, set this define so we don't try to include
1508 if ! echo "$egl_platforms" | grep -q 'x11'; then
1509 DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
1510 GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
1513 AC_ARG_WITH([egl-driver-dir],
1514 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1515 [directory for EGL drivers [[default=${libdir}/egl]]])],
1516 [EGL_DRIVER_INSTALL_DIR="$withval"],
1517 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1518 AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1520 AC_ARG_WITH([xorg-driver-dir],
1521 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1522 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1523 [XORG_DRIVER_INSTALL_DIR="$withval"],
1524 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1525 AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1527 AC_ARG_WITH([max-width],
1528 [AS_HELP_STRING([--with-max-width=N],
1529 [Maximum framebuffer width (4096)])],
1530 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1531 AS_IF([test "${withval}" -gt "4096"],
1532 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1534 AC_ARG_WITH([max-height],
1535 [AS_HELP_STRING([--with-max-height=N],
1536 [Maximum framebuffer height (4096)])],
1537 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1538 AS_IF([test "${withval}" -gt "4096"],
1539 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1545 AC_ARG_ENABLE([gallium-llvm],
1546 [AS_HELP_STRING([--enable-gallium-llvm],
1547 [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
1548 [enable_gallium_llvm="$enableval"],
1549 [enable_gallium_llvm=auto])
1551 AC_ARG_WITH([llvm-shared-libs],
1552 [AS_HELP_STRING([--with-llvm-shared-libs],
1553 [link with LLVM shared libraries @<:@default=disabled@:>@])],
1555 [with_llvm_shared_libs=no])
1556 AS_IF([test x$enable_opencl = xyes],
1558 AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
1559 with_llvm_shared_libs=yes
1562 AC_ARG_WITH([llvm-prefix],
1563 [AS_HELP_STRING([--with-llvm-prefix],
1564 [Prefix for LLVM installations in non-standard locations])],
1565 [llvm_prefix="$withval"],
1569 # Call this inside ` ` to get the return value.
1570 # $1 is the llvm-config command with arguments.
1571 strip_unwanted_llvm_flags() {
1572 # Use \> (marks the end of the word)
1574 -e 's/-DNDEBUG\>//g' \
1575 -e 's/-pedantic\>//g' \
1576 -e 's/-Wcovered-switch-default\>//g' \
1580 -e 's/-fomit-frame-pointer\>//g'
1584 if test "x$with_gallium_drivers" = x; then
1585 enable_gallium_llvm=no
1587 if test "x$enable_gallium_llvm" = xauto; then
1589 i*86|x86_64|amd64) enable_gallium_llvm=yes;;
1592 if test "x$enable_gallium_llvm" = xyes; then
1593 if test "x$llvm_prefix" != x; then
1594 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
1596 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1599 if test "x$LLVM_CONFIG" != xno; then
1600 LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
1601 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
1602 LLVM_BINDIR=`$LLVM_CONFIG --bindir`
1603 LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
1604 LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
1605 LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
1606 LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
1607 LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
1609 AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
1610 [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
1611 AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
1612 [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
1614 if test "x${LLVM_VERSION_MAJOR}" != x; then
1615 LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
1617 LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
1620 LLVM_COMPONENTS="engine bitwriter"
1621 if $LLVM_CONFIG --components | grep -qw 'mcjit'; then
1622 LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
1625 if test "x$enable_opencl" = xyes; then
1626 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
1627 # LLVM 3.3 >= 177971 requires IRReader
1628 if $LLVM_CONFIG --components | grep -qw 'irreader'; then
1629 LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
1631 # LLVM 3.4 requires Option
1632 if $LLVM_CONFIG --components | grep -qw 'option'; then
1633 LLVM_COMPONENTS="${LLVM_COMPONENTS} option"
1636 DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
1639 dnl Check for Clang internal headers
1640 if test "x$enable_opencl" = xyes; then
1641 if test "x$CLANG_LIBDIR" = x; then
1642 CLANG_LIBDIR=${LLVM_LIBDIR}
1644 CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
1645 AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
1646 [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
1657 dnl Directory for XVMC libs
1658 AC_ARG_WITH([xvmc-libdir],
1659 [AS_HELP_STRING([--with-xvmc-libdir=DIR],
1660 [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
1661 [XVMC_LIB_INSTALL_DIR="$withval"],
1662 [XVMC_LIB_INSTALL_DIR='${libdir}'])
1663 AC_SUBST([XVMC_LIB_INSTALL_DIR])
1668 if test "x$enable_gallium_tests" = xyes; then
1669 enable_gallium_loader=yes
1671 AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
1673 if test "x$enable_gallium_loader" = xyes; then
1674 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
1676 AM_CONDITIONAL(NEED_GALLIUM_LOADER, test "x$enable_gallium_loader" = xyes)
1678 dnl Directory for VDPAU libs
1679 AC_ARG_WITH([vdpau-libdir],
1680 [AS_HELP_STRING([--with-vdpau-libdir=DIR],
1681 [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
1682 [VDPAU_LIB_INSTALL_DIR="$withval"],
1683 [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
1684 AC_SUBST([VDPAU_LIB_INSTALL_DIR])
1686 dnl Directory for OpenCL libs
1687 AC_ARG_WITH([opencl-libdir],
1688 [AS_HELP_STRING([--with-opencl-libdir=DIR],
1689 [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])],
1690 [OPENCL_LIB_INSTALL_DIR="$withval"],
1691 [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
1692 AC_SUBST([OPENCL_LIB_INSTALL_DIR])
1695 dnl Gallium helper functions
1697 gallium_check_st() {
1698 if test "x$NEED_NONNULL_WINSYS" = xyes; then
1699 if test "x$have_libdrm" != xyes; then
1700 AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
1702 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1704 if test "x$enable_dri" = xyes && test "x$2" != x; then
1705 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
1708 if test "x$enable_xorg" = xyes && test "x$3" != x; then
1709 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1711 if test "x$enable_xa" = xyes && test "x$4" != x; then
1712 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
1714 if test "x$enable_xvmc" = xyes && test "x$5" != x; then
1715 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
1717 if test "x$enable_vdpau" = xyes && test "x$6" != x; then
1718 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
1722 gallium_require_llvm() {
1723 if test "x$MESA_LLVM" = x0; then
1725 i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
1730 gallium_require_drm_loader() {
1731 if test "x$enable_gallium_loader" = xyes; then
1732 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1733 AC_MSG_ERROR([Gallium drm loader requires libudev]))
1734 if test "x$have_libdrm" != xyes; then
1735 AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
1737 enable_gallium_drm_loader=yes
1741 radeon_llvm_check() {
1742 LLVM_REQUIRED_VERSION_MAJOR="3"
1743 LLVM_REQUIRED_VERSION_MINOR="3"
1744 if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
1745 AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required for r600g and radeonsi.])
1747 if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
1748 AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
1749 sources with the --enable-experimental-targets=R600
1752 LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
1753 NEED_RADEON_LLVM=yes
1754 AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
1755 [AC_MSG_ERROR([radeonsi and r600g require libelf when using LLVM])])
1759 if test "x$enable_dri" = xyes -o "x$enable_xorg" = xyes -o \
1760 "x$enable_xa" = xyes -o "x$enable_xvmc" = xyes -o \
1761 "x$enable_vdpau" = xyes; then
1762 NEED_NONNULL_WINSYS=yes
1764 AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
1766 dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
1767 if test "x$with_gallium_drivers" != x; then
1768 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
1769 for driver in $gallium_drivers; do
1772 HAVE_GALLIUM_SVGA=yes
1773 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
1774 gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
1777 HAVE_GALLIUM_I915=yes
1778 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1779 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
1780 if test "x$MESA_LLVM" = x1; then
1781 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1783 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
1784 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1787 HAVE_GALLIUM_ILO=yes
1788 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1789 gallium_require_drm_loader
1790 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
1791 gallium_check_st "intel/drm" "dri-ilo"
1794 HAVE_GALLIUM_R300=yes
1795 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1796 gallium_require_llvm "Gallium R300"
1797 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
1798 gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300"
1801 HAVE_GALLIUM_R600=yes
1802 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1803 gallium_require_drm_loader
1804 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
1805 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
1807 R600_NEED_RADEON_GALLIUM=yes;
1808 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
1810 if test "x$enable_r600_llvm" = xyes; then
1811 USE_R600_LLVM_COMPILER=yes;
1813 if test "x$enable_opencl" = xyes; then
1814 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
1816 gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
1819 HAVE_GALLIUM_RADEONSI=yes
1820 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1821 gallium_require_drm_loader
1822 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
1824 gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
1827 HAVE_GALLIUM_NOUVEAU=yes
1828 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
1829 gallium_require_drm_loader
1830 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0"
1831 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
1834 HAVE_GALLIUM_FREEDRENO=yes
1835 PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
1836 gallium_require_drm_loader
1837 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
1838 gallium_check_st "freedreno/drm" "dri-freedreno" "" "" "" ""
1841 HAVE_GALLIUM_SOFTPIPE=yes
1842 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
1843 if test "x$MESA_LLVM" = x1; then
1844 HAVE_GALLIUM_LLVMPIPE=yes
1845 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1848 if test "x$enable_dri" = xyes; then
1849 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1852 if test "x$enable_vdpau" = xyes; then
1853 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
1855 if test "x$enable_xvmc" = xyes; then
1856 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
1858 if test "x$enable_vdpau" = xyes -o "x$enable_xvmc" = xyes; then
1859 NEED_WINSYS_XLIB=yes
1860 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
1864 AC_MSG_ERROR([Unknown Gallium driver: $driver])
1870 dnl Set LLVM_LIBS - This is done after the driver configuration so
1871 dnl that drivers can add additonal components to LLVM_COMPONENTS.
1872 dnl Previously, gallium drivers were updating LLVM_LIBS directly
1873 dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
1874 dnl this was causing the same libraries to be appear multiple times
1877 if test "x$MESA_LLVM" != x0; then
1879 LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
1881 if test "x$with_llvm_shared_libs" = xyes; then
1882 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
1883 LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
1884 AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
1886 if test "x$llvm_have_one_so" = xyes; then
1887 dnl LLVM was built using auto*, so there is only one shared object.
1888 LLVM_LIBS="-l$LLVM_SO_NAME"
1890 dnl If LLVM was built with CMake, there will be one shared object per
1892 AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
1893 [AC_MSG_ERROR([Could not find llvm shared libraries:
1894 Please make sure you have built llvm with the --enable-shared option
1895 and that your llvm libraries are installed in $LLVM_LIBDIR
1896 If you have installed your llvm libraries to a different directory you
1897 can use the --with-llvm-prefix= configure flag to specify this directory.
1898 NOTE: Mesa is attempting to use llvm shared libraries because you have
1899 passed one of the following options to configure:
1900 --with-llvm-shared-libs
1902 If you do not want to build with llvm shared libraries and instead want to
1903 use llvm static libraries then remove these options from your configure
1904 invocation and reconfigure.])])
1906 dnl We don't need to update LLVM_LIBS in this case because the LLVM
1907 dnl install uses a shared object for each compoenent and we have
1908 dnl already added all of these objects to LLVM_LIBS.
1913 AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
1914 AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
1915 AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
1916 AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
1917 AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
1918 AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
1919 AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
1920 AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
1921 AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
1922 AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
1924 AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -o \
1925 "x$HAVE_GALLIUM_I915" = xyes -o \
1926 "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
1927 AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
1928 "x$HAVE_GALLIUM_SOFTPIPE" = xyes \
1929 && test "x$MESA_LLVM" = x1)
1931 if test "x$enable_gallium_loader" = xyes; then
1932 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
1934 if test "x$enable_gallium_drm_loader" = xyes; then
1935 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
1936 PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
1937 pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
1938 if test "x$pipe_loader_have_xcb" = xyes; then
1939 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XCB"
1940 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
1944 AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
1945 AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
1948 AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
1949 AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
1950 AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
1951 AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
1952 AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
1953 AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
1954 AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
1956 AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
1957 "x$HAVE_GALLIUM_R300" = xyes -o \
1958 "x$HAVE_GALLIUM_R600" = xyes -o \
1959 "x$HAVE_GALLIUM_RADEONSI" = xyes)
1960 AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
1961 "x$HAVE_GALLIUM_SVGA" = xyes)
1962 AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
1963 AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
1964 AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
1965 AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
1966 AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
1967 AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
1968 AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
1969 AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
1970 AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
1974 AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
1975 "x$enable_xlib_glx" = xyes -o \
1976 "x$enable_osmesa" = xyes -o \
1977 "x$enable_gallium_osmesa" = xyes)
1978 AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
1979 AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
1980 AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
1982 AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
1983 AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
1984 AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
1986 AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
1988 AC_SUBST([VDPAU_MAJOR], 1)
1989 AC_SUBST([VDPAU_MINOR], 0)
1991 AC_SUBST([XVMC_MAJOR], 1)
1992 AC_SUBST([XVMC_MINOR], 0)
1994 AC_SUBST([XA_MAJOR], 2)
1995 AC_SUBST([XA_MINOR], 0)
1996 AC_SUBST([XA_TINY], 0)
1997 AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
1999 dnl Restore LDFLAGS and CPPFLAGS
2000 LDFLAGS="$_SAVE_LDFLAGS"
2001 CPPFLAGS="$_SAVE_CPPFLAGS"
2003 dnl Add user CFLAGS and CXXFLAGS
2004 CFLAGS="$CFLAGS $USER_CFLAGS"
2005 CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
2007 dnl Substitute the config
2008 AC_CONFIG_FILES([Makefile
2011 src/egl/drivers/Makefile
2012 src/egl/drivers/dri2/Makefile
2013 src/egl/drivers/glx/Makefile
2014 src/egl/main/Makefile
2016 src/egl/wayland/Makefile
2017 src/egl/wayland/wayland-drm/Makefile
2018 src/egl/wayland/wayland-egl/Makefile
2019 src/egl/wayland/wayland-egl/wayland-egl.pc
2020 src/gallium/auxiliary/Makefile
2021 src/gallium/auxiliary/pipe-loader/Makefile
2022 src/gallium/drivers/Makefile
2023 src/gallium/drivers/freedreno/Makefile
2024 src/gallium/drivers/freedreno/a2xx/Makefile
2025 src/gallium/drivers/freedreno/a3xx/Makefile
2026 src/gallium/drivers/i915/Makefile
2027 src/gallium/drivers/ilo/Makefile
2028 src/gallium/drivers/llvmpipe/Makefile
2029 src/gallium/drivers/nouveau/Makefile
2030 src/gallium/drivers/nv30/Makefile
2031 src/gallium/drivers/nv50/Makefile
2032 src/gallium/drivers/nvc0/Makefile
2033 src/gallium/drivers/r300/Makefile
2034 src/gallium/drivers/r600/Makefile
2035 src/gallium/drivers/radeon/Makefile
2036 src/gallium/drivers/radeonsi/Makefile
2037 src/gallium/drivers/rbug/Makefile
2038 src/gallium/drivers/softpipe/Makefile
2039 src/gallium/drivers/svga/Makefile
2040 src/gallium/drivers/trace/Makefile
2041 src/gallium/state_trackers/Makefile
2042 src/gallium/state_trackers/clover/Makefile
2043 src/gallium/state_trackers/dri/Makefile
2044 src/gallium/state_trackers/dri/drm/Makefile
2045 src/gallium/state_trackers/dri/sw/Makefile
2046 src/gallium/state_trackers/egl/Makefile
2047 src/gallium/state_trackers/gbm/Makefile
2048 src/gallium/state_trackers/glx/Makefile
2049 src/gallium/state_trackers/osmesa/Makefile
2050 src/gallium/state_trackers/vdpau/Makefile
2051 src/gallium/state_trackers/vega/Makefile
2052 src/gallium/state_trackers/xa/Makefile
2053 src/gallium/state_trackers/xorg/Makefile
2054 src/gallium/state_trackers/xvmc/Makefile
2055 src/gallium/targets/Makefile
2056 src/gallium/targets/dri-freedreno/Makefile
2057 src/gallium/targets/dri-i915/Makefile
2058 src/gallium/targets/dri-ilo/Makefile
2059 src/gallium/targets/dri-nouveau/Makefile
2060 src/gallium/targets/dri-r300/Makefile
2061 src/gallium/targets/dri-r600/Makefile
2062 src/gallium/targets/dri-radeonsi/Makefile
2063 src/gallium/targets/dri-swrast/Makefile
2064 src/gallium/targets/dri-vmwgfx/Makefile
2065 src/gallium/targets/egl-static/Makefile
2066 src/gallium/targets/gbm/Makefile
2067 src/gallium/targets/opencl/Makefile
2068 src/gallium/targets/osmesa/Makefile
2069 src/gallium/targets/osmesa/osmesa.pc
2070 src/gallium/targets/pipe-loader/Makefile
2071 src/gallium/targets/libgl-xlib/Makefile
2072 src/gallium/targets/vdpau-nouveau/Makefile
2073 src/gallium/targets/vdpau-r300/Makefile
2074 src/gallium/targets/vdpau-r600/Makefile
2075 src/gallium/targets/vdpau-radeonsi/Makefile
2076 src/gallium/targets/vdpau-softpipe/Makefile
2077 src/gallium/targets/xa-vmwgfx/Makefile
2078 src/gallium/targets/xa-vmwgfx/xatracker.pc
2079 src/gallium/targets/xorg-i915/Makefile
2080 src/gallium/targets/xorg-nouveau/Makefile
2081 src/gallium/targets/xorg-r600/Makefile
2082 src/gallium/targets/xorg-radeonsi/Makefile
2083 src/gallium/targets/xvmc-nouveau/Makefile
2084 src/gallium/targets/xvmc-r300/Makefile
2085 src/gallium/targets/xvmc-r600/Makefile
2086 src/gallium/targets/xvmc-softpipe/Makefile
2087 src/gallium/tests/trivial/Makefile
2088 src/gallium/tests/unit/Makefile
2089 src/gallium/winsys/Makefile
2090 src/gallium/winsys/freedreno/drm/Makefile
2091 src/gallium/winsys/i915/drm/Makefile
2092 src/gallium/winsys/i915/sw/Makefile
2093 src/gallium/winsys/intel/drm/Makefile
2094 src/gallium/winsys/nouveau/drm/Makefile
2095 src/gallium/winsys/radeon/drm/Makefile
2096 src/gallium/winsys/svga/drm/Makefile
2097 src/gallium/winsys/sw/dri/Makefile
2098 src/gallium/winsys/sw/fbdev/Makefile
2099 src/gallium/winsys/sw/null/Makefile
2100 src/gallium/winsys/sw/wayland/Makefile
2101 src/gallium/winsys/sw/wrapper/Makefile
2102 src/gallium/winsys/sw/xlib/Makefile
2106 src/glsl/builtin_compiler/Makefile
2108 src/glx/tests/Makefile
2111 src/mapi/es1api/Makefile
2112 src/mapi/es1api/glesv1_cm.pc
2113 src/mapi/es2api/Makefile
2114 src/mapi/es2api/glesv2.pc
2115 src/mapi/glapi/Makefile
2116 src/mapi/glapi/gen/Makefile
2117 src/mapi/glapi/tests/Makefile
2118 src/mapi/shared-glapi/Makefile
2119 src/mapi/shared-glapi/tests/Makefile
2120 src/mapi/vgapi/Makefile
2121 src/mapi/vgapi/vg.pc
2124 src/mesa/drivers/dri/dri.pc
2125 src/mesa/drivers/dri/common/Makefile
2126 src/mesa/drivers/dri/common/xmlpool/Makefile
2127 src/mesa/drivers/dri/i915/Makefile
2128 src/mesa/drivers/dri/i965/Makefile
2129 src/mesa/drivers/dri/Makefile
2130 src/mesa/drivers/dri/nouveau/Makefile
2131 src/mesa/drivers/dri/r200/Makefile
2132 src/mesa/drivers/dri/radeon/Makefile
2133 src/mesa/drivers/dri/swrast/Makefile
2134 src/mesa/drivers/osmesa/Makefile
2135 src/mesa/drivers/osmesa/osmesa.pc
2136 src/mesa/drivers/x11/Makefile
2137 src/mesa/libdricore/Makefile
2138 src/mesa/main/tests/Makefile
2139 src/mesa/main/tests/hash_table/Makefile
2140 src/mesa/program/Makefile
2141 src/mesa/x86-64/Makefile
2142 src/mesa/x86/Makefile])
2144 dnl Sort the dirs alphabetically
2145 GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2146 GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2147 GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2148 GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2153 dnl Output some configuration info for the user
2156 echo " prefix: $prefix"
2157 echo " exec_prefix: $exec_prefix"
2158 echo " libdir: $libdir"
2159 echo " includedir: $includedir"
2163 echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
2164 echo " OpenVG: $enable_openvg"
2168 case "x$enable_osmesa$enable_gallium_osmesa" in
2170 echo " OSMesa: lib$OSMESA_LIB (Gallium)"
2173 echo " OSMesa: lib$OSMESA_LIB"
2180 if test "x$enable_dri" != xno; then
2181 # cleanup the drivers var
2182 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
2183 if test "x$DRI_DIRS" = x; then
2184 echo " DRI drivers: no"
2186 echo " DRI drivers: $dri_dirs"
2188 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
2191 case "x$enable_glx$enable_xlib_glx" in
2193 echo " GLX: Xlib-based"
2196 echo " GLX: DRI-based"
2199 echo " GLX: $enable_glx"
2205 echo " EGL: $enable_egl"
2206 if test "$enable_egl" = yes; then
2207 echo " EGL platforms: $egl_platforms"
2210 if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then
2211 egl_drivers="$egl_drivers builtin:egl_glx"
2213 if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
2214 egl_drivers="$egl_drivers builtin:egl_dri2"
2217 if test "x$enable_gallium_egl" = xyes; then
2218 echo " EGL drivers: ${egl_drivers} egl_gallium"
2219 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
2221 echo " EGL drivers: $egl_drivers"
2226 if test "x$MESA_LLVM" = x1; then
2228 echo " llvm-config: $LLVM_CONFIG"
2229 echo " llvm-version: $LLVM_VERSION"
2235 if test -n "$with_gallium_drivers"; then
2236 echo " Gallium: yes"
2237 echo " Target dirs: $GALLIUM_TARGET_DIRS"
2238 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
2239 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
2240 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
2248 echo " Shared libs: $enable_shared"
2249 echo " Static libs: $enable_static"
2250 echo " Shared-glapi: $enable_shared_glapi"
2252 dnl Compiler options
2253 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
2254 cflags=`echo $CFLAGS | \
2255 $SED 's/^ *//;s/ */ /;s/ *$//'`
2256 cxxflags=`echo $CXXFLAGS | \
2257 $SED 's/^ *//;s/ */ /;s/ *$//'`
2258 defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
2260 echo " CFLAGS: $cflags"
2261 echo " CXXFLAGS: $cxxflags"
2262 echo " Macros: $defines"
2264 if test "x$MESA_LLVM" = x1; then
2265 echo " LLVM_CFLAGS: $LLVM_CFLAGS"
2266 echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
2267 echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
2270 echo " PYTHON2: $PYTHON2"
2273 echo " Run '${MAKE-make}' to build Mesa"