blob: 8ca274932cc7cb6fab9702fbc258784a03446dae [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
Ian Romanick9aa3aa72010-03-03 15:59:37 -080049dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
50dnl versions are explictly not supported.
51if test "x$GCC" = xyes; then
52 AC_MSG_CHECKING([whether gcc version is sufficient])
53 major=0
54 minor=0
55
56 GCC_VERSION=`$CC -dumpversion`
57 if test $? -eq 0; then
58 major=`echo $GCC_VERSION | cut -d. -f1`
59 minor=`echo $GCC_VERSION | cut -d. -f1`
60 fi
61
62 if test $major -lt 3 -o $major -eq 3 -a $minor -lt 3 ; then
63 AC_MSG_RESULT([no])
64 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
65 else
66 AC_MSG_RESULT([yes])
67 fi
68fi
69
70
Dan Nicholsondb7fc632008-03-07 11:48:09 -080071MKDEP_OPTIONS=-fdepend
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050072dnl Ask gcc where it's keeping its secret headers
73if test "x$GCC" = xyes; then
Dan Nicholsona3d223f2009-01-30 10:52:09 -080074 for dir in include include-fixed; do
75 GCC_INCLUDES=`$CC -print-file-name=$dir`
76 if test "x$GCC_INCLUDES" != x && \
77 test "$GCC_INCLUDES" != "$dir" && \
78 test -d "$GCC_INCLUDES"; then
79 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
80 fi
81 done
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050082fi
Dan Nicholson297e16c2008-05-05 15:42:53 -070083AC_SUBST([MKDEP_OPTIONS])
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050084
Dan Nicholson41b00702007-12-12 08:48:30 -080085dnl Make sure the pkg-config macros are defined
Dan Nicholson356f3112009-04-29 06:49:27 -070086m4_ifndef([PKG_PROG_PKG_CONFIG],
87 [m4_fatal([Could not locate the pkg-config autoconf macros.
88 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
89 are in a different location, try setting the environment variable
90 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Dan Nicholsondca1b792007-10-23 09:25:58 -070091PKG_PROG_PKG_CONFIG()
92
93dnl LIB_DIR - library basename
94LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -070095AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -070096
97dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
98_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholson297e16c2008-05-05 15:42:53 -070099AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
100AC_SUBST([EXTRA_LIB_PATH])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700101
102dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
103_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700104AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
105AC_SUBST([X11_INCLUDES])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700106
107dnl Compiler macros
108DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -0700109AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700110case "$host_os" in
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700111linux*|*-gnu*|gnu*)
Dan Nicholson29f603a2009-01-12 11:10:31 -0800112 DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700113 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700114solaris*)
115 DEFINES="$DEFINES -DPTHREADS -DSVR4"
116 ;;
Brian Paul97988902010-02-18 12:46:12 -0700117cygwin*)
118 DEFINES="$DEFINES -DPTHREADS"
119 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -0700120esac
121
122dnl Add flags for gcc and g++
123if test "x$GCC" = xyes; then
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800124 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
125
126 # Enable -fvisibility=hidden if using a gcc that supports it
127 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800128 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800129 CFLAGS="$CFLAGS -fvisibility=hidden"
130 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
131 [CFLAGS="$save_CFLAGS" ; AC_MSG_RESULT([no])]);
Dan Nicholson0c275b62008-01-15 22:52:25 -0800132
133 # Work around aliasing bugs - developers should comment this out
134 CFLAGS="$CFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700135fi
136if test "x$GXX" = xyes; then
137 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800138
139 # Work around aliasing bugs - developers should comment this out
140 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700141fi
142
143dnl These should be unnecessary, but let the user set them if they want
Dan Nicholson297e16c2008-05-05 15:42:53 -0700144AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700145 Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700146AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
Dan Nicholsondca1b792007-10-23 09:25:58 -0700147 compiler. Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700148AC_SUBST([OPT_FLAGS])
149AC_SUBST([ARCH_FLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700150
151dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600152dnl Hacks to enable 32 or 64 bit build
153dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700154AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600155 [AS_HELP_STRING([--enable-32-bit],
156 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700157 [enable_32bit="$enableval"],
158 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600159)
160if test "x$enable_32bit" = xyes; then
161 if test "x$GCC" = xyes; then
162 CFLAGS="$CFLAGS -m32"
Marc Dietrichc705e722009-08-31 08:56:33 -0700163 ARCH_FLAGS="$ARCH_FLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600164 fi
165 if test "x$GXX" = xyes; then
166 CXXFLAGS="$CXXFLAGS -m32"
167 fi
168fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700169AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600170 [AS_HELP_STRING([--enable-64-bit],
171 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700172 [enable_64bit="$enableval"],
173 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600174)
175if test "x$enable_64bit" = xyes; then
176 if test "x$GCC" = xyes; then
177 CFLAGS="$CFLAGS -m64"
178 fi
179 if test "x$GXX" = xyes; then
180 CXXFLAGS="$CXXFLAGS -m64"
181 fi
182fi
183
184dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800185dnl shared/static libraries, mimic libtool options
186dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700187AC_ARG_ENABLE([static],
Dan Nicholson88586332007-11-15 08:59:57 -0800188 [AS_HELP_STRING([--enable-static],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800189 [build static libraries @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700190 [enable_static="$enableval"],
191 [enable_static=no]
Dan Nicholson88586332007-11-15 08:59:57 -0800192)
193case "x$enable_static" in
194xyes|xno ) ;;
195x ) enable_static=no ;;
196* )
197 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
198 ;;
199esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700200AC_ARG_ENABLE([shared],
Dan Nicholson88586332007-11-15 08:59:57 -0800201 [AS_HELP_STRING([--disable-shared],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800202 [build shared libraries @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700203 [enable_shared="$enableval"],
204 [enable_shared=yes]
Dan Nicholson88586332007-11-15 08:59:57 -0800205)
206case "x$enable_shared" in
207xyes|xno ) ;;
208x ) enable_shared=yes ;;
209* )
210 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
211 ;;
212esac
213
214dnl Can't have static and shared libraries, default to static if user
215dnl explicitly requested. If both disabled, set to static since shared
216dnl was explicitly requirested.
217case "x$enable_static$enable_shared" in
218xyesyes )
219 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
220 enable_shared=no
221 ;;
222xnono )
223 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
224 enable_static=yes
225 ;;
226esac
227
228dnl
229dnl mklib options
230dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700231AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
Dan Nicholson88586332007-11-15 08:59:57 -0800232if test "$enable_static" = yes; then
233 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
234fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700235AC_SUBST([MKLIB_OPTIONS])
Dan Nicholson88586332007-11-15 08:59:57 -0800236
Dan Nicholson23656c42007-12-12 09:02:31 -0800237dnl
238dnl other compiler options
239dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700240AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800241 [AS_HELP_STRING([--enable-debug],
242 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700243 [enable_debug="$enableval"],
244 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800245)
246if test "x$enable_debug" = xyes; then
247 DEFINES="$DEFINES -DDEBUG"
248 if test "x$GCC" = xyes; then
249 CFLAGS="$CFLAGS -g"
250 fi
251 if test "x$GXX" = xyes; then
252 CXXFLAGS="$CXXFLAGS -g"
253 fi
254fi
Dan Nicholson88586332007-11-15 08:59:57 -0800255
256dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700257dnl library names
258dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800259if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800260 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800261else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700262 case "$host_os" in
263 darwin* )
264 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100265 cygwin* )
266 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700267 aix* )
268 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700269 * )
270 LIB_EXTENSION='so' ;;
271 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800272fi
Dan Nicholson8217f242009-02-11 15:16:00 -0800273
274GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
275GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
276GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
277GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
278OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800279EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800280
281GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
282GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
283GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
284GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
285OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800286EGL_LIB_GLOB='lib$(EGL_LIB).*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800287
Dan Nicholson297e16c2008-05-05 15:42:53 -0700288AC_SUBST([GL_LIB_NAME])
289AC_SUBST([GLU_LIB_NAME])
290AC_SUBST([GLUT_LIB_NAME])
291AC_SUBST([GLW_LIB_NAME])
292AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800293AC_SUBST([EGL_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700294
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700295AC_SUBST([GL_LIB_GLOB])
296AC_SUBST([GLU_LIB_GLOB])
297AC_SUBST([GLUT_LIB_GLOB])
298AC_SUBST([GLW_LIB_GLOB])
299AC_SUBST([OSMESA_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800300AC_SUBST([EGL_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700301
Dan Nicholsondca1b792007-10-23 09:25:58 -0700302dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700303dnl Arch/platform-specific settings
304dnl
305AC_ARG_ENABLE([asm],
306 [AS_HELP_STRING([--disable-asm],
307 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
308 [enable_asm="$enableval"],
309 [enable_asm=yes]
310)
311asm_arch=""
312ASM_FLAGS=""
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800313MESA_ASM_SOURCES=""
314GLAPI_ASM_SOURCES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700315AC_MSG_CHECKING([whether to enable assembly])
316test "x$enable_asm" = xno && AC_MSG_RESULT([no])
317# disable if cross compiling on x86/x86_64 since we must run gen_matypes
318if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
319 case "$host_cpu" in
320 i?86 | x86_64)
321 enable_asm=no
322 AC_MSG_RESULT([no, cross compiling])
323 ;;
324 esac
325fi
326# check for supported arches
327if test "x$enable_asm" = xyes; then
328 case "$host_cpu" in
329 i?86)
330 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100331 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700332 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
333 ;;
334 esac
335 ;;
336 x86_64)
337 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100338 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700339 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
340 ;;
341 esac
342 ;;
343 powerpc)
344 case "$host_os" in
345 linux*)
346 asm_arch=ppc
347 ;;
348 esac
349 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800350 sparc*)
351 case "$host_os" in
352 linux*)
353 asm_arch=sparc
354 ;;
355 esac
356 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700357 esac
358
359 case "$asm_arch" in
360 x86)
Dan Nicholson61e925f2009-02-11 10:42:34 -0800361 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800362 MESA_ASM_SOURCES='$(X86_SOURCES)'
363 GLAPI_ASM_SOURCES='$(X86_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700364 AC_MSG_RESULT([yes, x86])
365 ;;
366 x86_64)
367 ASM_FLAGS="-DUSE_X86_64_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800368 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
369 GLAPI_ASM_SOURCES='$(X86-64_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700370 AC_MSG_RESULT([yes, x86_64])
371 ;;
372 ppc)
373 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800374 MESA_ASM_SOURCES='$(PPC_SOURCES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700375 AC_MSG_RESULT([yes, ppc])
376 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800377 sparc)
378 ASM_FLAGS="-DUSE_SPARC_ASM"
379 MESA_ASM_SOURCES='$(SPARC_SOURCES)'
380 GLAPI_ASM_SOURCES='$(SPARC_API)'
381 AC_MSG_RESULT([yes, sparc])
382 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700383 *)
384 AC_MSG_RESULT([no, platform not supported])
385 ;;
386 esac
387fi
388AC_SUBST([ASM_FLAGS])
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800389AC_SUBST([MESA_ASM_SOURCES])
390AC_SUBST([GLAPI_ASM_SOURCES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700391
392dnl PIC code macro
393MESA_PIC_FLAGS
394
395dnl Check to see if dlopen is in default libraries (like Solaris, which
396dnl has it in libc), or if libdl is needed to get it.
397AC_CHECK_FUNC([dlopen], [],
398 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
399
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700400dnl See if posix_memalign is available
401AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
402
Dan Nicholson871125a2008-06-04 13:00:35 -0700403dnl SELinux awareness.
404AC_ARG_ENABLE([selinux],
405 [AS_HELP_STRING([--enable-selinux],
406 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
407 [MESA_SELINUX="$enableval"],
408 [MESA_SELINUX=no])
409if test "x$enable_selinux" = "xyes"; then
410 AC_CHECK_HEADER([selinux/selinux.h],[],
411 [AC_MSG_ERROR([SELinux headers not found])])
412 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
413 [AC_MSG_ERROR([SELinux library not found])])
414 SELINUX_LIBS="-lselinux"
415 DEFINES="$DEFINES -DMESA_SELINUX"
416fi
417
Dan Nicholson871125a2008-06-04 13:00:35 -0700418dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800419dnl Driver configuration. Options are xlib, dri and osmesa right now.
Kristian Høgsberg43875802010-02-25 15:49:18 -0500420dnl More later: fbdev, ...
Dan Nicholson44d99142007-12-05 18:47:01 -0800421dnl
Eric Anholt711222b2008-04-18 15:03:01 -0700422default_driver="xlib"
423
424case "$host_os" in
425linux*)
426 case "$host_cpu" in
David S. Miller32dc28a2009-02-24 20:06:05 -0700427 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
Eric Anholt711222b2008-04-18 15:03:01 -0700428 esac
429 ;;
Julien Cristau98fcdf32008-10-28 18:56:05 +0100430*freebsd* | dragonfly*)
Eric Anholt711222b2008-04-18 15:03:01 -0700431 case "$host_cpu" in
Robert Noland48f05432009-04-10 11:41:27 -0500432 i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
Eric Anholt711222b2008-04-18 15:03:01 -0700433 esac
434 ;;
435esac
436
Dan Nicholson297e16c2008-05-05 15:42:53 -0700437AC_ARG_WITH([driver],
Dan Nicholson44d99142007-12-05 18:47:01 -0800438 [AS_HELP_STRING([--with-driver=DRIVER],
Eric Anholt711222b2008-04-18 15:03:01 -0700439 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700440 [mesa_driver="$withval"],
441 [mesa_driver="$default_driver"])
Dan Nicholson44d99142007-12-05 18:47:01 -0800442dnl Check for valid option
443case "x$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800444xxlib|xdri|xosmesa)
Dan Nicholson44d99142007-12-05 18:47:01 -0800445 ;;
446*)
447 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
448 ;;
449esac
450
451dnl
452dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700453dnl
Chia-I Wu99a37ed2010-01-05 17:39:05 +0800454
455dnl this variable will be prepended to SRC_DIRS and is not exported
456CORE_DIRS="glsl mesa"
457
458SRC_DIRS="glew"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700459GLU_DIRS="sgi"
Dan Nicholson44d99142007-12-05 18:47:01 -0800460WINDOW_SYSTEM=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100461GALLIUM_DIRS="auxiliary drivers state_trackers"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100462GALLIUM_WINSYS_DIRS=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100463GALLIUM_WINSYS_DRM_DIRS=""
Jakob Bornecrantzd60b2c62009-06-24 02:42:41 +0200464GALLIUM_DRIVERS_DIRS="softpipe failover trace identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100465GALLIUM_STATE_TRACKERS_DIRS=""
466
Dan Nicholson44d99142007-12-05 18:47:01 -0800467case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800468xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800469 DRIVER_DIRS="x11"
Jakob Bornecrantz373e6712009-04-18 23:13:56 +0100470 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS xlib"
Dan Nicholson44d99142007-12-05 18:47:01 -0800471 ;;
472dri)
Kristian Høgsberg6e8897f2010-02-09 09:58:36 -0500473 SRC_DIRS="$SRC_DIRS glx"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100474 DRIVER_DIRS="dri"
Dan Nicholson44d99142007-12-05 18:47:01 -0800475 WINDOW_SYSTEM="dri"
Jakob Bornecrantz373e6712009-04-18 23:13:56 +0100476 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS drm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800477 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800478osmesa)
479 DRIVER_DIRS="osmesa"
480 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800481esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700482AC_SUBST([SRC_DIRS])
483AC_SUBST([GLU_DIRS])
484AC_SUBST([DRIVER_DIRS])
485AC_SUBST([WINDOW_SYSTEM])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100486AC_SUBST([GALLIUM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100487AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100488AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +0000489AC_SUBST([GALLIUM_DRIVERS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100490AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700491
492dnl
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800493dnl User supplied program configuration
494dnl
495if test -d "$srcdir/progs/demos"; then
496 default_demos=yes
497else
498 default_demos=no
499fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700500AC_ARG_WITH([demos],
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800501 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
502 [optional comma delimited demo directories to build
Dan Nicholsonc79c93c2007-12-12 18:13:04 -0800503 @<:@default=auto if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700504 [with_demos="$withval"],
505 [with_demos="$default_demos"])
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800506if test "x$with_demos" = x; then
507 with_demos=no
508fi
509
510dnl If $with_demos is yes, directories will be added as libs available
511PROGRAM_DIRS=""
512case "$with_demos" in
Dan Nicholsonb9576552008-03-10 14:05:46 -0700513no) ;;
514yes)
515 # If the driver isn't osmesa, we have libGL and can build xdemos
516 if test "$mesa_driver" != osmesa; then
517 PROGRAM_DIRS="xdemos"
518 fi
519 ;;
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800520*)
521 # verify the requested demos directories exist
522 demos=`IFS=,; echo $with_demos`
523 for demo in $demos; do
524 test -d "$srcdir/progs/$demo" || \
525 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
526 done
527 PROGRAM_DIRS="$demos"
528 ;;
529esac
530
531dnl
Dan Nicholsone6a06092008-05-05 15:16:22 -0700532dnl Find out if X is available. The variable have_x is set if libX11 is
Dan Nicholson99803a42008-07-01 09:03:15 -0700533dnl found to mimic AC_PATH_XTRA.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700534dnl
535if test -n "$PKG_CONFIG"; then
536 AC_MSG_CHECKING([pkg-config files for X11 are available])
Dan Nicholsone6a06092008-05-05 15:16:22 -0700537 PKG_CHECK_EXISTS([x11],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700538 x11_pkgconfig=yes
539 have_x=yes
Dan Nicholsone6a06092008-05-05 15:16:22 -0700540 ],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700541 x11_pkgconfig=no
Dan Nicholsone6a06092008-05-05 15:16:22 -0700542 ])
543 AC_MSG_RESULT([$x11_pkgconfig])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700544else
545 x11_pkgconfig=no
546fi
547dnl Use the autoconf macro if no pkg-config files
548if test "$x11_pkgconfig" = no; then
549 AC_PATH_XTRA
550fi
551
Dan Nicholson99803a42008-07-01 09:03:15 -0700552dnl Try to tell the user that the --x-* options are only used when
553dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
554m4_divert_once([HELP_BEGIN],
555[These options are only used when the X libraries cannot be found by the
556pkg-config utility.])
557
Dan Nicholson44d99142007-12-05 18:47:01 -0800558dnl We need X for xlib and dri, so bomb now if it's not found
559case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800560xlib|dri)
Dan Nicholson44d99142007-12-05 18:47:01 -0800561 if test "$no_x" = yes; then
562 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
563 fi
564 ;;
565esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700566
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700567dnl XCB - this is only used for GLX right now
568AC_ARG_ENABLE([xcb],
569 [AS_HELP_STRING([--enable-xcb],
570 [use XCB for GLX @<:@default=disabled@:>@])],
571 [enable_xcb="$enableval"],
572 [enable_xcb=no])
573if test "x$enable_xcb" = xyes; then
574 DEFINES="$DEFINES -DUSE_XCB"
575else
576 enable_xcb=no
577fi
578
Dan Nicholson44d99142007-12-05 18:47:01 -0800579dnl
580dnl libGL configuration per driver
581dnl
582case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800583xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800584 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700585 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800586 GL_PC_REQ_PRIV="x11 xext"
Dan Nicholsona1307182007-12-12 17:49:49 -0800587 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
588 GL_LIB_DEPS="$XLIBGL_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800589 else
590 # should check these...
591 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
592 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800593 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
594 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson44d99142007-12-05 18:47:01 -0800595 fi
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700596 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread"
597 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
Dan Nicholson88586332007-11-15 08:59:57 -0800598
599 # if static, move the external libraries to the programs
600 # and empty the libraries for libGL
601 if test "$enable_static" = yes; then
602 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
603 GL_LIB_DEPS=""
604 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800605 ;;
606dri)
Dan Nicholson88586332007-11-15 08:59:57 -0800607 # DRI must be shared, I think
608 if test "$enable_static" = yes; then
609 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
610 fi
611
Dan Nicholson44d99142007-12-05 18:47:01 -0800612 # Check for libdrm
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -0700613 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
614 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500615 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Jesse Barnesed59b132010-01-13 15:48:14 -0500616 GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED glproto >= $GLPROTO_REQUIRED"
617 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Dan Nicholson44d99142007-12-05 18:47:01 -0800618
619 # find the DRI deps for libGL
620 if test "$x11_pkgconfig" = yes; then
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700621 # add xcb modules if necessary
622 dri_modules="x11 xext xxf86vm xdamage xfixes"
623 if test "$enable_xcb" = yes; then
624 dri_modules="$dri_modules x11-xcb xcb-glx"
625 fi
626
627 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800628 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
Dan Nicholson44d99142007-12-05 18:47:01 -0800629 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
630 GL_LIB_DEPS="$DRIGL_LIBS"
631 else
632 # should check these...
633 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
634 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800635 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
636 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700637
638 # XCB can only be used from pkg-config
639 if test "$enable_xcb" = yes; then
640 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800641 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700642 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
643 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
644 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800645 fi
646
647 # need DRM libs, -lpthread, etc.
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700648 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
649 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800650 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800651osmesa)
652 # No libGL for osmesa
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700653 GL_LIB_DEPS=""
Dan Nicholson979ff512007-12-05 18:47:01 -0800654 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800655esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700656AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800657AC_SUBST([GL_PC_REQ_PRIV])
658AC_SUBST([GL_PC_LIB_PRIV])
659AC_SUBST([GL_PC_CFLAGS])
660AC_SUBST([DRI_PC_REQ_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700661
662dnl
663dnl More X11 setup
664dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800665if test "$mesa_driver" = xlib; then
Dan Nicholsondca1b792007-10-23 09:25:58 -0700666 DEFINES="$DEFINES -DUSE_XSHM"
667fi
668
669dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800670dnl More DRI setup
671dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700672AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800673 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800674 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700675 [GLX_USE_TLS="$enableval"],
676 [GLX_USE_TLS=no])
Dan Nicholson44d99142007-12-05 18:47:01 -0800677dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700678AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800679 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700680 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700681 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700682 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700683AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800684dnl Extra search path for DRI drivers
685AC_ARG_WITH([dri-searchpath],
686 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
687 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
688 [DRI_DRIVER_SEARCH_DIR="$withval"],
689 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
690AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholson44d99142007-12-05 18:47:01 -0800691dnl Direct rendering or just indirect rendering
Dan Nicholson297e16c2008-05-05 15:42:53 -0700692AC_ARG_ENABLE([driglx-direct],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800693 [AS_HELP_STRING([--disable-driglx-direct],
694 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700695 [driglx_direct="$enableval"],
696 [driglx_direct="yes"])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800697dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700698AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800699 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700700 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200701 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700702 [with_dri_drivers="$withval"],
703 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800704if test "x$with_dri_drivers" = x; then
705 with_dri_drivers=no
706fi
707
708dnl If $with_dri_drivers is yes, directories will be added through
709dnl platform checks
710DRI_DIRS=""
711case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100712no) ;;
713yes)
714 DRI_DIRS="yes"
715 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800716*)
717 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700718 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800719 for driver in $dri_drivers; do
720 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
721 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
722 done
723 DRI_DIRS="$dri_drivers"
724 ;;
725esac
726
Dan Nicholson44d99142007-12-05 18:47:01 -0800727dnl Set DRI_DIRS, DEFINES and LIB_DEPS
728if test "$mesa_driver" = dri; then
729 # Use TLS in GLX?
730 if test "x$GLX_USE_TLS" = xyes; then
731 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
732 fi
733
Dan Nicholson44d99142007-12-05 18:47:01 -0800734 # Platform specific settings and drivers to build
735 case "$host_os" in
736 linux*)
737 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Dan Nicholson44d99142007-12-05 18:47:01 -0800738 if test "x$driglx_direct" = xyes; then
739 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
740 fi
Jerome Glisse14f79d42008-12-18 13:36:07 +0100741 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800742
743 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -0800744 x86_64)
Kristian Høgsberg79aeafd2010-02-25 16:12:58 -0500745 # sis is missing because they have not be converted to use
746 # the new interface. i810 are missing because there is no
747 # x86-64 system where they could *ever* be used.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100748 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400749 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 r600 radeon \
George Sapountzis280bf892008-05-11 14:43:40 +0300750 savage tdfx unichrome swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800751 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800752 ;;
753 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800754 # Build only the drivers for cards that exist on PowerPC.
755 # At some point MGA will be added, but not yet.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100756 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400757 DRI_DIRS="mach64 r128 r200 r300 r600 radeon tdfx swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800758 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800759 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000760 sparc*)
761 # Build only the drivers for cards that exist on sparc`
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100762 if test "x$DRI_DIRS" = "xyes"; then
Kristian Høgsberg79aeafd2010-02-25 16:12:58 -0500763 DRI_DIRS="mach64 r128 r200 r300 r600 radeon swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000764 fi
765 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800766 esac
767 ;;
Hasso Tepper9f8df2d2008-04-09 10:51:21 -0700768 freebsd* | dragonfly*)
Dan Nicholson44d99142007-12-05 18:47:01 -0800769 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
770 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
771 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
772 if test "x$driglx_direct" = xyes; then
773 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
774 fi
775 if test "x$GXX" = xyes; then
776 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
777 fi
778
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100779 if test "x$DRI_DIRS" = "xyes"; then
Alex Deucher4138bdb2009-04-08 15:16:35 -0400780 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon tdfx \
George Sapountzis280bf892008-05-11 14:43:40 +0300781 unichrome savage sis swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800782 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800783 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700784 gnu*)
785 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
786 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
787 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700788 solaris*)
789 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
790 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
791 if test "x$driglx_direct" = xyes; then
792 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
793 fi
794 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800795 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -0800796
797 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100798 if test "x$DRI_DIRS" = "xyes"; then
Corbin Simpson8e4657a2009-10-22 12:29:30 -0700799 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 r600 radeon \
Kristian Høgsberg79aeafd2010-02-25 16:12:58 -0500800 savage sis tdfx unichrome swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -0800801 fi
802
Dan Nicholson44d99142007-12-05 18:47:01 -0800803 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
804
805 # Check for expat
806 EXPAT_INCLUDES=""
807 EXPAT_LIB=-lexpat
Dan Nicholson297e16c2008-05-05 15:42:53 -0700808 AC_ARG_WITH([expat],
809 [AS_HELP_STRING([--with-expat=DIR],
810 [expat install directory])],[
Dan Nicholson44d99142007-12-05 18:47:01 -0800811 EXPAT_INCLUDES="-I$withval/include"
812 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
813 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
814 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
815 ])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700816 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
817 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
818 [AC_MSG_ERROR([Expat required for DRI.])])
Dan Nicholson44d99142007-12-05 18:47:01 -0800819
820 # put all the necessary libs together
Eric Anholt050c5332008-03-20 17:28:58 -0700821 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800822fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700823AC_SUBST([DRI_DIRS])
824AC_SUBST([EXPAT_INCLUDES])
825AC_SUBST([DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -0800826
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500827case $DRI_DIRS in
828*i915*|*i965*)
Eric Anholt179d2c02010-03-02 15:34:17 -0800829 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= 2.4.19])
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500830 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -0500831esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500832
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -0500833case $DRI_DIRS in
Kristian Høgsberg8616cec2010-01-01 17:03:33 -0500834*radeon*|*r200*|*r300*|*r600*)
835 PKG_CHECK_MODULES([LIBDRM_RADEON],
836 [libdrm_radeon libdrm >= $LIBDRM_RADEON_REQUIRED],
837 HAVE_LIBDRM_RADEON=yes,
838 HAVE_LIBDRM_RADEON=no)
839
840 if test "$HAVE_LIBDRM_RADEON" = yes; then
841 RADEON_CFLAGS="-DHAVE_LIBDRM_RADEON=1 $LIBDRM_RADEON_CFLAGS"
842 RADEON_LDFLAGS=$LIBDRM_RADEON_LIBS
843 fi
844 ;;
845esac
846AC_SUBST([RADEON_CFLAGS])
847AC_SUBST([RADEON_LDFLAGS])
848
849
Dan Nicholson44d99142007-12-05 18:47:01 -0800850dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700851dnl OSMesa configuration
852dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800853if test "$mesa_driver" = xlib; then
Dan Nicholson544ab202007-12-30 08:41:53 -0800854 default_gl_osmesa=yes
Dan Nicholson979ff512007-12-05 18:47:01 -0800855else
Dan Nicholson544ab202007-12-30 08:41:53 -0800856 default_gl_osmesa=no
Dan Nicholson44d99142007-12-05 18:47:01 -0800857fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700858AC_ARG_ENABLE([gl-osmesa],
Dan Nicholson544ab202007-12-30 08:41:53 -0800859 [AS_HELP_STRING([--enable-gl-osmesa],
860 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700861 [gl_osmesa="$enableval"],
862 [gl_osmesa="$default_gl_osmesa"])
Dan Nicholson544ab202007-12-30 08:41:53 -0800863if test "x$gl_osmesa" = xyes; then
864 if test "$mesa_driver" = osmesa; then
865 AC_MSG_ERROR([libGL is not available for OSMesa driver])
Dan Nicholson979ff512007-12-05 18:47:01 -0800866 else
Dan Nicholson544ab202007-12-30 08:41:53 -0800867 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Dan Nicholson979ff512007-12-05 18:47:01 -0800868 fi
869fi
870
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800871dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -0700872AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800873 [AS_HELP_STRING([--with-osmesa-bits=BITS],
874 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700875 [osmesa_bits="$withval"],
876 [osmesa_bits=8])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800877if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
878 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
879 osmesa_bits=8
880fi
881case "x$osmesa_bits" in
882x8)
883 OSMESA_LIB=OSMesa
884 ;;
885x16|x32)
886 OSMESA_LIB="OSMesa$osmesa_bits"
887 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
888 ;;
889*)
890 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
891 ;;
892esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700893AC_SUBST([OSMESA_LIB])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800894
Dan Nicholson979ff512007-12-05 18:47:01 -0800895case "$mesa_driver" in
896osmesa)
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700897 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800898 if test "$enable_static" = no; then
Dan Nicholson4795dd52009-06-04 19:42:08 -0700899 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800900 else
901 OSMESA_LIB_DEPS=""
902 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800903 OSMESA_MESA_DEPS=""
Dan Nicholson4795dd52009-06-04 19:42:08 -0700904 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800905 ;;
906*)
907 # Link OSMesa to libGL otherwise
908 OSMESA_LIB_DEPS=""
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700909 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800910 if test "$enable_static" = no; then
911 OSMESA_MESA_DEPS='-l$(GL_LIB)'
912 else
913 OSMESA_MESA_DEPS=""
914 fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800915 OSMESA_PC_REQ="gl"
Dan Nicholson979ff512007-12-05 18:47:01 -0800916 ;;
917esac
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700918OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700919AC_SUBST([OSMESA_LIB_DEPS])
920AC_SUBST([OSMESA_MESA_DEPS])
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800921AC_SUBST([OSMESA_PC_REQ])
922AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700923
924dnl
Dan Nicholson53b37342009-02-25 17:45:34 -0800925dnl EGL configuration
926dnl
Dan Nicholson66f97862009-04-29 12:11:43 -0700927AC_ARG_ENABLE([egl],
928 [AS_HELP_STRING([--disable-egl],
929 [disable EGL library @<:@default=enabled@:>@])],
930 [enable_egl="$enableval"],
931 [enable_egl=yes])
932if test "x$enable_egl" = xyes; then
933 SRC_DIRS="$SRC_DIRS egl"
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800934 EGL_LIB_DEPS="$DLOPEN_LIBS -lpthread"
935 EGL_DRIVERS_DIRS=""
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800936 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800937 # build egl_glx when libGL is built
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800938 if test "$mesa_driver" != osmesa; then
939 EGL_DRIVERS_DIRS="glx"
940 fi
941
942 # build egl_dri2 when xcb-dri2 is available
Kristian Høgsberg077bc2f2010-02-05 13:55:32 -0500943 PKG_CHECK_MODULES([EGL_DRI2], [x11-xcb xcb-dri2 xcb-xfixes libdrm],
944 [have_xcb_dri2=yes],[have_xcb_dri2=no])
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +0800945 if test "$have_xcb_dri2" = yes; then
946 EGL_DRIVERS_DIRS="$EGL_DRIVERS_DIRS dri2"
947 fi
Kristian Høgsberg42fa0092010-02-03 10:18:28 -0500948 fi
Kristian Høgsberg1ebc5682010-02-09 15:54:59 -0500949
950 if test "$with_demos" = yes; then
951 PROGRAM_DIRS="$PROGRAM_DIRS egl"
952 fi
Dan Nicholson53b37342009-02-25 17:45:34 -0800953fi
Dan Nicholson53b37342009-02-25 17:45:34 -0800954AC_SUBST([EGL_LIB_DEPS])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800955AC_SUBST([EGL_DRIVERS_DIRS])
Dan Nicholson53b37342009-02-25 17:45:34 -0800956
957dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700958dnl GLU configuration
959dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700960AC_ARG_ENABLE([glu],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800961 [AS_HELP_STRING([--disable-glu],
962 [enable OpenGL Utility library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700963 [enable_glu="$enableval"],
964 [enable_glu=yes])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700965if test "x$enable_glu" = xyes; then
966 SRC_DIRS="$SRC_DIRS glu"
967
Dan Nicholson979ff512007-12-05 18:47:01 -0800968 case "$mesa_driver" in
969 osmesa)
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800970 # If GLU is available and we have libOSMesa (not 16 or 32),
971 # we can build the osdemos
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800972 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800973 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
974 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700975
Dan Nicholson979ff512007-12-05 18:47:01 -0800976 # Link libGLU to libOSMesa instead of libGL
977 GLU_LIB_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800978 GLU_PC_REQ="osmesa"
Dan Nicholson88586332007-11-15 08:59:57 -0800979 if test "$enable_static" = no; then
980 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
981 else
982 GLU_MESA_DEPS=""
983 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800984 ;;
985 *)
Dan Nicholson88586332007-11-15 08:59:57 -0800986 # If static, empty GLU_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800987 GLU_PC_REQ="gl"
988 GLU_PC_LIB_PRIV="-lm"
Dan Nicholson88586332007-11-15 08:59:57 -0800989 if test "$enable_static" = no; then
990 GLU_LIB_DEPS="-lm"
991 GLU_MESA_DEPS='-l$(GL_LIB)'
992 else
993 GLU_LIB_DEPS=""
994 GLU_MESA_DEPS=""
995 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
996 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800997 ;;
998 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700999fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001000if test "$enable_static" = no; then
1001 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
1002fi
Dan Nicholson71e208b2008-11-24 11:01:57 -08001003GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -07001004AC_SUBST([GLU_LIB_DEPS])
1005AC_SUBST([GLU_MESA_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001006AC_SUBST([GLU_PC_REQ])
1007AC_SUBST([GLU_PC_REQ_PRIV])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001008AC_SUBST([GLU_PC_LIB_PRIV])
1009AC_SUBST([GLU_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001010
1011dnl
1012dnl GLw configuration
1013dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -07001014AC_ARG_ENABLE([glw],
Dan Nicholson79ad4582007-12-07 19:11:01 -08001015 [AS_HELP_STRING([--disable-glw],
1016 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001017 [enable_glw="$enableval"],
1018 [enable_glw=yes])
Dan Nicholson979ff512007-12-05 18:47:01 -08001019dnl Don't build GLw on osmesa
1020if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
1021 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
1022 enable_glw=no
1023fi
Dan Nicholson776c60d2008-07-18 07:40:41 -07001024AC_ARG_ENABLE([motif],
1025 [AS_HELP_STRING([--enable-motif],
1026 [use Motif widgets in GLw @<:@default=disabled@:>@])],
1027 [enable_motif="$enableval"],
1028 [enable_motif=no])
1029
Dan Nicholsondca1b792007-10-23 09:25:58 -07001030if test "x$enable_glw" = xyes; then
1031 SRC_DIRS="$SRC_DIRS glw"
1032 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001033 PKG_CHECK_MODULES([GLW],[x11 xt])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001034 GLW_PC_REQ_PRIV="x11 xt"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001035 GLW_LIB_DEPS="$GLW_LIBS"
1036 else
1037 # should check these...
Dan Nicholson776c60d2008-07-18 07:40:41 -07001038 GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001039 GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
1040 GLW_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001041 fi
1042
1043 GLW_SOURCES="GLwDrawA.c"
1044 MOTIF_CFLAGS=
1045 if test "x$enable_motif" = xyes; then
1046 GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
1047 AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
1048 if test "x$MOTIF_CONFIG" != xno; then
1049 MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
1050 MOTIF_LIBS=`$MOTIF_CONFIG --libs`
1051 else
1052 AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
1053 [AC_MSG_ERROR([Can't locate Motif headers])])
1054 AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
1055 [AC_MSG_ERROR([Can't locate Motif Xm library])])
1056 fi
1057 # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
1058 GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001059 GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
1060 GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001061 fi
1062
Dan Nicholson88586332007-11-15 08:59:57 -08001063 # If static, empty GLW_LIB_DEPS and add libs for programs to link
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001064 GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV"
Dan Nicholson88586332007-11-15 08:59:57 -08001065 if test "$enable_static" = no; then
1066 GLW_MESA_DEPS='-l$(GL_LIB)'
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001067 GLW_LIB_DEPS="$GLW_LIB_DEPS"
Dan Nicholson88586332007-11-15 08:59:57 -08001068 else
1069 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
1070 GLW_LIB_DEPS=""
1071 GLW_MESA_DEPS=""
1072 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001073fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001074AC_SUBST([GLW_LIB_DEPS])
1075AC_SUBST([GLW_MESA_DEPS])
Dan Nicholson776c60d2008-07-18 07:40:41 -07001076AC_SUBST([GLW_SOURCES])
1077AC_SUBST([MOTIF_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001078AC_SUBST([GLW_PC_REQ_PRIV])
1079AC_SUBST([GLW_PC_LIB_PRIV])
1080AC_SUBST([GLW_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001081
1082dnl
1083dnl GLUT configuration
1084dnl
1085if test -f "$srcdir/include/GL/glut.h"; then
1086 default_glut=yes
1087else
1088 default_glut=no
1089fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001090AC_ARG_ENABLE([glut],
Dan Nicholson79ad4582007-12-07 19:11:01 -08001091 [AS_HELP_STRING([--disable-glut],
1092 [enable GLUT library @<:@default=enabled if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001093 [enable_glut="$enableval"],
1094 [enable_glut="$default_glut"])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001095
1096dnl Can't build glut if GLU not available
1097if test "x$enable_glu$enable_glut" = xnoyes; then
1098 AC_MSG_WARN([Disabling glut since GLU is disabled])
1099 enable_glut=no
1100fi
Dan Nicholson979ff512007-12-05 18:47:01 -08001101dnl Don't build glut on osmesa
1102if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
1103 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
1104 enable_glut=no
1105fi
1106
Dan Nicholsondca1b792007-10-23 09:25:58 -07001107if test "x$enable_glut" = xyes; then
1108 SRC_DIRS="$SRC_DIRS glut/glx"
1109 GLUT_CFLAGS=""
1110 if test "x$GCC" = xyes; then
1111 GLUT_CFLAGS="-fexceptions"
1112 fi
1113 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001114 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001115 GLUT_PC_REQ_PRIV="x11 xmu xi"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001116 GLUT_LIB_DEPS="$GLUT_LIBS"
1117 else
1118 # should check these...
Dan Nicholson70d0c832007-12-07 11:12:20 -08001119 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001120 GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
1121 GLUT_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001122 fi
Alan Coopersmith3cf6e622009-03-23 16:51:54 -07001123 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm"
1124 GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001125
1126 # If glut is available, we can build most programs
Dan Nicholson8e4d1472007-11-15 08:59:57 -08001127 if test "$with_demos" = yes; then
1128 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
1129 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001130
Dan Nicholson88586332007-11-15 08:59:57 -08001131 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
1132 if test "$enable_static" = no; then
1133 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
1134 else
1135 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
1136 GLUT_LIB_DEPS=""
1137 GLUT_MESA_DEPS=""
1138 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001139fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001140AC_SUBST([GLUT_LIB_DEPS])
1141AC_SUBST([GLUT_MESA_DEPS])
1142AC_SUBST([GLUT_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001143AC_SUBST([GLUT_PC_REQ_PRIV])
1144AC_SUBST([GLUT_PC_LIB_PRIV])
1145AC_SUBST([GLUT_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001146
1147dnl
1148dnl Program library dependencies
1149dnl Only libm is added here if necessary as the libraries should
1150dnl be pulled in by the linker
1151dnl
1152if test "x$APP_LIB_DEPS" = x; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001153 case "$host_os" in
1154 solaris*)
1155 APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
1156 ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +01001157 cygwin*)
1158 APP_LIB_DEPS="-lX11"
1159 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001160 *)
1161 APP_LIB_DEPS="-lm"
1162 ;;
1163 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -07001164fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001165AC_SUBST([APP_LIB_DEPS])
1166AC_SUBST([PROGRAM_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001167
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001168dnl
1169dnl Gallium configuration
1170dnl
1171AC_ARG_ENABLE([gallium],
1172 [AS_HELP_STRING([--disable-gallium],
1173 [build gallium @<:@default=enabled@:>@])],
1174 [enable_gallium="$enableval"],
1175 [enable_gallium=yes])
1176if test "x$enable_gallium" = xyes; then
1177 SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
1178fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001179
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001180dnl
1181dnl Gallium state trackers configuration
1182dnl
1183AC_ARG_WITH([state-trackers],
1184 [AS_HELP_STRING([--with-state-trackers@<:@=DIRS...@:>@],
1185 [comma delimited state_trackers list, e.g.
1186 "egl,glx" @<:@default=auto@:>@])],
1187 [with_state_trackers="$withval"],
1188 [with_state_trackers=yes])
1189
1190case "$with_state_trackers" in
1191no)
1192 GALLIUM_STATE_TRACKERS_DIRS=""
1193 ;;
1194yes)
1195 # look at what else is built
1196 case "$mesa_driver" in
Jakob Bornecrantz373e6712009-04-18 23:13:56 +01001197 xlib)
1198 GALLIUM_STATE_TRACKERS_DIRS=glx
1199 ;;
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001200 dri)
Jakob Bornecrantzbc0532b2009-12-04 18:50:29 +00001201 GALLIUM_STATE_TRACKERS_DIRS="dri"
1202 if test "x$enable_egl" = xyes; then
Chia-I Wu3c967a92010-01-22 16:31:43 +08001203 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
Jakob Bornecrantzbc0532b2009-12-04 18:50:29 +00001204 fi
1205 # Have only tested st/xorg on 1.6.0 servers
1206 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
1207 HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
1208 HAVE_XORG="no")
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001209 ;;
1210 esac
1211 ;;
1212*)
1213 # verify the requested state tracker exist
1214 state_trackers=`IFS=', '; echo $with_state_trackers`
1215 for tracker in $state_trackers; do
1216 test -d "$srcdir/src/gallium/state_trackers/$tracker" || \
1217 AC_MSG_ERROR([state tracker '$tracker' doesn't exist])
Dan Nicholson66f97862009-04-29 12:11:43 -07001218
Chia-I Wue5d351d2009-12-23 11:18:00 +08001219 case "$tracker" in
Chia-I Wu3c967a92010-01-22 16:31:43 +08001220 egl)
Chia-I Wue5d351d2009-12-23 11:18:00 +08001221 if test "x$enable_egl" != xyes; then
Chia-I Wu3c967a92010-01-22 16:31:43 +08001222 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
Chia-I Wue5d351d2009-12-23 11:18:00 +08001223 fi
1224 ;;
1225 xorg)
Dave Airliee9d6ab72009-09-21 13:26:48 +10001226 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
Jakob Bornecrantz5c4bdbd2009-10-15 01:24:53 +01001227 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
Dave Airliee9d6ab72009-09-21 13:26:48 +10001228 HAVE_XEXTPROTO_71="no")
Chia-I Wue5d351d2009-12-23 11:18:00 +08001229 ;;
1230 es)
1231 # mesa/es is required to build es state tracker
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001232 CORE_DIRS="$CORE_DIRS mesa/es"
Chia-I Wue5d351d2009-12-23 11:18:00 +08001233 ;;
1234 esac
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001235 done
1236 GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
1237 ;;
1238esac
1239
Chia-I Wu49381d62010-01-11 01:23:01 +08001240AC_ARG_WITH([egl-displays],
1241 [AS_HELP_STRING([--with-egl-displays@<:@=DIRS...@:>@],
1242 [comma delimited native displays libEGL supports, e.g.
Chia-I Wua68b51d2010-01-03 19:24:04 +08001243 "x11,kms" @<:@default=auto@:>@])],
Chia-I Wu49381d62010-01-11 01:23:01 +08001244 [with_egl_displays="$withval"],
1245 [with_egl_displays=yes])
1246
1247EGL_DISPLAYS=""
1248case "$with_egl_displays" in
1249yes)
1250 if test "x$enable_egl" = xyes && test "x$mesa_driver" != xosmesa; then
1251 EGL_DISPLAYS="x11"
1252 fi
1253 ;;
1254*)
1255 if test "x$enable_egl" != xyes; then
1256 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1257 fi
1258 # verify the requested driver directories exist
1259 egl_displays=`IFS=', '; echo $with_egl_displays`
1260 for dpy in $egl_displays; do
Chia-I Wu3c967a92010-01-22 16:31:43 +08001261 test -d "$srcdir/src/gallium/state_trackers/egl/$dpy" || \
Chia-I Wu49381d62010-01-11 01:23:01 +08001262 AC_MSG_ERROR([EGL display '$dpy' does't exist])
1263 done
1264 EGL_DISPLAYS="$egl_displays"
1265 ;;
1266esac
1267AC_SUBST([EGL_DISPLAYS])
1268
Chia-I Wu28c3e572010-01-23 20:18:43 +08001269AC_ARG_WITH([egl-driver-dir],
1270 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1271 [directory for EGL drivers [[default=${libdir}/egl]]])],
1272 [EGL_DRIVER_INSTALL_DIR="$withval"],
1273 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1274AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1275
Joel Bosveld8acca482009-03-06 08:46:08 +09001276AC_ARG_WITH([xorg-driver-dir],
1277 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1278 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1279 [XORG_DRIVER_INSTALL_DIR="$withval"],
1280 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1281AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1282
Tom Fogal7085dce2009-08-13 19:40:30 -06001283AC_ARG_WITH([max-width],
1284 [AS_HELP_STRING([--with-max-width=N],
1285 [Maximum framebuffer width (4096)])],
1286 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1287 AS_IF([test "${withval}" -gt "4096"],
1288 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1289)
1290AC_ARG_WITH([max-height],
1291 [AS_HELP_STRING([--with-max-height=N],
1292 [Maximum framebuffer height (4096)])],
1293 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1294 AS_IF([test "${withval}" -gt "4096"],
1295 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1296)
1297
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001298dnl
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001299dnl Gallium SVGA configuration
1300dnl
1301AC_ARG_ENABLE([gallium-svga],
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001302 [AS_HELP_STRING([--enable-gallium-svga],
1303 [build gallium SVGA @<:@default=disabled@:>@])],
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001304 [enable_gallium_svga="$enableval"],
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001305 [enable_gallium_svga=auto])
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001306if test "x$enable_gallium_svga" = xyes; then
1307 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS vmware"
1308 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
Jakob Bornecrantz5e6fff72009-07-19 09:22:31 +02001309elif test "x$enable_gallium_svga" = xauto; then
1310 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga"
Jakob Bornecrantz60769b22009-11-12 01:28:26 +01001311fi
1312
1313dnl
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001314dnl Gallium Intel configuration
1315dnl
1316AC_ARG_ENABLE([gallium-intel],
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001317 [AS_HELP_STRING([--enable-gallium-intel],
1318 [build gallium intel @<:@default=disabled@:>@])],
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001319 [enable_gallium_intel="$enableval"],
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001320 [enable_gallium_intel=auto])
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001321if test "x$enable_gallium_intel" = xyes; then
Jakob Bornecrantzce4f23a2009-11-04 23:02:13 +00001322 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel i965"
1323 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
Jakob Bornecrantz8ac25032009-12-04 16:01:41 +00001324elif test "x$enable_gallium_intel" = xauto; then
Keith Whitwellaa026832009-12-22 09:40:39 +00001325 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 i965"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001326fi
1327
1328dnl
1329dnl Gallium Radeon configuration
1330dnl
1331AC_ARG_ENABLE([gallium-radeon],
1332 [AS_HELP_STRING([--enable-gallium-radeon],
1333 [build gallium radeon @<:@default=disabled@:>@])],
1334 [enable_gallium_radeon="$enableval"],
Jakob Bornecrantz877cadb2010-01-14 22:51:25 +00001335 [enable_gallium_radeon=auto])
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001336if test "x$enable_gallium_radeon" = xyes; then
1337 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS radeon"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00001338 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Jakob Bornecrantz877cadb2010-01-14 22:51:25 +00001339elif test "x$enable_gallium_radeon" = xauto; then
1340 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001341fi
1342
1343dnl
Thierry Vignaud1402ea82009-09-14 11:48:51 -06001344dnl Gallium Nouveau configuration
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001345dnl
1346AC_ARG_ENABLE([gallium-nouveau],
1347 [AS_HELP_STRING([--enable-gallium-nouveau],
1348 [build gallium nouveau @<:@default=disabled@:>@])],
1349 [enable_gallium_nouveau="$enableval"],
1350 [enable_gallium_nouveau=no])
1351if test "x$enable_gallium_nouveau" = xyes; then
1352 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS nouveau"
Francisco Jerez5b6b67e2010-02-04 22:15:22 +01001353 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv40 nv50"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001354fi
1355
Chia-I Wua1306f42010-01-22 15:51:51 +08001356dnl
1357dnl Gallium swrast configuration
1358dnl
1359AC_ARG_ENABLE([gallium-swrast],
1360 [AS_HELP_STRING([--enable-gallium-swrast],
1361 [build gallium swrast @<:@default=disabled@:>@])],
1362 [enable_gallium_swrast="$enableval"],
1363 [enable_gallium_swrast=auto])
1364if test "x$enable_gallium_swrast" = xyes; then
1365 GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS swrast"
1366fi
1367
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001368dnl prepend CORE_DIRS to SRC_DIRS
1369SRC_DIRS="$CORE_DIRS $SRC_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001370
Dan Nicholsondca1b792007-10-23 09:25:58 -07001371dnl Restore LDFLAGS and CPPFLAGS
1372LDFLAGS="$_SAVE_LDFLAGS"
1373CPPFLAGS="$_SAVE_CPPFLAGS"
1374
1375dnl Substitute the config
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -08001376AC_CONFIG_FILES([configs/autoconf])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001377
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001378dnl Replace the configs/current symlink
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001379AC_CONFIG_COMMANDS([configs],[
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001380if test -f configs/current || test -L configs/current; then
1381 rm -f configs/current
1382fi
1383ln -s autoconf configs/current
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001384])
1385
1386AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001387
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001388dnl
1389dnl Output some configuration info for the user
1390dnl
1391echo ""
1392echo " prefix: $prefix"
1393echo " exec_prefix: $exec_prefix"
1394echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07001395echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001396
1397dnl Driver info
1398echo ""
1399echo " Driver: $mesa_driver"
Dan Nicholson544ab202007-12-30 08:41:53 -08001400if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
1401 echo " OSMesa: lib$OSMESA_LIB"
1402else
1403 echo " OSMesa: no"
1404fi
1405if test "$mesa_driver" = dri; then
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001406 # cleanup the drivers var
1407 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001408if test "x$DRI_DIRS" = x; then
1409 echo " DRI drivers: no"
1410else
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001411 echo " DRI drivers: $dri_dirs"
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001412fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001413 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08001414fi
RALOVICH, Kristóf5f19f5c2008-11-04 11:53:32 +01001415echo " Use XCB: $enable_xcb"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001416
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001417echo ""
1418if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
1419 echo " Gallium: yes"
1420 echo " Gallium dirs: $GALLIUM_DIRS"
1421 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001422 echo " Winsys drm dirs:$GALLIUM_WINSYS_DRM_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00001423 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001424 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
1425else
1426 echo " Gallium: no"
1427fi
1428
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001429dnl Libraries
1430echo ""
1431echo " Shared libs: $enable_shared"
1432echo " Static libs: $enable_static"
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001433if test "$enable_egl" = yes; then
1434 echo " EGL: $EGL_DRIVERS_DIRS"
1435else
1436 echo " EGL: no"
1437fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001438echo " GLU: $enable_glu"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001439echo " GLw: $enable_glw (Motif: $enable_motif)"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001440echo " glut: $enable_glut"
1441
1442dnl Programs
1443# cleanup the programs var for display
1444program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1445if test "x$program_dirs" = x; then
1446 echo " Demos: no"
1447else
1448 echo " Demos: $program_dirs"
1449fi
1450
Dan Nicholson16a07fb2007-12-12 09:12:15 -08001451dnl Compiler options
1452# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
1453cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1454 $SED 's/^ *//;s/ */ /;s/ *$//'`
1455cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1456 $SED 's/^ *//;s/ */ /;s/ *$//'`
1457defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1458echo ""
1459echo " CFLAGS: $cflags"
1460echo " CXXFLAGS: $cxxflags"
1461echo " Macros: $defines"
1462
Dan Nicholsondca1b792007-10-23 09:25:58 -07001463echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07001464echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001465echo ""