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])
20 dnl Versions for external dependencies
22 DRI2PROTO_REQUIRED=1.1
28 AC_CHECK_PROGS([MAKE], [gmake make])
29 AC_PATH_PROG([MKDEP], [makedepend])
30 AC_PATH_PROG([SED], [sed])
32 MKDEP_OPTIONS=-fdepend
33 dnl Ask gcc where it's keeping its secret headers
34 if test "x$GCC" = xyes; then
35 GCC_INCLUDES=`$CC -print-file-name=include`
36 if test "x$GCC_INCLUDES" != x; then
37 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
40 AC_SUBST([MKDEP_OPTIONS])
42 dnl Check to see if dlopen is in default libraries (like Solaris, which
43 dnl has it in libc), or if libdl is needed to get it.
44 AC_CHECK_FUNC([dlopen], [],
45 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
47 dnl Make sure the pkg-config macros are defined
48 m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
49 m4_errprint([Error: Could not locate the pkg-config autoconf macros.
50 These are usually located in /usr/share/aclocal/pkg.m4. If your
51 macros are in a different location, try setting the environment
52 variable ACLOCAL="aclocal -I/other/macro/dir" before running
59 dnl LIB_DIR - library basename
60 LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
63 dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
64 _SAVE_LDFLAGS="$LDFLAGS"
65 AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
66 AC_SUBST([EXTRA_LIB_PATH])
68 dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
69 _SAVE_CPPFLAGS="$CPPFLAGS"
70 AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
71 AC_SUBST([X11_INCLUDES])
78 if test "x$GCC" = xyes; then
79 DEFINES="$DEFINES -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE"
81 DEFINES="$DEFINES -D_SVID_SOURCE -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN"
85 dnl Add flags for gcc and g++
86 if test "x$GCC" = xyes; then
87 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
89 # Work around aliasing bugs - developers should comment this out
90 CFLAGS="$CFLAGS -fno-strict-aliasing"
92 if test "x$GXX" = xyes; then
93 CXXFLAGS="$CXXFLAGS -Wall"
95 # Work around aliasing bugs - developers should comment this out
96 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
99 dnl These should be unnecessary, but let the user set them if they want
100 AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
101 Default is to use CFLAGS.])
102 AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
103 compiler. Default is to use CFLAGS.])
104 AC_SUBST([OPT_FLAGS])
105 AC_SUBST([ARCH_FLAGS])
108 dnl Hacks to enable 32 or 64 bit build
110 AC_ARG_ENABLE([32-bit],
111 [AS_HELP_STRING([--enable-32-bit],
112 [build 32-bit libraries @<:@default=auto@:>@])],
113 [enable_32bit="$enableval"],
116 if test "x$enable_32bit" = xyes; then
117 if test "x$GCC" = xyes; then
118 CFLAGS="$CFLAGS -m32"
120 if test "x$GXX" = xyes; then
121 CXXFLAGS="$CXXFLAGS -m32"
124 AC_ARG_ENABLE([64-bit],
125 [AS_HELP_STRING([--enable-64-bit],
126 [build 64-bit libraries @<:@default=auto@:>@])],
127 [enable_64bit="$enableval"],
130 if test "x$enable_64bit" = xyes; then
131 if test "x$GCC" = xyes; then
132 CFLAGS="$CFLAGS -m64"
134 if test "x$GXX" = xyes; then
135 CXXFLAGS="$CXXFLAGS -m64"
140 dnl shared/static libraries, mimic libtool options
142 AC_ARG_ENABLE([static],
143 [AS_HELP_STRING([--enable-static],
144 [build static libraries @<:@default=disabled@:>@])],
145 [enable_static="$enableval"],
148 case "x$enable_static" in
150 x ) enable_static=no ;;
152 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
155 AC_ARG_ENABLE([shared],
156 [AS_HELP_STRING([--disable-shared],
157 [build shared libraries @<:@default=enabled@:>@])],
158 [enable_shared="$enableval"],
161 case "x$enable_shared" in
163 x ) enable_shared=yes ;;
165 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
169 dnl Can't have static and shared libraries, default to static if user
170 dnl explicitly requested. If both disabled, set to static since shared
171 dnl was explicitly requirested.
172 case "x$enable_static$enable_shared" in
174 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
178 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
186 AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
187 if test "$enable_static" = yes; then
188 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
190 AC_SUBST([MKLIB_OPTIONS])
193 dnl other compiler options
195 AC_ARG_ENABLE([debug],
196 [AS_HELP_STRING([--enable-debug],
197 [use debug compiler flags and macros @<:@default=disabled@:>@])],
198 [enable_debug="$enableval"],
201 if test "x$enable_debug" = xyes; then
202 DEFINES="$DEFINES -DDEBUG"
203 if test "x$GCC" = xyes; then
206 if test "x$GXX" = xyes; then
207 CXXFLAGS="$CXXFLAGS -g"
214 if test "$enable_static" = yes; then
215 GL_LIB_NAME='lib$(GL_LIB).a'
216 GLU_LIB_NAME='lib$(GLU_LIB).a'
217 GLUT_LIB_NAME='lib$(GLUT_LIB).a'
218 GLW_LIB_NAME='lib$(GLW_LIB).a'
219 OSMESA_LIB_NAME='lib$(OSMESA_LIB).a'
221 GL_LIB_NAME='lib$(GL_LIB).so'
222 GLU_LIB_NAME='lib$(GLU_LIB).so'
223 GLUT_LIB_NAME='lib$(GLUT_LIB).so'
224 GLW_LIB_NAME='lib$(GLW_LIB).so'
225 OSMESA_LIB_NAME='lib$(OSMESA_LIB).so'
227 AC_SUBST([GL_LIB_NAME])
228 AC_SUBST([GLU_LIB_NAME])
229 AC_SUBST([GLUT_LIB_NAME])
230 AC_SUBST([GLW_LIB_NAME])
231 AC_SUBST([OSMESA_LIB_NAME])
234 dnl Driver configuration. Options are xlib, dri and osmesa right now.
235 dnl More later: directfb, fbdev, ...
237 default_driver="xlib"
242 i*86|x86_64|powerpc*) default_driver="dri";;
245 freebsd* | dragonfly*)
247 i*86|x86_64) default_driver="dri";;
252 AC_ARG_WITH([driver],
253 [AS_HELP_STRING([--with-driver=DRIVER],
254 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
255 [mesa_driver="$withval"],
256 [mesa_driver="$default_driver"])
257 dnl Check for valid option
258 case "x$mesa_driver" in
262 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
267 dnl Driver specific build directories
272 case "$mesa_driver" in
277 SRC_DIRS="glx/x11 $SRC_DIRS"
287 AC_SUBST([DRIVER_DIRS])
288 AC_SUBST([WINDOW_SYSTEM])
291 dnl User supplied program configuration
293 if test -d "$srcdir/progs/demos"; then
299 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
300 [optional comma delimited demo directories to build
301 @<:@default=auto if source available@:>@])],
302 [with_demos="$withval"],
303 [with_demos="$default_demos"])
304 if test "x$with_demos" = x; then
308 dnl If $with_demos is yes, directories will be added as libs available
310 case "$with_demos" in
313 # If the driver isn't osmesa, we have libGL and can build xdemos
314 if test "$mesa_driver" != osmesa; then
315 PROGRAM_DIRS="xdemos"
319 # verify the requested demos directories exist
320 demos=`IFS=,; echo $with_demos`
321 for demo in $demos; do
322 test -d "$srcdir/progs/$demo" || \
323 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
325 PROGRAM_DIRS="$demos"
330 dnl Find out if X is available. The variable have_x is set if libX11 is
331 dnl to mimic AC_PATH_XTRA.
333 if test -n "$PKG_CONFIG"; then
334 AC_MSG_CHECKING([pkg-config files for X11 are available])
335 PKG_CHECK_EXISTS([x11],[
341 AC_MSG_RESULT([$x11_pkgconfig])
345 dnl Use the autoconf macro if no pkg-config files
346 if test "$x11_pkgconfig" = no; then
350 dnl We need X for xlib and dri, so bomb now if it's not found
351 case "$mesa_driver" in
353 if test "$no_x" = yes; then
354 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
360 AC_ARG_ENABLE([selinux],
361 [AS_HELP_STRING([--enable-selinux],
362 [Build SELinux-aware Mesa (default: disabled)])],
363 [MESA_SELINUX="$enableval"],
365 if test "x$enable_selinux" = "xyes"; then
366 AC_CHECK_HEADER([selinux/selinux.h],[],
367 [AC_MSG_ERROR([SELinux headers not found])])
368 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
369 [AC_MSG_ERROR([SELinux library not found])])
370 SELINUX_LIBS="-lselinux"
371 DEFINES="$DEFINES -DMESA_SELINUX"
375 dnl libGL configuration per driver
377 case "$mesa_driver" in
379 if test "$x11_pkgconfig" = yes; then
380 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
381 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
382 GL_LIB_DEPS="$XLIBGL_LIBS"
384 # should check these...
385 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
386 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
388 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
390 # if static, move the external libraries to the programs
391 # and empty the libraries for libGL
392 if test "$enable_static" = yes; then
393 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
398 # DRI must be shared, I think
399 if test "$enable_static" = yes; then
400 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
404 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
405 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
407 # find the DRI deps for libGL
408 if test "$x11_pkgconfig" = yes; then
409 PKG_CHECK_MODULES([DRIGL], [x11 xext xxf86vm xdamage xfixes])
410 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
411 GL_LIB_DEPS="$DRIGL_LIBS"
413 # should check these...
414 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
415 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
418 # need DRM libs, -lpthread, etc.
419 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
422 # No libGL for osmesa
426 AC_SUBST([GL_LIB_DEPS])
431 if test "$mesa_driver" = xlib; then
432 DEFINES="$DEFINES -DUSE_XSHM"
438 AC_ARG_ENABLE([glx-tls],
439 [AS_HELP_STRING([--enable-glx-tls],
440 [enable TLS support in GLX @<:@default=disabled@:>@])],
441 [GLX_USE_TLS="$enableval"],
443 dnl Directory for DRI drivers
444 AC_ARG_WITH([dri-driverdir],
445 [AS_HELP_STRING([--with-dri-driverdir=DIR],
446 [directory for the DRI drivers @<:@/usr/X11R6/lib/modules/dri@:>@])],
447 [DRI_DRIVER_INSTALL_DIR="$withval"],
448 [DRI_DRIVER_INSTALL_DIR='/usr/X11R6/lib/modules/dri'])
449 AC_SUBST([DRI_DRIVER_INSTALL_DIR])
450 dnl Direct rendering or just indirect rendering
451 AC_ARG_ENABLE([driglx-direct],
452 [AS_HELP_STRING([--disable-driglx-direct],
453 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
454 [driglx_direct="$enableval"],
455 [driglx_direct="yes"])
457 dnl Which drivers to build - default is chosen by platform
458 AC_ARG_WITH([dri-drivers],
459 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
460 [comma delimited DRI drivers, e.g. "i965,radeon,nouveau" @<:@default=auto@:>@])],
461 [with_dri_drivers="$withval"],
462 [with_dri_drivers=yes])
463 if test "x$with_dri_drivers" = x; then
467 dnl If $with_dri_drivers is yes, directories will be added through
470 case "$with_dri_drivers" in
473 # verify the requested driver directories exist
474 dri_drivers=`IFS=,; echo $with_dri_drivers`
475 for driver in $dri_drivers; do
476 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
477 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
479 DRI_DIRS="$dri_drivers"
483 dnl Just default to no EGL for now
485 AC_SUBST([USING_EGL])
487 dnl Set DRI_DIRS, DEFINES and LIB_DEPS
488 if test "$mesa_driver" = dri; then
490 if test "x$GLX_USE_TLS" = xyes; then
491 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
494 if test "x$USING_EGL" = x1; then
498 # Platform specific settings and drivers to build
501 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
502 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
503 if test "x$driglx_direct" = xyes; then
504 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
509 # ffb, gamma, and sis are missing because they have not be
510 # converted to use the new interface. i810 are missing
511 # because there is no x86-64 system where they could *ever*
513 if test "x$DRI_DIRS" = x; then
514 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
515 savage tdfx unichrome"
519 # Build only the drivers for cards that exist on PowerPC.
520 # At some point MGA will be added, but not yet.
521 if test "x$DRI_DIRS" = x; then
522 DRI_DIRS="mach64 r128 r200 r300 radeon tdfx"
527 freebsd* | dragonfly*)
528 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
529 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
530 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
531 if test "x$driglx_direct" = xyes; then
532 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
534 if test "x$GXX" = xyes; then
535 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
538 # ffb and gamma are missing because they have not been converted
539 # to use the new interface.
540 if test "x$DRI_DIRS" = x; then
541 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
542 unichrome savage sis"
548 if test "x$DRI_DIRS" = x; then
549 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
550 savage sis tdfx trident unichrome ffb"
553 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
559 [AS_HELP_STRING([--with-expat=DIR],
560 [expat install directory])],[
561 EXPAT_INCLUDES="-I$withval/include"
562 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
563 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
564 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
566 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
567 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
568 [AC_MSG_ERROR([Expat required for DRI.])])
570 # put all the necessary libs together
571 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
574 AC_SUBST([EXPAT_INCLUDES])
575 AC_SUBST([DRI_LIB_DEPS])
578 dnl OSMesa configuration
580 if test "$mesa_driver" = xlib; then
581 default_gl_osmesa=yes
585 AC_ARG_ENABLE([gl-osmesa],
586 [AS_HELP_STRING([--enable-gl-osmesa],
587 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
588 [gl_osmesa="$enableval"],
589 [gl_osmesa="$default_gl_osmesa"])
590 if test "x$gl_osmesa" = xyes; then
591 if test "$mesa_driver" = osmesa; then
592 AC_MSG_ERROR([libGL is not available for OSMesa driver])
594 DRIVER_DIRS="$DRIVER_DIRS osmesa"
598 dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
599 AC_ARG_WITH([osmesa-bits],
600 [AS_HELP_STRING([--with-osmesa-bits=BITS],
601 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
602 [osmesa_bits="$withval"],
604 if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
605 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
608 case "x$osmesa_bits" in
613 OSMESA_LIB="OSMesa$osmesa_bits"
614 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
617 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
620 AC_SUBST([OSMESA_LIB])
622 case "$mesa_driver" in
624 # only link librararies with osmesa if shared
625 if test "$enable_static" = no; then
626 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
633 # Link OSMesa to libGL otherwise
635 # only link librararies with osmesa if shared
636 if test "$enable_static" = no; then
637 OSMESA_MESA_DEPS='-l$(GL_LIB)'
643 AC_SUBST([OSMESA_LIB_DEPS])
644 AC_SUBST([OSMESA_MESA_DEPS])
647 dnl GLcore configuration
649 # delay pkg-config checks until `make glcore' run
650 XORG_CFLAGS='`pkg-config --cflags xorg-server`'
651 GLCORE_LIB_DEPS='-lm -lpthread'
652 if test "$mesa_driver" = dri; then
653 GLCORE_LIB_DEPS="$GLCORE_LIB_DEPS $DLOPEN_LIBS"
655 AC_SUBST([XORG_CFLAGS])
656 AC_SUBST([GLCORE_LIB_DEPS])
659 dnl GLU configuration
662 [AS_HELP_STRING([--disable-glu],
663 [enable OpenGL Utility library @<:@default=enabled@:>@])],
664 [enable_glu="$enableval"],
666 if test "x$enable_glu" = xyes; then
667 SRC_DIRS="$SRC_DIRS glu"
669 case "$mesa_driver" in
671 # If GLU is available and we have libOSMesa (not 16 or 32),
672 # we can build the osdemos
673 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
674 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
677 # Link libGLU to libOSMesa instead of libGL
679 if test "$enable_static" = no; then
680 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
686 # If static, empty GLU_LIB_DEPS and add libs for programs to link
687 if test "$enable_static" = no; then
689 GLU_MESA_DEPS='-l$(GL_LIB)'
693 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
698 AC_SUBST([GLU_LIB_DEPS])
699 AC_SUBST([GLU_MESA_DEPS])
702 dnl GLw configuration
705 [AS_HELP_STRING([--disable-glw],
706 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
707 [enable_glw="$enableval"],
709 dnl Don't build GLw on osmesa
710 if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
711 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
714 if test "x$enable_glw" = xyes; then
715 SRC_DIRS="$SRC_DIRS glw"
716 if test "$x11_pkgconfig" = yes; then
717 PKG_CHECK_MODULES([GLW],[x11 xt])
718 GLW_LIB_DEPS="$GLW_LIBS"
720 # should check these...
721 GLW_LIB_DEPS="$X_LIBS -lX11 -lXt"
724 # If static, empty GLW_LIB_DEPS and add libs for programs to link
725 if test "$enable_static" = no; then
726 GLW_MESA_DEPS='-l$(GL_LIB)'
728 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
733 AC_SUBST([GLW_LIB_DEPS])
734 AC_SUBST([GLW_MESA_DEPS])
737 dnl GLUT configuration
739 if test -f "$srcdir/include/GL/glut.h"; then
744 AC_ARG_ENABLE([glut],
745 [AS_HELP_STRING([--disable-glut],
746 [enable GLUT library @<:@default=enabled if source available@:>@])],
747 [enable_glut="$enableval"],
748 [enable_glut="$default_glut"])
750 dnl Can't build glut if GLU not available
751 if test "x$enable_glu$enable_glut" = xnoyes; then
752 AC_MSG_WARN([Disabling glut since GLU is disabled])
755 dnl Don't build glut on osmesa
756 if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
757 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
761 if test "x$enable_glut" = xyes; then
762 SRC_DIRS="$SRC_DIRS glut/glx"
764 if test "x$GCC" = xyes; then
765 GLUT_CFLAGS="-fexceptions"
767 if test "$x11_pkgconfig" = yes; then
768 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
769 GLUT_LIB_DEPS="$GLUT_LIBS"
771 # should check these...
772 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
774 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
776 # If glut is available, we can build most programs
777 if test "$with_demos" = yes; then
778 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
781 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
782 if test "$enable_static" = no; then
783 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
785 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
790 AC_SUBST([GLUT_LIB_DEPS])
791 AC_SUBST([GLUT_MESA_DEPS])
792 AC_SUBST([GLUT_CFLAGS])
795 dnl Program library dependencies
796 dnl Only libm is added here if necessary as the libraries should
797 dnl be pulled in by the linker
799 if test "x$APP_LIB_DEPS" = x; then
802 AC_SUBST([APP_LIB_DEPS])
803 AC_SUBST([PROGRAM_DIRS])
806 dnl Arch/platform-specific settings
809 [AS_HELP_STRING([--disable-asm],
810 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
811 [enable_asm="$enableval"],
818 AC_MSG_CHECKING([whether to enable assembly])
819 test "x$enable_asm" = xno && AC_MSG_RESULT([no])
820 # disable if cross compiling on x86/x86_64 since we must run gen_matypes
821 if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
825 AC_MSG_RESULT([no, cross compiling])
829 # check for supported arches
830 if test "x$enable_asm" = xyes; then
834 linux* | freebsd* | dragonfly*)
835 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
841 linux* | freebsd* | dragonfly*)
842 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
857 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
858 ASM_SOURCES='$(X86_SOURCES)'
860 AC_MSG_RESULT([yes, x86])
863 ASM_FLAGS="-DUSE_X86_64_ASM"
864 ASM_SOURCES='$(X86-64_SOURCES)'
865 ASM_API='$(X86-64_API)'
866 AC_MSG_RESULT([yes, x86_64])
869 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
870 ASM_SOURCES='$(PPC_SOURCES)'
871 AC_MSG_RESULT([yes, ppc])
874 AC_MSG_RESULT([no, platform not supported])
878 AC_SUBST([ASM_FLAGS])
879 AC_SUBST([ASM_SOURCES])
887 freebsd* | dragonfly*)
896 AC_SUBST([PIC_FLAGS])
898 dnl Restore LDFLAGS and CPPFLAGS
899 LDFLAGS="$_SAVE_LDFLAGS"
900 CPPFLAGS="$_SAVE_CPPFLAGS"
902 dnl Substitute the config
903 AC_CONFIG_FILES([configs/autoconf])
906 dnl Replace the configs/current symlink
907 if test -f configs/current || test -L configs/current; then
908 rm -f configs/current
910 ln -s autoconf configs/current
913 dnl Output some configuration info for the user
916 echo " prefix: $prefix"
917 echo " exec_prefix: $exec_prefix"
918 echo " libdir: $libdir"
922 echo " Driver: $mesa_driver"
923 if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
924 echo " OSMesa: lib$OSMESA_LIB"
928 if test "$mesa_driver" = dri; then
929 # cleanup the drivers var
930 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
931 echo " DRI drivers: $dri_dirs"
932 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
937 echo " Shared libs: $enable_shared"
938 echo " Static libs: $enable_static"
939 echo " GLU: $enable_glu"
940 echo " GLw: $enable_glw"
941 echo " glut: $enable_glut"
944 # cleanup the programs var for display
945 program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
946 if test "x$program_dirs" = x; then
949 echo " Demos: $program_dirs"
953 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars
954 cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
955 $SED 's/^ *//;s/ */ /;s/ *$//'`
956 cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
957 $SED 's/^ *//;s/ */ /;s/ *$//'`
958 defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
960 echo " CFLAGS: $cflags"
961 echo " CXXFLAGS: $cxxflags"
962 echo " Macros: $defines"
965 echo " Run '${MAKE-make}' to build Mesa"