blob: b6c6535fc6e547bcc3f7adbce9707247aa779529 [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
Jesse Barnesa35f6bb2009-07-17 03:30:29 -040023DRI2PROTO_REQUIRED=2.2
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 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -070095esac
96
97dnl Add flags for gcc and g++
98if test "x$GCC" = xyes; then
Alan Coopersmithadda7f32010-01-16 18:34:23 -080099 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
100
101 # Enable -fvisibility=hidden if using a gcc that supports it
102 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800103 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800104 CFLAGS="$CFLAGS -fvisibility=hidden"
105 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
106 [CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
Dan Nicholson0c275b62008-01-15 22:52:25 -0800107
108 # Work around aliasing bugs - developers should comment this out
109 CFLAGS="$CFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700110fi
111if test "x$GXX" = xyes; then
112 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800113
114 # Work around aliasing bugs - developers should comment this out
115 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700116fi
117
118dnl These should be unnecessary, but let the user set them if they want
Dan Nicholson297e16c2008-05-05 15:42:53 -0700119AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700120 Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700121AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
Dan Nicholsondca1b792007-10-23 09:25:58 -0700122 compiler. Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700123AC_SUBST([OPT_FLAGS])
124AC_SUBST([ARCH_FLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700125
126dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600127dnl Hacks to enable 32 or 64 bit build
128dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700129AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600130 [AS_HELP_STRING([--enable-32-bit],
131 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700132 [enable_32bit="$enableval"],
133 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600134)
135if test "x$enable_32bit" = xyes; then
136 if test "x$GCC" = xyes; then
137 CFLAGS="$CFLAGS -m32"
Marc Dietrichc705e722009-08-31 08:56:33 -0700138 ARCH_FLAGS="$ARCH_FLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600139 fi
140 if test "x$GXX" = xyes; then
141 CXXFLAGS="$CXXFLAGS -m32"
142 fi
143fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700144AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600145 [AS_HELP_STRING([--enable-64-bit],
146 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700147 [enable_64bit="$enableval"],
148 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600149)
150if test "x$enable_64bit" = xyes; then
151 if test "x$GCC" = xyes; then
152 CFLAGS="$CFLAGS -m64"
153 fi
154 if test "x$GXX" = xyes; then
155 CXXFLAGS="$CXXFLAGS -m64"
156 fi
157fi
158
159dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800160dnl shared/static libraries, mimic libtool options
161dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700162AC_ARG_ENABLE([static],
Dan Nicholson88586332007-11-15 08:59:57 -0800163 [AS_HELP_STRING([--enable-static],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800164 [build static libraries @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700165 [enable_static="$enableval"],
166 [enable_static=no]
Dan Nicholson88586332007-11-15 08:59:57 -0800167)
168case "x$enable_static" in
169xyes|xno ) ;;
170x ) enable_static=no ;;
171* )
172 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
173 ;;
174esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700175AC_ARG_ENABLE([shared],
Dan Nicholson88586332007-11-15 08:59:57 -0800176 [AS_HELP_STRING([--disable-shared],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800177 [build shared libraries @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700178 [enable_shared="$enableval"],
179 [enable_shared=yes]
Dan Nicholson88586332007-11-15 08:59:57 -0800180)
181case "x$enable_shared" in
182xyes|xno ) ;;
183x ) enable_shared=yes ;;
184* )
185 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
186 ;;
187esac
188
189dnl Can't have static and shared libraries, default to static if user
190dnl explicitly requested. If both disabled, set to static since shared
191dnl was explicitly requirested.
192case "x$enable_static$enable_shared" in
193xyesyes )
194 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
195 enable_shared=no
196 ;;
197xnono )
198 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
199 enable_static=yes
200 ;;
201esac
202
203dnl
204dnl mklib options
205dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700206AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
Dan Nicholson88586332007-11-15 08:59:57 -0800207if test "$enable_static" = yes; then
208 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
209fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700210AC_SUBST([MKLIB_OPTIONS])
Dan Nicholson88586332007-11-15 08:59:57 -0800211
Dan Nicholson23656c42007-12-12 09:02:31 -0800212dnl
213dnl other compiler options
214dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700215AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800216 [AS_HELP_STRING([--enable-debug],
217 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700218 [enable_debug="$enableval"],
219 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800220)
221if test "x$enable_debug" = xyes; then
222 DEFINES="$DEFINES -DDEBUG"
223 if test "x$GCC" = xyes; then
224 CFLAGS="$CFLAGS -g"
225 fi
226 if test "x$GXX" = xyes; then
227 CXXFLAGS="$CXXFLAGS -g"
228 fi
229fi
Dan Nicholson88586332007-11-15 08:59:57 -0800230
231dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700232dnl library names
233dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800234if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800235 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800236else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700237 case "$host_os" in
238 darwin* )
239 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100240 cygwin* )
241 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700242 aix* )
243 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700244 * )
245 LIB_EXTENSION='so' ;;
246 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800247fi
Dan Nicholson8217f242009-02-11 15:16:00 -0800248
249GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
250GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
251GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
252GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
253OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800254EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800255
256GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
257GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
258GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
259GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
260OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800261EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800262
Dan Nicholson297e16c2008-05-05 15:42:53 -0700263AC_SUBST([GL_LIB_NAME])
264AC_SUBST([GLU_LIB_NAME])
265AC_SUBST([GLUT_LIB_NAME])
266AC_SUBST([GLW_LIB_NAME])
267AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800268AC_SUBST([EGL_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700269
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700270AC_SUBST([GL_LIB_GLOB])
271AC_SUBST([GLU_LIB_GLOB])
272AC_SUBST([GLUT_LIB_GLOB])
273AC_SUBST([GLW_LIB_GLOB])
274AC_SUBST([OSMESA_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800275AC_SUBST([EGL_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700276
Dan Nicholsondca1b792007-10-23 09:25:58 -0700277dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700278dnl Arch/platform-specific settings
279dnl
280AC_ARG_ENABLE([asm],
281 [AS_HELP_STRING([--disable-asm],
282 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
283 [enable_asm="$enableval"],
284 [enable_asm=yes]
285)
286asm_arch=""
287ASM_FLAGS=""
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800288MESA_ASM_SOURCES=""
289GLAPI_ASM_SOURCES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700290AC_MSG_CHECKING([whether to enable assembly])
291test "x$enable_asm" = xno && AC_MSG_RESULT([no])
292# disable if cross compiling on x86/x86_64 since we must run gen_matypes
293if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
294 case "$host_cpu" in
295 i?86 | x86_64)
296 enable_asm=no
297 AC_MSG_RESULT([no, cross compiling])
298 ;;
299 esac
300fi
301# check for supported arches
302if test "x$enable_asm" = xyes; then
303 case "$host_cpu" in
304 i?86)
305 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100306 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700307 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
308 ;;
309 esac
310 ;;
311 x86_64)
312 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100313 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700314 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
315 ;;
316 esac
317 ;;
318 powerpc)
319 case "$host_os" in
320 linux*)
321 asm_arch=ppc
322 ;;
323 esac
324 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800325 sparc*)
326 case "$host_os" in
327 linux*)
328 asm_arch=sparc
329 ;;
330 esac
331 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700332 esac
333
334 case "$asm_arch" in
335 x86)
Dan Nicholson61e925f2009-02-11 10:42:34 -0800336 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800337 MESA_ASM_SOURCES='$(X86_SOURCES)'
338 GLAPI_ASM_SOURCES='$(X86_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700339 AC_MSG_RESULT([yes, x86])
340 ;;
341 x86_64)
342 ASM_FLAGS="-DUSE_X86_64_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800343 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
344 GLAPI_ASM_SOURCES='$(X86-64_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700345 AC_MSG_RESULT([yes, x86_64])
346 ;;
347 ppc)
348 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800349 MESA_ASM_SOURCES='$(PPC_SOURCES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700350 AC_MSG_RESULT([yes, ppc])
351 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800352 sparc)
353 ASM_FLAGS="-DUSE_SPARC_ASM"
354 MESA_ASM_SOURCES='$(SPARC_SOURCES)'
355 GLAPI_ASM_SOURCES='$(SPARC_API)'
356 AC_MSG_RESULT([yes, sparc])
357 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700358 *)
359 AC_MSG_RESULT([no, platform not supported])
360 ;;
361 esac
362fi
363AC_SUBST([ASM_FLAGS])
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800364AC_SUBST([MESA_ASM_SOURCES])
365AC_SUBST([GLAPI_ASM_SOURCES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700366
367dnl PIC code macro
368MESA_PIC_FLAGS
369
370dnl Check to see if dlopen is in default libraries (like Solaris, which
371dnl has it in libc), or if libdl is needed to get it.
372AC_CHECK_FUNC([dlopen], [],
373 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
374
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700375dnl See if posix_memalign is available
376AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
377
Dan Nicholson871125a2008-06-04 13:00:35 -0700378dnl SELinux awareness.
379AC_ARG_ENABLE([selinux],
380 [AS_HELP_STRING([--enable-selinux],
381 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
382 [MESA_SELINUX="$enableval"],
383 [MESA_SELINUX=no])
384if test "x$enable_selinux" = "xyes"; then
385 AC_CHECK_HEADER([selinux/selinux.h],[],
386 [AC_MSG_ERROR([SELinux headers not found])])
387 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
388 [AC_MSG_ERROR([SELinux library not found])])
389 SELINUX_LIBS="-lselinux"
390 DEFINES="$DEFINES -DMESA_SELINUX"
391fi
392
Dan Nicholson871125a2008-06-04 13:00:35 -0700393dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800394dnl Driver configuration. Options are xlib, dri and osmesa right now.
Dan Nicholson979ff512007-12-05 18:47:01 -0800395dnl More later: directfb, fbdev, ...
Dan Nicholson44d99142007-12-05 18:47:01 -0800396dnl
Eric Anholt711222b2008-04-18 15:03:01 -0700397default_driver="xlib"
398
399case "$host_os" in
400linux*)
401 case "$host_cpu" in
David S. Miller32dc28a2009-02-24 20:06:05 -0700402 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
Eric Anholt711222b2008-04-18 15:03:01 -0700403 esac
404 ;;
Julien Cristau98fcdf32008-10-28 18:56:05 +0100405*freebsd* | dragonfly*)
Eric Anholt711222b2008-04-18 15:03:01 -0700406 case "$host_cpu" in
Robert Noland48f05432009-04-10 11:41:27 -0500407 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
Eric Anholt711222b2008-04-18 15:03:01 -0700408 esac
409 ;;
410esac
411
Dan Nicholson297e16c2008-05-05 15:42:53 -0700412AC_ARG_WITH([driver],
Dan Nicholson44d99142007-12-05 18:47:01 -0800413 [AS_HELP_STRING([--with-driver=DRIVER],
Eric Anholt711222b2008-04-18 15:03:01 -0700414 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700415 [mesa_driver="$withval"],
416 [mesa_driver="$default_driver"])
Dan Nicholson44d99142007-12-05 18:47:01 -0800417dnl Check for valid option
418case "x$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800419xxlib|xdri|xosmesa)
Dan Nicholson44d99142007-12-05 18:47:01 -0800420 ;;
421*)
422 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
423 ;;
424esac
425
426dnl
427dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700428dnl
Chia-I Wu99a37ed2010-01-05 17:39:05 +0800429
430dnl this variable will be prepended to SRC_DIRS and is not exported
431CORE_DIRS="glsl mesa"
432
433SRC_DIRS="glew"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700434GLU_DIRS="sgi"
Dan Nicholson44d99142007-12-05 18:47:01 -0800435WINDOW_SYSTEM=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100436GALLIUM_DIRS="auxiliary drivers state_trackers"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100437GALLIUM_WINSYS_DIRS=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100438GALLIUM_WINSYS_DRM_DIRS=""
Jakob Bornecrantzd60b2c62009-06-24 02:42:41 +0200439GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100440GALLIUM_STATE_TRACKERS_DIRS=""
441
Dan Nicholson44d99142007-12-05 18:47:01 -0800442case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800443xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800444 DRIVER_DIRS="x11"
Jakob Bornecrantz373e6712009-04-18 23:13:56 +0100445 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
Dan Nicholson44d99142007-12-05 18:47:01 -0800446 ;;
447dri)
Chia-I Wu14693172010-01-21 17:58:28 +0800448 SRC_DIRS="$SRC_DIRS glx/x11"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100449 DRIVER_DIRS="dri"
Dan Nicholson44d99142007-12-05 18:47:01 -0800450 WINDOW_SYSTEM="dri"
Jakob Bornecrantz373e6712009-04-18 23:13:56 +0100451 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800452 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800453osmesa)
454 DRIVER_DIRS="osmesa"
455 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800456esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700457AC_SUBST([SRC_DIRS])
458AC_SUBST([GLU_DIRS])
459AC_SUBST([DRIVER_DIRS])
460AC_SUBST([WINDOW_SYSTEM])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100461AC_SUBST([GALLIUM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100462AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100463AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +0000464AC_SUBST([GALLIUM_DRIVERS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100465AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700466
467dnl
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800468dnl User supplied program configuration
469dnl
470if test -d "$srcdir/progs/demos"; then
471 default_demos=yes
472else
473 default_demos=no
474fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700475AC_ARG_WITH([demos],
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800476 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
477 [optional comma delimited demo directories to build
Dan Nicholsonc79c93c2007-12-12 18:13:04 -0800478 @<:@default=auto if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700479 [with_demos="$withval"],
480 [with_demos="$default_demos"])
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800481if test "x$with_demos" = x; then
482 with_demos=no
483fi
484
485dnl If $with_demos is yes, directories will be added as libs available
486PROGRAM_DIRS=""
487case "$with_demos" in
Dan Nicholsonb9576552008-03-10 14:05:46 -0700488no) ;;
489yes)
490 # If the driver isn't osmesa, we have libGL and can build xdemos
491 if test "$mesa_driver" != osmesa; then
492 PROGRAM_DIRS="xdemos"
493 fi
494 ;;
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800495*)
496 # verify the requested demos directories exist
497 demos=`IFS=,; echo $with_demos`
498 for demo in $demos; do
499 test -d "$srcdir/progs/$demo" || \
500 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
501 done
502 PROGRAM_DIRS="$demos"
503 ;;
504esac
505
506dnl
Dan Nicholsone6a06092008-05-05 15:16:22 -0700507dnl Find out if X is available. The variable have_x is set if libX11 is
Dan Nicholson99803a42008-07-01 09:03:15 -0700508dnl found to mimic AC_PATH_XTRA.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700509dnl
510if test -n "$PKG_CONFIG"; then
511 AC_MSG_CHECKING([pkg-config files for X11 are available])
Dan Nicholsone6a06092008-05-05 15:16:22 -0700512 PKG_CHECK_EXISTS([x11],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700513 x11_pkgconfig=yes
514 have_x=yes
Dan Nicholsone6a06092008-05-05 15:16:22 -0700515 ],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700516 x11_pkgconfig=no
Dan Nicholsone6a06092008-05-05 15:16:22 -0700517 ])
518 AC_MSG_RESULT([$x11_pkgconfig])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700519else
520 x11_pkgconfig=no
521fi
522dnl Use the autoconf macro if no pkg-config files
523if test "$x11_pkgconfig" = no; then
524 AC_PATH_XTRA
525fi
526
Dan Nicholson99803a42008-07-01 09:03:15 -0700527dnl Try to tell the user that the --x-* options are only used when
528dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
529m4_divert_once([HELP_BEGIN],
530[These options are only used when the X libraries cannot be found by the
531pkg-config utility.])
532
Dan Nicholson44d99142007-12-05 18:47:01 -0800533dnl We need X for xlib and dri, so bomb now if it's not found
534case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800535xlib|dri)
Dan Nicholson44d99142007-12-05 18:47:01 -0800536 if test "$no_x" = yes; then
537 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
538 fi
539 ;;
540esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700541
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700542dnl XCB - this is only used for GLX right now
543AC_ARG_ENABLE([xcb],
544 [AS_HELP_STRING([--enable-xcb],
545 [use XCB for GLX @<:@default=disabled@:>@])],
546 [enable_xcb="$enableval"],
547 [enable_xcb=no])
548if test "x$enable_xcb" = xyes; then
549 DEFINES="$DEFINES -DUSE_XCB"
550else
551 enable_xcb=no
552fi
553
Dan Nicholson44d99142007-12-05 18:47:01 -0800554dnl
555dnl libGL configuration per driver
556dnl
557case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800558xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800559 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700560 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800561 GL_PC_REQ_PRIV="x11 xext"
Dan Nicholsona1307182007-12-12 17:49:49 -0800562 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
563 GL_LIB_DEPS="$XLIBGL_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800564 else
565 # should check these...
566 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
567 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800568 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
569 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson44d99142007-12-05 18:47:01 -0800570 fi
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700571 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
572 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
Dan Nicholson88586332007-11-15 08:59:57 -0800573
574 # if static, move the external libraries to the programs
575 # and empty the libraries for libGL
576 if test "$enable_static" = yes; then
577 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
578 GL_LIB_DEPS=""
579 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800580 ;;
581dri)
Dan Nicholson88586332007-11-15 08:59:57 -0800582 # DRI must be shared, I think
583 if test "$enable_static" = yes; then
584 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
585 fi
586
Dan Nicholson44d99142007-12-05 18:47:01 -0800587 # Check for libdrm
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -0700588 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
589 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500590 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Jesse Barnesed59b132010-01-13 15:48:14 -0500591 GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
592 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Dan Nicholson44d99142007-12-05 18:47:01 -0800593
594 # find the DRI deps for libGL
595 if test "$x11_pkgconfig" = yes; then
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700596 # add xcb modules if necessary
597 dri_modules="x11 xext xxf86vm xdamage xfixes"
598 if test "$enable_xcb" = yes; then
599 dri_modules="$dri_modules x11-xcb xcb-glx"
600 fi
601
602 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800603 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
Dan Nicholson44d99142007-12-05 18:47:01 -0800604 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
605 GL_LIB_DEPS="$DRIGL_LIBS"
606 else
607 # should check these...
608 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
609 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800610 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
611 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700612
613 # XCB can only be used from pkg-config
614 if test "$enable_xcb" = yes; then
615 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800616 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700617 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
618 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
619 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800620 fi
621
622 # need DRM libs, -lpthread, etc.
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700623 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
624 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800625 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800626osmesa)
627 # No libGL for osmesa
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700628 GL_LIB_DEPS=""
Dan Nicholson979ff512007-12-05 18:47:01 -0800629 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800630esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700631AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800632AC_SUBST([GL_PC_REQ_PRIV])
633AC_SUBST([GL_PC_LIB_PRIV])
634AC_SUBST([GL_PC_CFLAGS])
635AC_SUBST([DRI_PC_REQ_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700636
637dnl
638dnl More X11 setup
639dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800640if test "$mesa_driver" = xlib; then
Dan Nicholsondca1b792007-10-23 09:25:58 -0700641 DEFINES="$DEFINES -DUSE_XSHM"
642fi
643
644dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800645dnl More DRI setup
646dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700647AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800648 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800649 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700650 [GLX_USE_TLS="$enableval"],
651 [GLX_USE_TLS=no])
Dan Nicholson44d99142007-12-05 18:47:01 -0800652dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700653AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800654 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700655 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700656 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700657 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700658AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800659dnl Extra search path for DRI drivers
660AC_ARG_WITH([dri-searchpath],
661 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
662 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
663 [DRI_DRIVER_SEARCH_DIR="$withval"],
664 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
665AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholson44d99142007-12-05 18:47:01 -0800666dnl Direct rendering or just indirect rendering
Dan Nicholson297e16c2008-05-05 15:42:53 -0700667AC_ARG_ENABLE([driglx-direct],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800668 [AS_HELP_STRING([--disable-driglx-direct],
669 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700670 [driglx_direct="$enableval"],
671 [driglx_direct="yes"])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800672dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700673AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800674 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700675 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200676 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700677 [with_dri_drivers="$withval"],
678 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800679if test "x$with_dri_drivers" = x; then
680 with_dri_drivers=no
681fi
682
683dnl If $with_dri_drivers is yes, directories will be added through
684dnl platform checks
685DRI_DIRS=""
686case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100687no) ;;
688yes)
689 DRI_DIRS="yes"
690 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800691*)
692 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700693 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800694 for driver in $dri_drivers; do
695 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
696 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
697 done
698 DRI_DIRS="$dri_drivers"
699 ;;
700esac
701
Dan Nicholson44d99142007-12-05 18:47:01 -0800702dnl Set DRI_DIRS, DEFINES and LIB_DEPS
703if test "$mesa_driver" = dri; then
704 # Use TLS in GLX?
705 if test "x$GLX_USE_TLS" = xyes; then
706 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
707 fi
708
Dan Nicholson44d99142007-12-05 18:47:01 -0800709 # Platform specific settings and drivers to build
710 case "$host_os" in
711 linux*)
712 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Dan Nicholson44d99142007-12-05 18:47:01 -0800713 if test "x$driglx_direct" = xyes; then
714 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
715 fi
Jerome Glisse14f79d42008-12-18 13:36:07 +0100716 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800717
718 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -0800719 x86_64)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800720 # ffb, gamma, and sis are missing because they have not be
721 # converted to use the new interface. i810 are missing
722 # because there is no x86-64 system where they could *ever*
723 # be used.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100724 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400725 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
George Sapountzis280bf892008-05-11 14:43:40 +0300726 savage tdfx unichrome swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800727 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800728 ;;
729 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800730 # Build only the drivers for cards that exist on PowerPC.
731 # At some point MGA will be added, but not yet.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100732 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400733 DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800734 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800735 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000736 sparc*)
737 # Build only the drivers for cards that exist on sparc`
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100738 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400739 DRI_DIRS="mach64 r128 r200 r300 r600 radeon ffb swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000740 fi
741 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800742 esac
743 ;;
Hasso Tepper9f8df2d2008-04-09 10:51:21 -0700744 freebsd* | dragonfly*)
Dan Nicholson44d99142007-12-05 18:47:01 -0800745 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
746 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
747 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
748 if test "x$driglx_direct" = xyes; then
749 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
750 fi
751 if test "x$GXX" = xyes; then
752 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
753 fi
754
Dan Nicholsona76e2452007-12-07 11:25:08 -0800755 # ffb and gamma are missing because they have not been converted
756 # to use the new interface.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100757 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400758 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
George Sapountzis280bf892008-05-11 14:43:40 +0300759 unichrome savage sis swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800760 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800761 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700762 gnu*)
763 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
764 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
765 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700766 solaris*)
767 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
768 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
769 if test "x$driglx_direct" = xyes; then
770 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
771 fi
772 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800773 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -0800774
775 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100776 if test "x$DRI_DIRS" = "xyes"; then
Corbin Simpson8e4657a2009-10-22 12:29:30 -0700777 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
Corbin Simpsonfd7ee2b2009-10-22 12:57:13 -0700778 savage sis tdfx unichrome ffb swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -0800779 fi
780
Dan Nicholson44d99142007-12-05 18:47:01 -0800781 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
782
783 # Check for expat
784 EXPAT_INCLUDES=""
785 EXPAT_LIB=-lexpat
Dan Nicholson297e16c2008-05-05 15:42:53 -0700786 AC_ARG_WITH([expat],
787 [AS_HELP_STRING([--with-expat=DIR],
788 [expat install directory])],[
Dan Nicholson44d99142007-12-05 18:47:01 -0800789 EXPAT_INCLUDES="-I$withval/include"
790 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
791 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
792 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
793 ])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700794 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
795 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
796 [AC_MSG_ERROR([Expat required for DRI.])])
Dan Nicholson44d99142007-12-05 18:47:01 -0800797
798 # put all the necessary libs together
Eric Anholt050c5332008-03-20 17:28:58 -0700799 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800800fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700801AC_SUBST([DRI_DIRS])
802AC_SUBST([EXPAT_INCLUDES])
803AC_SUBST([DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -0800804
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500805case $DRI_DIRS in
806*i915*|*i965*)
807 PKG_CHECK_MODULES([INTEL], [libdrm_intel])
808 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -0500809esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500810
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -0500811case $DRI_DIRS in
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500812*radeon*|*r200*|*r300*|*r600*)
813 PKG_CHECK_MODULES([LIBDRM_RADEON],
814 [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
815 HAVE_LIBDRM_RADEON=yes,
816 HAVE_LIBDRM_RADEON=no)
817
818 if test "$HAVE_LIBDRM_RADEON" = yes; then
819 RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
820 RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
821 fi
822 ;;
823esac
824AC_SUBST([RADEON_CFLAGS])
825AC_SUBST([RADEON_LDFLAGS])
826
827
Dan Nicholson44d99142007-12-05 18:47:01 -0800828dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700829dnl OSMesa configuration
830dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800831if test "$mesa_driver" = xlib; then
Dan Nicholson544ab202007-12-30 08:41:53 -0800832 default_gl_osmesa=yes
Dan Nicholson979ff512007-12-05 18:47:01 -0800833else
Dan Nicholson544ab202007-12-30 08:41:53 -0800834 default_gl_osmesa=no
Dan Nicholson44d99142007-12-05 18:47:01 -0800835fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700836AC_ARG_ENABLE([gl-osmesa],
Dan Nicholson544ab202007-12-30 08:41:53 -0800837 [AS_HELP_STRING([--enable-gl-osmesa],
838 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700839 [gl_osmesa="$enableval"],
840 [gl_osmesa="$default_gl_osmesa"])
Dan Nicholson544ab202007-12-30 08:41:53 -0800841if test "x$gl_osmesa" = xyes; then
842 if test "$mesa_driver" = osmesa; then
843 AC_MSG_ERROR([libGL is not available for OSMesa driver])
Dan Nicholson979ff512007-12-05 18:47:01 -0800844 else
Dan Nicholson544ab202007-12-30 08:41:53 -0800845 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Dan Nicholson979ff512007-12-05 18:47:01 -0800846 fi
847fi
848
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800849dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -0700850AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800851 [AS_HELP_STRING([--with-osmesa-bits=BITS],
852 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700853 [osmesa_bits="$withval"],
854 [osmesa_bits=8])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800855if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
856 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
857 osmesa_bits=8
858fi
859case "x$osmesa_bits" in
860x8)
861 OSMESA_LIB=OSMesa
862 ;;
863x16|x32)
864 OSMESA_LIB="OSMesa$osmesa_bits"
865 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
866 ;;
867*)
868 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
869 ;;
870esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700871AC_SUBST([OSMESA_LIB])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800872
Dan Nicholson979ff512007-12-05 18:47:01 -0800873case "$mesa_driver" in
874osmesa)
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700875 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800876 if test "$enable_static" = no; then
Dan Nicholson4795dd52009-06-04 19:42:08 -0700877 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800878 else
879 OSMESA_LIB_DEPS=""
880 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800881 OSMESA_MESA_DEPS=""
Dan Nicholson4795dd52009-06-04 19:42:08 -0700882 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800883 ;;
884*)
885 # Link OSMesa to libGL otherwise
886 OSMESA_LIB_DEPS=""
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700887 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800888 if test "$enable_static" = no; then
889 OSMESA_MESA_DEPS='-l$(GL_LIB)'
890 else
891 OSMESA_MESA_DEPS=""
892 fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800893 OSMESA_PC_REQ="gl"
Dan Nicholson979ff512007-12-05 18:47:01 -0800894 ;;
895esac
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700896OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700897AC_SUBST([OSMESA_LIB_DEPS])
898AC_SUBST([OSMESA_MESA_DEPS])
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800899AC_SUBST([OSMESA_PC_REQ])
900AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700901
902dnl
Dan Nicholson53b37342009-02-25 17:45:34 -0800903dnl EGL configuration
904dnl
Dan Nicholson66f97862009-04-29 12:11:43 -0700905AC_ARG_ENABLE([egl],
906 [AS_HELP_STRING([--disable-egl],
907 [disable EGL library @<:@default=enabled@:>@])],
908 [enable_egl="$enableval"],
909 [enable_egl=yes])
910if test "x$enable_egl" = xyes; then
911 SRC_DIRS="$SRC_DIRS egl"
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800912 EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
913 EGL_DRIVERS_DIRS=""
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800914 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800915 # build egl_glx when libGL is built
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800916 if test "$mesa_driver" != osmesa; then
917 EGL_DRIVERS_DIRS="glx"
918 fi
919
920 # build egl_dri2 when xcb-dri2 is available
Kristian Høgsberg077bc2f2010-02-05 13:55:32 -0500921 PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm],
922 [have_xcb_dri2=yes],[have_xcb_dri2=no])
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800923 if test "$have_xcb_dri2" = yes; then
924 EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
925 fi
Kristian Høgsberg42fa0092010-02-03 10:18:28 -0500926 fi
Dan Nicholson53b37342009-02-25 17:45:34 -0800927fi
Dan Nicholson53b37342009-02-25 17:45:34 -0800928AC_SUBST([EGL_LIB_DEPS])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800929AC_SUBST([EGL_DRIVERS_DIRS])
Dan Nicholson53b37342009-02-25 17:45:34 -0800930
931dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700932dnl GLU configuration
933dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700934AC_ARG_ENABLE([glu],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800935 [AS_HELP_STRING([--disable-glu],
936 [enable OpenGL Utility library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700937 [enable_glu="$enableval"],
938 [enable_glu=yes])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700939if test "x$enable_glu" = xyes; then
940 SRC_DIRS="$SRC_DIRS glu"
941
Dan Nicholson979ff512007-12-05 18:47:01 -0800942 case "$mesa_driver" in
943 osmesa)
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800944 # If GLU is available and we have libOSMesa (not 16 or 32),
945 # we can build the osdemos
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800946 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800947 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
948 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700949
Dan Nicholson979ff512007-12-05 18:47:01 -0800950 # Link libGLU to libOSMesa instead of libGL
951 GLU_LIB_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800952 GLU_PC_REQ="osmesa"
Dan Nicholson88586332007-11-15 08:59:57 -0800953 if test "$enable_static" = no; then
954 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
955 else
956 GLU_MESA_DEPS=""
957 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800958 ;;
959 *)
Dan Nicholson88586332007-11-15 08:59:57 -0800960 # If static, empty GLU_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800961 GLU_PC_REQ="gl"
962 GLU_PC_LIB_PRIV="-lm"
Dan Nicholson88586332007-11-15 08:59:57 -0800963 if test "$enable_static" = no; then
964 GLU_LIB_DEPS="-lm"
965 GLU_MESA_DEPS='-l$(GL_LIB)'
966 else
967 GLU_LIB_DEPS=""
968 GLU_MESA_DEPS=""
969 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
970 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800971 ;;
972 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700973fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700974if test "$enable_static" = no; then
975 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
976fi
Dan Nicholson71e208b2008-11-24 11:01:57 -0800977GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700978AC_SUBST([GLU_LIB_DEPS])
979AC_SUBST([GLU_MESA_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800980AC_SUBST([GLU_PC_REQ])
981AC_SUBST([GLU_PC_REQ_PRIV])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800982AC_SUBST([GLU_PC_LIB_PRIV])
983AC_SUBST([GLU_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700984
985dnl
986dnl GLw configuration
987dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700988AC_ARG_ENABLE([glw],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800989 [AS_HELP_STRING([--disable-glw],
990 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700991 [enable_glw="$enableval"],
992 [enable_glw=yes])
Dan Nicholson979ff512007-12-05 18:47:01 -0800993dnl Don't build GLw on osmesa
994if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
995 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
996 enable_glw=no
997fi
Dan Nicholson776c60d2008-07-18 07:40:41 -0700998AC_ARG_ENABLE([motif],
999 [AS_HELP_STRING([--enable-motif],
1000 [use Motif widgets in GLw @<:@default=disabled@:>@])],
1001 [enable_motif="$enableval"],
1002 [enable_motif=no])
1003
Dan Nicholsondca1b792007-10-23 09:25:58 -07001004if test "x$enable_glw" = xyes; then
1005 SRC_DIRS="$SRC_DIRS glw"
1006 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001007 PKG_CHECK_MODULES([GLW],[x11 xt])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001008 GLW_PC_REQ_PRIV="x11 xt"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001009 GLW_LIB_DEPS="$GLW_LIBS"
1010 else
1011 # should check these...
Dan Nicholson776c60d2008-07-18 07:40:41 -07001012 GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001013 GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
1014 GLW_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001015 fi
1016
1017 GLW_SOURCES="GLwDrawA.c"
1018 MOTIF_CFLAGS=
1019 if test "x$enable_motif" = xyes; then
1020 GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
1021 AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
1022 if test "x$MOTIF_CONFIG" != xno; then
1023 MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
1024 MOTIF_LIBS=`$MOTIF_CONFIG --libs`
1025 else
1026 AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
1027 [AC_MSG_ERROR([Can't locate Motif headers])])
1028 AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
1029 [AC_MSG_ERROR([Can't locate Motif Xm library])])
1030 fi
1031 # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
1032 GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001033 GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
1034 GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001035 fi
1036
Dan Nicholson88586332007-11-15 08:59:57 -08001037 # If static, empty GLW_LIB_DEPS and add libs for programs to link
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001038 GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
Dan Nicholson88586332007-11-15 08:59:57 -08001039 if test "$enable_static" = no; then
1040 GLW_MESA_DEPS='-l$(GL_LIB)'
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001041 GLW_LIB_DEPS="$GLW_LIB_DEPS"
Dan Nicholson88586332007-11-15 08:59:57 -08001042 else
1043 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
1044 GLW_LIB_DEPS=""
1045 GLW_MESA_DEPS=""
1046 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001047fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001048AC_SUBST([GLW_LIB_DEPS])
1049AC_SUBST([GLW_MESA_DEPS])
Dan Nicholson776c60d2008-07-18 07:40:41 -07001050AC_SUBST([GLW_SOURCES])
1051AC_SUBST([MOTIF_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001052AC_SUBST([GLW_PC_REQ_PRIV])
1053AC_SUBST([GLW_PC_LIB_PRIV])
1054AC_SUBST([GLW_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001055
1056dnl
1057dnl GLUT configuration
1058dnl
1059if test -f "$srcdir/include/GL/glut.h"; then
1060 default_glut=yes
1061else
1062 default_glut=no
1063fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001064AC_ARG_ENABLE([glut],
Dan Nicholson79ad4582007-12-07 19:11:01 -08001065 [AS_HELP_STRING([--disable-glut],
1066 [enable GLUT library @<:@default=enabled if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001067 [enable_glut="$enableval"],
1068 [enable_glut="$default_glut"])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001069
1070dnl Can't build glut if GLU not available
1071if test "x$enable_glu$enable_glut" = xnoyes; then
1072 AC_MSG_WARN([Disabling glut since GLU is disabled])
1073 enable_glut=no
1074fi
Dan Nicholson979ff512007-12-05 18:47:01 -08001075dnl Don't build glut on osmesa
1076if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
1077 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
1078 enable_glut=no
1079fi
1080
Dan Nicholsondca1b792007-10-23 09:25:58 -07001081if test "x$enable_glut" = xyes; then
1082 SRC_DIRS="$SRC_DIRS glut/glx"
1083 GLUT_CFLAGS=""
1084 if test "x$GCC" = xyes; then
1085 GLUT_CFLAGS="-fexceptions"
1086 fi
1087 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001088 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001089 GLUT_PC_REQ_PRIV="x11 xmu xi"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001090 GLUT_LIB_DEPS="$GLUT_LIBS"
1091 else
1092 # should check these...
Dan Nicholson70d0c832007-12-07 11:12:20 -08001093 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001094 GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
1095 GLUT_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001096 fi
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001097 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
1098 GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001099
1100 # If glut is available, we can build most programs
Dan Nicholson8e4d1472007-11-15 08:59:57 -08001101 if test "$with_demos" = yes; then
1102 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
1103 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001104
Dan Nicholson88586332007-11-15 08:59:57 -08001105 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
1106 if test "$enable_static" = no; then
1107 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
1108 else
1109 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
1110 GLUT_LIB_DEPS=""
1111 GLUT_MESA_DEPS=""
1112 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001113fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001114AC_SUBST([GLUT_LIB_DEPS])
1115AC_SUBST([GLUT_MESA_DEPS])
1116AC_SUBST([GLUT_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001117AC_SUBST([GLUT_PC_REQ_PRIV])
1118AC_SUBST([GLUT_PC_LIB_PRIV])
1119AC_SUBST([GLUT_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001120
1121dnl
1122dnl Program library dependencies
1123dnl Only libm is added here if necessary as the libraries should
1124dnl be pulled in by the linker
1125dnl
1126if test "x$APP_LIB_DEPS" = x; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001127 case "$host_os" in
1128 solaris*)
1129 APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
1130 ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +01001131 cygwin*)
1132 APP_LIB_DEPS="-lX11"
1133 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001134 *)
1135 APP_LIB_DEPS="-lm"
1136 ;;
1137 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -07001138fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001139AC_SUBST([APP_LIB_DEPS])
1140AC_SUBST([PROGRAM_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001141
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001142dnl
1143dnl Gallium configuration
1144dnl
1145AC_ARG_ENABLE([gallium],
1146 [AS_HELP_STRING([--disable-gallium],
1147 [build gallium @<:@default=enabled@:>@])],
1148 [enable_gallium="$enableval"],
1149 [enable_gallium=yes])
1150if test "x$enable_gallium" = xyes; then
1151 SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
1152fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001153
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001154dnl
1155dnl Gallium state trackers configuration
1156dnl
1157AC_ARG_WITH([state-trackers],
1158 [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
1159 [comma delimited state_trackers list, e.g.
1160 "egl,glx" @<:@default=auto@:>@])],
1161 [with_state_trackers="$withval"],
1162 [with_state_trackers=yes])
1163
1164case "$with_state_trackers" in
1165no)
1166 GALLIUM_STATE_TRACKERS_DIRS=""
1167 ;;
1168yes)
1169 # look at what else is built
1170 case "$mesa_driver" in
Jakob Bornecrantz373e6712009-04-18 23:13:56 +01001171 xlib)
1172 GALLIUM_STATE_TRACKERS_DIRS=glx
1173 ;;
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001174 dri)
Jakob Bornecrantzbc0532b2009-12-04 18:50:29 +00001175 GALLIUM_STATE_TRACKERS_DIRS="dri"
1176 if test "x$enable_egl" = xyes; then
Chia-I Wu3c967a92010-01-22 16:31:43 +08001177 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
Jakob Bornecrantzbc0532b2009-12-04 18:50:29 +00001178 fi
1179 # Have only tested st/xorg on 1.6.0 servers
1180 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
1181 HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
1182 HAVE_XORG="no")
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001183 ;;
1184 esac
1185 ;;
1186*)
1187 # verify the requested state tracker exist
1188 state_trackers=`IFS=', '; echo $with_state_trackers`
1189 for tracker in $state_trackers; do
1190 test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
1191 AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
Dan Nicholson66f97862009-04-29 12:11:43 -07001192
Chia-I Wue5d351d2009-12-23 11:18:00 +08001193 case "$tracker" in
Chia-I Wu3c967a92010-01-22 16:31:43 +08001194 egl)
Chia-I Wue5d351d2009-12-23 11:18:00 +08001195 if test "x$enable_egl" != xyes; then
Chia-I Wu3c967a92010-01-22 16:31:43 +08001196 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
Chia-I Wue5d351d2009-12-23 11:18:00 +08001197 fi
1198 ;;
1199 xorg)
Dave Airliee9d6ab72009-09-21 13:26:48 +10001200 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
Jakob Bornecrantz5c4bdbd2009-10-15 01:24:53 +01001201 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
Dave Airliee9d6ab72009-09-21 13:26:48 +10001202 HAVE_XEXTPROTO_71="no")
Chia-I Wue5d351d2009-12-23 11:18:00 +08001203 ;;
1204 es)
1205 # mesa/es is required to build es state tracker
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001206 CORE_DIRS="$CORE_DIRS mesa/es"
Chia-I Wue5d351d2009-12-23 11:18:00 +08001207 ;;
1208 esac
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001209 done
1210 GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
1211 ;;
1212esac
1213
Chia-I Wu49381d62010-01-11 01:23:01 +08001214AC_ARG_WITH([egl-displays],
1215 [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
1216 [comma delimited native displays libEGL supports, e.g.
Chia-I Wua68b51d2010-01-03 19:24:04 +08001217 "x11,kms" @<:@default=auto@:>@])],
Chia-I Wu49381d62010-01-11 01:23:01 +08001218 [with_egl_displays="$withval"],
1219 [with_egl_displays=yes])
1220
1221EGL_DISPLAYS=""
1222case "$with_egl_displays" in
1223yes)
1224 if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
1225 EGL_DISPLAYS="x11"
1226 fi
1227 ;;
1228*)
1229 if test "x$enable_egl" != xyes; then
1230 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1231 fi
1232 # verify the requested driver directories exist
1233 egl_displays=`IFS=', '; echo $with_egl_displays`
1234 for dpy in $egl_displays; do
Chia-I Wu3c967a92010-01-22 16:31:43 +08001235 test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \
Chia-I Wu49381d62010-01-11 01:23:01 +08001236 AC_MSG_ERROR([EGL display '$dpy' does't exist])
1237 done
1238 EGL_DISPLAYS="$egl_displays"
1239 ;;
1240esac
1241AC_SUBST([EGL_DISPLAYS])
1242
Chia-I Wu28c3e572010-01-23 20:18:43 +08001243AC_ARG_WITH([egl-driver-dir],
1244 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1245 [directory for EGL drivers [[default=${libdir}/egl]]])],
1246 [EGL_DRIVER_INSTALL_DIR="$withval"],
1247 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1248AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1249
Joel Bosveld8acca482009-03-06 08:46:08 +09001250AC_ARG_WITH([xorg-driver-dir],
1251 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1252 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1253 [XORG_DRIVER_INSTALL_DIR="$withval"],
1254 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1255AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1256
Tom Fogal7085dce2009-08-13 19:40:30 -06001257AC_ARG_WITH([max-width],
1258 [AS_HELP_STRING([--with-max-width=N],
1259 [Maximum framebuffer width (4096)])],
1260 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1261 AS_IF([test "${withval}" -gt "4096"],
1262 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1263)
1264AC_ARG_WITH([max-height],
1265 [AS_HELP_STRING([--with-max-height=N],
1266 [Maximum framebuffer height (4096)])],
1267 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1268 AS_IF([test "${withval}" -gt "4096"],
1269 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1270)
1271
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001272dnl
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001273dnl Gallium SVGA configuration
1274dnl
1275AC_ARG_ENABLE([gallium-svga],
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001276 [AS_HELP_STRING([--enable-gallium-svga],
1277 [build gallium SVGA @<:@default=disabled@:>@])],
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001278 [enable_gallium_svga="$enableval"],
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001279 [enable_gallium_svga=auto])
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001280if test "x$enable_gallium_svga" = xyes; then
1281 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
1282 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001283elif test "x$enable_gallium_svga" = xauto; then
1284 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001285fi
1286
1287dnl
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001288dnl Gallium Intel configuration
1289dnl
1290AC_ARG_ENABLE([gallium-intel],
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001291 [AS_HELP_STRING([--enable-gallium-intel],
1292 [build gallium intel @<:@default=disabled@:>@])],
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001293 [enable_gallium_intel="$enableval"],
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001294 [enable_gallium_intel=auto])
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001295if test "x$enable_gallium_intel" = xyes; then
Jakob Bornecrantzce4f23a2009-11-04 23:02:13 +00001296 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel i965"
1297 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001298elif test "x$enable_gallium_intel" = xauto; then
Keith Whitwellaa026832009-12-22 09:40:39 +00001299 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001300fi
1301
1302dnl
1303dnl Gallium Radeon configuration
1304dnl
1305AC_ARG_ENABLE([gallium-radeon],
1306 [AS_HELP_STRING([--enable-gallium-radeon],
1307 [build gallium radeon @<:@default=disabled@:>@])],
1308 [enable_gallium_radeon="$enableval"],
Jakob Bornecrantz877cadb2010-01-14 22:51:25 +00001309 [enable_gallium_radeon=auto])
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001310if test "x$enable_gallium_radeon" = xyes; then
1311 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00001312 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Jakob Bornecrantz877cadb2010-01-14 22:51:25 +00001313elif test "x$enable_gallium_radeon" = xauto; then
1314 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001315fi
1316
1317dnl
Thierry Vignaud1402ea82009-09-14 11:48:51 -06001318dnl Gallium Nouveau configuration
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001319dnl
1320AC_ARG_ENABLE([gallium-nouveau],
1321 [AS_HELP_STRING([--enable-gallium-nouveau],
1322 [build gallium nouveau @<:@default=disabled@:>@])],
1323 [enable_gallium_nouveau="$enableval"],
1324 [enable_gallium_nouveau=no])
1325if test "x$enable_gallium_nouveau" = xyes; then
1326 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
Francisco Jerez5b6b67e2010-02-04 22:15:22 +01001327 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv40 nv50"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001328fi
1329
Chia-I Wua1306f42010-01-22 15:51:51 +08001330dnl
1331dnl Gallium swrast configuration
1332dnl
1333AC_ARG_ENABLE([gallium-swrast],
1334 [AS_HELP_STRING([--enable-gallium-swrast],
1335 [build gallium swrast @<:@default=disabled@:>@])],
1336 [enable_gallium_swrast="$enableval"],
1337 [enable_gallium_swrast=auto])
1338if test "x$enable_gallium_swrast" = xyes; then
1339 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS swrast"
1340fi
1341
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001342dnl prepend CORE_DIRS to SRC_DIRS
1343SRC_DIRS="$CORE_DIRS $SRC_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001344
Dan Nicholsondca1b792007-10-23 09:25:58 -07001345dnl Restore LDFLAGS and CPPFLAGS
1346LDFLAGS="$_SAVE_LDFLAGS"
1347CPPFLAGS="$_SAVE_CPPFLAGS"
1348
1349dnl Substitute the config
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -08001350AC_CONFIG_FILES([configs/autoconf])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001351
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001352dnl Replace the configs/current symlink
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001353AC_CONFIG_COMMANDS([configs],[
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001354if test -f configs/current || test -L configs/current; then
1355 rm -f configs/current
1356fi
1357ln -s autoconf configs/current
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001358])
1359
1360AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001361
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001362dnl
1363dnl Output some configuration info for the user
1364dnl
1365echo ""
1366echo " prefix: $prefix"
1367echo " exec_prefix: $exec_prefix"
1368echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07001369echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001370
1371dnl Driver info
1372echo ""
1373echo " Driver: $mesa_driver"
Dan Nicholson544ab202007-12-30 08:41:53 -08001374if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
1375 echo " OSMesa: lib$OSMESA_LIB"
1376else
1377 echo " OSMesa: no"
1378fi
1379if test "$mesa_driver" = dri; then
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001380 # cleanup the drivers var
1381 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001382if test "x$DRI_DIRS" = x; then
1383 echo " DRI drivers: no"
1384else
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001385 echo " DRI drivers: $dri_dirs"
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001386fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001387 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08001388fi
RALOVICH, Kristóf5f19f5c2008-11-04 11:53:32 +01001389echo " Use XCB: $enable_xcb"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001390
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001391echo ""
1392if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
1393 echo " Gallium: yes"
1394 echo " Gallium dirs: $GALLIUM_DIRS"
1395 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001396 echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00001397 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001398 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
1399else
1400 echo " Gallium: no"
1401fi
1402
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001403dnl Libraries
1404echo ""
1405echo " Shared libs: $enable_shared"
1406echo " Static libs: $enable_static"
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001407if test "$enable_egl" = yes; then
1408 echo " EGL: $EGL_DRIVERS_DIRS"
1409else
1410 echo " EGL: no"
1411fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001412echo " GLU: $enable_glu"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001413echo " GLw: $enable_glw (Motif: $enable_motif)"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001414echo " glut: $enable_glut"
1415
1416dnl Programs
1417# cleanup the programs var for display
1418program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1419if test "x$program_dirs" = x; then
1420 echo " Demos: no"
1421else
1422 echo " Demos: $program_dirs"
1423fi
1424
Dan Nicholson16a07fb2007-12-12 09:12:15 -08001425dnl Compiler options
1426# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
1427cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1428 $SED 's/^ *//;s/ */ /;s/ *$//'`
1429cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1430 $SED 's/^ *//;s/ */ /;s/ *$//'`
1431defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1432echo ""
1433echo " CFLAGS: $cflags"
1434echo " CXXFLAGS: $cxxflags"
1435echo " Macros: $defines"
1436
Dan Nicholsondca1b792007-10-23 09:25:58 -07001437echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07001438echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001439echo ""