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'])])
8 m4_ifval(mesa_version,[],[
9 m4_errprint([Error: Failed to get the Mesa version from the output of
10 running `make -f bin/version.mk version'
15 AC_INIT([Mesa],[mesa_version],
16 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
17 AC_CONFIG_AUX_DIR([bin])
24 AC_CHECK_PROGS([MAKE], [gmake make])
25 AC_PATH_PROG([MKDEP], [makedepend])
26 AC_PATH_PROG([SED], [sed])
28 MKDEP_OPTIONS=-fdepend
29 dnl Ask gcc where it's keeping its secret headers
30 if test "x$GCC" = xyes; then
31 GCC_INCLUDES=`$CC -print-file-name=include`
32 if test "x$GCC_INCLUDES" != x; then
33 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
36 AC_SUBST([MKDEP_OPTIONS])
38 dnl Check to see if dlopen is in default libraries (like Solaris, which
39 dnl has it in libc), or if libdl is needed to get it.
40 AC_CHECK_FUNC([dlopen], [],
41 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
43 dnl Make sure the pkg-config macros are defined
44 m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
45 m4_errprint([Error: Could not locate the pkg-config autoconf macros.
46 These are usually located in /usr/share/aclocal/pkg.m4. If your
47 macros are in a different location, try setting the environment
48 variable ACLOCAL="aclocal -I/other/macro/dir" before running
55 dnl LIB_DIR - library basename
56 LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
59 dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
60 _SAVE_LDFLAGS="$LDFLAGS"
61 AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
62 AC_SUBST([EXTRA_LIB_PATH])
64 dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
65 _SAVE_CPPFLAGS="$CPPFLAGS"
66 AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
67 AC_SUBST([X11_INCLUDES])
74 if test "x$GCC" = xyes; then
75 DEFINES="$DEFINES -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE"
77 DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN"
81 dnl Add flags for gcc and g++
82 if test "x$GCC" = xyes; then
83 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
85 # Work around aliasing bugs - developers should comment this out
86 CFLAGS="$CFLAGS -fno-strict-aliasing"
88 if test "x$GXX" = xyes; then
89 CXXFLAGS="$CXXFLAGS -Wall"
91 # Work around aliasing bugs - developers should comment this out
92 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
95 dnl These should be unnecessary, but let the user set them if they want
96 AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
97 Default is to use CFLAGS.])
98 AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
99 compiler. Default is to use CFLAGS.])
100 AC_SUBST([OPT_FLAGS])
101 AC_SUBST([ARCH_FLAGS])
104 dnl Hacks to enable 32 or 64 bit build
106 AC_ARG_ENABLE([32-bit],
107 [AS_HELP_STRING([--enable-32-bit],
108 [build 32-bit libraries @<:@default=auto@:>@])],
109 [enable_32bit="$enableval"],
112 if test "x$enable_32bit" = xyes; then
113 if test "x$GCC" = xyes; then
114 CFLAGS="$CFLAGS -m32"
116 if test "x$GXX" = xyes; then
117 CXXFLAGS="$CXXFLAGS -m32"
120 AC_ARG_ENABLE([64-bit],
121 [AS_HELP_STRING([--enable-64-bit],
122 [build 64-bit libraries @<:@default=auto@:>@])],
123 [enable_64bit="$enableval"],
126 if test "x$enable_64bit" = xyes; then
127 if test "x$GCC" = xyes; then
128 CFLAGS="$CFLAGS -m64"
130 if test "x$GXX" = xyes; then
131 CXXFLAGS="$CXXFLAGS -m64"
136 dnl shared/static libraries, mimic libtool options
138 AC_ARG_ENABLE([static],
139 [AS_HELP_STRING([--enable-static],
140 [build static libraries @<:@default=disabled@:>@])],
141 [enable_static="$enableval"],
144 case "x$enable_static" in
146 x ) enable_static=no ;;
148 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
151 AC_ARG_ENABLE([shared],
152 [AS_HELP_STRING([--disable-shared],
153 [build shared libraries @<:@default=enabled@:>@])],
154 [enable_shared="$enableval"],
157 case "x$enable_shared" in
159 x ) enable_shared=yes ;;
161 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
165 dnl Can't have static and shared libraries, default to static if user
166 dnl explicitly requested. If both disabled, set to static since shared
167 dnl was explicitly requirested.
168 case "x$enable_static$enable_shared" in
170 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
174 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
182 AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
183 if test "$enable_static" = yes; then
184 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
186 AC_SUBST([MKLIB_OPTIONS])
189 dnl other compiler options
191 AC_ARG_ENABLE([debug],
192 [AS_HELP_STRING([--enable-debug],
193 [use debug compiler flags and macros @<:@default=disabled@:>@])],
194 [enable_debug="$enableval"],
197 if test "x$enable_debug" = xyes; then
198 DEFINES="$DEFINES -DDEBUG"
199 if test "x$GCC" = xyes; then
202 if test "x$GXX" = xyes; then
203 CXXFLAGS="$CXXFLAGS -g"
206 dnl These will be used near the end in the arch specific options
208 [AS_HELP_STRING([--disable-asm],
209 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
210 [enable_asm="$enableval"],
217 if test "$enable_static" = yes; then
218 GL_LIB_NAME='lib$(GL_LIB).a'
219 GLU_LIB_NAME='lib$(GLU_LIB).a'
220 GLUT_LIB_NAME='lib$(GLUT_LIB).a'
221 GLW_LIB_NAME='lib$(GLW_LIB).a'
222 OSMESA_LIB_NAME='lib$(OSMESA_LIB).a'
224 GL_LIB_NAME='lib$(GL_LIB).so'
225 GLU_LIB_NAME='lib$(GLU_LIB).so'
226 GLUT_LIB_NAME='lib$(GLUT_LIB).so'
227 GLW_LIB_NAME='lib$(GLW_LIB).so'
228 OSMESA_LIB_NAME='lib$(OSMESA_LIB).so'
230 AC_SUBST([GL_LIB_NAME])
231 AC_SUBST([GLU_LIB_NAME])
232 AC_SUBST([GLUT_LIB_NAME])
233 AC_SUBST([GLW_LIB_NAME])
234 AC_SUBST([OSMESA_LIB_NAME])
237 dnl Driver configuration. Options are xlib, dri and osmesa right now.
238 dnl More later: directfb, fbdev, ...
240 default_driver="xlib"
245 i*86|x86_64|powerpc*) default_driver="dri";;
248 freebsd* | dragonfly*)
250 i*86|x86_64) default_driver="dri";;
255 AC_ARG_WITH([driver],
256 [AS_HELP_STRING([--with-driver=DRIVER],
257 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
258 [mesa_driver="$withval"],
259 [mesa_driver="$default_driver"])
260 dnl Check for valid option
261 case "x$mesa_driver" in
265 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
270 dnl Driver specific build directories
275 case "$mesa_driver" in
280 SRC_DIRS="glx/x11 $SRC_DIRS"
290 AC_SUBST([DRIVER_DIRS])
291 AC_SUBST([WINDOW_SYSTEM])
294 dnl User supplied program configuration
296 if test -d "$srcdir/progs/demos"; then
302 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
303 [optional comma delimited demo directories to build
304 @<:@default=auto if source available@:>@])],
305 [with_demos="$withval"],
306 [with_demos="$default_demos"])
307 if test "x$with_demos" = x; then
311 dnl If $with_demos is yes, directories will be added as libs available
313 case "$with_demos" in
316 # If the driver isn't osmesa, we have libGL and can build xdemos
317 if test "$mesa_driver" != osmesa; then
318 PROGRAM_DIRS="xdemos"
322 # verify the requested demos directories exist
323 demos=`IFS=,; echo $with_demos`
324 for demo in $demos; do
325 test -d "$srcdir/progs/$demo" || \
326 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
328 PROGRAM_DIRS="$demos"
333 dnl Find out if X is available. The variable have_x is set if libX11 is
334 dnl to mimic AC_PATH_XTRA.
336 if test -n "$PKG_CONFIG"; then
337 AC_MSG_CHECKING([pkg-config files for X11 are available])
338 PKG_CHECK_EXISTS([x11],[
344 AC_MSG_RESULT([$x11_pkgconfig])
348 dnl Use the autoconf macro if no pkg-config files
349 if test "$x11_pkgconfig" = no; then
353 dnl We need X for xlib and dri, so bomb now if it's not found
354 case "$mesa_driver" in
356 if test "$no_x" = yes; then
357 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
363 AC_ARG_ENABLE([selinux],
364 [AS_HELP_STRING([--enable-selinux],
365 [Build SELinux-aware Mesa (default: disabled)])],
366 [MESA_SELINUX="$enableval"],
368 if test "x$enable_selinux" = "xyes"; then
369 AC_CHECK_HEADER([selinux/selinux.h],[],
370 [AC_MSG_ERROR([SELinux headers not found])])
371 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
372 [AC_MSG_ERROR([SELinux library not found])])
373 SELINUX_LIBS="-lselinux"
374 DEFINES="$DEFINES -DMESA_SELINUX"
378 dnl libGL configuration per driver
380 case "$mesa_driver" in
382 if test "$x11_pkgconfig" = yes; then
383 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
384 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
385 GL_LIB_DEPS="$XLIBGL_LIBS"
387 # should check these...
388 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
389 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
391 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
393 # if static, move the external libraries to the programs
394 # and empty the libraries for libGL
395 if test "$enable_static" = yes; then
396 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
401 # DRI must be shared, I think
402 if test "$enable_static" = yes; then
403 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
407 PKG_CHECK_MODULES([LIBDRM], [libdrm])
408 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= 1.1])
410 # find the DRI deps for libGL
411 if test "$x11_pkgconfig" = yes; then
412 PKG_CHECK_MODULES([DRIGL], [x11 xext xxf86vm xdamage xfixes])
413 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
414 GL_LIB_DEPS="$DRIGL_LIBS"
416 # should check these...
417 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
418 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
421 # need DRM libs, -lpthread, etc.
422 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
425 # No libGL for osmesa
429 AC_SUBST([GL_LIB_DEPS])
434 if test "$mesa_driver" = xlib; then
435 DEFINES="$DEFINES -DUSE_XSHM"
441 AC_ARG_ENABLE([glx-tls],
442 [AS_HELP_STRING([--enable-glx-tls],
443 [enable TLS support in GLX @<:@default=disabled@:>@])],
444 [GLX_USE_TLS="$enableval"],
446 dnl Directory for DRI drivers
447 AC_ARG_WITH([dri-driverdir],
448 [AS_HELP_STRING([--with-dri-driverdir=DIR],
449 [directory for the DRI drivers @<:@/usr/X11R6/lib/modules/dri@:>@])],
450 [DRI_DRIVER_INSTALL_DIR="$withval"],
451 [DRI_DRIVER_INSTALL_DIR='/usr/X11R6/lib/modules/dri'])
452 AC_SUBST([DRI_DRIVER_INSTALL_DIR])
453 dnl Direct rendering or just indirect rendering
454 AC_ARG_ENABLE([driglx-direct],
455 [AS_HELP_STRING([--disable-driglx-direct],
456 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
457 [driglx_direct="$enableval"],
458 [driglx_direct="yes"])
460 dnl Which drivers to build - default is chosen by platform
461 AC_ARG_WITH([dri-drivers],
462 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
463 [comma delimited DRI drivers, e.g. "i965,radeon,nouveau" @<:@default=auto@:>@])],
464 [with_dri_drivers="$withval"],
465 [with_dri_drivers=yes])
466 if test "x$with_dri_drivers" = x; then
470 dnl If $with_dri_drivers is yes, directories will be added through
473 case "$with_dri_drivers" in
476 # verify the requested driver directories exist
477 dri_drivers=`IFS=,; echo $with_dri_drivers`
478 for driver in $dri_drivers; do
479 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
480 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
482 DRI_DIRS="$dri_drivers"
486 dnl Just default to no EGL for now
488 AC_SUBST([USING_EGL])
490 dnl Set DRI_DIRS, DEFINES and LIB_DEPS
491 if test "$mesa_driver" = dri; then
493 if test "x$GLX_USE_TLS" = xyes; then
494 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
497 if test "x$USING_EGL" = x1; then
501 # Platform specific settings and drivers to build
504 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
505 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
506 if test "x$driglx_direct" = xyes; then
507 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
512 # ffb, gamma, and sis are missing because they have not be
513 # converted to use the new interface. i810 are missing
514 # because there is no x86-64 system where they could *ever*
516 if test "x$DRI_DIRS" = x; then
517 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
518 savage tdfx unichrome"
522 # Build only the drivers for cards that exist on PowerPC.
523 # At some point MGA will be added, but not yet.
524 if test "x$DRI_DIRS" = x; then
525 DRI_DIRS="mach64 r128 r200 r300 radeon tdfx"
530 freebsd* | dragonfly*)
531 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
532 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
533 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
534 if test "x$driglx_direct" = xyes; then
535 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
537 if test "x$GXX" = xyes; then
538 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
541 # ffb and gamma are missing because they have not been converted
542 # to use the new interface.
543 if test "x$DRI_DIRS" = x; then
544 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
545 unichrome savage sis"
551 if test "x$DRI_DIRS" = x; then
552 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
553 savage sis tdfx trident unichrome ffb"
556 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
562 [AS_HELP_STRING([--with-expat=DIR],
563 [expat install directory])],[
564 EXPAT_INCLUDES="-I$withval/include"
565 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
566 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
567 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
569 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
570 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
571 [AC_MSG_ERROR([Expat required for DRI.])])
573 # put all the necessary libs together
574 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
577 AC_SUBST([EXPAT_INCLUDES])
578 AC_SUBST([DRI_LIB_DEPS])
581 dnl OSMesa configuration
583 if test "$mesa_driver" = xlib; then
584 default_gl_osmesa=yes
588 AC_ARG_ENABLE([gl-osmesa],
589 [AS_HELP_STRING([--enable-gl-osmesa],
590 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
591 [gl_osmesa="$enableval"],
592 [gl_osmesa="$default_gl_osmesa"])
593 if test "x$gl_osmesa" = xyes; then
594 if test "$mesa_driver" = osmesa; then
595 AC_MSG_ERROR([libGL is not available for OSMesa driver])
597 DRIVER_DIRS="$DRIVER_DIRS osmesa"
601 dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
602 AC_ARG_WITH([osmesa-bits],
603 [AS_HELP_STRING([--with-osmesa-bits=BITS],
604 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
605 [osmesa_bits="$withval"],
607 if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
608 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
611 case "x$osmesa_bits" in
616 OSMESA_LIB="OSMesa$osmesa_bits"
617 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
620 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
623 AC_SUBST([OSMESA_LIB])
625 case "$mesa_driver" in
627 # only link librararies with osmesa if shared
628 if test "$enable_static" = no; then
629 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
636 # Link OSMesa to libGL otherwise
638 # only link librararies with osmesa if shared
639 if test "$enable_static" = no; then
640 OSMESA_MESA_DEPS='-l$(GL_LIB)'
646 AC_SUBST([OSMESA_LIB_DEPS])
647 AC_SUBST([OSMESA_MESA_DEPS])
650 dnl GLcore configuration
652 # delay pkg-config checks until `make glcore' run
653 XORG_CFLAGS='`pkg-config --cflags xorg-server`'
654 GLCORE_LIB_DEPS='-lm -lpthread'
655 if test "$mesa_driver" = dri; then
656 GLCORE_LIB_DEPS="$GLCORE_LIB_DEPS $DLOPEN_LIBS"
658 AC_SUBST([XORG_CFLAGS])
659 AC_SUBST([GLCORE_LIB_DEPS])
662 dnl GLU configuration
665 [AS_HELP_STRING([--disable-glu],
666 [enable OpenGL Utility library @<:@default=enabled@:>@])],
667 [enable_glu="$enableval"],
669 if test "x$enable_glu" = xyes; then
670 SRC_DIRS="$SRC_DIRS glu"
672 case "$mesa_driver" in
674 # If GLU is available and we have libOSMesa (not 16 or 32),
675 # we can build the osdemos
676 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
677 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
680 # Link libGLU to libOSMesa instead of libGL
682 if test "$enable_static" = no; then
683 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
689 # If static, empty GLU_LIB_DEPS and add libs for programs to link
690 if test "$enable_static" = no; then
692 GLU_MESA_DEPS='-l$(GL_LIB)'
696 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
701 AC_SUBST([GLU_LIB_DEPS])
702 AC_SUBST([GLU_MESA_DEPS])
705 dnl GLw configuration
708 [AS_HELP_STRING([--disable-glw],
709 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
710 [enable_glw="$enableval"],
712 dnl Don't build GLw on osmesa
713 if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
714 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
717 if test "x$enable_glw" = xyes; then
718 SRC_DIRS="$SRC_DIRS glw"
719 if test "$x11_pkgconfig" = yes; then
720 PKG_CHECK_MODULES([GLW],[x11 xt])
721 GLW_LIB_DEPS="$GLW_LIBS"
723 # should check these...
724 GLW_LIB_DEPS="$X_LIBS -lX11 -lXt"
727 # If static, empty GLW_LIB_DEPS and add libs for programs to link
728 if test "$enable_static" = no; then
729 GLW_MESA_DEPS='-l$(GL_LIB)'
731 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
736 AC_SUBST([GLW_LIB_DEPS])
737 AC_SUBST([GLW_MESA_DEPS])
740 dnl GLUT configuration
742 if test -f "$srcdir/include/GL/glut.h"; then
747 AC_ARG_ENABLE([glut],
748 [AS_HELP_STRING([--disable-glut],
749 [enable GLUT library @<:@default=enabled if source available@:>@])],
750 [enable_glut="$enableval"],
751 [enable_glut="$default_glut"])
753 dnl Can't build glut if GLU not available
754 if test "x$enable_glu$enable_glut" = xnoyes; then
755 AC_MSG_WARN([Disabling glut since GLU is disabled])
758 dnl Don't build glut on osmesa
759 if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
760 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
764 if test "x$enable_glut" = xyes; then
765 SRC_DIRS="$SRC_DIRS glut/glx"
767 if test "x$GCC" = xyes; then
768 GLUT_CFLAGS="-fexceptions"
770 if test "$x11_pkgconfig" = yes; then
771 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
772 GLUT_LIB_DEPS="$GLUT_LIBS"
774 # should check these...
775 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
777 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
779 # If glut is available, we can build most programs
780 if test "$with_demos" = yes; then
781 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
784 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
785 if test "$enable_static" = no; then
786 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
788 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
793 AC_SUBST([GLUT_LIB_DEPS])
794 AC_SUBST([GLUT_MESA_DEPS])
795 AC_SUBST([GLUT_CFLAGS])
798 dnl Program library dependencies
799 dnl Only libm is added here if necessary as the libraries should
800 dnl be pulled in by the linker
802 if test "x$APP_LIB_DEPS" = x; then
805 AC_SUBST([APP_LIB_DEPS])
806 AC_SUBST([PROGRAM_DIRS])
808 dnl Arch/platform-specific settings
813 AC_SUBST([PIC_FLAGS])
814 AC_SUBST([ASM_FLAGS])
815 AC_SUBST([ASM_SOURCES])
822 if test "x$enable_asm" = xyes; then
823 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
824 ASM_SOURCES='$(X86_SOURCES)'
829 if test "x$enable_asm" = xyes; then
830 ASM_FLAGS="-DUSE_X86_64_ASM"
831 ASM_SOURCES='$(X86-64_SOURCES)'
832 ASM_API='$(X86-64_API)'
836 if test "x$enable_asm" = xyes; then
837 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
838 ASM_SOURCES='$(PPC_SOURCES)'
843 freebsd* | dragonfly*)
848 if test "x$enable_asm" = xyes; then
849 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
850 ASM_SOURCES='$(X86_SOURCES)'
855 if test "x$enable_asm" = xyes; then
856 ASM_FLAGS="-DUSE_X86_64_ASM"
857 ASM_SOURCES='$(X86-64_SOURCES)'
858 ASM_API='$(X86-64_API)'
865 dnl Restore LDFLAGS and CPPFLAGS
866 LDFLAGS="$_SAVE_LDFLAGS"
867 CPPFLAGS="$_SAVE_CPPFLAGS"
869 dnl Substitute the config
870 AC_CONFIG_FILES([configs/autoconf])
873 dnl Replace the configs/current symlink
874 if test -f configs/current || test -L configs/current; then
875 rm -f configs/current
877 ln -s autoconf configs/current
880 dnl Output some configuration info for the user
883 echo " prefix: $prefix"
884 echo " exec_prefix: $exec_prefix"
885 echo " libdir: $libdir"
889 echo " Driver: $mesa_driver"
890 if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
891 echo " OSMesa: lib$OSMESA_LIB"
895 if test "$mesa_driver" = dri; then
896 # cleanup the drivers var
897 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
898 echo " DRI drivers: $dri_dirs"
899 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
904 echo " Shared libs: $enable_shared"
905 echo " Static libs: $enable_static"
906 echo " GLU: $enable_glu"
907 echo " GLw: $enable_glw"
908 echo " glut: $enable_glut"
911 # cleanup the programs var for display
912 program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
913 if test "x$program_dirs" = x; then
916 echo " Demos: $program_dirs"
920 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
921 cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
922 $SED 's/^ *//;s/ */ /;s/ *$//'`
923 cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
924 $SED 's/^ *//;s/ */ /;s/ *$//'`
925 defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
927 echo " CFLAGS: $cflags"
928 echo " CXXFLAGS: $cxxflags"
929 echo " Macros: $defines"
932 echo " Run '${MAKE-make}' to build Mesa"