blob: a9a8d5ad0be27a70ed6893c84c5f29018aca327d [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'])])
8m4_ifval(mesa_version,[],[
9 m4_errprint([Error: Failed to get the Mesa version from the output of
10 running `make -f bin/version.mk version'
11])
12 m4_exit([1])
13])
Dan Nicholsondca1b792007-10-23 09:25:58 -070014
Dan Nicholsone97ab722008-07-01 08:55:42 -070015dnl Tell the user about autoconf.html in the --help output
16m4_divert_once([HELP_END], [
17See docs/autoconf.html for more details on the options for Mesa.])
18
Dan Nicholson00994ac2008-04-30 15:06:00 -070019AC_INIT([Mesa],[mesa_version],
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -080020 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
Dan Nicholson297e16c2008-05-05 15:42:53 -070021AC_CONFIG_AUX_DIR([bin])
Dan Nicholsondca1b792007-10-23 09:25:58 -070022AC_CANONICAL_HOST
23
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070024dnl Versions for external dependencies
Brian44557bf2009-01-10 16:32:32 -070025LIBDRM_REQUIRED=2.4.3
Kristian Høgsberg154a9e52008-12-01 21:44:03 -050026DRI2PROTO_REQUIRED=1.99.3
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070027
Dan Nicholsondca1b792007-10-23 09:25:58 -070028dnl Check for progs
29AC_PROG_CPP
30AC_PROG_CC
31AC_PROG_CXX
Dan Nicholson297e16c2008-05-05 15:42:53 -070032AC_CHECK_PROGS([MAKE], [gmake make])
33AC_PATH_PROG([MKDEP], [makedepend])
34AC_PATH_PROG([SED], [sed])
Dan Nicholson41b00702007-12-12 08:48:30 -080035
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070036dnl We need a POSIX shell for parts of the build. Assume we have one
37dnl in most cases.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070038case "$host_os" in
39solaris*)
40 # Solaris /bin/sh is too old/non-POSIX compliant
41 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070042 SHELL="$POSIX_SHELL"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070043 ;;
44esac
45
Dan Nicholsondb7fc632008-03-07 11:48:09 -080046MKDEP_OPTIONS=-fdepend
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050047dnl Ask gcc where it's keeping its secret headers
48if test "x$GCC" = xyes; then
Dan Nicholsona3d223f2009-01-30 10:52:09 -080049 for dir in include include-fixed; do
50 GCC_INCLUDES=`$CC -print-file-name=$dir`
51 if test "x$GCC_INCLUDES" != x && \
52 test "$GCC_INCLUDES" != "$dir" && \
53 test -d "$GCC_INCLUDES"; then
54 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
55 fi
56 done
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050057fi
Dan Nicholson297e16c2008-05-05 15:42:53 -070058AC_SUBST([MKDEP_OPTIONS])
Kristian Høgsbergbcecea62008-02-25 18:50:26 -050059
Dan Nicholson41b00702007-12-12 08:48:30 -080060dnl Make sure the pkg-config macros are defined
Dan Nicholson297e16c2008-05-05 15:42:53 -070061m4_ifdef([PKG_PROG_PKG_CONFIG],[],[
Dan Nicholson7154d662008-04-30 13:53:37 -070062 m4_errprint([Error: Could not locate the pkg-config autoconf macros.
63 These are usually located in /usr/share/aclocal/pkg.m4. If your
64 macros are in a different location, try setting the environment
65 variable ACLOCAL="aclocal -I/other/macro/dir" before running
66 autoreconf.
67])
68 m4_exit([1])
69])
Dan Nicholsondca1b792007-10-23 09:25:58 -070070PKG_PROG_PKG_CONFIG()
71
72dnl LIB_DIR - library basename
73LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -070074AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -070075
76dnl Cache LDFLAGS so we can add EXTRA_LIB_PATH and restore it later
77_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholson297e16c2008-05-05 15:42:53 -070078AC_ARG_VAR([EXTRA_LIB_PATH],[Extra -L paths for the linker])
79AC_SUBST([EXTRA_LIB_PATH])
Dan Nicholsondca1b792007-10-23 09:25:58 -070080
81dnl Cache CPPFLAGS so we can add *_INCLUDES and restore it later
82_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholson297e16c2008-05-05 15:42:53 -070083AC_ARG_VAR([X11_INCLUDES],[Extra -I paths for X11 headers])
84AC_SUBST([X11_INCLUDES])
Dan Nicholsondca1b792007-10-23 09:25:58 -070085
86dnl Compiler macros
87DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -070088AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -070089case "$host_os" in
Julien Cristau7f7fc3e2009-01-12 16:04:32 +010090*-gnu*)
Dan Nicholson29f603a2009-01-12 11:10:31 -080091 DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
Dan Nicholsondca1b792007-10-23 09:25:58 -070092 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070093solaris*)
94 DEFINES="$DEFINES -DPTHREADS -DSVR4"
95 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -070096esac
97
98dnl Add flags for gcc and g++
99if test "x$GCC" = xyes; then
100 CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -std=c99 -ffast-math"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800101
102 # Work around aliasing bugs - developers should comment this out
103 CFLAGS="$CFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700104fi
105if test "x$GXX" = xyes; then
106 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800107
108 # Work around aliasing bugs - developers should comment this out
109 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700110fi
111
112dnl These should be unnecessary, but let the user set them if they want
Dan Nicholson297e16c2008-05-05 15:42:53 -0700113AC_ARG_VAR([OPT_FLAGS], [Additional optimization flags for the compiler.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700114 Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700115AC_ARG_VAR([ARCH_FLAGS], [Additional architecture specific flags for the
Dan Nicholsondca1b792007-10-23 09:25:58 -0700116 compiler. Default is to use CFLAGS.])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700117AC_SUBST([OPT_FLAGS])
118AC_SUBST([ARCH_FLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700119
120dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600121dnl Hacks to enable 32 or 64 bit build
122dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700123AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600124 [AS_HELP_STRING([--enable-32-bit],
125 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700126 [enable_32bit="$enableval"],
127 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600128)
129if test "x$enable_32bit" = xyes; then
130 if test "x$GCC" = xyes; then
131 CFLAGS="$CFLAGS -m32"
132 fi
133 if test "x$GXX" = xyes; then
134 CXXFLAGS="$CXXFLAGS -m32"
135 fi
136fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700137AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600138 [AS_HELP_STRING([--enable-64-bit],
139 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700140 [enable_64bit="$enableval"],
141 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600142)
143if test "x$enable_64bit" = xyes; then
144 if test "x$GCC" = xyes; then
145 CFLAGS="$CFLAGS -m64"
146 fi
147 if test "x$GXX" = xyes; then
148 CXXFLAGS="$CXXFLAGS -m64"
149 fi
150fi
151
152dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800153dnl shared/static libraries, mimic libtool options
154dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700155AC_ARG_ENABLE([static],
Dan Nicholson88586332007-11-15 08:59:57 -0800156 [AS_HELP_STRING([--enable-static],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800157 [build static libraries @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700158 [enable_static="$enableval"],
159 [enable_static=no]
Dan Nicholson88586332007-11-15 08:59:57 -0800160)
161case "x$enable_static" in
162xyes|xno ) ;;
163x ) enable_static=no ;;
164* )
165 AC_MSG_ERROR([Static library option '$enable_static' is not a valid])
166 ;;
167esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700168AC_ARG_ENABLE([shared],
Dan Nicholson88586332007-11-15 08:59:57 -0800169 [AS_HELP_STRING([--disable-shared],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800170 [build shared libraries @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700171 [enable_shared="$enableval"],
172 [enable_shared=yes]
Dan Nicholson88586332007-11-15 08:59:57 -0800173)
174case "x$enable_shared" in
175xyes|xno ) ;;
176x ) enable_shared=yes ;;
177* )
178 AC_MSG_ERROR([Shared library option '$enable_shared' is not a valid])
179 ;;
180esac
181
182dnl Can't have static and shared libraries, default to static if user
183dnl explicitly requested. If both disabled, set to static since shared
184dnl was explicitly requirested.
185case "x$enable_static$enable_shared" in
186xyesyes )
187 AC_MSG_WARN([Can't build static and shared libraries, disabling shared])
188 enable_shared=no
189 ;;
190xnono )
191 AC_MSG_WARN([Can't disable both static and shared libraries, enabling static])
192 enable_static=yes
193 ;;
194esac
195
196dnl
197dnl mklib options
198dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700199AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
Dan Nicholson88586332007-11-15 08:59:57 -0800200if test "$enable_static" = yes; then
201 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
202fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700203AC_SUBST([MKLIB_OPTIONS])
Dan Nicholson88586332007-11-15 08:59:57 -0800204
Dan Nicholson23656c42007-12-12 09:02:31 -0800205dnl
206dnl other compiler options
207dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700208AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800209 [AS_HELP_STRING([--enable-debug],
210 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700211 [enable_debug="$enableval"],
212 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800213)
214if test "x$enable_debug" = xyes; then
215 DEFINES="$DEFINES -DDEBUG"
216 if test "x$GCC" = xyes; then
217 CFLAGS="$CFLAGS -g"
218 fi
219 if test "x$GXX" = xyes; then
220 CXXFLAGS="$CXXFLAGS -g"
221 fi
222fi
Dan Nicholson88586332007-11-15 08:59:57 -0800223
224dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700225dnl library names
226dnl
Dan Nicholson88586332007-11-15 08:59:57 -0800227if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800228 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800229else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700230 case "$host_os" in
231 darwin* )
232 LIB_EXTENSION='dylib' ;;
233 * )
234 LIB_EXTENSION='so' ;;
235 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800236fi
Dan Nicholson8217f242009-02-11 15:16:00 -0800237
238GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
239GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
240GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
241GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
242OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
243
244GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
245GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
246GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
247GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
248OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
249
Dan Nicholson297e16c2008-05-05 15:42:53 -0700250AC_SUBST([GL_LIB_NAME])
251AC_SUBST([GLU_LIB_NAME])
252AC_SUBST([GLUT_LIB_NAME])
253AC_SUBST([GLW_LIB_NAME])
254AC_SUBST([OSMESA_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700255
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700256AC_SUBST([GL_LIB_GLOB])
257AC_SUBST([GLU_LIB_GLOB])
258AC_SUBST([GLUT_LIB_GLOB])
259AC_SUBST([GLW_LIB_GLOB])
260AC_SUBST([OSMESA_LIB_GLOB])
261
Dan Nicholsondca1b792007-10-23 09:25:58 -0700262dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700263dnl Arch/platform-specific settings
264dnl
265AC_ARG_ENABLE([asm],
266 [AS_HELP_STRING([--disable-asm],
267 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
268 [enable_asm="$enableval"],
269 [enable_asm=yes]
270)
271asm_arch=""
272ASM_FLAGS=""
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800273MESA_ASM_SOURCES=""
274GLAPI_ASM_SOURCES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700275AC_MSG_CHECKING([whether to enable assembly])
276test "x$enable_asm" = xno && AC_MSG_RESULT([no])
277# disable if cross compiling on x86/x86_64 since we must run gen_matypes
278if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
279 case "$host_cpu" in
280 i?86 | x86_64)
281 enable_asm=no
282 AC_MSG_RESULT([no, cross compiling])
283 ;;
284 esac
285fi
286# check for supported arches
287if test "x$enable_asm" = xyes; then
288 case "$host_cpu" in
289 i?86)
290 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100291 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700292 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
293 ;;
294 esac
295 ;;
296 x86_64)
297 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100298 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700299 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
300 ;;
301 esac
302 ;;
303 powerpc)
304 case "$host_os" in
305 linux*)
306 asm_arch=ppc
307 ;;
308 esac
309 ;;
310 esac
311
312 case "$asm_arch" in
313 x86)
Dan Nicholson61e925f2009-02-11 10:42:34 -0800314 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800315 MESA_ASM_SOURCES='$(X86_SOURCES)'
316 GLAPI_ASM_SOURCES='$(X86_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700317 AC_MSG_RESULT([yes, x86])
318 ;;
319 x86_64)
320 ASM_FLAGS="-DUSE_X86_64_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800321 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
322 GLAPI_ASM_SOURCES='$(X86-64_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700323 AC_MSG_RESULT([yes, x86_64])
324 ;;
325 ppc)
326 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800327 MESA_ASM_SOURCES='$(PPC_SOURCES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700328 AC_MSG_RESULT([yes, ppc])
329 ;;
330 *)
331 AC_MSG_RESULT([no, platform not supported])
332 ;;
333 esac
334fi
335AC_SUBST([ASM_FLAGS])
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800336AC_SUBST([MESA_ASM_SOURCES])
337AC_SUBST([GLAPI_ASM_SOURCES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700338
339dnl PIC code macro
340MESA_PIC_FLAGS
341
342dnl Check to see if dlopen is in default libraries (like Solaris, which
343dnl has it in libc), or if libdl is needed to get it.
344AC_CHECK_FUNC([dlopen], [],
345 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
346
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700347dnl See if posix_memalign is available
348AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
349
Dan Nicholson871125a2008-06-04 13:00:35 -0700350dnl SELinux awareness.
351AC_ARG_ENABLE([selinux],
352 [AS_HELP_STRING([--enable-selinux],
353 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
354 [MESA_SELINUX="$enableval"],
355 [MESA_SELINUX=no])
356if test "x$enable_selinux" = "xyes"; then
357 AC_CHECK_HEADER([selinux/selinux.h],[],
358 [AC_MSG_ERROR([SELinux headers not found])])
359 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
360 [AC_MSG_ERROR([SELinux library not found])])
361 SELINUX_LIBS="-lselinux"
362 DEFINES="$DEFINES -DMESA_SELINUX"
363fi
364
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700365dnl OS-specific libraries
366OS_LIBS=""
367case "$host_os" in
368solaris*)
369 OS_LIBS="-lc"
370 if test "x$GXX" != xyes; then
371 OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
372 fi
373 ;;
374esac
Dan Nicholson871125a2008-06-04 13:00:35 -0700375
376dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800377dnl Driver configuration. Options are xlib, dri and osmesa right now.
Dan Nicholson979ff512007-12-05 18:47:01 -0800378dnl More later: directfb, fbdev, ...
Dan Nicholson44d99142007-12-05 18:47:01 -0800379dnl
Eric Anholt711222b2008-04-18 15:03:01 -0700380default_driver="xlib"
381
382case "$host_os" in
383linux*)
384 case "$host_cpu" in
385 i*86|x86_64|powerpc*) default_driver="dri";;
386 esac
387 ;;
Julien Cristau98fcdf32008-10-28 18:56:05 +0100388*freebsd* | dragonfly*)
Eric Anholt711222b2008-04-18 15:03:01 -0700389 case "$host_cpu" in
390 i*86|x86_64) default_driver="dri";;
391 esac
392 ;;
393esac
394
Dan Nicholson297e16c2008-05-05 15:42:53 -0700395AC_ARG_WITH([driver],
Dan Nicholson44d99142007-12-05 18:47:01 -0800396 [AS_HELP_STRING([--with-driver=DRIVER],
Eric Anholt711222b2008-04-18 15:03:01 -0700397 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700398 [mesa_driver="$withval"],
399 [mesa_driver="$default_driver"])
Dan Nicholson44d99142007-12-05 18:47:01 -0800400dnl Check for valid option
401case "x$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800402xxlib|xdri|xosmesa)
Dan Nicholson44d99142007-12-05 18:47:01 -0800403 ;;
404*)
405 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
406 ;;
407esac
408
409dnl
410dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700411dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100412SRC_DIRS="mesa egl"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700413GLU_DIRS="sgi"
Dan Nicholson44d99142007-12-05 18:47:01 -0800414WINDOW_SYSTEM=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100415GALLIUM_DIRS="auxiliary drivers state_trackers"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100416GALLIUM_WINSYS_DIRS=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100417GALLIUM_WINSYS_DRM_DIRS=""
Jerome Glisse14f79d42008-12-18 13:36:07 +0100418GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100419GALLIUM_DRIVER_DIRS="softpipe failover trace"
420GALLIUM_STATE_TRACKERS_DIRS=""
421
Dan Nicholson44d99142007-12-05 18:47:01 -0800422case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800423xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800424 DRIVER_DIRS="x11"
425 ;;
426dri)
427 SRC_DIRS="glx/x11 $SRC_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100428 DRIVER_DIRS="dri"
Dan Nicholson44d99142007-12-05 18:47:01 -0800429 WINDOW_SYSTEM="dri"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100430 GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100431 GALLIUM_WINSYS_DRM_DIRS="intel"
Jakob Bornecrantze94b4dd2009-02-11 02:25:10 +0100432 GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS i915simple i965simple"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100433 GALLIUM_STATE_TRACKERS_DIRS="egl"
Dan Nicholson44d99142007-12-05 18:47:01 -0800434 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800435osmesa)
436 DRIVER_DIRS="osmesa"
437 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800438esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700439AC_SUBST([SRC_DIRS])
440AC_SUBST([GLU_DIRS])
441AC_SUBST([DRIVER_DIRS])
442AC_SUBST([WINDOW_SYSTEM])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100443AC_SUBST([GALLIUM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100444AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100445AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100446AC_SUBST([GALLIUM_DRIVER_DIRS])
447AC_SUBST([GALLIUM_AUXILIARY_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100448AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700449
450dnl
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800451dnl User supplied program configuration
452dnl
453if test -d "$srcdir/progs/demos"; then
454 default_demos=yes
455else
456 default_demos=no
457fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700458AC_ARG_WITH([demos],
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800459 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
460 [optional comma delimited demo directories to build
Dan Nicholsonc79c93c2007-12-12 18:13:04 -0800461 @<:@default=auto if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700462 [with_demos="$withval"],
463 [with_demos="$default_demos"])
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800464if test "x$with_demos" = x; then
465 with_demos=no
466fi
467
468dnl If $with_demos is yes, directories will be added as libs available
469PROGRAM_DIRS=""
470case "$with_demos" in
Dan Nicholsonb9576552008-03-10 14:05:46 -0700471no) ;;
472yes)
473 # If the driver isn't osmesa, we have libGL and can build xdemos
474 if test "$mesa_driver" != osmesa; then
475 PROGRAM_DIRS="xdemos"
476 fi
477 ;;
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800478*)
479 # verify the requested demos directories exist
480 demos=`IFS=,; echo $with_demos`
481 for demo in $demos; do
482 test -d "$srcdir/progs/$demo" || \
483 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
484 done
485 PROGRAM_DIRS="$demos"
486 ;;
487esac
488
489dnl
Dan Nicholsone6a06092008-05-05 15:16:22 -0700490dnl Find out if X is available. The variable have_x is set if libX11 is
Dan Nicholson99803a42008-07-01 09:03:15 -0700491dnl found to mimic AC_PATH_XTRA.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700492dnl
493if test -n "$PKG_CONFIG"; then
494 AC_MSG_CHECKING([pkg-config files for X11 are available])
Dan Nicholsone6a06092008-05-05 15:16:22 -0700495 PKG_CHECK_EXISTS([x11],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700496 x11_pkgconfig=yes
497 have_x=yes
Dan Nicholsone6a06092008-05-05 15:16:22 -0700498 ],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700499 x11_pkgconfig=no
Dan Nicholsone6a06092008-05-05 15:16:22 -0700500 ])
501 AC_MSG_RESULT([$x11_pkgconfig])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700502else
503 x11_pkgconfig=no
504fi
505dnl Use the autoconf macro if no pkg-config files
506if test "$x11_pkgconfig" = no; then
507 AC_PATH_XTRA
508fi
509
Dan Nicholson99803a42008-07-01 09:03:15 -0700510dnl Try to tell the user that the --x-* options are only used when
511dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
512m4_divert_once([HELP_BEGIN],
513[These options are only used when the X libraries cannot be found by the
514pkg-config utility.])
515
Dan Nicholson44d99142007-12-05 18:47:01 -0800516dnl We need X for xlib and dri, so bomb now if it's not found
517case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800518xlib|dri)
Dan Nicholson44d99142007-12-05 18:47:01 -0800519 if test "$no_x" = yes; then
520 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
521 fi
522 ;;
523esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700524
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700525dnl XCB - this is only used for GLX right now
526AC_ARG_ENABLE([xcb],
527 [AS_HELP_STRING([--enable-xcb],
528 [use XCB for GLX @<:@default=disabled@:>@])],
529 [enable_xcb="$enableval"],
530 [enable_xcb=no])
531if test "x$enable_xcb" = xyes; then
532 DEFINES="$DEFINES -DUSE_XCB"
533else
534 enable_xcb=no
535fi
536
Dan Nicholson44d99142007-12-05 18:47:01 -0800537dnl
538dnl libGL configuration per driver
539dnl
540case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800541xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800542 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700543 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800544 GL_PC_REQ_PRIV="x11 xext"
Dan Nicholsona1307182007-12-12 17:49:49 -0800545 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
546 GL_LIB_DEPS="$XLIBGL_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800547 else
548 # should check these...
549 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
550 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800551 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
552 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson44d99142007-12-05 18:47:01 -0800553 fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700554 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800555 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800556
557 # if static, move the external libraries to the programs
558 # and empty the libraries for libGL
559 if test "$enable_static" = yes; then
560 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
561 GL_LIB_DEPS=""
562 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800563 ;;
564dri)
Dan Nicholson88586332007-11-15 08:59:57 -0800565 # DRI must be shared, I think
566 if test "$enable_static" = yes; then
567 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
568 fi
569
Dan Nicholson44d99142007-12-05 18:47:01 -0800570 # Check for libdrm
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -0700571 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
572 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800573 GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
574 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Dan Nicholson44d99142007-12-05 18:47:01 -0800575
576 # find the DRI deps for libGL
577 if test "$x11_pkgconfig" = yes; then
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700578 # add xcb modules if necessary
579 dri_modules="x11 xext xxf86vm xdamage xfixes"
580 if test "$enable_xcb" = yes; then
581 dri_modules="$dri_modules x11-xcb xcb-glx"
582 fi
583
584 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800585 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
Dan Nicholson44d99142007-12-05 18:47:01 -0800586 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
587 GL_LIB_DEPS="$DRIGL_LIBS"
588 else
589 # should check these...
590 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
591 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800592 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
593 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700594
595 # XCB can only be used from pkg-config
596 if test "$enable_xcb" = yes; then
597 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800598 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700599 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
600 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
601 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800602 fi
603
604 # need DRM libs, -lpthread, etc.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700605 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800606 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800607 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800608osmesa)
609 # No libGL for osmesa
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700610 GL_LIB_DEPS="$OS_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800611 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800612esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700613AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800614AC_SUBST([GL_PC_REQ_PRIV])
615AC_SUBST([GL_PC_LIB_PRIV])
616AC_SUBST([GL_PC_CFLAGS])
617AC_SUBST([DRI_PC_REQ_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700618
619dnl
620dnl More X11 setup
621dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800622if test "$mesa_driver" = xlib; then
Dan Nicholsondca1b792007-10-23 09:25:58 -0700623 DEFINES="$DEFINES -DUSE_XSHM"
624fi
625
626dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800627dnl More DRI setup
628dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700629AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800630 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800631 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700632 [GLX_USE_TLS="$enableval"],
633 [GLX_USE_TLS=no])
Dan Nicholson44d99142007-12-05 18:47:01 -0800634dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700635AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800636 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700637 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700638 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700639 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700640AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Dan Nicholson44d99142007-12-05 18:47:01 -0800641dnl Direct rendering or just indirect rendering
Dan Nicholson297e16c2008-05-05 15:42:53 -0700642AC_ARG_ENABLE([driglx-direct],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800643 [AS_HELP_STRING([--disable-driglx-direct],
644 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700645 [driglx_direct="$enableval"],
646 [driglx_direct="yes"])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800647dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700648AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800649 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700650 [comma delimited DRI drivers list, e.g.
651 "swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700652 [with_dri_drivers="$withval"],
653 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800654if test "x$with_dri_drivers" = x; then
655 with_dri_drivers=no
656fi
657
658dnl If $with_dri_drivers is yes, directories will be added through
659dnl platform checks
660DRI_DIRS=""
661case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100662no) ;;
663yes)
664 DRI_DIRS="yes"
665 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800666*)
667 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700668 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800669 for driver in $dri_drivers; do
670 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
671 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
672 done
673 DRI_DIRS="$dri_drivers"
674 ;;
675esac
676
Dan Nicholson44d99142007-12-05 18:47:01 -0800677dnl Just default to no EGL for now
678USING_EGL=0
Dan Nicholson297e16c2008-05-05 15:42:53 -0700679AC_SUBST([USING_EGL])
Dan Nicholson44d99142007-12-05 18:47:01 -0800680
681dnl Set DRI_DIRS, DEFINES and LIB_DEPS
682if test "$mesa_driver" = dri; then
683 # Use TLS in GLX?
684 if test "x$GLX_USE_TLS" = xyes; then
685 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
686 fi
687
688 if test "x$USING_EGL" = x1; then
689 PROGRAM_DIRS="egl"
690 fi
691
692 # Platform specific settings and drivers to build
693 case "$host_os" in
694 linux*)
695 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Dan Nicholson44d99142007-12-05 18:47:01 -0800696 if test "x$driglx_direct" = xyes; then
697 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
698 fi
Jerome Glisse14f79d42008-12-18 13:36:07 +0100699 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800700
701 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -0800702 x86_64)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800703 # ffb, gamma, and sis are missing because they have not be
704 # converted to use the new interface. i810 are missing
705 # because there is no x86-64 system where they could *ever*
706 # be used.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100707 if test "x$DRI_DIRS" = "xyes"; then
Dan Nicholsona76e2452007-12-07 11:25:08 -0800708 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
George Sapountzis280bf892008-05-11 14:43:40 +0300709 savage tdfx unichrome swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800710 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800711 ;;
712 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800713 # Build only the drivers for cards that exist on PowerPC.
714 # At some point MGA will be added, but not yet.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100715 if test "x$DRI_DIRS" = "xyes"; then
George Sapountzis280bf892008-05-11 14:43:40 +0300716 DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800717 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800718 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000719 sparc*)
720 # Build only the drivers for cards that exist on sparc`
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100721 if test "x$DRI_DIRS" = "xyes"; then
Dave Airlie41bdb882008-06-12 16:26:46 +1000722 DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000723 fi
724 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800725 esac
726 ;;
Hasso Tepper9f8df2d2008-04-09 10:51:21 -0700727 freebsd* | dragonfly*)
Dan Nicholson44d99142007-12-05 18:47:01 -0800728 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
729 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
730 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
731 if test "x$driglx_direct" = xyes; then
732 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
733 fi
734 if test "x$GXX" = xyes; then
735 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
736 fi
737
Dan Nicholsona76e2452007-12-07 11:25:08 -0800738 # ffb and gamma are missing because they have not been converted
739 # to use the new interface.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100740 if test "x$DRI_DIRS" = "xyes"; then
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800741 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
George Sapountzis280bf892008-05-11 14:43:40 +0300742 unichrome savage sis swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800743 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800744 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700745 solaris*)
746 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
747 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
748 if test "x$driglx_direct" = xyes; then
749 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
750 fi
751 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800752 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -0800753
754 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100755 if test "x$DRI_DIRS" = "xyes"; then
Dan Nicholson112a40e2008-02-21 10:17:19 -0800756 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
George Sapountzis280bf892008-05-11 14:43:40 +0300757 savage sis tdfx trident unichrome ffb swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -0800758 fi
759
Dan Nicholson44d99142007-12-05 18:47:01 -0800760 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
761
762 # Check for expat
763 EXPAT_INCLUDES=""
764 EXPAT_LIB=-lexpat
Dan Nicholson297e16c2008-05-05 15:42:53 -0700765 AC_ARG_WITH([expat],
766 [AS_HELP_STRING([--with-expat=DIR],
767 [expat install directory])],[
Dan Nicholson44d99142007-12-05 18:47:01 -0800768 EXPAT_INCLUDES="-I$withval/include"
769 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
770 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
771 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
772 ])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700773 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
774 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
775 [AC_MSG_ERROR([Expat required for DRI.])])
Dan Nicholson44d99142007-12-05 18:47:01 -0800776
777 # put all the necessary libs together
Eric Anholt050c5332008-03-20 17:28:58 -0700778 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800779fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700780AC_SUBST([DRI_DIRS])
781AC_SUBST([EXPAT_INCLUDES])
782AC_SUBST([DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -0800783
784dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700785dnl OSMesa configuration
786dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800787if test "$mesa_driver" = xlib; then
Dan Nicholson544ab202007-12-30 08:41:53 -0800788 default_gl_osmesa=yes
Dan Nicholson979ff512007-12-05 18:47:01 -0800789else
Dan Nicholson544ab202007-12-30 08:41:53 -0800790 default_gl_osmesa=no
Dan Nicholson44d99142007-12-05 18:47:01 -0800791fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700792AC_ARG_ENABLE([gl-osmesa],
Dan Nicholson544ab202007-12-30 08:41:53 -0800793 [AS_HELP_STRING([--enable-gl-osmesa],
794 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700795 [gl_osmesa="$enableval"],
796 [gl_osmesa="$default_gl_osmesa"])
Dan Nicholson544ab202007-12-30 08:41:53 -0800797if test "x$gl_osmesa" = xyes; then
798 if test "$mesa_driver" = osmesa; then
799 AC_MSG_ERROR([libGL is not available for OSMesa driver])
Dan Nicholson979ff512007-12-05 18:47:01 -0800800 else
Dan Nicholson544ab202007-12-30 08:41:53 -0800801 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Dan Nicholson979ff512007-12-05 18:47:01 -0800802 fi
803fi
804
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800805dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -0700806AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800807 [AS_HELP_STRING([--with-osmesa-bits=BITS],
808 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700809 [osmesa_bits="$withval"],
810 [osmesa_bits=8])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800811if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
812 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
813 osmesa_bits=8
814fi
815case "x$osmesa_bits" in
816x8)
817 OSMESA_LIB=OSMesa
818 ;;
819x16|x32)
820 OSMESA_LIB="OSMesa$osmesa_bits"
821 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
822 ;;
823*)
824 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
825 ;;
826esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700827AC_SUBST([OSMESA_LIB])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800828
Dan Nicholson979ff512007-12-05 18:47:01 -0800829case "$mesa_driver" in
830osmesa)
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700831 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800832 if test "$enable_static" = no; then
Adam Jackson66611f22008-02-15 13:49:12 -0500833 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800834 else
835 OSMESA_LIB_DEPS=""
836 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800837 OSMESA_MESA_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800838 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800839 ;;
840*)
841 # Link OSMesa to libGL otherwise
842 OSMESA_LIB_DEPS=""
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700843 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800844 if test "$enable_static" = no; then
845 OSMESA_MESA_DEPS='-l$(GL_LIB)'
846 else
847 OSMESA_MESA_DEPS=""
848 fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800849 OSMESA_PC_REQ="gl"
Dan Nicholson979ff512007-12-05 18:47:01 -0800850 ;;
851esac
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700852if test "$enable_static" = no; then
853 OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
854fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800855OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700856AC_SUBST([OSMESA_LIB_DEPS])
857AC_SUBST([OSMESA_MESA_DEPS])
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800858AC_SUBST([OSMESA_PC_REQ])
859AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700860
861dnl
862dnl GLU configuration
863dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700864AC_ARG_ENABLE([glu],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800865 [AS_HELP_STRING([--disable-glu],
866 [enable OpenGL Utility library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700867 [enable_glu="$enableval"],
868 [enable_glu=yes])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700869if test "x$enable_glu" = xyes; then
870 SRC_DIRS="$SRC_DIRS glu"
871
Dan Nicholson979ff512007-12-05 18:47:01 -0800872 case "$mesa_driver" in
873 osmesa)
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800874 # If GLU is available and we have libOSMesa (not 16 or 32),
875 # we can build the osdemos
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800876 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800877 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
878 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700879
Dan Nicholson979ff512007-12-05 18:47:01 -0800880 # Link libGLU to libOSMesa instead of libGL
881 GLU_LIB_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800882 GLU_PC_REQ="osmesa"
Dan Nicholson88586332007-11-15 08:59:57 -0800883 if test "$enable_static" = no; then
884 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
885 else
886 GLU_MESA_DEPS=""
887 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800888 ;;
889 *)
Dan Nicholson88586332007-11-15 08:59:57 -0800890 # If static, empty GLU_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800891 GLU_PC_REQ="gl"
892 GLU_PC_LIB_PRIV="-lm"
Dan Nicholson88586332007-11-15 08:59:57 -0800893 if test "$enable_static" = no; then
894 GLU_LIB_DEPS="-lm"
895 GLU_MESA_DEPS='-l$(GL_LIB)'
896 else
897 GLU_LIB_DEPS=""
898 GLU_MESA_DEPS=""
899 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
900 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800901 ;;
902 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700903fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700904if test "$enable_static" = no; then
905 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
906fi
Dan Nicholson71e208b2008-11-24 11:01:57 -0800907GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700908AC_SUBST([GLU_LIB_DEPS])
909AC_SUBST([GLU_MESA_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800910AC_SUBST([GLU_PC_REQ])
911AC_SUBST([GLU_PC_REQ_PRIV])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800912AC_SUBST([GLU_PC_LIB_PRIV])
913AC_SUBST([GLU_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700914
915dnl
916dnl GLw configuration
917dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700918AC_ARG_ENABLE([glw],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800919 [AS_HELP_STRING([--disable-glw],
920 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700921 [enable_glw="$enableval"],
922 [enable_glw=yes])
Dan Nicholson979ff512007-12-05 18:47:01 -0800923dnl Don't build GLw on osmesa
924if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
925 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
926 enable_glw=no
927fi
Dan Nicholson776c60d2008-07-18 07:40:41 -0700928AC_ARG_ENABLE([motif],
929 [AS_HELP_STRING([--enable-motif],
930 [use Motif widgets in GLw @<:@default=disabled@:>@])],
931 [enable_motif="$enableval"],
932 [enable_motif=no])
933
Dan Nicholsondca1b792007-10-23 09:25:58 -0700934if test "x$enable_glw" = xyes; then
935 SRC_DIRS="$SRC_DIRS glw"
936 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700937 PKG_CHECK_MODULES([GLW],[x11 xt])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800938 GLW_PC_REQ_PRIV="x11 xt"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700939 GLW_LIB_DEPS="$GLW_LIBS"
940 else
941 # should check these...
Dan Nicholson776c60d2008-07-18 07:40:41 -0700942 GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800943 GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
944 GLW_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson776c60d2008-07-18 07:40:41 -0700945 fi
946
947 GLW_SOURCES="GLwDrawA.c"
948 MOTIF_CFLAGS=
949 if test "x$enable_motif" = xyes; then
950 GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
951 AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
952 if test "x$MOTIF_CONFIG" != xno; then
953 MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
954 MOTIF_LIBS=`$MOTIF_CONFIG --libs`
955 else
956 AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
957 [AC_MSG_ERROR([Can't locate Motif headers])])
958 AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
959 [AC_MSG_ERROR([Can't locate Motif Xm library])])
960 fi
961 # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
962 GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800963 GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
964 GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700965 fi
966
Dan Nicholson88586332007-11-15 08:59:57 -0800967 # If static, empty GLW_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800968 GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800969 if test "$enable_static" = no; then
970 GLW_MESA_DEPS='-l$(GL_LIB)'
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700971 GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800972 else
973 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
974 GLW_LIB_DEPS=""
975 GLW_MESA_DEPS=""
976 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700977fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700978AC_SUBST([GLW_LIB_DEPS])
979AC_SUBST([GLW_MESA_DEPS])
Dan Nicholson776c60d2008-07-18 07:40:41 -0700980AC_SUBST([GLW_SOURCES])
981AC_SUBST([MOTIF_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800982AC_SUBST([GLW_PC_REQ_PRIV])
983AC_SUBST([GLW_PC_LIB_PRIV])
984AC_SUBST([GLW_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700985
986dnl
987dnl GLUT configuration
988dnl
989if test -f "$srcdir/include/GL/glut.h"; then
990 default_glut=yes
991else
992 default_glut=no
993fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700994AC_ARG_ENABLE([glut],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800995 [AS_HELP_STRING([--disable-glut],
996 [enable GLUT library @<:@default=enabled if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700997 [enable_glut="$enableval"],
998 [enable_glut="$default_glut"])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700999
1000dnl Can't build glut if GLU not available
1001if test "x$enable_glu$enable_glut" = xnoyes; then
1002 AC_MSG_WARN([Disabling glut since GLU is disabled])
1003 enable_glut=no
1004fi
Dan Nicholson979ff512007-12-05 18:47:01 -08001005dnl Don't build glut on osmesa
1006if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
1007 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
1008 enable_glut=no
1009fi
1010
Dan Nicholsondca1b792007-10-23 09:25:58 -07001011if test "x$enable_glut" = xyes; then
1012 SRC_DIRS="$SRC_DIRS glut/glx"
1013 GLUT_CFLAGS=""
1014 if test "x$GCC" = xyes; then
1015 GLUT_CFLAGS="-fexceptions"
1016 fi
1017 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001018 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001019 GLUT_PC_REQ_PRIV="x11 xmu xi"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001020 GLUT_LIB_DEPS="$GLUT_LIBS"
1021 else
1022 # should check these...
Dan Nicholson70d0c832007-12-07 11:12:20 -08001023 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001024 GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
1025 GLUT_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001026 fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001027 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001028 GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001029
1030 # If glut is available, we can build most programs
Dan Nicholson8e4d1472007-11-15 08:59:57 -08001031 if test "$with_demos" = yes; then
1032 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
1033 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001034
Dan Nicholson88586332007-11-15 08:59:57 -08001035 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
1036 if test "$enable_static" = no; then
1037 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
1038 else
1039 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
1040 GLUT_LIB_DEPS=""
1041 GLUT_MESA_DEPS=""
1042 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001043fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001044AC_SUBST([GLUT_LIB_DEPS])
1045AC_SUBST([GLUT_MESA_DEPS])
1046AC_SUBST([GLUT_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001047AC_SUBST([GLUT_PC_REQ_PRIV])
1048AC_SUBST([GLUT_PC_LIB_PRIV])
1049AC_SUBST([GLUT_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001050
1051dnl
1052dnl Program library dependencies
1053dnl Only libm is added here if necessary as the libraries should
1054dnl be pulled in by the linker
1055dnl
1056if test "x$APP_LIB_DEPS" = x; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001057 case "$host_os" in
1058 solaris*)
1059 APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
1060 ;;
1061 *)
1062 APP_LIB_DEPS="-lm"
1063 ;;
1064 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -07001065fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001066AC_SUBST([APP_LIB_DEPS])
1067AC_SUBST([PROGRAM_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001068
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001069dnl
1070dnl Gallium configuration
1071dnl
1072AC_ARG_ENABLE([gallium],
1073 [AS_HELP_STRING([--disable-gallium],
1074 [build gallium @<:@default=enabled@:>@])],
1075 [enable_gallium="$enableval"],
1076 [enable_gallium=yes])
1077if test "x$enable_gallium" = xyes; then
1078 SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
1079fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001080
1081dnl Restore LDFLAGS and CPPFLAGS
1082LDFLAGS="$_SAVE_LDFLAGS"
1083CPPFLAGS="$_SAVE_CPPFLAGS"
1084
1085dnl Substitute the config
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -08001086AC_CONFIG_FILES([configs/autoconf])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001087
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001088dnl Replace the configs/current symlink
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001089AC_CONFIG_COMMANDS([configs],[
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001090if test -f configs/current || test -L configs/current; then
1091 rm -f configs/current
1092fi
1093ln -s autoconf configs/current
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001094])
1095
1096AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001097
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001098dnl
1099dnl Output some configuration info for the user
1100dnl
1101echo ""
1102echo " prefix: $prefix"
1103echo " exec_prefix: $exec_prefix"
1104echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07001105echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001106
1107dnl Driver info
1108echo ""
1109echo " Driver: $mesa_driver"
Dan Nicholson544ab202007-12-30 08:41:53 -08001110if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
1111 echo " OSMesa: lib$OSMESA_LIB"
1112else
1113 echo " OSMesa: no"
1114fi
1115if test "$mesa_driver" = dri; then
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001116 # cleanup the drivers var
1117 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001118if test "x$DRI_DIRS" = x; then
1119 echo " DRI drivers: no"
1120else
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001121 echo " DRI drivers: $dri_dirs"
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001122fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001123 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08001124fi
RALOVICH, Kristóf5f19f5c2008-11-04 11:53:32 +01001125echo " Use XCB: $enable_xcb"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001126
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001127echo ""
1128if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
1129 echo " Gallium: yes"
1130 echo " Gallium dirs: $GALLIUM_DIRS"
1131 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
1132 echo " Winsys drm dirs: $GALLIUM_WINSYS_DRM_DIRS"
1133 echo " Auxiliary dirs: $GALLIUM_AUXILIARY_DIRS"
1134 echo " Driver dirs: $GALLIUM_DRIVER_DIRS"
1135 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
1136else
1137 echo " Gallium: no"
1138fi
1139
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001140dnl Libraries
1141echo ""
1142echo " Shared libs: $enable_shared"
1143echo " Static libs: $enable_static"
1144echo " GLU: $enable_glu"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001145echo " GLw: $enable_glw (Motif: $enable_motif)"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001146echo " glut: $enable_glut"
1147
1148dnl Programs
1149# cleanup the programs var for display
1150program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1151if test "x$program_dirs" = x; then
1152 echo " Demos: no"
1153else
1154 echo " Demos: $program_dirs"
1155fi
1156
Dan Nicholson16a07fb2007-12-12 09:12:15 -08001157dnl Compiler options
1158# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
1159cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1160 $SED 's/^ *//;s/ */ /;s/ *$//'`
1161cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1162 $SED 's/^ *//;s/ */ /;s/ *$//'`
1163defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1164echo ""
1165echo " CFLAGS: $cflags"
1166echo " CXXFLAGS: $cxxflags"
1167echo " Macros: $defines"
1168
Dan Nicholsondca1b792007-10-23 09:25:58 -07001169echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07001170echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001171echo ""