blob: 485836a428215d0be0dff22a3c145519cb18f1e0 [file] [log] [blame]
Dan Nicholsondca1b792007-10-23 09:25:58 -07001dnl Process this file with autoconf to create configure.
2
Dan Nicholson297e16c2008-05-05 15:42:53 -07003AC_PREREQ([2.59])
Dan Nicholsondca1b792007-10-23 09:25:58 -07004
Dan Nicholson00994ac2008-04-30 15:06:00 -07005dnl Versioning - scrape the version from configs/default
6m4_define([mesa_version],
7 [m4_esyscmd([${MAKE-make} -s -f bin/version.mk version | tr -d '\n'])])
Dan Nicholson356f3112009-04-29 06:49:27 -07008m4_ifval(mesa_version,,
9 [m4_fatal([Failed to get the Mesa version from `make -f bin/version.mk version`])])
Dan Nicholsondca1b792007-10-23 09:25:58 -070010
Dan Nicholsone97ab722008-07-01 08:55:42 -070011dnl Tell the user about autoconf.html in the --help output
12m4_divert_once([HELP_END], [
13See docs/autoconf.html for more details on the options for Mesa.])
14
Dan Nicholson00994ac2008-04-30 15:06:00 -070015AC_INIT([Mesa],[mesa_version],
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -080016 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
Dan Nicholson297e16c2008-05-05 15:42:53 -070017AC_CONFIG_AUX_DIR([bin])
Dan Nicholsondca1b792007-10-23 09:25:58 -070018AC_CANONICAL_HOST
19
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070020dnl Versions for external dependencies
Eric Anholt859828c2009-10-08 17:18:12 -070021LIBDRM_REQUIRED=2.4.15
Fabio Pedrettiae1c0a02009-12-22 10:43:35 +100022LIBDRM_RADEON_REQUIRED=2.4.17
Kristian Høgsbergaa0cd702010-02-15 10:44:05 -050023DRI2PROTO_REQUIRED=2.1
Jesse Barnesf2f83d92010-01-11 17:28:10 -050024GLPROTO_REQUIRED=1.4.11
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070025
Dan Nicholsondca1b792007-10-23 09:25:58 -070026dnl Check for progs
27AC_PROG_CPP
28AC_PROG_CC
29AC_PROG_CXX
Dan Nicholson297e16c2008-05-05 15:42:53 -070030AC_CHECK_PROGS([MAKE], [gmake make])
31AC_PATH_PROG([MKDEP], [makedepend])
32AC_PATH_PROG([SED], [sed])
Dan Nicholson41b00702007-12-12 08:48:30 -080033
Dan Nicholsonbc302b22009-05-22 09:39:02 -070034dnl Our fallback install-sh is a symlink to minstall. Use the existing
35dnl configuration in that case.
36AC_PROG_INSTALL
37test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
38
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070039dnl We need a POSIX shell for parts of the build. Assume we have one
40dnl in most cases.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070041case "$host_os" in
42solaris*)
43 # Solaris /bin/sh is too old/non-POSIX compliant
44 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070045 SHELL="$POSIX_SHELL"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070046 ;;
47esac
48
Dan Nicholsondb7fc632008-03-07 11:48:09 -080049MKDEP_OPTIONS=-fdepend
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050050dnl Ask gcc where it's keeping its secret headers
51if test "x$GCC" = xyes; then
Dan Nicholsona3d223f2009-01-30 10:52:09 -080052 for dir in include include-fixed; do
53 GCC_INCLUDES=`$CC -print-file-name=$dir`
54 if test "x$GCC_INCLUDES" != x && \
55 test "$GCC_INCLUDES" != "$dir" && \
56 test -d "$GCC_INCLUDES"; then
57 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
58 fi
59 done
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050060fi
Dan Nicholson297e16c2008-05-05 15:42:53 -070061AC_SUBST([MKDEP_OPTIONS])
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050062
Dan Nicholson41b00702007-12-12 08:48:30 -080063dnl Make sure the pkg-config macros are defined
Dan Nicholson356f3112009-04-29 06:49:27 -070064m4_ifndef([PKG_PROG_PKG_CONFIG],
65 [m4_fatal([Could not locate the pkg-config autoconf macros.
66 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
67 are in a different location, try setting the environment variable
68 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Dan Nicholsondca1b792007-10-23 09:25:58 -070069PKG_PROG_PKG_CONFIG()
70
71dnl LIB_DIR - library basename
72LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -070073AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -070074
75dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
76_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholson297e16c2008-05-05 15:42:53 -070077AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
78AC_SUBST([EXTRA_LIB_PATH])
Dan Nicholsondca1b792007-10-23 09:25:58 -070079
80dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
81_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholson297e16c2008-05-05 15:42:53 -070082AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
83AC_SUBST([X11_INCLUDES])
Dan Nicholsondca1b792007-10-23 09:25:58 -070084
85dnl Compiler macros
86DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -070087AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -070088case "$host_os" in
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -070089linux*|*-gnu*|gnu*)
Dan Nicholson29f603a2009-01-12 11:10:31 -080090 DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
Dan Nicholsondca1b792007-10-23 09:25:58 -070091 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070092solaris*)
93 DEFINES="$DEFINES -DPTHREADS -DSVR4"
94 ;;
Brian Paul97988902010-02-18 12:46:12 -070095cygwin*)
96 DEFINES="$DEFINES -DPTHREADS"
97 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -070098esac
99
100dnl Add flags for gcc and g++
101if test "x$GCC" = xyes; then
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800102 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
103
104 # Enable -fvisibility=hidden if using a gcc that supports it
105 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800106 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800107 CFLAGS="$CFLAGS -fvisibility=hidden"
108 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
109 [CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
Dan Nicholson0c275b62008-01-15 22:52:25 -0800110
111 # Work around aliasing bugs - developers should comment this out
112 CFLAGS="$CFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700113fi
114if test "x$GXX" = xyes; then
115 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800116
117 # Work around aliasing bugs - developers should comment this out
118 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700119fi
120
121dnl These should be unnecessary, but let the user set them if they want
Dan Nicholson297e16c2008-05-05 15:42:53 -0700122AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700123 Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700124AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
Dan Nicholsondca1b792007-10-23 09:25:58 -0700125 compiler. Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700126AC_SUBST([OPT_FLAGS])
127AC_SUBST([ARCH_FLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700128
129dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600130dnl Hacks to enable 32 or 64 bit build
131dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700132AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600133 [AS_HELP_STRING([--enable-32-bit],
134 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700135 [enable_32bit="$enableval"],
136 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600137)
138if test "x$enable_32bit" = xyes; then
139 if test "x$GCC" = xyes; then
140 CFLAGS="$CFLAGS -m32"
Marc Dietrichc705e722009-08-31 08:56:33 -0700141 ARCH_FLAGS="$ARCH_FLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600142 fi
143 if test "x$GXX" = xyes; then
144 CXXFLAGS="$CXXFLAGS -m32"
145 fi
146fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700147AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600148 [AS_HELP_STRING([--enable-64-bit],
149 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700150 [enable_64bit="$enableval"],
151 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600152)
153if test "x$enable_64bit" = xyes; then
154 if test "x$GCC" = xyes; then
155 CFLAGS="$CFLAGS -m64"
156 fi
157 if test "x$GXX" = xyes; then
158 CXXFLAGS="$CXXFLAGS -m64"
159 fi
160fi
161
162dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800163dnl shared/static libraries, mimic libtool options
164dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700165AC_ARG_ENABLE([static],
Dan Nicholson88586332007-11-15 08:59:57 -0800166 [AS_HELP_STRING([--enable-static],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800167 [build static libraries @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700168 [enable_static="$enableval"],
169 [enable_static=no]
Dan Nicholson88586332007-11-15 08:59:57 -0800170)
171case "x$enable_static" in
172xyes|xno ) ;;
173x ) enable_static=no ;;
174* )
175 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
176 ;;
177esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700178AC_ARG_ENABLE([shared],
Dan Nicholson88586332007-11-15 08:59:57 -0800179 [AS_HELP_STRING([--disable-shared],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800180 [build shared libraries @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700181 [enable_shared="$enableval"],
182 [enable_shared=yes]
Dan Nicholson88586332007-11-15 08:59:57 -0800183)
184case "x$enable_shared" in
185xyes|xno ) ;;
186x ) enable_shared=yes ;;
187* )
188 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
189 ;;
190esac
191
192dnl Can't have static and shared libraries, default to static if user
193dnl explicitly requested. If both disabled, set to static since shared
194dnl was explicitly requirested.
195case "x$enable_static$enable_shared" in
196xyesyes )
197 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
198 enable_shared=no
199 ;;
200xnono )
201 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
202 enable_static=yes
203 ;;
204esac
205
206dnl
207dnl mklib options
208dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700209AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
Dan Nicholson88586332007-11-15 08:59:57 -0800210if test "$enable_static" = yes; then
211 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
212fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700213AC_SUBST([MKLIB_OPTIONS])
Dan Nicholson88586332007-11-15 08:59:57 -0800214
Dan Nicholson23656c42007-12-12 09:02:31 -0800215dnl
216dnl other compiler options
217dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700218AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800219 [AS_HELP_STRING([--enable-debug],
220 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700221 [enable_debug="$enableval"],
222 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800223)
224if test "x$enable_debug" = xyes; then
225 DEFINES="$DEFINES -DDEBUG"
226 if test "x$GCC" = xyes; then
227 CFLAGS="$CFLAGS -g"
228 fi
229 if test "x$GXX" = xyes; then
230 CXXFLAGS="$CXXFLAGS -g"
231 fi
232fi
Dan Nicholson88586332007-11-15 08:59:57 -0800233
234dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700235dnl library names
236dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800237if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800238 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800239else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700240 case "$host_os" in
241 darwin* )
242 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100243 cygwin* )
244 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700245 aix* )
246 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700247 * )
248 LIB_EXTENSION='so' ;;
249 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800250fi
Dan Nicholson8217f242009-02-11 15:16:00 -0800251
252GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
253GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
254GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
255GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
256OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800257EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800258
259GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
260GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
261GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
262GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
263OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800264EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800265
Dan Nicholson297e16c2008-05-05 15:42:53 -0700266AC_SUBST([GL_LIB_NAME])
267AC_SUBST([GLU_LIB_NAME])
268AC_SUBST([GLUT_LIB_NAME])
269AC_SUBST([GLW_LIB_NAME])
270AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800271AC_SUBST([EGL_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700272
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700273AC_SUBST([GL_LIB_GLOB])
274AC_SUBST([GLU_LIB_GLOB])
275AC_SUBST([GLUT_LIB_GLOB])
276AC_SUBST([GLW_LIB_GLOB])
277AC_SUBST([OSMESA_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800278AC_SUBST([EGL_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700279
Dan Nicholsondca1b792007-10-23 09:25:58 -0700280dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700281dnl Arch/platform-specific settings
282dnl
283AC_ARG_ENABLE([asm],
284 [AS_HELP_STRING([--disable-asm],
285 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
286 [enable_asm="$enableval"],
287 [enable_asm=yes]
288)
289asm_arch=""
290ASM_FLAGS=""
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800291MESA_ASM_SOURCES=""
292GLAPI_ASM_SOURCES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700293AC_MSG_CHECKING([whether to enable assembly])
294test "x$enable_asm" = xno && AC_MSG_RESULT([no])
295# disable if cross compiling on x86/x86_64 since we must run gen_matypes
296if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
297 case "$host_cpu" in
298 i?86 | x86_64)
299 enable_asm=no
300 AC_MSG_RESULT([no, cross compiling])
301 ;;
302 esac
303fi
304# check for supported arches
305if test "x$enable_asm" = xyes; then
306 case "$host_cpu" in
307 i?86)
308 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100309 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700310 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
311 ;;
312 esac
313 ;;
314 x86_64)
315 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100316 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700317 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
318 ;;
319 esac
320 ;;
321 powerpc)
322 case "$host_os" in
323 linux*)
324 asm_arch=ppc
325 ;;
326 esac
327 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800328 sparc*)
329 case "$host_os" in
330 linux*)
331 asm_arch=sparc
332 ;;
333 esac
334 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700335 esac
336
337 case "$asm_arch" in
338 x86)
Dan Nicholson61e925f2009-02-11 10:42:34 -0800339 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800340 MESA_ASM_SOURCES='$(X86_SOURCES)'
341 GLAPI_ASM_SOURCES='$(X86_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700342 AC_MSG_RESULT([yes, x86])
343 ;;
344 x86_64)
345 ASM_FLAGS="-DUSE_X86_64_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800346 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
347 GLAPI_ASM_SOURCES='$(X86-64_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700348 AC_MSG_RESULT([yes, x86_64])
349 ;;
350 ppc)
351 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800352 MESA_ASM_SOURCES='$(PPC_SOURCES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700353 AC_MSG_RESULT([yes, ppc])
354 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800355 sparc)
356 ASM_FLAGS="-DUSE_SPARC_ASM"
357 MESA_ASM_SOURCES='$(SPARC_SOURCES)'
358 GLAPI_ASM_SOURCES='$(SPARC_API)'
359 AC_MSG_RESULT([yes, sparc])
360 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700361 *)
362 AC_MSG_RESULT([no, platform not supported])
363 ;;
364 esac
365fi
366AC_SUBST([ASM_FLAGS])
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800367AC_SUBST([MESA_ASM_SOURCES])
368AC_SUBST([GLAPI_ASM_SOURCES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700369
370dnl PIC code macro
371MESA_PIC_FLAGS
372
373dnl Check to see if dlopen is in default libraries (like Solaris, which
374dnl has it in libc), or if libdl is needed to get it.
375AC_CHECK_FUNC([dlopen], [],
376 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
377
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700378dnl See if posix_memalign is available
379AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
380
Dan Nicholson871125a2008-06-04 13:00:35 -0700381dnl SELinux awareness.
382AC_ARG_ENABLE([selinux],
383 [AS_HELP_STRING([--enable-selinux],
384 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
385 [MESA_SELINUX="$enableval"],
386 [MESA_SELINUX=no])
387if test "x$enable_selinux" = "xyes"; then
388 AC_CHECK_HEADER([selinux/selinux.h],[],
389 [AC_MSG_ERROR([SELinux headers not found])])
390 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
391 [AC_MSG_ERROR([SELinux library not found])])
392 SELINUX_LIBS="-lselinux"
393 DEFINES="$DEFINES -DMESA_SELINUX"
394fi
395
Dan Nicholson871125a2008-06-04 13:00:35 -0700396dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800397dnl Driver configuration. Options are xlib, dri and osmesa right now.
Dan Nicholson979ff512007-12-05 18:47:01 -0800398dnl More later: directfb, fbdev, ...
Dan Nicholson44d99142007-12-05 18:47:01 -0800399dnl
Eric Anholt711222b2008-04-18 15:03:01 -0700400default_driver="xlib"
401
402case "$host_os" in
403linux*)
404 case "$host_cpu" in
David S. Miller32dc28a2009-02-24 20:06:05 -0700405 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
Eric Anholt711222b2008-04-18 15:03:01 -0700406 esac
407 ;;
Julien Cristau98fcdf32008-10-28 18:56:05 +0100408*freebsd* | dragonfly*)
Eric Anholt711222b2008-04-18 15:03:01 -0700409 case "$host_cpu" in
Robert Noland48f05432009-04-10 11:41:27 -0500410 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
Eric Anholt711222b2008-04-18 15:03:01 -0700411 esac
412 ;;
413esac
414
Dan Nicholson297e16c2008-05-05 15:42:53 -0700415AC_ARG_WITH([driver],
Dan Nicholson44d99142007-12-05 18:47:01 -0800416 [AS_HELP_STRING([--with-driver=DRIVER],
Eric Anholt711222b2008-04-18 15:03:01 -0700417 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700418 [mesa_driver="$withval"],
419 [mesa_driver="$default_driver"])
Dan Nicholson44d99142007-12-05 18:47:01 -0800420dnl Check for valid option
421case "x$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800422xxlib|xdri|xosmesa)
Dan Nicholson44d99142007-12-05 18:47:01 -0800423 ;;
424*)
425 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
426 ;;
427esac
428
429dnl
430dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700431dnl
Chia-I Wu99a37ed2010-01-05 17:39:05 +0800432
433dnl this variable will be prepended to SRC_DIRS and is not exported
434CORE_DIRS="glsl mesa"
435
436SRC_DIRS="glew"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700437GLU_DIRS="sgi"
Dan Nicholson44d99142007-12-05 18:47:01 -0800438WINDOW_SYSTEM=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100439GALLIUM_DIRS="auxiliary drivers state_trackers"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100440GALLIUM_WINSYS_DIRS=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100441GALLIUM_WINSYS_DRM_DIRS=""
Jakob Bornecrantzd60b2c62009-06-24 02:42:41 +0200442GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100443GALLIUM_STATE_TRACKERS_DIRS=""
444
Dan Nicholson44d99142007-12-05 18:47:01 -0800445case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800446xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800447 DRIVER_DIRS="x11"
Jakob Bornecrantz373e6712009-04-18 23:13:56 +0100448 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
Dan Nicholson44d99142007-12-05 18:47:01 -0800449 ;;
450dri)
Kristian Høgsberg6e8897f2010-02-09 09:58:36 -0500451 SRC_DIRS="$SRC_DIRS glx"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100452 DRIVER_DIRS="dri"
Dan Nicholson44d99142007-12-05 18:47:01 -0800453 WINDOW_SYSTEM="dri"
Jakob Bornecrantz373e6712009-04-18 23:13:56 +0100454 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800455 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800456osmesa)
457 DRIVER_DIRS="osmesa"
458 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800459esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700460AC_SUBST([SRC_DIRS])
461AC_SUBST([GLU_DIRS])
462AC_SUBST([DRIVER_DIRS])
463AC_SUBST([WINDOW_SYSTEM])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100464AC_SUBST([GALLIUM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100465AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100466AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +0000467AC_SUBST([GALLIUM_DRIVERS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100468AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700469
470dnl
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800471dnl User supplied program configuration
472dnl
473if test -d "$srcdir/progs/demos"; then
474 default_demos=yes
475else
476 default_demos=no
477fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700478AC_ARG_WITH([demos],
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800479 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
480 [optional comma delimited demo directories to build
Dan Nicholsonc79c93c2007-12-12 18:13:04 -0800481 @<:@default=auto if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700482 [with_demos="$withval"],
483 [with_demos="$default_demos"])
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800484if test "x$with_demos" = x; then
485 with_demos=no
486fi
487
488dnl If $with_demos is yes, directories will be added as libs available
489PROGRAM_DIRS=""
490case "$with_demos" in
Dan Nicholsonb9576552008-03-10 14:05:46 -0700491no) ;;
492yes)
493 # If the driver isn't osmesa, we have libGL and can build xdemos
494 if test "$mesa_driver" != osmesa; then
495 PROGRAM_DIRS="xdemos"
496 fi
497 ;;
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800498*)
499 # verify the requested demos directories exist
500 demos=`IFS=,; echo $with_demos`
501 for demo in $demos; do
502 test -d "$srcdir/progs/$demo" || \
503 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
504 done
505 PROGRAM_DIRS="$demos"
506 ;;
507esac
508
509dnl
Dan Nicholsone6a06092008-05-05 15:16:22 -0700510dnl Find out if X is available. The variable have_x is set if libX11 is
Dan Nicholson99803a42008-07-01 09:03:15 -0700511dnl found to mimic AC_PATH_XTRA.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700512dnl
513if test -n "$PKG_CONFIG"; then
514 AC_MSG_CHECKING([pkg-config files for X11 are available])
Dan Nicholsone6a06092008-05-05 15:16:22 -0700515 PKG_CHECK_EXISTS([x11],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700516 x11_pkgconfig=yes
517 have_x=yes
Dan Nicholsone6a06092008-05-05 15:16:22 -0700518 ],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700519 x11_pkgconfig=no
Dan Nicholsone6a06092008-05-05 15:16:22 -0700520 ])
521 AC_MSG_RESULT([$x11_pkgconfig])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700522else
523 x11_pkgconfig=no
524fi
525dnl Use the autoconf macro if no pkg-config files
526if test "$x11_pkgconfig" = no; then
527 AC_PATH_XTRA
528fi
529
Dan Nicholson99803a42008-07-01 09:03:15 -0700530dnl Try to tell the user that the --x-* options are only used when
531dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
532m4_divert_once([HELP_BEGIN],
533[These options are only used when the X libraries cannot be found by the
534pkg-config utility.])
535
Dan Nicholson44d99142007-12-05 18:47:01 -0800536dnl We need X for xlib and dri, so bomb now if it's not found
537case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800538xlib|dri)
Dan Nicholson44d99142007-12-05 18:47:01 -0800539 if test "$no_x" = yes; then
540 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
541 fi
542 ;;
543esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700544
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700545dnl XCB - this is only used for GLX right now
546AC_ARG_ENABLE([xcb],
547 [AS_HELP_STRING([--enable-xcb],
548 [use XCB for GLX @<:@default=disabled@:>@])],
549 [enable_xcb="$enableval"],
550 [enable_xcb=no])
551if test "x$enable_xcb" = xyes; then
552 DEFINES="$DEFINES -DUSE_XCB"
553else
554 enable_xcb=no
555fi
556
Dan Nicholson44d99142007-12-05 18:47:01 -0800557dnl
558dnl libGL configuration per driver
559dnl
560case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800561xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800562 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700563 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800564 GL_PC_REQ_PRIV="x11 xext"
Dan Nicholsona1307182007-12-12 17:49:49 -0800565 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
566 GL_LIB_DEPS="$XLIBGL_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800567 else
568 # should check these...
569 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
570 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800571 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
572 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson44d99142007-12-05 18:47:01 -0800573 fi
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700574 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
575 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
Dan Nicholson88586332007-11-15 08:59:57 -0800576
577 # if static, move the external libraries to the programs
578 # and empty the libraries for libGL
579 if test "$enable_static" = yes; then
580 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
581 GL_LIB_DEPS=""
582 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800583 ;;
584dri)
Dan Nicholson88586332007-11-15 08:59:57 -0800585 # DRI must be shared, I think
586 if test "$enable_static" = yes; then
587 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
588 fi
589
Dan Nicholson44d99142007-12-05 18:47:01 -0800590 # Check for libdrm
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -0700591 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
592 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500593 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Jesse Barnesed59b132010-01-13 15:48:14 -0500594 GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
595 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Dan Nicholson44d99142007-12-05 18:47:01 -0800596
597 # find the DRI deps for libGL
598 if test "$x11_pkgconfig" = yes; then
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700599 # add xcb modules if necessary
600 dri_modules="x11 xext xxf86vm xdamage xfixes"
601 if test "$enable_xcb" = yes; then
602 dri_modules="$dri_modules x11-xcb xcb-glx"
603 fi
604
605 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800606 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
Dan Nicholson44d99142007-12-05 18:47:01 -0800607 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
608 GL_LIB_DEPS="$DRIGL_LIBS"
609 else
610 # should check these...
611 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
612 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800613 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
614 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700615
616 # XCB can only be used from pkg-config
617 if test "$enable_xcb" = yes; then
618 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800619 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700620 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
621 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
622 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800623 fi
624
625 # need DRM libs, -lpthread, etc.
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700626 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
627 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800628 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800629osmesa)
630 # No libGL for osmesa
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700631 GL_LIB_DEPS=""
Dan Nicholson979ff512007-12-05 18:47:01 -0800632 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800633esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700634AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800635AC_SUBST([GL_PC_REQ_PRIV])
636AC_SUBST([GL_PC_LIB_PRIV])
637AC_SUBST([GL_PC_CFLAGS])
638AC_SUBST([DRI_PC_REQ_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700639
640dnl
641dnl More X11 setup
642dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800643if test "$mesa_driver" = xlib; then
Dan Nicholsondca1b792007-10-23 09:25:58 -0700644 DEFINES="$DEFINES -DUSE_XSHM"
645fi
646
647dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800648dnl More DRI setup
649dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700650AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800651 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800652 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700653 [GLX_USE_TLS="$enableval"],
654 [GLX_USE_TLS=no])
Dan Nicholson44d99142007-12-05 18:47:01 -0800655dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700656AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800657 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700658 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700659 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700660 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700661AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800662dnl Extra search path for DRI drivers
663AC_ARG_WITH([dri-searchpath],
664 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
665 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
666 [DRI_DRIVER_SEARCH_DIR="$withval"],
667 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
668AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholson44d99142007-12-05 18:47:01 -0800669dnl Direct rendering or just indirect rendering
Dan Nicholson297e16c2008-05-05 15:42:53 -0700670AC_ARG_ENABLE([driglx-direct],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800671 [AS_HELP_STRING([--disable-driglx-direct],
672 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700673 [driglx_direct="$enableval"],
674 [driglx_direct="yes"])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800675dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700676AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800677 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700678 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200679 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700680 [with_dri_drivers="$withval"],
681 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800682if test "x$with_dri_drivers" = x; then
683 with_dri_drivers=no
684fi
685
686dnl If $with_dri_drivers is yes, directories will be added through
687dnl platform checks
688DRI_DIRS=""
689case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100690no) ;;
691yes)
692 DRI_DIRS="yes"
693 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800694*)
695 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700696 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800697 for driver in $dri_drivers; do
698 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
699 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
700 done
701 DRI_DIRS="$dri_drivers"
702 ;;
703esac
704
Dan Nicholson44d99142007-12-05 18:47:01 -0800705dnl Set DRI_DIRS, DEFINES and LIB_DEPS
706if test "$mesa_driver" = dri; then
707 # Use TLS in GLX?
708 if test "x$GLX_USE_TLS" = xyes; then
709 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
710 fi
711
Dan Nicholson44d99142007-12-05 18:47:01 -0800712 # Platform specific settings and drivers to build
713 case "$host_os" in
714 linux*)
715 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Dan Nicholson44d99142007-12-05 18:47:01 -0800716 if test "x$driglx_direct" = xyes; then
717 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
718 fi
Jerome Glisse14f79d42008-12-18 13:36:07 +0100719 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800720
721 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -0800722 x86_64)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800723 # ffb, gamma, and sis are missing because they have not be
724 # converted to use the new interface. i810 are missing
725 # because there is no x86-64 system where they could *ever*
726 # be used.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100727 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400728 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
George Sapountzis280bf892008-05-11 14:43:40 +0300729 savage tdfx unichrome swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800730 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800731 ;;
732 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800733 # Build only the drivers for cards that exist on PowerPC.
734 # At some point MGA will be added, but not yet.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100735 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400736 DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800737 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800738 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000739 sparc*)
740 # Build only the drivers for cards that exist on sparc`
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100741 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400742 DRI_DIRS="mach64 r128 r200 r300 r600 radeon ffb swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000743 fi
744 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800745 esac
746 ;;
Hasso Tepper9f8df2d2008-04-09 10:51:21 -0700747 freebsd* | dragonfly*)
Dan Nicholson44d99142007-12-05 18:47:01 -0800748 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
749 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
750 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
751 if test "x$driglx_direct" = xyes; then
752 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
753 fi
754 if test "x$GXX" = xyes; then
755 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
756 fi
757
Dan Nicholsona76e2452007-12-07 11:25:08 -0800758 # ffb and gamma are missing because they have not been converted
759 # to use the new interface.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100760 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400761 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
George Sapountzis280bf892008-05-11 14:43:40 +0300762 unichrome savage sis swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800763 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800764 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700765 gnu*)
766 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
767 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
768 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700769 solaris*)
770 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
771 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
772 if test "x$driglx_direct" = xyes; then
773 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
774 fi
775 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800776 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -0800777
778 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100779 if test "x$DRI_DIRS" = "xyes"; then
Corbin Simpson8e4657a2009-10-22 12:29:30 -0700780 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
Corbin Simpsonfd7ee2b2009-10-22 12:57:13 -0700781 savage sis tdfx unichrome ffb swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -0800782 fi
783
Dan Nicholson44d99142007-12-05 18:47:01 -0800784 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
785
786 # Check for expat
787 EXPAT_INCLUDES=""
788 EXPAT_LIB=-lexpat
Dan Nicholson297e16c2008-05-05 15:42:53 -0700789 AC_ARG_WITH([expat],
790 [AS_HELP_STRING([--with-expat=DIR],
791 [expat install directory])],[
Dan Nicholson44d99142007-12-05 18:47:01 -0800792 EXPAT_INCLUDES="-I$withval/include"
793 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
794 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
795 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
796 ])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700797 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
798 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
799 [AC_MSG_ERROR([Expat required for DRI.])])
Dan Nicholson44d99142007-12-05 18:47:01 -0800800
801 # put all the necessary libs together
Eric Anholt050c5332008-03-20 17:28:58 -0700802 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800803fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700804AC_SUBST([DRI_DIRS])
805AC_SUBST([EXPAT_INCLUDES])
806AC_SUBST([DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -0800807
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500808case $DRI_DIRS in
809*i915*|*i965*)
810 PKG_CHECK_MODULES([INTEL], [libdrm_intel])
811 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -0500812esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500813
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -0500814case $DRI_DIRS in
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500815*radeon*|*r200*|*r300*|*r600*)
816 PKG_CHECK_MODULES([LIBDRM_RADEON],
817 [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
818 HAVE_LIBDRM_RADEON=yes,
819 HAVE_LIBDRM_RADEON=no)
820
821 if test "$HAVE_LIBDRM_RADEON" = yes; then
822 RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
823 RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
824 fi
825 ;;
826esac
827AC_SUBST([RADEON_CFLAGS])
828AC_SUBST([RADEON_LDFLAGS])
829
830
Dan Nicholson44d99142007-12-05 18:47:01 -0800831dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700832dnl OSMesa configuration
833dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800834if test "$mesa_driver" = xlib; then
Dan Nicholson544ab202007-12-30 08:41:53 -0800835 default_gl_osmesa=yes
Dan Nicholson979ff512007-12-05 18:47:01 -0800836else
Dan Nicholson544ab202007-12-30 08:41:53 -0800837 default_gl_osmesa=no
Dan Nicholson44d99142007-12-05 18:47:01 -0800838fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700839AC_ARG_ENABLE([gl-osmesa],
Dan Nicholson544ab202007-12-30 08:41:53 -0800840 [AS_HELP_STRING([--enable-gl-osmesa],
841 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700842 [gl_osmesa="$enableval"],
843 [gl_osmesa="$default_gl_osmesa"])
Dan Nicholson544ab202007-12-30 08:41:53 -0800844if test "x$gl_osmesa" = xyes; then
845 if test "$mesa_driver" = osmesa; then
846 AC_MSG_ERROR([libGL is not available for OSMesa driver])
Dan Nicholson979ff512007-12-05 18:47:01 -0800847 else
Dan Nicholson544ab202007-12-30 08:41:53 -0800848 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Dan Nicholson979ff512007-12-05 18:47:01 -0800849 fi
850fi
851
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800852dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -0700853AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800854 [AS_HELP_STRING([--with-osmesa-bits=BITS],
855 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700856 [osmesa_bits="$withval"],
857 [osmesa_bits=8])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800858if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
859 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
860 osmesa_bits=8
861fi
862case "x$osmesa_bits" in
863x8)
864 OSMESA_LIB=OSMesa
865 ;;
866x16|x32)
867 OSMESA_LIB="OSMesa$osmesa_bits"
868 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
869 ;;
870*)
871 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
872 ;;
873esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700874AC_SUBST([OSMESA_LIB])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800875
Dan Nicholson979ff512007-12-05 18:47:01 -0800876case "$mesa_driver" in
877osmesa)
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700878 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800879 if test "$enable_static" = no; then
Dan Nicholson4795dd52009-06-04 19:42:08 -0700880 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800881 else
882 OSMESA_LIB_DEPS=""
883 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800884 OSMESA_MESA_DEPS=""
Dan Nicholson4795dd52009-06-04 19:42:08 -0700885 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800886 ;;
887*)
888 # Link OSMesa to libGL otherwise
889 OSMESA_LIB_DEPS=""
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700890 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800891 if test "$enable_static" = no; then
892 OSMESA_MESA_DEPS='-l$(GL_LIB)'
893 else
894 OSMESA_MESA_DEPS=""
895 fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800896 OSMESA_PC_REQ="gl"
Dan Nicholson979ff512007-12-05 18:47:01 -0800897 ;;
898esac
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700899OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700900AC_SUBST([OSMESA_LIB_DEPS])
901AC_SUBST([OSMESA_MESA_DEPS])
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800902AC_SUBST([OSMESA_PC_REQ])
903AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700904
905dnl
Dan Nicholson53b37342009-02-25 17:45:34 -0800906dnl EGL configuration
907dnl
Dan Nicholson66f97862009-04-29 12:11:43 -0700908AC_ARG_ENABLE([egl],
909 [AS_HELP_STRING([--disable-egl],
910 [disable EGL library @<:@default=enabled@:>@])],
911 [enable_egl="$enableval"],
912 [enable_egl=yes])
913if test "x$enable_egl" = xyes; then
914 SRC_DIRS="$SRC_DIRS egl"
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800915 EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
916 EGL_DRIVERS_DIRS=""
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800917 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800918 # build egl_glx when libGL is built
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800919 if test "$mesa_driver" != osmesa; then
920 EGL_DRIVERS_DIRS="glx"
921 fi
922
923 # build egl_dri2 when xcb-dri2 is available
Kristian Høgsberg077bc2f2010-02-05 13:55:32 -0500924 PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm],
925 [have_xcb_dri2=yes],[have_xcb_dri2=no])
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800926 if test "$have_xcb_dri2" = yes; then
927 EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
928 fi
Kristian Høgsberg42fa0092010-02-03 10:18:28 -0500929 fi
Kristian Høgsberg1ebc5682010-02-09 15:54:59 -0500930
931 if test "$with_demos" = yes; then
932 PROGRAM_DIRS="$PROGRAM_DIRS egl"
933 fi
Dan Nicholson53b37342009-02-25 17:45:34 -0800934fi
Dan Nicholson53b37342009-02-25 17:45:34 -0800935AC_SUBST([EGL_LIB_DEPS])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800936AC_SUBST([EGL_DRIVERS_DIRS])
Dan Nicholson53b37342009-02-25 17:45:34 -0800937
938dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700939dnl GLU configuration
940dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700941AC_ARG_ENABLE([glu],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800942 [AS_HELP_STRING([--disable-glu],
943 [enable OpenGL Utility library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700944 [enable_glu="$enableval"],
945 [enable_glu=yes])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700946if test "x$enable_glu" = xyes; then
947 SRC_DIRS="$SRC_DIRS glu"
948
Dan Nicholson979ff512007-12-05 18:47:01 -0800949 case "$mesa_driver" in
950 osmesa)
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800951 # If GLU is available and we have libOSMesa (not 16 or 32),
952 # we can build the osdemos
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800953 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800954 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
955 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700956
Dan Nicholson979ff512007-12-05 18:47:01 -0800957 # Link libGLU to libOSMesa instead of libGL
958 GLU_LIB_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800959 GLU_PC_REQ="osmesa"
Dan Nicholson88586332007-11-15 08:59:57 -0800960 if test "$enable_static" = no; then
961 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
962 else
963 GLU_MESA_DEPS=""
964 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800965 ;;
966 *)
Dan Nicholson88586332007-11-15 08:59:57 -0800967 # If static, empty GLU_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800968 GLU_PC_REQ="gl"
969 GLU_PC_LIB_PRIV="-lm"
Dan Nicholson88586332007-11-15 08:59:57 -0800970 if test "$enable_static" = no; then
971 GLU_LIB_DEPS="-lm"
972 GLU_MESA_DEPS='-l$(GL_LIB)'
973 else
974 GLU_LIB_DEPS=""
975 GLU_MESA_DEPS=""
976 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
977 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800978 ;;
979 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700980fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700981if test "$enable_static" = no; then
982 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
983fi
Dan Nicholson71e208b2008-11-24 11:01:57 -0800984GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700985AC_SUBST([GLU_LIB_DEPS])
986AC_SUBST([GLU_MESA_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800987AC_SUBST([GLU_PC_REQ])
988AC_SUBST([GLU_PC_REQ_PRIV])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800989AC_SUBST([GLU_PC_LIB_PRIV])
990AC_SUBST([GLU_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700991
992dnl
993dnl GLw configuration
994dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700995AC_ARG_ENABLE([glw],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800996 [AS_HELP_STRING([--disable-glw],
997 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700998 [enable_glw="$enableval"],
999 [enable_glw=yes])
Dan Nicholson979ff512007-12-05 18:47:01 -08001000dnl Don't build GLw on osmesa
1001if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
1002 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
1003 enable_glw=no
1004fi
Dan Nicholson776c60d2008-07-18 07:40:41 -07001005AC_ARG_ENABLE([motif],
1006 [AS_HELP_STRING([--enable-motif],
1007 [use Motif widgets in GLw @<:@default=disabled@:>@])],
1008 [enable_motif="$enableval"],
1009 [enable_motif=no])
1010
Dan Nicholsondca1b792007-10-23 09:25:58 -07001011if test "x$enable_glw" = xyes; then
1012 SRC_DIRS="$SRC_DIRS glw"
1013 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001014 PKG_CHECK_MODULES([GLW],[x11 xt])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001015 GLW_PC_REQ_PRIV="x11 xt"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001016 GLW_LIB_DEPS="$GLW_LIBS"
1017 else
1018 # should check these...
Dan Nicholson776c60d2008-07-18 07:40:41 -07001019 GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001020 GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
1021 GLW_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001022 fi
1023
1024 GLW_SOURCES="GLwDrawA.c"
1025 MOTIF_CFLAGS=
1026 if test "x$enable_motif" = xyes; then
1027 GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
1028 AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
1029 if test "x$MOTIF_CONFIG" != xno; then
1030 MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
1031 MOTIF_LIBS=`$MOTIF_CONFIG --libs`
1032 else
1033 AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
1034 [AC_MSG_ERROR([Can't locate Motif headers])])
1035 AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
1036 [AC_MSG_ERROR([Can't locate Motif Xm library])])
1037 fi
1038 # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
1039 GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001040 GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
1041 GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001042 fi
1043
Dan Nicholson88586332007-11-15 08:59:57 -08001044 # If static, empty GLW_LIB_DEPS and add libs for programs to link
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001045 GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
Dan Nicholson88586332007-11-15 08:59:57 -08001046 if test "$enable_static" = no; then
1047 GLW_MESA_DEPS='-l$(GL_LIB)'
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001048 GLW_LIB_DEPS="$GLW_LIB_DEPS"
Dan Nicholson88586332007-11-15 08:59:57 -08001049 else
1050 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
1051 GLW_LIB_DEPS=""
1052 GLW_MESA_DEPS=""
1053 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001054fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001055AC_SUBST([GLW_LIB_DEPS])
1056AC_SUBST([GLW_MESA_DEPS])
Dan Nicholson776c60d2008-07-18 07:40:41 -07001057AC_SUBST([GLW_SOURCES])
1058AC_SUBST([MOTIF_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001059AC_SUBST([GLW_PC_REQ_PRIV])
1060AC_SUBST([GLW_PC_LIB_PRIV])
1061AC_SUBST([GLW_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001062
1063dnl
1064dnl GLUT configuration
1065dnl
1066if test -f "$srcdir/include/GL/glut.h"; then
1067 default_glut=yes
1068else
1069 default_glut=no
1070fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001071AC_ARG_ENABLE([glut],
Dan Nicholson79ad4582007-12-07 19:11:01 -08001072 [AS_HELP_STRING([--disable-glut],
1073 [enable GLUT library @<:@default=enabled if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001074 [enable_glut="$enableval"],
1075 [enable_glut="$default_glut"])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001076
1077dnl Can't build glut if GLU not available
1078if test "x$enable_glu$enable_glut" = xnoyes; then
1079 AC_MSG_WARN([Disabling glut since GLU is disabled])
1080 enable_glut=no
1081fi
Dan Nicholson979ff512007-12-05 18:47:01 -08001082dnl Don't build glut on osmesa
1083if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
1084 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
1085 enable_glut=no
1086fi
1087
Dan Nicholsondca1b792007-10-23 09:25:58 -07001088if test "x$enable_glut" = xyes; then
1089 SRC_DIRS="$SRC_DIRS glut/glx"
1090 GLUT_CFLAGS=""
1091 if test "x$GCC" = xyes; then
1092 GLUT_CFLAGS="-fexceptions"
1093 fi
1094 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001095 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001096 GLUT_PC_REQ_PRIV="x11 xmu xi"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001097 GLUT_LIB_DEPS="$GLUT_LIBS"
1098 else
1099 # should check these...
Dan Nicholson70d0c832007-12-07 11:12:20 -08001100 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001101 GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
1102 GLUT_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001103 fi
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001104 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
1105 GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001106
1107 # If glut is available, we can build most programs
Dan Nicholson8e4d1472007-11-15 08:59:57 -08001108 if test "$with_demos" = yes; then
1109 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
1110 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001111
Dan Nicholson88586332007-11-15 08:59:57 -08001112 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
1113 if test "$enable_static" = no; then
1114 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
1115 else
1116 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
1117 GLUT_LIB_DEPS=""
1118 GLUT_MESA_DEPS=""
1119 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001120fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001121AC_SUBST([GLUT_LIB_DEPS])
1122AC_SUBST([GLUT_MESA_DEPS])
1123AC_SUBST([GLUT_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001124AC_SUBST([GLUT_PC_REQ_PRIV])
1125AC_SUBST([GLUT_PC_LIB_PRIV])
1126AC_SUBST([GLUT_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001127
1128dnl
1129dnl Program library dependencies
1130dnl Only libm is added here if necessary as the libraries should
1131dnl be pulled in by the linker
1132dnl
1133if test "x$APP_LIB_DEPS" = x; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001134 case "$host_os" in
1135 solaris*)
1136 APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
1137 ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +01001138 cygwin*)
1139 APP_LIB_DEPS="-lX11"
1140 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001141 *)
1142 APP_LIB_DEPS="-lm"
1143 ;;
1144 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -07001145fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001146AC_SUBST([APP_LIB_DEPS])
1147AC_SUBST([PROGRAM_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001148
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001149dnl
1150dnl Gallium configuration
1151dnl
1152AC_ARG_ENABLE([gallium],
1153 [AS_HELP_STRING([--disable-gallium],
1154 [build gallium @<:@default=enabled@:>@])],
1155 [enable_gallium="$enableval"],
1156 [enable_gallium=yes])
1157if test "x$enable_gallium" = xyes; then
1158 SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
1159fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001160
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001161dnl
1162dnl Gallium state trackers configuration
1163dnl
1164AC_ARG_WITH([state-trackers],
1165 [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
1166 [comma delimited state_trackers list, e.g.
1167 "egl,glx" @<:@default=auto@:>@])],
1168 [with_state_trackers="$withval"],
1169 [with_state_trackers=yes])
1170
1171case "$with_state_trackers" in
1172no)
1173 GALLIUM_STATE_TRACKERS_DIRS=""
1174 ;;
1175yes)
1176 # look at what else is built
1177 case "$mesa_driver" in
Jakob Bornecrantz373e6712009-04-18 23:13:56 +01001178 xlib)
1179 GALLIUM_STATE_TRACKERS_DIRS=glx
1180 ;;
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001181 dri)
Jakob Bornecrantzbc0532b2009-12-04 18:50:29 +00001182 GALLIUM_STATE_TRACKERS_DIRS="dri"
1183 if test "x$enable_egl" = xyes; then
Chia-I Wu3c967a92010-01-22 16:31:43 +08001184 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
Jakob Bornecrantzbc0532b2009-12-04 18:50:29 +00001185 fi
1186 # Have only tested st/xorg on 1.6.0 servers
1187 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
1188 HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
1189 HAVE_XORG="no")
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001190 ;;
1191 esac
1192 ;;
1193*)
1194 # verify the requested state tracker exist
1195 state_trackers=`IFS=', '; echo $with_state_trackers`
1196 for tracker in $state_trackers; do
1197 test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
1198 AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
Dan Nicholson66f97862009-04-29 12:11:43 -07001199
Chia-I Wue5d351d2009-12-23 11:18:00 +08001200 case "$tracker" in
Chia-I Wu3c967a92010-01-22 16:31:43 +08001201 egl)
Chia-I Wue5d351d2009-12-23 11:18:00 +08001202 if test "x$enable_egl" != xyes; then
Chia-I Wu3c967a92010-01-22 16:31:43 +08001203 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
Chia-I Wue5d351d2009-12-23 11:18:00 +08001204 fi
1205 ;;
1206 xorg)
Dave Airliee9d6ab72009-09-21 13:26:48 +10001207 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
Jakob Bornecrantz5c4bdbd2009-10-15 01:24:53 +01001208 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
Dave Airliee9d6ab72009-09-21 13:26:48 +10001209 HAVE_XEXTPROTO_71="no")
Chia-I Wue5d351d2009-12-23 11:18:00 +08001210 ;;
1211 es)
1212 # mesa/es is required to build es state tracker
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001213 CORE_DIRS="$CORE_DIRS mesa/es"
Chia-I Wue5d351d2009-12-23 11:18:00 +08001214 ;;
1215 esac
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001216 done
1217 GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
1218 ;;
1219esac
1220
Chia-I Wu49381d62010-01-11 01:23:01 +08001221AC_ARG_WITH([egl-displays],
1222 [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
1223 [comma delimited native displays libEGL supports, e.g.
Chia-I Wua68b51d2010-01-03 19:24:04 +08001224 "x11,kms" @<:@default=auto@:>@])],
Chia-I Wu49381d62010-01-11 01:23:01 +08001225 [with_egl_displays="$withval"],
1226 [with_egl_displays=yes])
1227
1228EGL_DISPLAYS=""
1229case "$with_egl_displays" in
1230yes)
1231 if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
1232 EGL_DISPLAYS="x11"
1233 fi
1234 ;;
1235*)
1236 if test "x$enable_egl" != xyes; then
1237 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1238 fi
1239 # verify the requested driver directories exist
1240 egl_displays=`IFS=', '; echo $with_egl_displays`
1241 for dpy in $egl_displays; do
Chia-I Wu3c967a92010-01-22 16:31:43 +08001242 test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \
Chia-I Wu49381d62010-01-11 01:23:01 +08001243 AC_MSG_ERROR([EGL display '$dpy' does't exist])
1244 done
1245 EGL_DISPLAYS="$egl_displays"
1246 ;;
1247esac
1248AC_SUBST([EGL_DISPLAYS])
1249
Chia-I Wu28c3e572010-01-23 20:18:43 +08001250AC_ARG_WITH([egl-driver-dir],
1251 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1252 [directory for EGL drivers [[default=${libdir}/egl]]])],
1253 [EGL_DRIVER_INSTALL_DIR="$withval"],
1254 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1255AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1256
Joel Bosveld8acca482009-03-06 08:46:08 +09001257AC_ARG_WITH([xorg-driver-dir],
1258 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1259 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1260 [XORG_DRIVER_INSTALL_DIR="$withval"],
1261 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1262AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1263
Tom Fogal7085dce2009-08-13 19:40:30 -06001264AC_ARG_WITH([max-width],
1265 [AS_HELP_STRING([--with-max-width=N],
1266 [Maximum framebuffer width (4096)])],
1267 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1268 AS_IF([test "${withval}" -gt "4096"],
1269 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1270)
1271AC_ARG_WITH([max-height],
1272 [AS_HELP_STRING([--with-max-height=N],
1273 [Maximum framebuffer height (4096)])],
1274 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1275 AS_IF([test "${withval}" -gt "4096"],
1276 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1277)
1278
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001279dnl
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001280dnl Gallium SVGA configuration
1281dnl
1282AC_ARG_ENABLE([gallium-svga],
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001283 [AS_HELP_STRING([--enable-gallium-svga],
1284 [build gallium SVGA @<:@default=disabled@:>@])],
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001285 [enable_gallium_svga="$enableval"],
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001286 [enable_gallium_svga=auto])
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001287if test "x$enable_gallium_svga" = xyes; then
1288 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
1289 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001290elif test "x$enable_gallium_svga" = xauto; then
1291 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001292fi
1293
1294dnl
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001295dnl Gallium Intel configuration
1296dnl
1297AC_ARG_ENABLE([gallium-intel],
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001298 [AS_HELP_STRING([--enable-gallium-intel],
1299 [build gallium intel @<:@default=disabled@:>@])],
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001300 [enable_gallium_intel="$enableval"],
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001301 [enable_gallium_intel=auto])
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001302if test "x$enable_gallium_intel" = xyes; then
Jakob Bornecrantzce4f23a2009-11-04 23:02:13 +00001303 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel i965"
1304 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001305elif test "x$enable_gallium_intel" = xauto; then
Keith Whitwellaa026832009-12-22 09:40:39 +00001306 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001307fi
1308
1309dnl
1310dnl Gallium Radeon configuration
1311dnl
1312AC_ARG_ENABLE([gallium-radeon],
1313 [AS_HELP_STRING([--enable-gallium-radeon],
1314 [build gallium radeon @<:@default=disabled@:>@])],
1315 [enable_gallium_radeon="$enableval"],
Jakob Bornecrantz877cadb2010-01-14 22:51:25 +00001316 [enable_gallium_radeon=auto])
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001317if test "x$enable_gallium_radeon" = xyes; then
1318 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00001319 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Jakob Bornecrantz877cadb2010-01-14 22:51:25 +00001320elif test "x$enable_gallium_radeon" = xauto; then
1321 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001322fi
1323
1324dnl
Thierry Vignaud1402ea82009-09-14 11:48:51 -06001325dnl Gallium Nouveau configuration
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001326dnl
1327AC_ARG_ENABLE([gallium-nouveau],
1328 [AS_HELP_STRING([--enable-gallium-nouveau],
1329 [build gallium nouveau @<:@default=disabled@:>@])],
1330 [enable_gallium_nouveau="$enableval"],
1331 [enable_gallium_nouveau=no])
1332if test "x$enable_gallium_nouveau" = xyes; then
1333 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
Francisco Jerez5b6b67e2010-02-04 22:15:22 +01001334 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv40 nv50"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001335fi
1336
Chia-I Wua1306f42010-01-22 15:51:51 +08001337dnl
1338dnl Gallium swrast configuration
1339dnl
1340AC_ARG_ENABLE([gallium-swrast],
1341 [AS_HELP_STRING([--enable-gallium-swrast],
1342 [build gallium swrast @<:@default=disabled@:>@])],
1343 [enable_gallium_swrast="$enableval"],
1344 [enable_gallium_swrast=auto])
1345if test "x$enable_gallium_swrast" = xyes; then
1346 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS swrast"
1347fi
1348
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001349dnl prepend CORE_DIRS to SRC_DIRS
1350SRC_DIRS="$CORE_DIRS $SRC_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001351
Dan Nicholsondca1b792007-10-23 09:25:58 -07001352dnl Restore LDFLAGS and CPPFLAGS
1353LDFLAGS="$_SAVE_LDFLAGS"
1354CPPFLAGS="$_SAVE_CPPFLAGS"
1355
1356dnl Substitute the config
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -08001357AC_CONFIG_FILES([configs/autoconf])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001358
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001359dnl Replace the configs/current symlink
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001360AC_CONFIG_COMMANDS([configs],[
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001361if test -f configs/current || test -L configs/current; then
1362 rm -f configs/current
1363fi
1364ln -s autoconf configs/current
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001365])
1366
1367AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001368
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001369dnl
1370dnl Output some configuration info for the user
1371dnl
1372echo ""
1373echo " prefix: $prefix"
1374echo " exec_prefix: $exec_prefix"
1375echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07001376echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001377
1378dnl Driver info
1379echo ""
1380echo " Driver: $mesa_driver"
Dan Nicholson544ab202007-12-30 08:41:53 -08001381if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
1382 echo " OSMesa: lib$OSMESA_LIB"
1383else
1384 echo " OSMesa: no"
1385fi
1386if test "$mesa_driver" = dri; then
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001387 # cleanup the drivers var
1388 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001389if test "x$DRI_DIRS" = x; then
1390 echo " DRI drivers: no"
1391else
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001392 echo " DRI drivers: $dri_dirs"
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001393fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001394 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08001395fi
RALOVICH, Kristóf5f19f5c2008-11-04 11:53:32 +01001396echo " Use XCB: $enable_xcb"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001397
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001398echo ""
1399if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
1400 echo " Gallium: yes"
1401 echo " Gallium dirs: $GALLIUM_DIRS"
1402 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001403 echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00001404 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001405 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
1406else
1407 echo " Gallium: no"
1408fi
1409
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001410dnl Libraries
1411echo ""
1412echo " Shared libs: $enable_shared"
1413echo " Static libs: $enable_static"
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001414if test "$enable_egl" = yes; then
1415 echo " EGL: $EGL_DRIVERS_DIRS"
1416else
1417 echo " EGL: no"
1418fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001419echo " GLU: $enable_glu"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001420echo " GLw: $enable_glw (Motif: $enable_motif)"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001421echo " glut: $enable_glut"
1422
1423dnl Programs
1424# cleanup the programs var for display
1425program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1426if test "x$program_dirs" = x; then
1427 echo " Demos: no"
1428else
1429 echo " Demos: $program_dirs"
1430fi
1431
Dan Nicholson16a07fb2007-12-12 09:12:15 -08001432dnl Compiler options
1433# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
1434cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1435 $SED 's/^ *//;s/ */ /;s/ *$//'`
1436cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1437 $SED 's/^ *//;s/ */ /;s/ *$//'`
1438defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1439echo ""
1440echo " CFLAGS: $cflags"
1441echo " CXXFLAGS: $cxxflags"
1442echo " Macros: $defines"
1443
Dan Nicholsondca1b792007-10-23 09:25:58 -07001444echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07001445echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001446echo ""