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])
20 dnl Versions for external dependencies
21 LIBDRM_REQUIRED=2.4.24
22 LIBDRM_RADEON_REQUIRED=2.4.24
23 LIBDRM_INTEL_REQUIRED=2.4.24
24 DRI2PROTO_REQUIRED=2.1
25 GLPROTO_REQUIRED=1.4.11
26 LIBDRM_XORG_REQUIRED=2.4.24
27 LIBKMS_XORG_REQUIRED=1.0.0
33 AC_CHECK_PROGS([MAKE], [gmake make])
34 AC_CHECK_PROGS([PYTHON2], [python2 python])
35 AC_PATH_PROG([MKDEP], [makedepend])
36 AC_PATH_PROG([SED], [sed])
38 if test "x$MKDEP" = "x"; then
39 AC_MSG_ERROR([makedepend is required to build Mesa])
42 dnl Our fallback install-sh is a symlink to minstall. Use the existing
43 dnl configuration in that case.
45 test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
47 dnl We need a POSIX shell for parts of the build. Assume we have one
51 # Solaris /bin/sh is too old/non-POSIX compliant
52 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
57 dnl clang is mostly GCC-compatible, but its version is much lower,
58 dnl so we have to check for it.
59 AC_MSG_CHECKING([if compiling with clang])
62 [AC_LANG_PROGRAM([], [[
67 [CLANG=yes], [CLANG=no])
69 AC_MSG_RESULT([$CLANG])
71 dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
72 dnl versions are explictly not supported.
73 if test "x$GCC" = xyes -a "x$CLANG" = xno; then
74 AC_MSG_CHECKING([whether gcc version is sufficient])
78 GCC_VERSION=`$CC -dumpversion`
79 if test $? -eq 0; then
80 major=`echo $GCC_VERSION | cut -d. -f1`
81 minor=`echo $GCC_VERSION | cut -d. -f1`
84 if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
86 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
93 MKDEP_OPTIONS=-fdepend
94 dnl Ask gcc where it's keeping its secret headers
95 if test "x$GCC" = xyes; then
96 for dir in include include-fixed; do
97 GCC_INCLUDES=`$CC -print-file-name=$dir`
98 if test "x$GCC_INCLUDES" != x && \
99 test "$GCC_INCLUDES" != "$dir" && \
100 test -d "$GCC_INCLUDES"; then
101 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
105 AC_SUBST([MKDEP_OPTIONS])
107 dnl Make sure the pkg-config macros are defined
108 m4_ifndef([PKG_PROG_PKG_CONFIG],
109 [m4_fatal([Could not locate the pkg-config autoconf macros.
110 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
111 are in a different location, try setting the environment variable
112 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
113 PKG_PROG_PKG_CONFIG()
115 dnl LIB_DIR - library basename
116 LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
119 dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
120 _SAVE_LDFLAGS="$LDFLAGS"
121 AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
122 AC_SUBST([EXTRA_LIB_PATH])
124 dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
125 _SAVE_CPPFLAGS="$CPPFLAGS"
126 AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
127 AC_SUBST([X11_INCLUDES])
134 DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
137 DEFINES="$DEFINES -DPTHREADS -DSVR4"
140 DEFINES="$DEFINES -DPTHREADS"
144 dnl Add flags for gcc and g++
145 if test "x$GCC" = xyes; then
146 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99"
147 if test "x$CLANG" = "xno"; then
148 CFLAGS="$CFLAGS -ffast-math"
151 # Enable -fvisibility=hidden if using a gcc that supports it
152 save_CFLAGS="$CFLAGS"
153 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
154 VISIBILITY_CFLAGS="-fvisibility=hidden"
155 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
156 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
157 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
159 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
162 # Work around aliasing bugs - developers should comment this out
163 CFLAGS="$CFLAGS -fno-strict-aliasing"
165 if test "x$GXX" = xyes; then
166 CXXFLAGS="$CXXFLAGS -Wall"
168 # Enable -fvisibility=hidden if using a gcc that supports it
169 save_CXXFLAGS="$CXXFLAGS"
170 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
171 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
172 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
173 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
174 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
176 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
177 CXXFLAGS=$save_CXXFLAGS
179 # Work around aliasing bugs - developers should comment this out
180 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
183 AC_SUBST([VISIBILITY_CFLAGS])
184 AC_SUBST([VISIBILITY_CXXFLAGS])
186 dnl These should be unnecessary, but let the user set them if they want
187 AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
188 Default is to use CFLAGS.])
189 AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
190 compiler. Default is to use CFLAGS.])
191 AC_SUBST([OPT_FLAGS])
192 AC_SUBST([ARCH_FLAGS])
195 dnl Hacks to enable 32 or 64 bit build
197 AC_ARG_ENABLE([32-bit],
198 [AS_HELP_STRING([--enable-32-bit],
199 [build 32-bit libraries @<:@default=auto@:>@])],
200 [enable_32bit="$enableval"],
203 if test "x$enable_32bit" = xyes; then
204 if test "x$GCC" = xyes; then
205 CFLAGS="$CFLAGS -m32"
206 ARCH_FLAGS="$ARCH_FLAGS -m32"
208 if test "x$GXX" = xyes; then
209 CXXFLAGS="$CXXFLAGS -m32"
212 AC_ARG_ENABLE([64-bit],
213 [AS_HELP_STRING([--enable-64-bit],
214 [build 64-bit libraries @<:@default=auto@:>@])],
215 [enable_64bit="$enableval"],
218 if test "x$enable_64bit" = xyes; then
219 if test "x$GCC" = xyes; then
220 CFLAGS="$CFLAGS -m64"
222 if test "x$GXX" = xyes; then
223 CXXFLAGS="$CXXFLAGS -m64"
228 dnl shared/static libraries, mimic libtool options
230 AC_ARG_ENABLE([static],
231 [AS_HELP_STRING([--enable-static],
232 [build static libraries @<:@default=disabled@:>@])],
233 [enable_static="$enableval"],
236 case "x$enable_static" in
238 x ) enable_static=no ;;
240 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
243 AC_ARG_ENABLE([shared],
244 [AS_HELP_STRING([--disable-shared],
245 [build shared libraries @<:@default=enabled@:>@])],
246 [enable_shared="$enableval"],
249 case "x$enable_shared" in
251 x ) enable_shared=yes ;;
253 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
257 dnl Can't have static and shared libraries, default to static if user
258 dnl explicitly requested. If both disabled, set to static since shared
259 dnl was explicitly requirested.
260 case "x$enable_static$enable_shared" in
262 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
266 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
274 AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
275 if test "$enable_static" = yes; then
276 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
278 AC_SUBST([MKLIB_OPTIONS])
281 dnl other compiler options
283 AC_ARG_ENABLE([debug],
284 [AS_HELP_STRING([--enable-debug],
285 [use debug compiler flags and macros @<:@default=disabled@:>@])],
286 [enable_debug="$enableval"],
289 if test "x$enable_debug" = xyes; then
290 DEFINES="$DEFINES -DDEBUG"
291 if test "x$GCC" = xyes; then
294 if test "x$GXX" = xyes; then
295 CXXFLAGS="$CXXFLAGS -g"
302 LIB_PREFIX_GLOB='lib'
303 LIB_VERSION_SEPARATOR='.'
304 if test "$enable_static" = yes; then
309 LIB_EXTENSION='dylib' ;;
311 dnl prefix can be 'cyg' or 'lib'
312 LIB_PREFIX_GLOB='???'
313 LIB_VERSION_SEPARATOR='-'
314 LIB_EXTENSION='dll' ;;
318 LIB_EXTENSION='so' ;;
322 GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
323 GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
324 GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
325 GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
326 OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
327 EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
328 GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
329 GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
330 VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
331 GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
332 WAYLAND_EGL_LIB_NAME='lib$(WAYLAND_EGL_LIB).'${LIB_EXTENSION}
334 GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
335 GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
336 GLUT_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLUT_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
337 GLW_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLW_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
338 OSMESA_LIB_GLOB=${LIB_PREFIX_GLOB}'$(OSMESA_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
339 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
340 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
341 GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
342 GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
343 VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
344 GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
345 WAYLAND_EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(WAYLAND_EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
347 AC_SUBST([GL_LIB_NAME])
348 AC_SUBST([GLU_LIB_NAME])
349 AC_SUBST([GLUT_LIB_NAME])
350 AC_SUBST([GLW_LIB_NAME])
351 AC_SUBST([OSMESA_LIB_NAME])
352 AC_SUBST([EGL_LIB_NAME])
353 AC_SUBST([GLESv1_CM_LIB_NAME])
354 AC_SUBST([GLESv2_LIB_NAME])
355 AC_SUBST([VG_LIB_NAME])
356 AC_SUBST([GLAPI_LIB_NAME])
357 AC_SUBST([WAYLAND_EGL_LIB_NAME])
359 AC_SUBST([GL_LIB_GLOB])
360 AC_SUBST([GLU_LIB_GLOB])
361 AC_SUBST([GLUT_LIB_GLOB])
362 AC_SUBST([GLW_LIB_GLOB])
363 AC_SUBST([OSMESA_LIB_GLOB])
364 AC_SUBST([EGL_LIB_GLOB])
365 AC_SUBST([GLESv1_CM_LIB_GLOB])
366 AC_SUBST([GLESv2_LIB_GLOB])
367 AC_SUBST([VG_LIB_GLOB])
368 AC_SUBST([GLAPI_LIB_GLOB])
369 AC_SUBST([WAYLAND_EGL_LIB_GLOB])
372 dnl Arch/platform-specific settings
375 [AS_HELP_STRING([--disable-asm],
376 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
377 [enable_asm="$enableval"],
384 AC_MSG_CHECKING([whether to enable assembly])
385 test "x$enable_asm" = xno && AC_MSG_RESULT([no])
386 # disable if cross compiling on x86/x86_64 since we must run gen_matypes
387 if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
391 AC_MSG_RESULT([no, cross compiling])
395 # check for supported arches
396 if test "x$enable_asm" = xyes; then
400 linux* | *freebsd* | dragonfly* | *netbsd*)
401 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
407 linux* | *freebsd* | dragonfly* | *netbsd*)
408 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
430 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
431 MESA_ASM_SOURCES='$(X86_SOURCES)'
432 GLAPI_ASM_SOURCES='$(X86_API)'
433 AC_MSG_RESULT([yes, x86])
436 ASM_FLAGS="-DUSE_X86_64_ASM"
437 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
438 GLAPI_ASM_SOURCES='$(X86-64_API)'
439 AC_MSG_RESULT([yes, x86_64])
442 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
443 MESA_ASM_SOURCES='$(PPC_SOURCES)'
444 AC_MSG_RESULT([yes, ppc])
447 ASM_FLAGS="-DUSE_SPARC_ASM"
448 MESA_ASM_SOURCES='$(SPARC_SOURCES)'
449 GLAPI_ASM_SOURCES='$(SPARC_API)'
450 AC_MSG_RESULT([yes, sparc])
453 AC_MSG_RESULT([no, platform not supported])
457 AC_SUBST([ASM_FLAGS])
458 AC_SUBST([MESA_ASM_SOURCES])
459 AC_SUBST([GLAPI_ASM_SOURCES])
464 dnl Check to see if dlopen is in default libraries (like Solaris, which
465 dnl has it in libc), or if libdl is needed to get it.
466 AC_CHECK_FUNC([dlopen], [],
467 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
468 AC_SUBST([DLOPEN_LIBS])
470 dnl See if posix_memalign is available
471 AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
473 dnl SELinux awareness.
474 AC_ARG_ENABLE([selinux],
475 [AS_HELP_STRING([--enable-selinux],
476 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
477 [MESA_SELINUX="$enableval"],
479 if test "x$enable_selinux" = "xyes"; then
480 AC_CHECK_HEADER([selinux/selinux.h],[],
481 [AC_MSG_ERROR([SELinux headers not found])])
482 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
483 [AC_MSG_ERROR([SELinux library not found])])
484 SELINUX_LIBS="-lselinux"
485 DEFINES="$DEFINES -DMESA_SELINUX"
488 dnl Determine which APIs to support
489 AC_ARG_ENABLE([opengl],
490 [AS_HELP_STRING([--disable-opengl],
491 [disable support for standard OpenGL API @<:@default=no@:>@])],
492 [enable_opengl="$enableval"],
494 AC_ARG_ENABLE([gles1],
495 [AS_HELP_STRING([--enable-gles1],
496 [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
497 [enable_gles1="$enableval"],
499 AC_ARG_ENABLE([gles2],
500 [AS_HELP_STRING([--enable-gles2],
501 [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
502 [enable_gles2="$enableval"],
504 AC_ARG_ENABLE([gles-overlay],
505 [AS_HELP_STRING([--enable-gles-overlay],
506 [DEPRECATED. Same as --enable-gles1 and --enable-gles2])],
507 [enable_gles1="$enableval"; enable_gles2="$enableval"],
510 AC_ARG_ENABLE([openvg],
511 [AS_HELP_STRING([--enable-openvg],
512 [enable support for OpenVG API @<:@default=no@:>@])],
513 [enable_openvg="$enableval"],
516 dnl smooth the transition; should be removed eventually
517 if test "x$enable_openvg" = xno; then
518 case "x$with_state_trackers" in
520 AC_MSG_WARN([vega state tracker is enabled without --enable-openvg])
526 if test "x$enable_opengl" = xno -a \
527 "x$enable_gles1" = xno -a \
528 "x$enable_gles2" = xno -a \
529 "x$enable_openvg" = xno; then
530 AC_MSG_ERROR([at least one API should be enabled])
534 if test "x$enable_opengl" = xno; then
535 API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
537 API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
539 if test "x$enable_gles1" = xyes; then
540 API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
542 if test "x$enable_gles2" = xyes; then
543 API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
545 AC_SUBST([API_DEFINES])
547 AC_ARG_ENABLE([shared-glapi],
548 [AS_HELP_STRING([--enable-shared-glapi],
549 [EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
550 [enable_shared_glapi="$enableval"],
551 [enable_shared_glapi=no])
554 if test "x$enable_shared_glapi" = xyes; then
557 AC_SUBST([SHARED_GLAPI])
560 dnl Driver configuration. Options are xlib, dri and osmesa right now.
561 dnl More later: fbdev, ...
563 default_driver="xlib"
568 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
571 *freebsd* | dragonfly* | *netbsd*)
573 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
578 if test "x$enable_opengl" = xno; then
582 AC_ARG_WITH([driver],
583 [AS_HELP_STRING([--with-driver=DRIVER],
584 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
585 [mesa_driver="$withval"],
586 [mesa_driver="$default_driver"])
587 dnl Check for valid option
588 case "x$mesa_driver" in
590 if test "x$enable_opengl" = xno; then
591 AC_MSG_ERROR([Driver '$mesa_driver' requires OpenGL enabled])
597 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
602 dnl Driver specific build directories
605 dnl this variable will be prepended to SRC_DIRS and is not exported
610 GALLIUM_DIRS="auxiliary drivers state_trackers"
611 GALLIUM_TARGET_DIRS=""
612 GALLIUM_WINSYS_DIRS="sw"
613 GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug noop identity"
614 GALLIUM_STATE_TRACKERS_DIRS=""
616 # build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
617 case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
619 CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
623 # build glapi if OpenGL is enabled
624 if test "x$enable_opengl" = xyes; then
625 CORE_DIRS="$CORE_DIRS mapi/glapi"
628 # build es1api if OpenGL ES 1.x is enabled
629 if test "x$enable_gles1" = xyes; then
630 CORE_DIRS="$CORE_DIRS mapi/es1api"
633 # build es2api if OpenGL ES 2.x is enabled
634 if test "x$enable_gles2" = xyes; then
635 CORE_DIRS="$CORE_DIRS mapi/es2api"
638 # build vgapi if OpenVG is enabled
639 if test "x$enable_openvg" = xyes; then
640 CORE_DIRS="$CORE_DIRS mapi/vgapi"
643 # build glsl and mesa if OpenGL or OpenGL ES is enabled
644 case "x$enable_opengl$enable_gles1$enable_gles2" in
646 CORE_DIRS="$CORE_DIRS glsl mesa"
650 case "$mesa_driver" in
653 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
654 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
657 SRC_DIRS="$SRC_DIRS glx"
659 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib sw/dri"
670 AC_SUBST([DRIVER_DIRS])
671 AC_SUBST([GALLIUM_DIRS])
672 AC_SUBST([GALLIUM_TARGET_DIRS])
673 AC_SUBST([GALLIUM_WINSYS_DIRS])
674 AC_SUBST([GALLIUM_DRIVERS_DIRS])
675 AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
676 AC_SUBST([MESA_LLVM])
679 dnl Find out if X is available. The variable have_x is set if libX11 is
680 dnl found to mimic AC_PATH_XTRA.
682 if test -n "$PKG_CONFIG"; then
683 AC_MSG_CHECKING([pkg-config files for X11 are available])
684 PKG_CHECK_EXISTS([x11],[
690 AC_MSG_RESULT([$x11_pkgconfig])
694 dnl Use the autoconf macro if no pkg-config files
695 if test "$x11_pkgconfig" = yes; then
696 PKG_CHECK_MODULES([X11], [x11])
699 test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
700 test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
701 AC_SUBST([X11_CFLAGS])
705 dnl Try to tell the user that the --x-* options are only used when
706 dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
707 m4_divert_once([HELP_BEGIN],
708 [These options are only used when the X libraries cannot be found by the
709 pkg-config utility.])
711 dnl We need X for xlib and dri, so bomb now if it's not found
712 case "$mesa_driver" in
714 if test "$no_x" = yes; then
715 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
720 dnl XCB - this is only used for GLX right now
722 [AS_HELP_STRING([--enable-xcb],
723 [use XCB for GLX @<:@default=disabled@:>@])],
724 [enable_xcb="$enableval"],
726 if test "x$enable_xcb" = xyes; then
727 DEFINES="$DEFINES -DUSE_XCB"
732 dnl Direct rendering or just indirect rendering
735 dnl Disable by default on GNU/Hurd
736 driglx_direct_default="no"
739 driglx_direct_default="yes"
742 AC_ARG_ENABLE([driglx-direct],
743 [AS_HELP_STRING([--disable-driglx-direct],
744 [enable direct rendering in GLX and EGL for DRI \
745 @<:@default=auto@:>@])],
746 [driglx_direct="$enableval"],
747 [driglx_direct="$driglx_direct_default"])
750 dnl libGL configuration per driver
752 case "$mesa_driver" in
754 if test "$x11_pkgconfig" = yes; then
755 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
756 GL_PC_REQ_PRIV="x11 xext"
757 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
758 GL_LIB_DEPS="$XLIBGL_LIBS"
760 # should check these...
761 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
762 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
763 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
764 GL_PC_CFLAGS="$X11_INCLUDES"
766 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
767 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
769 # if static, move the external libraries to the programs
770 # and empty the libraries for libGL
771 if test "$enable_static" = yes; then
772 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
776 dri|no) # these checks are still desired when there is no mesa_driver
777 # DRI must be shared, I think
778 if test "$enable_static" = yes; then
779 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
782 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
783 GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
786 if test x"$driglx_direct" = xyes; then
788 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
789 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
790 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
791 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
794 # find the DRI deps for libGL
795 if test "$x11_pkgconfig" = yes; then
796 dri_modules="x11 xext xdamage xfixes"
798 # add xf86vidmode if available
799 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
800 if test "$HAVE_XF86VIDMODE" = yes ; then
801 dri_modules="$dri_modules xxf86vm"
804 # add xcb modules if necessary
805 if test "$enable_xcb" = yes; then
806 dri_modules="$dri_modules x11-xcb xcb-glx"
809 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
810 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
811 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
812 GL_LIB_DEPS="$DRIGL_LIBS"
814 # should check these...
815 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
816 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
817 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
818 GL_PC_CFLAGS="$X11_INCLUDES"
820 # XCB can only be used from pkg-config
821 if test "$enable_xcb" = yes; then
822 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
823 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
824 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
825 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
829 # need DRM libs, -lpthread, etc.
830 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
831 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
832 GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
833 GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
834 GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
835 GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
838 # No libGL for osmesa
842 AC_SUBST([GL_LIB_DEPS])
843 AC_SUBST([GL_PC_REQ_PRIV])
844 AC_SUBST([GL_PC_LIB_PRIV])
845 AC_SUBST([GL_PC_CFLAGS])
846 AC_SUBST([DRI_PC_REQ_PRIV])
847 AC_SUBST([GLESv1_CM_LIB_DEPS])
848 AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
849 AC_SUBST([GLESv2_LIB_DEPS])
850 AC_SUBST([GLESv2_PC_LIB_PRIV])
852 GLAPI_LIB_DEPS="-lpthread"
853 AC_SUBST([GLAPI_LIB_DEPS])
856 dnl Setup default DRI CFLAGS
857 DRI_CFLAGS='$(CFLAGS)'
858 DRI_CXXFLAGS='$(CXXFLAGS)'
859 DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
860 MESA_MODULES='$(TOP)/src/mesa/libmesa.a'
862 AC_ARG_ENABLE([shared-dricore],
863 [AS_HELP_STRING([--enable-shared-dricore],
864 [link DRI modules with shared core DRI routines @<:@default=disabled@:>@])],
865 [enable_dricore="$enableval"],
867 if test "$mesa_driver" = dri ; then
868 if test "$enable_dricore" = yes ; then
869 if test "$GCC$GXX" != yesyes ; then
870 AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore])
873 DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
874 DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
875 DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
876 DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
877 DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
878 DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
879 MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
883 AC_SUBST([DRICORE_LIBS])
884 AC_SUBST([DRICORE_GLSL_LIBS])
885 AC_SUBST([DRICORE_LIB_DEPS])
886 AC_SUBST([DRI_CXXFLAGS])
887 AC_SUBST([DRI_CFLAGS])
888 AC_SUBST([MESA_MODULES])
890 AC_SUBST([HAVE_XF86VIDMODE])
892 PKG_CHECK_MODULES([LIBDRM_RADEON],
893 [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED],
894 HAVE_LIBDRM_RADEON=yes,
895 HAVE_LIBDRM_RADEON=no)
900 if test "$mesa_driver" = xlib; then
901 DEFINES="$DEFINES -DUSE_XSHM"
908 AC_ARG_ENABLE([glx-tls],
909 [AS_HELP_STRING([--enable-glx-tls],
910 [enable TLS support in GLX @<:@default=disabled@:>@])],
911 [GLX_USE_TLS="$enableval"],
913 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
915 AS_IF([test "x$GLX_USE_TLS" = xyes],
916 [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
921 dnl Directory for DRI drivers
922 AC_ARG_WITH([dri-driverdir],
923 [AS_HELP_STRING([--with-dri-driverdir=DIR],
924 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
925 [DRI_DRIVER_INSTALL_DIR="$withval"],
926 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
927 AC_SUBST([DRI_DRIVER_INSTALL_DIR])
928 dnl Extra search path for DRI drivers
929 AC_ARG_WITH([dri-searchpath],
930 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
931 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
932 [DRI_DRIVER_SEARCH_DIR="$withval"],
933 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
934 AC_SUBST([DRI_DRIVER_SEARCH_DIR])
935 dnl Which drivers to build - default is chosen by platform
936 AC_ARG_WITH([dri-drivers],
937 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
938 [comma delimited DRI drivers list, e.g.
939 "swrast,i965,radeon" @<:@default=auto@:>@])],
940 [with_dri_drivers="$withval"],
941 [with_dri_drivers=yes])
942 if test "x$with_dri_drivers" = x; then
946 dnl If $with_dri_drivers is yes, directories will be added through
949 case "$with_dri_drivers" in
955 # verify the requested driver directories exist
956 dri_drivers=`IFS=', '; echo $with_dri_drivers`
957 for driver in $dri_drivers; do
958 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
959 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
961 DRI_DIRS="$dri_drivers"
965 dnl Set DRI_DIRS, DEFINES and LIB_DEPS
966 if test "$mesa_driver" = dri -o "$mesa_driver" = no; then
967 # Platform specific settings and drivers to build
970 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
971 if test "x$driglx_direct" = xyes; then
972 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
974 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
978 # sis is missing because they have not be converted to use
979 # the new interface. i810 are missing because there is no
980 # x86-64 system where they could *ever* be used.
981 if test "x$DRI_DIRS" = "xyes"; then
982 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
983 savage tdfx unichrome swrast"
987 # Build only the drivers for cards that exist on PowerPC.
988 # At some point MGA will be added, but not yet.
989 if test "x$DRI_DIRS" = "xyes"; then
990 DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
994 # Build only the drivers for cards that exist on sparc`
995 if test "x$DRI_DIRS" = "xyes"; then
996 DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
1001 freebsd* | dragonfly* | *netbsd*)
1002 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
1003 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
1004 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
1005 if test "x$driglx_direct" = xyes; then
1006 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
1009 if test "x$DRI_DIRS" = "xyes"; then
1010 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
1011 unichrome savage sis swrast"
1015 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
1016 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
1019 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
1020 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
1021 if test "x$driglx_direct" = xyes; then
1022 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
1028 if test "x$DRI_DIRS" = "xyes"; then
1029 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
1030 savage sis tdfx unichrome swrast"
1033 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1036 if test "$mesa_driver" = dri; then
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.])])
1048 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1049 [AC_MSG_ERROR([Expat required for DRI.])])
1052 # put all the necessary libs together, including possibly libdricore
1053 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
1055 AC_SUBST([DRI_DIRS])
1056 AC_SUBST([EXPAT_INCLUDES])
1057 AC_SUBST([DRI_LIB_DEPS])
1061 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1066 *radeon*|*r200*|*r300*|*r600*)
1067 if test "x$HAVE_LIBDRM_RADEON" = xyes; then
1068 RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
1069 RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
1073 AC_SUBST([RADEON_CFLAGS])
1074 AC_SUBST([RADEON_LDFLAGS])
1078 dnl OSMesa configuration
1080 if test "$mesa_driver" = xlib; then
1081 default_gl_osmesa=yes
1083 default_gl_osmesa=no
1085 AC_ARG_ENABLE([gl-osmesa],
1086 [AS_HELP_STRING([--enable-gl-osmesa],
1087 [enable OSMesa with libGL @<:@default=enabled for xlib driver@:>@])],
1088 [gl_osmesa="$enableval"],
1089 [gl_osmesa="$default_gl_osmesa"])
1090 if test "x$gl_osmesa" = xyes; then
1091 if test "x$enable_opengl" = xno; then
1092 AC_MSG_ERROR([OpenGL is not available for OSMesa driver])
1094 if test "$mesa_driver" = osmesa; then
1095 AC_MSG_ERROR([libGL is not available for OSMesa driver])
1097 DRIVER_DIRS="$DRIVER_DIRS osmesa"
1101 dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
1102 AC_ARG_WITH([osmesa-bits],
1103 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1104 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
1105 [osmesa_bits="$withval"],
1107 if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
1108 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
1111 case "x$osmesa_bits" in
1116 OSMESA_LIB="OSMesa$osmesa_bits"
1117 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1120 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1123 AC_SUBST([OSMESA_LIB])
1125 case "$DRIVER_DIRS" in
1127 # only link libraries with osmesa if shared
1128 if test "$enable_static" = no; then
1129 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
1134 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
1137 AC_SUBST([OSMESA_LIB_DEPS])
1138 AC_SUBST([OSMESA_MESA_DEPS])
1139 AC_SUBST([OSMESA_PC_REQ])
1140 AC_SUBST([OSMESA_PC_LIB_PRIV])
1143 dnl EGL configuration
1145 AC_ARG_ENABLE([egl],
1146 [AS_HELP_STRING([--disable-egl],
1147 [disable EGL library @<:@default=enabled@:>@])],
1148 [enable_egl="$enableval"],
1150 if test "x$enable_egl" = xno; then
1151 if test "x$mesa_driver" = xno; then
1152 AC_MSG_ERROR([cannot disable EGL when there is no mesa driver])
1154 if test "x$enable_openvg" = xyes; then
1155 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1158 if test "x$enable_egl" = xyes; then
1159 SRC_DIRS="$SRC_DIRS egl"
1160 EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
1162 if test "$enable_static" != yes; then
1163 # build egl_glx when libGL is built
1164 if test "$mesa_driver" = xlib -o "$mesa_driver" = dri; then
1165 EGL_DRIVERS_DIRS="glx"
1168 if test "$mesa_driver" = dri; then
1169 # build egl_dri2 when xcb-dri2 is available
1170 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes],
1171 [have_xcb_dri2=yes],[have_xcb_dri2=no])
1172 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1173 [have_libudev=yes],[have_libudev=no])
1175 if test "$have_xcb_dri2" = yes; then
1176 EGL_DRIVER_DRI2=dri2
1177 DEFINES="$DEFINES -DHAVE_XCB_DRI2"
1178 if test "$have_libudev" = yes; then
1179 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1181 # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
1182 AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
1183 [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
1187 EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS $EGL_DRIVER_DRI2"
1190 AC_SUBST([EGL_LIB_DEPS])
1191 AC_SUBST([EGL_DRIVERS_DIRS])
1194 dnl GLU configuration
1196 AC_ARG_ENABLE([glu],
1197 [AS_HELP_STRING([--disable-glu],
1198 [enable OpenGL Utility library @<:@default=enabled@:>@])],
1199 [enable_glu="$enableval"],
1202 if test "x$enable_glu" = xyes -a "x$mesa_driver" = xno; then
1203 AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
1207 if test "x$enable_glu" = xyes; then
1208 SRC_DIRS="$SRC_DIRS glu"
1210 case "$mesa_driver" in
1212 # Link libGLU to libOSMesa instead of libGL
1215 if test "$enable_static" = no; then
1216 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
1222 # If static, empty GLU_LIB_DEPS and add libs for programs to link
1224 GLU_PC_LIB_PRIV="-lm"
1225 if test "$enable_static" = no; then
1227 GLU_MESA_DEPS='-l$(GL_LIB)'
1231 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
1236 if test "$enable_static" = no; then
1237 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
1239 GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
1240 AC_SUBST([GLU_LIB_DEPS])
1241 AC_SUBST([GLU_MESA_DEPS])
1242 AC_SUBST([GLU_PC_REQ])
1243 AC_SUBST([GLU_PC_REQ_PRIV])
1244 AC_SUBST([GLU_PC_LIB_PRIV])
1245 AC_SUBST([GLU_PC_CFLAGS])
1248 dnl GLw configuration
1250 AC_ARG_ENABLE([glw],
1251 [AS_HELP_STRING([--disable-glw],
1252 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
1253 [enable_glw="$enableval"],
1255 dnl Don't build GLw on osmesa
1256 if test "x$enable_glw" = xyes; then
1257 case "$mesa_driver" in
1259 AC_MSG_NOTICE([Disabling GLw since there is no OpenGL driver])
1264 AC_ARG_ENABLE([motif],
1265 [AS_HELP_STRING([--enable-motif],
1266 [use Motif widgets in GLw @<:@default=disabled@:>@])],
1267 [enable_motif="$enableval"],
1270 if test "x$enable_glw" = xyes; then
1271 SRC_DIRS="$SRC_DIRS glw"
1272 if test "$x11_pkgconfig" = yes; then
1273 PKG_CHECK_MODULES([GLW],[x11 xt])
1274 GLW_PC_REQ_PRIV="x11 xt"
1275 GLW_LIB_DEPS="$GLW_LIBS"
1277 # should check these...
1278 GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
1279 GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
1280 GLW_PC_CFLAGS="$X11_INCLUDES"
1283 GLW_SOURCES="GLwDrawA.c"
1285 if test "x$enable_motif" = xyes; then
1286 GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
1287 AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
1288 if test "x$MOTIF_CONFIG" != xno; then
1289 MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
1290 MOTIF_LIBS=`$MOTIF_CONFIG --libs`
1292 AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
1293 [AC_MSG_ERROR([Can't locate Motif headers])])
1294 AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
1295 [AC_MSG_ERROR([Can't locate Motif Xm library])])
1297 # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
1298 GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
1299 GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
1300 GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
1303 # If static, empty GLW_LIB_DEPS and add libs for programs to link
1304 GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
1305 if test "$enable_static" = no; then
1306 GLW_MESA_DEPS='-l$(GL_LIB)'
1307 GLW_LIB_DEPS="$GLW_LIB_DEPS"
1309 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
1314 AC_SUBST([GLW_LIB_DEPS])
1315 AC_SUBST([GLW_MESA_DEPS])
1316 AC_SUBST([GLW_SOURCES])
1317 AC_SUBST([MOTIF_CFLAGS])
1318 AC_SUBST([GLW_PC_REQ_PRIV])
1319 AC_SUBST([GLW_PC_LIB_PRIV])
1320 AC_SUBST([GLW_PC_CFLAGS])
1323 dnl GLUT configuration
1325 if test -f "$srcdir/include/GL/glut.h"; then
1330 AC_ARG_ENABLE([glut],
1331 [AS_HELP_STRING([--disable-glut],
1332 [enable GLUT library @<:@default=enabled if source available@:>@])],
1333 [enable_glut="$enableval"],
1334 [enable_glut="$default_glut"])
1336 dnl Don't build glut on osmesa
1337 if test "x$enable_glut" = xyes; then
1338 case "$mesa_driver" in
1340 AC_MSG_NOTICE([Disabling glut since there is no OpenGL driver])
1345 dnl Can't build glut if GLU not available
1346 if test "x$enable_glu$enable_glut" = xnoyes; then
1347 AC_MSG_WARN([Disabling glut since GLU is disabled])
1351 if test "x$enable_glut" = xyes; then
1352 SRC_DIRS="$SRC_DIRS glut/glx"
1353 if test "$x11_pkgconfig" = yes; then
1354 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
1355 GLUT_PC_REQ_PRIV="x11 xmu xi"
1356 GLUT_LIB_DEPS="$GLUT_LIBS"
1358 # should check these...
1359 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
1360 GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
1361 GLUT_PC_CFLAGS="$X11_INCLUDES"
1363 if test "x$GCC" = xyes; then
1364 GLUT_CFLAGS="$GLUT_CFLAGS -fexceptions"
1366 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
1367 GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
1369 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
1370 if test "$enable_static" = no; then
1371 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
1373 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
1378 AC_SUBST([GLUT_LIB_DEPS])
1379 AC_SUBST([GLUT_MESA_DEPS])
1380 AC_SUBST([GLUT_CFLAGS])
1381 AC_SUBST([GLUT_PC_REQ_PRIV])
1382 AC_SUBST([GLUT_PC_LIB_PRIV])
1383 AC_SUBST([GLUT_PC_CFLAGS])
1386 dnl Program library dependencies
1387 dnl Only libm is added here if necessary as the libraries should
1388 dnl be pulled in by the linker
1390 if test "x$APP_LIB_DEPS" = x; then
1393 APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
1396 APP_LIB_DEPS="-lX11"
1403 AC_SUBST([APP_LIB_DEPS])
1404 AC_SUBST([PROGRAM_DIRS])
1407 dnl Gallium configuration
1409 AC_ARG_ENABLE([gallium],
1410 [AS_HELP_STRING([--disable-gallium],
1411 [build gallium @<:@default=enabled@:>@])],
1412 [enable_gallium="$enableval"],
1413 [enable_gallium=yes])
1414 if test "x$enable_gallium" = xno -a "x$enable_openvg" = xyes; then
1415 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1417 if test "x$enable_gallium" = xyes; then
1418 SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
1419 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1422 AC_SUBST([LLVM_CFLAGS])
1423 AC_SUBST([LLVM_LIBS])
1424 AC_SUBST([LLVM_LDFLAGS])
1425 AC_SUBST([LLVM_VERSION])
1428 dnl Gallium state trackers configuration
1431 AC_ARG_ENABLE([gallium-egl],
1432 [AS_HELP_STRING([--enable-gallium-egl],
1433 [enable gallium EGL state tracker @<:@default=auto@:>@])],
1434 [enable_gallium_egl="$enableval"],
1435 [enable_gallium_egl=auto])
1436 if test "x$enable_gallium_egl" = xauto; then
1437 case "$mesa_driver" in
1439 enable_gallium_egl=$enable_egl
1442 enable_gallium_egl=$enable_openvg
1446 case "x$enable_egl$enable_gallium_egl" in
1448 AC_MSG_ERROR([cannot build Gallium EGL state tracker without EGL])
1451 AC_ARG_WITH([state-trackers],
1452 [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
1453 [comma delimited state_trackers list, e.g.
1454 "egl,glx" @<:@default=auto@:>@])],
1455 [with_state_trackers="$withval"],
1456 [with_state_trackers=yes])
1458 case "$with_state_trackers" in
1460 GALLIUM_STATE_TRACKERS_DIRS=""
1463 # look at what else is built
1464 case "$mesa_driver" in
1466 GALLIUM_STATE_TRACKERS_DIRS=glx
1469 GALLIUM_STATE_TRACKERS_DIRS="dri"
1471 # Have only tested st/xorg on 1.6.0 servers
1472 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0 libdrm >= $LIBDRM_XORG_REQUIRED libkms >= $LIBKMS_XORG_REQUIRED],
1473 HAVE_ST_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
1478 if test "x$enable_egl" = xyes; then
1479 if test "$enable_openvg" = yes; then
1480 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vega"
1484 if test "$enable_gallium_egl" = yes; then
1485 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
1491 # verify the requested state tracker exist
1493 _state_trackers=`IFS=', '; echo $with_state_trackers`
1494 for tracker in $_state_trackers; do
1497 if test "x$mesa_driver" != xdri; then
1498 AC_MSG_ERROR([cannot build dri state tracker without mesa driver set to dri])
1503 if test "x$enable_egl" != xyes; then
1504 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1509 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1510 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1511 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1515 if test "x$enable_openvg" != xyes; then
1516 AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
1522 if test -n "$tracker"; then
1523 test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
1524 AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
1525 if test -n "$state_trackers"; then
1526 state_trackers="$state_trackers $tracker"
1528 state_trackers="$tracker"
1532 GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
1534 # append --enable-openvg/--enable-gallium-egl to --with-state-trackers
1535 if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
1536 AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
1538 if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
1539 AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
1548 case "x$enable_opengl$enable_gles1$enable_gles2" in
1550 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
1553 if test "x$enable_openvg" = xyes; then
1554 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
1555 VG_LIB_DEPS="$VG_LIB_DEPS -lpthread"
1558 AC_SUBST([VG_LIB_DEPS])
1559 AC_SUBST([EGL_CLIENT_APIS])
1561 if test "x$HAVE_ST_EGL" = xyes; then
1562 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl"
1565 if test "x$HAVE_ST_XORG" = xyes; then
1566 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1567 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1568 HAVE_XEXTPROTO_71="no")
1571 AC_ARG_WITH([egl-platforms],
1572 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1573 [comma delimited native platforms libEGL supports, e.g.
1574 "x11,drm" @<:@default=auto@:>@])],
1575 [with_egl_platforms="$withval"],
1576 [with_egl_platforms=yes])
1577 AC_ARG_WITH([egl-displays],
1578 [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
1579 [DEPRECATED. Use --with-egl-platforms instead])],
1580 [with_egl_platforms="$withval"])
1583 WAYLAND_EGL_LIB_DEPS=""
1585 case "$with_egl_platforms" in
1587 if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
1589 if test "$mesa_driver" = dri; then
1590 EGL_PLATFORMS="$EGL_PLATFORMS drm"
1595 if test "x$enable_egl" != xyes; then
1596 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1598 # verify the requested driver directories exist
1599 egl_platforms=`IFS=', '; echo $with_egl_platforms`
1600 for plat in $egl_platforms; do
1601 test -d "$srcdir/src/gallium/state_trackers/egl/$plat" || \
1602 AC_MSG_ERROR([EGL platform '$plat' doesn't exist])
1603 if test "$plat" = "fbdev"; then
1604 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
1606 if test "$plat" = "wayland"; then
1607 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
1608 [AC_MSG_ERROR([cannot find libwayland-client])])
1609 WAYLAND_EGL_LIB_DEPS="$WAYLAND_LIBS $LIBDRM_LIBS"
1612 EGL_PLATFORMS="$egl_platforms"
1615 AC_SUBST([EGL_PLATFORMS])
1617 AC_SUBST([WAYLAND_EGL_LIB_DEPS])
1618 WAYLAND_EGL_PC_REQ_PRIV="wayland-client libdrm"
1619 WAYLAND_EGL_PC_LIB_PRIV=
1620 WAYLAND_EGL_PC_CFLAGS=
1622 AC_SUBST([WAYLAND_EGL_PC_REQ_PRIV])
1623 AC_SUBST([WAYLAND_EGL_PC_LIB_PRIV])
1624 AC_SUBST([WAYLAND_EGL_PC_CFLAGS])
1627 AC_ARG_WITH([egl-driver-dir],
1628 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1629 [directory for EGL drivers [[default=${libdir}/egl]]])],
1630 [EGL_DRIVER_INSTALL_DIR="$withval"],
1631 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1632 AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1634 AC_ARG_WITH([xorg-driver-dir],
1635 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1636 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1637 [XORG_DRIVER_INSTALL_DIR="$withval"],
1638 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1639 AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1641 AC_ARG_WITH([max-width],
1642 [AS_HELP_STRING([--with-max-width=N],
1643 [Maximum framebuffer width (4096)])],
1644 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1645 AS_IF([test "${withval}" -gt "4096"],
1646 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1648 AC_ARG_WITH([max-height],
1649 [AS_HELP_STRING([--with-max-height=N],
1650 [Maximum framebuffer height (4096)])],
1651 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1652 AS_IF([test "${withval}" -gt "4096"],
1653 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1659 AC_ARG_ENABLE([gallium-llvm],
1660 [AS_HELP_STRING([--enable-gallium-llvm],
1661 [build gallium LLVM support @<:@default=disabled@:>@])],
1662 [enable_gallium_llvm="$enableval"],
1663 [enable_gallium_llvm=auto])
1664 if test "x$enable_gallium_llvm" = xyes; then
1665 if test "x$LLVM_CONFIG" != xno; then
1666 LLVM_VERSION=`$LLVM_CONFIG --version`
1667 LLVM_CFLAGS=`$LLVM_CONFIG --cppflags`
1668 LLVM_LIBS="`$LLVM_CONFIG --libs` -lstdc++"
1670 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
1671 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1672 DEFINES="$DEFINES -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS"
1682 dnl Gallium helper functions
1684 gallium_check_st() {
1685 if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes; then
1686 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1688 if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
1689 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
1691 if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
1692 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1698 dnl Gallium SVGA configuration
1700 AC_ARG_ENABLE([gallium-svga],
1701 [AS_HELP_STRING([--enable-gallium-svga],
1702 [build gallium SVGA @<:@default=disabled@:>@])],
1703 [enable_gallium_svga="$enableval"],
1704 [enable_gallium_svga=auto])
1705 if test "x$enable_gallium_svga" = xyes; then
1706 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
1707 gallium_check_st "svga/drm" "dri-vmwgfx" "xorg-vmwgfx"
1708 elif test "x$enable_gallium_svga" = xauto; then
1709 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
1713 dnl Gallium i915 configuration
1715 AC_ARG_ENABLE([gallium-i915],
1716 [AS_HELP_STRING([--enable-gallium-i915],
1717 [build gallium i915 @<:@default=disabled@:>@])],
1718 [enable_gallium_i915="$enableval"],
1719 [enable_gallium_i915=auto])
1720 if test "x$enable_gallium_i915" = xyes; then
1721 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
1722 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
1723 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1724 elif test "x$enable_gallium_i915" = xauto; then
1725 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
1726 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
1730 dnl Gallium i965 configuration
1732 AC_ARG_ENABLE([gallium-i965],
1733 [AS_HELP_STRING([--enable-gallium-i965],
1734 [build gallium i965 @<:@default=disabled@:>@])],
1735 [enable_gallium_i965="$enableval"],
1736 [enable_gallium_i965=auto])
1737 if test "x$enable_gallium_i965" = xyes; then
1738 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
1739 gallium_check_st "i965/drm" "dri-i965" "xorg-i965"
1740 elif test "x$enable_gallium_i965" = xauto; then
1741 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i965"
1745 dnl Gallium Radeon r300g configuration
1747 AC_ARG_ENABLE([gallium-radeon],
1748 [AS_HELP_STRING([--enable-gallium-radeon],
1749 [build gallium radeon @<:@default=disabled@:>@])],
1750 [enable_gallium_radeon="$enableval"],
1751 [enable_gallium_radeon=auto])
1752 if test "x$enable_gallium_radeon" = xauto; then
1753 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
1754 gallium_check_st "radeon/drm" "dri-r300"
1756 if test "x$enable_gallium_radeon" = xyes; then
1757 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
1758 gallium_check_st "radeon/drm" "dri-r300" "xorg-radeon"
1762 dnl Gallium Radeon r600g configuration
1764 AC_ARG_ENABLE([gallium-r600],
1765 [AS_HELP_STRING([--enable-gallium-r600],
1766 [build gallium radeon @<:@default=disabled@:>@])],
1767 [enable_gallium_r600="$enableval"],
1768 [enable_gallium_r600=auto])
1769 if test "x$enable_gallium_r600" = xyes; then
1770 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
1771 gallium_check_st "r600/drm" "dri-r600"
1775 dnl Gallium Nouveau configuration
1777 AC_ARG_ENABLE([gallium-nouveau],
1778 [AS_HELP_STRING([--enable-gallium-nouveau],
1779 [build gallium nouveau @<:@default=disabled@:>@])],
1780 [enable_gallium_nouveau="$enableval"],
1781 [enable_gallium_nouveau=no])
1782 if test "x$enable_gallium_nouveau" = xyes; then
1783 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nvfx nv50 nvc0"
1784 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau"
1788 dnl Gallium swrast configuration
1790 AC_ARG_ENABLE([gallium-swrast],
1791 [AS_HELP_STRING([--enable-gallium-swrast],
1792 [build gallium swrast @<:@default=auto@:>@])],
1793 [enable_gallium_swrast="$enableval"],
1794 [enable_gallium_swrast=auto])
1795 if test "x$enable_gallium_swrast" = xyes || test "x$enable_gallium_swrast" = xauto; then
1796 if test "x$HAVE_ST_DRI" = xyes; then
1797 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1801 dnl prepend CORE_DIRS to SRC_DIRS
1802 SRC_DIRS="$CORE_DIRS $SRC_DIRS"
1804 dnl Restore LDFLAGS and CPPFLAGS
1805 LDFLAGS="$_SAVE_LDFLAGS"
1806 CPPFLAGS="$_SAVE_CPPFLAGS"
1808 dnl Substitute the config
1809 AC_CONFIG_FILES([configs/autoconf])
1811 dnl Replace the configs/current symlink
1812 AC_CONFIG_COMMANDS([configs],[
1813 if test -f configs/current || test -L configs/current; then
1814 rm -f configs/current
1816 ln -s autoconf configs/current
1822 dnl Output some configuration info for the user
1825 echo " prefix: $prefix"
1826 echo " exec_prefix: $exec_prefix"
1827 echo " libdir: $libdir"
1828 echo " includedir: $includedir"
1832 echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
1833 echo " OpenVG: $enable_openvg"
1837 echo " Driver: $mesa_driver"
1838 if test "$mesa_driver" != no; then
1839 if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
1840 echo " OSMesa: lib$OSMESA_LIB"
1844 if test "$mesa_driver" = dri; then
1845 # cleanup the drivers var
1846 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1847 if test "x$DRI_DIRS" = x; then
1848 echo " DRI drivers: no"
1850 echo " DRI drivers: $dri_dirs"
1852 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
1853 echo " Use XCB: $enable_xcb"
1854 echo " Shared dricore: $enable_dricore"
1858 echo " GLU: $enable_glu"
1859 echo " GLw: $enable_glw (Motif: $enable_motif)"
1860 echo " glut: $enable_glut"
1864 echo " EGL: $enable_egl"
1865 if test "$enable_egl" = yes; then
1866 echo " EGL platforms: $EGL_PLATFORMS"
1869 for d in $EGL_DRIVERS_DIRS; do
1870 egl_drivers="$egl_drivers builtin:egl_$d"
1873 if test "$enable_gallium" = yes -a "$HAVE_ST_EGL" = yes; then
1874 echo " EGL drivers: ${egl_drivers} egl_gallium"
1875 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
1877 echo " EGL drivers: $egl_drivers"
1882 if test "x$MESA_LLVM" = x1; then
1884 echo " llvm-config: $LLVM_CONFIG"
1885 echo " llvm-version: $LLVM_VERSION"
1891 if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
1892 echo " Gallium: yes"
1893 echo " Gallium dirs: $GALLIUM_DIRS"
1894 echo " Target dirs: $GALLIUM_TARGET_DIRS"
1895 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
1896 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
1897 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
1904 echo " Shared libs: $enable_shared"
1905 echo " Static libs: $enable_static"
1907 dnl Compiler options
1908 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
1909 cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1910 $SED 's/^ *//;s/ */ /;s/ *$//'`
1911 cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1912 $SED 's/^ *//;s/ */ /;s/ *$//'`
1913 defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1915 echo " CFLAGS: $cflags"
1916 echo " CXXFLAGS: $cxxflags"
1917 echo " Macros: $defines"
1919 echo " PYTHON2: $PYTHON2"
1922 echo " Run '${MAKE-make}' to build Mesa"