blob: be5bcad0f3d8721c9d9cd0717ffea785542462d3 [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
228 GL_LIB_NAME='lib$(GL_LIB).a'
229 GLU_LIB_NAME='lib$(GLU_LIB).a'
230 GLUT_LIB_NAME='lib$(GLUT_LIB).a'
231 GLW_LIB_NAME='lib$(GLW_LIB).a'
232 OSMESA_LIB_NAME='lib$(OSMESA_LIB).a'
233else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700234 case "$host_os" in
235 darwin* )
236 LIB_EXTENSION='dylib' ;;
237 * )
238 LIB_EXTENSION='so' ;;
239 esac
240
241 GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
242 GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
243 GLUT_LIB_NAME='lib$(GLUT_LIB).'${LIB_EXTENSION}
244 GLW_LIB_NAME='lib$(GLW_LIB).'${LIB_EXTENSION}
245 OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
246
247 GL_LIB_GLOB='lib$(GL_LIB).*'${LIB_EXTENSION}'*'
248 GLU_LIB_GLOB='lib$(GLU_LIB).*'${LIB_EXTENSION}'*'
249 GLUT_LIB_GLOB='lib$(GLUT_LIB).*'${LIB_EXTENSION}'*'
250 GLW_LIB_GLOB='lib$(GLW_LIB).*'${LIB_EXTENSION}'*'
251 OSMESA_LIB_GLOB='lib$(OSMESA_LIB).*'${LIB_EXTENSION}'*'
Dan Nicholson88586332007-11-15 08:59:57 -0800252fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700253AC_SUBST([GL_LIB_NAME])
254AC_SUBST([GLU_LIB_NAME])
255AC_SUBST([GLUT_LIB_NAME])
256AC_SUBST([GLW_LIB_NAME])
257AC_SUBST([OSMESA_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700258
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700259AC_SUBST([GL_LIB_GLOB])
260AC_SUBST([GLU_LIB_GLOB])
261AC_SUBST([GLUT_LIB_GLOB])
262AC_SUBST([GLW_LIB_GLOB])
263AC_SUBST([OSMESA_LIB_GLOB])
264
Dan Nicholsondca1b792007-10-23 09:25:58 -0700265dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700266dnl Arch/platform-specific settings
267dnl
268AC_ARG_ENABLE([asm],
269 [AS_HELP_STRING([--disable-asm],
270 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
271 [enable_asm="$enableval"],
272 [enable_asm=yes]
273)
274asm_arch=""
275ASM_FLAGS=""
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800276MESA_ASM_SOURCES=""
277GLAPI_ASM_SOURCES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700278AC_MSG_CHECKING([whether to enable assembly])
279test "x$enable_asm" = xno && AC_MSG_RESULT([no])
280# disable if cross compiling on x86/x86_64 since we must run gen_matypes
281if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
282 case "$host_cpu" in
283 i?86 | x86_64)
284 enable_asm=no
285 AC_MSG_RESULT([no, cross compiling])
286 ;;
287 esac
288fi
289# check for supported arches
290if test "x$enable_asm" = xyes; then
291 case "$host_cpu" in
292 i?86)
293 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100294 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700295 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
296 ;;
297 esac
298 ;;
299 x86_64)
300 case "$host_os" in
Julien Cristau98fcdf32008-10-28 18:56:05 +0100301 linux* | *freebsd* | dragonfly*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700302 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
303 ;;
304 esac
305 ;;
306 powerpc)
307 case "$host_os" in
308 linux*)
309 asm_arch=ppc
310 ;;
311 esac
312 ;;
313 esac
314
315 case "$asm_arch" in
316 x86)
Dan Nicholson61e925f2009-02-11 10:42:34 -0800317 ASM_FLAGS="-DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800318 MESA_ASM_SOURCES='$(X86_SOURCES)'
319 GLAPI_ASM_SOURCES='$(X86_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700320 AC_MSG_RESULT([yes, x86])
321 ;;
322 x86_64)
323 ASM_FLAGS="-DUSE_X86_64_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800324 MESA_ASM_SOURCES='$(X86-64_SOURCES)'
325 GLAPI_ASM_SOURCES='$(X86-64_API)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700326 AC_MSG_RESULT([yes, x86_64])
327 ;;
328 ppc)
329 ASM_FLAGS="-DUSE_PPC_ASM -DUSE_VMX_ASM"
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800330 MESA_ASM_SOURCES='$(PPC_SOURCES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700331 AC_MSG_RESULT([yes, ppc])
332 ;;
333 *)
334 AC_MSG_RESULT([no, platform not supported])
335 ;;
336 esac
337fi
338AC_SUBST([ASM_FLAGS])
Dan Nicholsonc5bae142009-02-11 11:04:29 -0800339AC_SUBST([MESA_ASM_SOURCES])
340AC_SUBST([GLAPI_ASM_SOURCES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700341
342dnl PIC code macro
343MESA_PIC_FLAGS
344
345dnl Check to see if dlopen is in default libraries (like Solaris, which
346dnl has it in libc), or if libdl is needed to get it.
347AC_CHECK_FUNC([dlopen], [],
348 [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
349
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700350dnl See if posix_memalign is available
351AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
352
Dan Nicholson871125a2008-06-04 13:00:35 -0700353dnl SELinux awareness.
354AC_ARG_ENABLE([selinux],
355 [AS_HELP_STRING([--enable-selinux],
356 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
357 [MESA_SELINUX="$enableval"],
358 [MESA_SELINUX=no])
359if test "x$enable_selinux" = "xyes"; then
360 AC_CHECK_HEADER([selinux/selinux.h],[],
361 [AC_MSG_ERROR([SELinux headers not found])])
362 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
363 [AC_MSG_ERROR([SELinux library not found])])
364 SELINUX_LIBS="-lselinux"
365 DEFINES="$DEFINES -DMESA_SELINUX"
366fi
367
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700368dnl OS-specific libraries
369OS_LIBS=""
370case "$host_os" in
371solaris*)
372 OS_LIBS="-lc"
373 if test "x$GXX" != xyes; then
374 OS_CPLUSPLUS_LIBS="-lCrun $OS_LIBS"
375 fi
376 ;;
377esac
Dan Nicholson871125a2008-06-04 13:00:35 -0700378
379dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800380dnl Driver configuration. Options are xlib, dri and osmesa right now.
Dan Nicholson979ff512007-12-05 18:47:01 -0800381dnl More later: directfb, fbdev, ...
Dan Nicholson44d99142007-12-05 18:47:01 -0800382dnl
Eric Anholt711222b2008-04-18 15:03:01 -0700383default_driver="xlib"
384
385case "$host_os" in
386linux*)
387 case "$host_cpu" in
388 i*86|x86_64|powerpc*) default_driver="dri";;
389 esac
390 ;;
Julien Cristau98fcdf32008-10-28 18:56:05 +0100391*freebsd* | dragonfly*)
Eric Anholt711222b2008-04-18 15:03:01 -0700392 case "$host_cpu" in
393 i*86|x86_64) default_driver="dri";;
394 esac
395 ;;
396esac
397
Dan Nicholson297e16c2008-05-05 15:42:53 -0700398AC_ARG_WITH([driver],
Dan Nicholson44d99142007-12-05 18:47:01 -0800399 [AS_HELP_STRING([--with-driver=DRIVER],
Eric Anholt711222b2008-04-18 15:03:01 -0700400 [driver for Mesa: xlib,dri,osmesa @<:@default=dri when available, or xlib@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700401 [mesa_driver="$withval"],
402 [mesa_driver="$default_driver"])
Dan Nicholson44d99142007-12-05 18:47:01 -0800403dnl Check for valid option
404case "x$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800405xxlib|xdri|xosmesa)
Dan Nicholson44d99142007-12-05 18:47:01 -0800406 ;;
407*)
408 AC_MSG_ERROR([Driver '$mesa_driver' is not a valid option])
409 ;;
410esac
411
412dnl
413dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700414dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100415SRC_DIRS="mesa egl"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700416GLU_DIRS="sgi"
Dan Nicholson44d99142007-12-05 18:47:01 -0800417WINDOW_SYSTEM=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100418GALLIUM_DIRS="auxiliary drivers state_trackers"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100419GALLIUM_WINSYS_DIRS=""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100420GALLIUM_WINSYS_DRM_DIRS=""
Jerome Glisse14f79d42008-12-18 13:36:07 +0100421GALLIUM_AUXILIARY_DIRS="draw translate cso_cache pipebuffer tgsi sct rtasm util"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100422GALLIUM_DRIVER_DIRS="softpipe failover trace"
423GALLIUM_STATE_TRACKERS_DIRS=""
424
Dan Nicholson44d99142007-12-05 18:47:01 -0800425case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800426xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800427 DRIVER_DIRS="x11"
428 ;;
429dri)
430 SRC_DIRS="glx/x11 $SRC_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100431 DRIVER_DIRS="dri"
Dan Nicholson44d99142007-12-05 18:47:01 -0800432 WINDOW_SYSTEM="dri"
Jerome Glisse14f79d42008-12-18 13:36:07 +0100433 GALLIUM_WINSYS_DIRS="drm $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100434 GALLIUM_WINSYS_DRM_DIRS="intel"
Jakob Bornecrantze94b4dd2009-02-11 02:25:10 +0100435 GALLIUM_DRIVER_DIRS="$GALLIUM_DRIVER_DIRS i915simple i965simple"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100436 GALLIUM_STATE_TRACKERS_DIRS="egl"
Dan Nicholson44d99142007-12-05 18:47:01 -0800437 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800438osmesa)
439 DRIVER_DIRS="osmesa"
440 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800441esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700442AC_SUBST([SRC_DIRS])
443AC_SUBST([GLU_DIRS])
444AC_SUBST([DRIVER_DIRS])
445AC_SUBST([WINDOW_SYSTEM])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100446AC_SUBST([GALLIUM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100447AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100448AC_SUBST([GALLIUM_WINSYS_DRM_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100449AC_SUBST([GALLIUM_DRIVER_DIRS])
450AC_SUBST([GALLIUM_AUXILIARY_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100451AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700452
453dnl
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800454dnl User supplied program configuration
455dnl
456if test -d "$srcdir/progs/demos"; then
457 default_demos=yes
458else
459 default_demos=no
460fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700461AC_ARG_WITH([demos],
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800462 [AS_HELP_STRING([--with-demos@<:@=DIRS...@:>@],
463 [optional comma delimited demo directories to build
Dan Nicholsonc79c93c2007-12-12 18:13:04 -0800464 @<:@default=auto if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700465 [with_demos="$withval"],
466 [with_demos="$default_demos"])
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800467if test "x$with_demos" = x; then
468 with_demos=no
469fi
470
471dnl If $with_demos is yes, directories will be added as libs available
472PROGRAM_DIRS=""
473case "$with_demos" in
Dan Nicholsonb9576552008-03-10 14:05:46 -0700474no) ;;
475yes)
476 # If the driver isn't osmesa, we have libGL and can build xdemos
477 if test "$mesa_driver" != osmesa; then
478 PROGRAM_DIRS="xdemos"
479 fi
480 ;;
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800481*)
482 # verify the requested demos directories exist
483 demos=`IFS=,; echo $with_demos`
484 for demo in $demos; do
485 test -d "$srcdir/progs/$demo" || \
486 AC_MSG_ERROR([Program directory '$demo' doesn't exist])
487 done
488 PROGRAM_DIRS="$demos"
489 ;;
490esac
491
492dnl
Dan Nicholsone6a06092008-05-05 15:16:22 -0700493dnl Find out if X is available. The variable have_x is set if libX11 is
Dan Nicholson99803a42008-07-01 09:03:15 -0700494dnl found to mimic AC_PATH_XTRA.
Dan Nicholsondca1b792007-10-23 09:25:58 -0700495dnl
496if test -n "$PKG_CONFIG"; then
497 AC_MSG_CHECKING([pkg-config files for X11 are available])
Dan Nicholsone6a06092008-05-05 15:16:22 -0700498 PKG_CHECK_EXISTS([x11],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700499 x11_pkgconfig=yes
500 have_x=yes
Dan Nicholsone6a06092008-05-05 15:16:22 -0700501 ],[
Dan Nicholsondca1b792007-10-23 09:25:58 -0700502 x11_pkgconfig=no
Dan Nicholsone6a06092008-05-05 15:16:22 -0700503 ])
504 AC_MSG_RESULT([$x11_pkgconfig])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700505else
506 x11_pkgconfig=no
507fi
508dnl Use the autoconf macro if no pkg-config files
509if test "$x11_pkgconfig" = no; then
510 AC_PATH_XTRA
511fi
512
Dan Nicholson99803a42008-07-01 09:03:15 -0700513dnl Try to tell the user that the --x-* options are only used when
514dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
515m4_divert_once([HELP_BEGIN],
516[These options are only used when the X libraries cannot be found by the
517pkg-config utility.])
518
Dan Nicholson44d99142007-12-05 18:47:01 -0800519dnl We need X for xlib and dri, so bomb now if it's not found
520case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800521xlib|dri)
Dan Nicholson44d99142007-12-05 18:47:01 -0800522 if test "$no_x" = yes; then
523 AC_MSG_ERROR([X11 development libraries needed for $mesa_driver driver])
524 fi
525 ;;
526esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700527
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700528dnl XCB - this is only used for GLX right now
529AC_ARG_ENABLE([xcb],
530 [AS_HELP_STRING([--enable-xcb],
531 [use XCB for GLX @<:@default=disabled@:>@])],
532 [enable_xcb="$enableval"],
533 [enable_xcb=no])
534if test "x$enable_xcb" = xyes; then
535 DEFINES="$DEFINES -DUSE_XCB"
536else
537 enable_xcb=no
538fi
539
Dan Nicholson44d99142007-12-05 18:47:01 -0800540dnl
541dnl libGL configuration per driver
542dnl
543case "$mesa_driver" in
Dan Nicholsona1307182007-12-12 17:49:49 -0800544xlib)
Dan Nicholson44d99142007-12-05 18:47:01 -0800545 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700546 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800547 GL_PC_REQ_PRIV="x11 xext"
Dan Nicholsona1307182007-12-12 17:49:49 -0800548 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
549 GL_LIB_DEPS="$XLIBGL_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800550 else
551 # should check these...
552 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
553 GL_LIB_DEPS="$X_LIBS -lX11 -lXext"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800554 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
555 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson44d99142007-12-05 18:47:01 -0800556 fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700557 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $OS_LIBS"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800558 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread $OS_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800559
560 # if static, move the external libraries to the programs
561 # and empty the libraries for libGL
562 if test "$enable_static" = yes; then
563 APP_LIB_DEPS="$APP_LIB_DEPS $GL_LIB_DEPS"
564 GL_LIB_DEPS=""
565 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800566 ;;
567dri)
Dan Nicholson88586332007-11-15 08:59:57 -0800568 # DRI must be shared, I think
569 if test "$enable_static" = yes; then
570 AC_MSG_ERROR([Can't use static libraries for DRI drivers])
571 fi
572
Dan Nicholson44d99142007-12-05 18:47:01 -0800573 # Check for libdrm
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -0700574 PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED])
575 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800576 GL_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
577 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Dan Nicholson44d99142007-12-05 18:47:01 -0800578
579 # find the DRI deps for libGL
580 if test "$x11_pkgconfig" = yes; then
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700581 # add xcb modules if necessary
582 dri_modules="x11 xext xxf86vm xdamage xfixes"
583 if test "$enable_xcb" = yes; then
584 dri_modules="$dri_modules x11-xcb xcb-glx"
585 fi
586
587 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800588 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
Dan Nicholson44d99142007-12-05 18:47:01 -0800589 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
590 GL_LIB_DEPS="$DRIGL_LIBS"
591 else
592 # should check these...
593 X11_INCLUDES="$X11_INCLUDES $X_CFLAGS"
594 GL_LIB_DEPS="$X_LIBS -lX11 -lXext -lXxf86vm -lXdamage -lXfixes"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800595 GL_PC_LIB_PRIV="$GL_LIB_DEPS"
596 GL_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700597
598 # XCB can only be used from pkg-config
599 if test "$enable_xcb" = yes; then
600 PKG_CHECK_MODULES([XCB],[x11-xcb xcb-glx])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800601 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV x11-xcb xcb-glx"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700602 X11_INCLUDES="$X11_INCLUDES $XCB_CFLAGS"
603 GL_LIB_DEPS="$GL_LIB_DEPS $XCB_LIBS"
604 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800605 fi
606
607 # need DRM libs, -lpthread, etc.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700608 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS $OS_LIBS"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800609 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS $OS_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800610 ;;
Dan Nicholson979ff512007-12-05 18:47:01 -0800611osmesa)
612 # No libGL for osmesa
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700613 GL_LIB_DEPS="$OS_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800614 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800615esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700616AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800617AC_SUBST([GL_PC_REQ_PRIV])
618AC_SUBST([GL_PC_LIB_PRIV])
619AC_SUBST([GL_PC_CFLAGS])
620AC_SUBST([DRI_PC_REQ_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700621
622dnl
623dnl More X11 setup
624dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800625if test "$mesa_driver" = xlib; then
Dan Nicholsondca1b792007-10-23 09:25:58 -0700626 DEFINES="$DEFINES -DUSE_XSHM"
627fi
628
629dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800630dnl More DRI setup
631dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700632AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800633 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800634 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700635 [GLX_USE_TLS="$enableval"],
636 [GLX_USE_TLS=no])
Dan Nicholson44d99142007-12-05 18:47:01 -0800637dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700638AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800639 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700640 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700641 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700642 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700643AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Dan Nicholson44d99142007-12-05 18:47:01 -0800644dnl Direct rendering or just indirect rendering
Dan Nicholson297e16c2008-05-05 15:42:53 -0700645AC_ARG_ENABLE([driglx-direct],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800646 [AS_HELP_STRING([--disable-driglx-direct],
647 [enable direct rendering in GLX for DRI @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700648 [driglx_direct="$enableval"],
649 [driglx_direct="yes"])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800650dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700651AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800652 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700653 [comma delimited DRI drivers list, e.g.
654 "swrast,i965,radeon,nouveau" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700655 [with_dri_drivers="$withval"],
656 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800657if test "x$with_dri_drivers" = x; then
658 with_dri_drivers=no
659fi
660
661dnl If $with_dri_drivers is yes, directories will be added through
662dnl platform checks
663DRI_DIRS=""
664case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100665no) ;;
666yes)
667 DRI_DIRS="yes"
668 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800669*)
670 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700671 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800672 for driver in $dri_drivers; do
673 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
674 AC_MSG_ERROR([DRI driver directory '$driver' doesn't exist])
675 done
676 DRI_DIRS="$dri_drivers"
677 ;;
678esac
679
Dan Nicholson44d99142007-12-05 18:47:01 -0800680dnl Just default to no EGL for now
681USING_EGL=0
Dan Nicholson297e16c2008-05-05 15:42:53 -0700682AC_SUBST([USING_EGL])
Dan Nicholson44d99142007-12-05 18:47:01 -0800683
684dnl Set DRI_DIRS, DEFINES and LIB_DEPS
685if test "$mesa_driver" = dri; then
686 # Use TLS in GLX?
687 if test "x$GLX_USE_TLS" = xyes; then
688 DEFINES="$DEFINES -DGLX_USE_TLS -DPTHREADS"
689 fi
690
691 if test "x$USING_EGL" = x1; then
692 PROGRAM_DIRS="egl"
693 fi
694
695 # Platform specific settings and drivers to build
696 case "$host_os" in
697 linux*)
698 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Dan Nicholson44d99142007-12-05 18:47:01 -0800699 if test "x$driglx_direct" = xyes; then
700 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
701 fi
Jerome Glisse14f79d42008-12-18 13:36:07 +0100702 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800703
704 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -0800705 x86_64)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800706 # ffb, gamma, and sis are missing because they have not be
707 # converted to use the new interface. i810 are missing
708 # because there is no x86-64 system where they could *ever*
709 # be used.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100710 if test "x$DRI_DIRS" = "xyes"; then
Dan Nicholsona76e2452007-12-07 11:25:08 -0800711 DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
George Sapountzis280bf892008-05-11 14:43:40 +0300712 savage tdfx unichrome swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800713 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800714 ;;
715 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800716 # Build only the drivers for cards that exist on PowerPC.
717 # At some point MGA will be added, but not yet.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100718 if test "x$DRI_DIRS" = "xyes"; then
George Sapountzis280bf892008-05-11 14:43:40 +0300719 DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800720 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800721 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000722 sparc*)
723 # Build only the drivers for cards that exist on sparc`
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100724 if test "x$DRI_DIRS" = "xyes"; then
Dave Airlie41bdb882008-06-12 16:26:46 +1000725 DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000726 fi
727 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800728 esac
729 ;;
Hasso Tepper9f8df2d2008-04-09 10:51:21 -0700730 freebsd* | dragonfly*)
Dan Nicholson44d99142007-12-05 18:47:01 -0800731 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
732 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
733 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
734 if test "x$driglx_direct" = xyes; then
735 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
736 fi
737 if test "x$GXX" = xyes; then
738 CXXFLAGS="$CXXFLAGS -ansi -pedantic"
739 fi
740
Dan Nicholsona76e2452007-12-07 11:25:08 -0800741 # ffb and gamma are missing because they have not been converted
742 # to use the new interface.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100743 if test "x$DRI_DIRS" = "xyes"; then
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800744 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
George Sapountzis280bf892008-05-11 14:43:40 +0300745 unichrome savage sis swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800746 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800747 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700748 solaris*)
749 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
750 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
751 if test "x$driglx_direct" = xyes; then
752 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
753 fi
754 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800755 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -0800756
757 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100758 if test "x$DRI_DIRS" = "xyes"; then
Dan Nicholson112a40e2008-02-21 10:17:19 -0800759 DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
George Sapountzis280bf892008-05-11 14:43:40 +0300760 savage sis tdfx trident unichrome ffb swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -0800761 fi
762
Dan Nicholson44d99142007-12-05 18:47:01 -0800763 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
764
765 # Check for expat
766 EXPAT_INCLUDES=""
767 EXPAT_LIB=-lexpat
Dan Nicholson297e16c2008-05-05 15:42:53 -0700768 AC_ARG_WITH([expat],
769 [AS_HELP_STRING([--with-expat=DIR],
770 [expat install directory])],[
Dan Nicholson44d99142007-12-05 18:47:01 -0800771 EXPAT_INCLUDES="-I$withval/include"
772 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
773 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
774 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
775 ])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700776 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
777 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
778 [AC_MSG_ERROR([Expat required for DRI.])])
Dan Nicholson44d99142007-12-05 18:47:01 -0800779
780 # put all the necessary libs together
Eric Anholt050c5332008-03-20 17:28:58 -0700781 DRI_LIB_DEPS="$SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800782fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700783AC_SUBST([DRI_DIRS])
784AC_SUBST([EXPAT_INCLUDES])
785AC_SUBST([DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -0800786
787dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700788dnl OSMesa configuration
789dnl
Dan Nicholsona1307182007-12-12 17:49:49 -0800790if test "$mesa_driver" = xlib; then
Dan Nicholson544ab202007-12-30 08:41:53 -0800791 default_gl_osmesa=yes
Dan Nicholson979ff512007-12-05 18:47:01 -0800792else
Dan Nicholson544ab202007-12-30 08:41:53 -0800793 default_gl_osmesa=no
Dan Nicholson44d99142007-12-05 18:47:01 -0800794fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700795AC_ARG_ENABLE([gl-osmesa],
Dan Nicholson544ab202007-12-30 08:41:53 -0800796 [AS_HELP_STRING([--enable-gl-osmesa],
797 [enable OSMesa on libGL @<:@default=enabled for xlib driver@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700798 [gl_osmesa="$enableval"],
799 [gl_osmesa="$default_gl_osmesa"])
Dan Nicholson544ab202007-12-30 08:41:53 -0800800if test "x$gl_osmesa" = xyes; then
801 if test "$mesa_driver" = osmesa; then
802 AC_MSG_ERROR([libGL is not available for OSMesa driver])
Dan Nicholson979ff512007-12-05 18:47:01 -0800803 else
Dan Nicholson544ab202007-12-30 08:41:53 -0800804 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Dan Nicholson979ff512007-12-05 18:47:01 -0800805 fi
806fi
807
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800808dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -0700809AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800810 [AS_HELP_STRING([--with-osmesa-bits=BITS],
811 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700812 [osmesa_bits="$withval"],
813 [osmesa_bits=8])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800814if test "$mesa_driver" != osmesa && test "x$osmesa_bits" != x8; then
815 AC_MSG_WARN([Ignoring OSMesa channel bits for non-OSMesa driver])
816 osmesa_bits=8
817fi
818case "x$osmesa_bits" in
819x8)
820 OSMESA_LIB=OSMesa
821 ;;
822x16|x32)
823 OSMESA_LIB="OSMesa$osmesa_bits"
824 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
825 ;;
826*)
827 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
828 ;;
829esac
Dan Nicholson297e16c2008-05-05 15:42:53 -0700830AC_SUBST([OSMESA_LIB])
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800831
Dan Nicholson979ff512007-12-05 18:47:01 -0800832case "$mesa_driver" in
833osmesa)
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700834 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800835 if test "$enable_static" = no; then
Adam Jackson66611f22008-02-15 13:49:12 -0500836 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800837 else
838 OSMESA_LIB_DEPS=""
839 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800840 OSMESA_MESA_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800841 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800842 ;;
843*)
844 # Link OSMesa to libGL otherwise
845 OSMESA_LIB_DEPS=""
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700846 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -0800847 if test "$enable_static" = no; then
848 OSMESA_MESA_DEPS='-l$(GL_LIB)'
849 else
850 OSMESA_MESA_DEPS=""
851 fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800852 OSMESA_PC_REQ="gl"
Dan Nicholson979ff512007-12-05 18:47:01 -0800853 ;;
854esac
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700855if test "$enable_static" = no; then
856 OSMESA_LIB_DEPS="$OSMESA_LIB_DEPS $OS_LIBS"
857fi
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800858OSMESA_PC_LIB_PRIV="$OSMESA_PC_LIB_PRIV $OS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700859AC_SUBST([OSMESA_LIB_DEPS])
860AC_SUBST([OSMESA_MESA_DEPS])
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800861AC_SUBST([OSMESA_PC_REQ])
862AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700863
864dnl
865dnl GLU configuration
866dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700867AC_ARG_ENABLE([glu],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800868 [AS_HELP_STRING([--disable-glu],
869 [enable OpenGL Utility library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700870 [enable_glu="$enableval"],
871 [enable_glu=yes])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700872if test "x$enable_glu" = xyes; then
873 SRC_DIRS="$SRC_DIRS glu"
874
Dan Nicholson979ff512007-12-05 18:47:01 -0800875 case "$mesa_driver" in
876 osmesa)
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800877 # If GLU is available and we have libOSMesa (not 16 or 32),
878 # we can build the osdemos
Dan Nicholson8e4d1472007-11-15 08:59:57 -0800879 if test "$with_demos" = yes && test "$osmesa_bits" = 8; then
Dan Nicholson6689f9e2007-12-05 21:04:15 -0800880 PROGRAM_DIRS="$PROGRAM_DIRS osdemos"
881 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700882
Dan Nicholson979ff512007-12-05 18:47:01 -0800883 # Link libGLU to libOSMesa instead of libGL
884 GLU_LIB_DEPS=""
Dan Nicholson8be02fc2008-12-14 09:35:29 -0800885 GLU_PC_REQ="osmesa"
Dan Nicholson88586332007-11-15 08:59:57 -0800886 if test "$enable_static" = no; then
887 GLU_MESA_DEPS='-l$(OSMESA_LIB)'
888 else
889 GLU_MESA_DEPS=""
890 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800891 ;;
892 *)
Dan Nicholson88586332007-11-15 08:59:57 -0800893 # If static, empty GLU_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800894 GLU_PC_REQ="gl"
895 GLU_PC_LIB_PRIV="-lm"
Dan Nicholson88586332007-11-15 08:59:57 -0800896 if test "$enable_static" = no; then
897 GLU_LIB_DEPS="-lm"
898 GLU_MESA_DEPS='-l$(GL_LIB)'
899 else
900 GLU_LIB_DEPS=""
901 GLU_MESA_DEPS=""
902 APP_LIB_DEPS="$APP_LIB_DEPS -lstdc++"
903 fi
Dan Nicholson979ff512007-12-05 18:47:01 -0800904 ;;
905 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700906fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700907if test "$enable_static" = no; then
908 GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
909fi
Dan Nicholson71e208b2008-11-24 11:01:57 -0800910GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
Dan Nicholson297e16c2008-05-05 15:42:53 -0700911AC_SUBST([GLU_LIB_DEPS])
912AC_SUBST([GLU_MESA_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800913AC_SUBST([GLU_PC_REQ])
914AC_SUBST([GLU_PC_REQ_PRIV])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800915AC_SUBST([GLU_PC_LIB_PRIV])
916AC_SUBST([GLU_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700917
918dnl
919dnl GLw configuration
920dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700921AC_ARG_ENABLE([glw],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800922 [AS_HELP_STRING([--disable-glw],
923 [enable Xt/Motif widget library @<:@default=enabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700924 [enable_glw="$enableval"],
925 [enable_glw=yes])
Dan Nicholson979ff512007-12-05 18:47:01 -0800926dnl Don't build GLw on osmesa
927if test "x$enable_glw" = xyes && test "$mesa_driver" = osmesa; then
928 AC_MSG_WARN([Disabling GLw since the driver is OSMesa])
929 enable_glw=no
930fi
Dan Nicholson776c60d2008-07-18 07:40:41 -0700931AC_ARG_ENABLE([motif],
932 [AS_HELP_STRING([--enable-motif],
933 [use Motif widgets in GLw @<:@default=disabled@:>@])],
934 [enable_motif="$enableval"],
935 [enable_motif=no])
936
Dan Nicholsondca1b792007-10-23 09:25:58 -0700937if test "x$enable_glw" = xyes; then
938 SRC_DIRS="$SRC_DIRS glw"
939 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -0700940 PKG_CHECK_MODULES([GLW],[x11 xt])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800941 GLW_PC_REQ_PRIV="x11 xt"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700942 GLW_LIB_DEPS="$GLW_LIBS"
943 else
944 # should check these...
Dan Nicholson776c60d2008-07-18 07:40:41 -0700945 GLW_LIB_DEPS="$X_LIBS -lXt -lX11"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800946 GLW_PC_LIB_PRIV="$GLW_LIB_DEPS"
947 GLW_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholson776c60d2008-07-18 07:40:41 -0700948 fi
949
950 GLW_SOURCES="GLwDrawA.c"
951 MOTIF_CFLAGS=
952 if test "x$enable_motif" = xyes; then
953 GLW_SOURCES="$GLW_SOURCES GLwMDrawA.c"
954 AC_PATH_PROG([MOTIF_CONFIG], [motif-config], [no])
955 if test "x$MOTIF_CONFIG" != xno; then
956 MOTIF_CFLAGS=`$MOTIF_CONFIG --cflags`
957 MOTIF_LIBS=`$MOTIF_CONFIG --libs`
958 else
959 AC_CHECK_HEADER([Xm/PrimitiveP.h], [],
960 [AC_MSG_ERROR([Can't locate Motif headers])])
961 AC_CHECK_LIB([Xm], [XmGetPixmap], [MOTIF_LIBS="-lXm"],
962 [AC_MSG_ERROR([Can't locate Motif Xm library])])
963 fi
964 # MOTIF_LIBS is prepended to GLW_LIB_DEPS since Xm needs Xt/X11
965 GLW_LIB_DEPS="$MOTIF_LIBS $GLW_LIB_DEPS"
Dan Nicholson71e208b2008-11-24 11:01:57 -0800966 GLW_PC_LIB_PRIV="$MOTIF_LIBS $GLW_PC_LIB_PRIV"
967 GLW_PC_CFLAGS="$MOTIF_CFLAGS $GLW_PC_CFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700968 fi
969
Dan Nicholson88586332007-11-15 08:59:57 -0800970 # If static, empty GLW_LIB_DEPS and add libs for programs to link
Dan Nicholson71e208b2008-11-24 11:01:57 -0800971 GLW_PC_LIB_PRIV="$GLW_PC_LIB_PRIV $OS_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800972 if test "$enable_static" = no; then
973 GLW_MESA_DEPS='-l$(GL_LIB)'
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700974 GLW_LIB_DEPS="$GLW_LIB_DEPS $OS_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -0800975 else
976 APP_LIB_DEPS="$APP_LIB_DEPS $GLW_LIB_DEPS"
977 GLW_LIB_DEPS=""
978 GLW_MESA_DEPS=""
979 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700980fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700981AC_SUBST([GLW_LIB_DEPS])
982AC_SUBST([GLW_MESA_DEPS])
Dan Nicholson776c60d2008-07-18 07:40:41 -0700983AC_SUBST([GLW_SOURCES])
984AC_SUBST([MOTIF_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800985AC_SUBST([GLW_PC_REQ_PRIV])
986AC_SUBST([GLW_PC_LIB_PRIV])
987AC_SUBST([GLW_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700988
989dnl
990dnl GLUT configuration
991dnl
992if test -f "$srcdir/include/GL/glut.h"; then
993 default_glut=yes
994else
995 default_glut=no
996fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700997AC_ARG_ENABLE([glut],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800998 [AS_HELP_STRING([--disable-glut],
999 [enable GLUT library @<:@default=enabled if source available@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001000 [enable_glut="$enableval"],
1001 [enable_glut="$default_glut"])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001002
1003dnl Can't build glut if GLU not available
1004if test "x$enable_glu$enable_glut" = xnoyes; then
1005 AC_MSG_WARN([Disabling glut since GLU is disabled])
1006 enable_glut=no
1007fi
Dan Nicholson979ff512007-12-05 18:47:01 -08001008dnl Don't build glut on osmesa
1009if test "x$enable_glut" = xyes && test "$mesa_driver" = osmesa; then
1010 AC_MSG_WARN([Disabling glut since the driver is OSMesa])
1011 enable_glut=no
1012fi
1013
Dan Nicholsondca1b792007-10-23 09:25:58 -07001014if test "x$enable_glut" = xyes; then
1015 SRC_DIRS="$SRC_DIRS glut/glx"
1016 GLUT_CFLAGS=""
1017 if test "x$GCC" = xyes; then
1018 GLUT_CFLAGS="-fexceptions"
1019 fi
1020 if test "$x11_pkgconfig" = yes; then
Dan Nicholson297e16c2008-05-05 15:42:53 -07001021 PKG_CHECK_MODULES([GLUT],[x11 xmu xi])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001022 GLUT_PC_REQ_PRIV="x11 xmu xi"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001023 GLUT_LIB_DEPS="$GLUT_LIBS"
1024 else
1025 # should check these...
Dan Nicholson70d0c832007-12-07 11:12:20 -08001026 GLUT_LIB_DEPS="$X_LIBS -lX11 -lXmu -lXi"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001027 GLUT_PC_LIB_PRIV="$GLUT_LIB_DEPS"
1028 GLUT_PC_CFLAGS="$X11_INCLUDES"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001029 fi
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001030 GLUT_LIB_DEPS="$GLUT_LIB_DEPS -lm $OS_LIBS"
Dan Nicholson71e208b2008-11-24 11:01:57 -08001031 GLUT_PC_LIB_PRIV="$GLUT_PC_LIB_PRIV -lm $OS_LIBS"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001032
1033 # If glut is available, we can build most programs
Dan Nicholson8e4d1472007-11-15 08:59:57 -08001034 if test "$with_demos" = yes; then
1035 PROGRAM_DIRS="$PROGRAM_DIRS demos redbook samples glsl"
1036 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001037
Dan Nicholson88586332007-11-15 08:59:57 -08001038 # If static, empty GLUT_LIB_DEPS and add libs for programs to link
1039 if test "$enable_static" = no; then
1040 GLUT_MESA_DEPS='-l$(GLU_LIB) -l$(GL_LIB)'
1041 else
1042 APP_LIB_DEPS="$APP_LIB_DEPS $GLUT_LIB_DEPS"
1043 GLUT_LIB_DEPS=""
1044 GLUT_MESA_DEPS=""
1045 fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001046fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001047AC_SUBST([GLUT_LIB_DEPS])
1048AC_SUBST([GLUT_MESA_DEPS])
1049AC_SUBST([GLUT_CFLAGS])
Dan Nicholson71e208b2008-11-24 11:01:57 -08001050AC_SUBST([GLUT_PC_REQ_PRIV])
1051AC_SUBST([GLUT_PC_LIB_PRIV])
1052AC_SUBST([GLUT_PC_CFLAGS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001053
1054dnl
1055dnl Program library dependencies
1056dnl Only libm is added here if necessary as the libraries should
1057dnl be pulled in by the linker
1058dnl
1059if test "x$APP_LIB_DEPS" = x; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001060 case "$host_os" in
1061 solaris*)
1062 APP_LIB_DEPS="-lX11 -lsocket -lnsl -lm"
1063 ;;
1064 *)
1065 APP_LIB_DEPS="-lm"
1066 ;;
1067 esac
Dan Nicholsondca1b792007-10-23 09:25:58 -07001068fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001069AC_SUBST([APP_LIB_DEPS])
1070AC_SUBST([PROGRAM_DIRS])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001071
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001072dnl
1073dnl Gallium configuration
1074dnl
1075AC_ARG_ENABLE([gallium],
1076 [AS_HELP_STRING([--disable-gallium],
1077 [build gallium @<:@default=enabled@:>@])],
1078 [enable_gallium="$enableval"],
1079 [enable_gallium=yes])
1080if test "x$enable_gallium" = xyes; then
1081 SRC_DIRS="$SRC_DIRS gallium gallium/winsys"
1082fi
Dan Nicholsondca1b792007-10-23 09:25:58 -07001083
1084dnl Restore LDFLAGS and CPPFLAGS
1085LDFLAGS="$_SAVE_LDFLAGS"
1086CPPFLAGS="$_SAVE_CPPFLAGS"
1087
1088dnl Substitute the config
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -08001089AC_CONFIG_FILES([configs/autoconf])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001090
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001091dnl Replace the configs/current symlink
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001092AC_CONFIG_COMMANDS([configs],[
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001093if test -f configs/current || test -L configs/current; then
1094 rm -f configs/current
1095fi
1096ln -s autoconf configs/current
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001097])
1098
1099AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08001100
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001101dnl
1102dnl Output some configuration info for the user
1103dnl
1104echo ""
1105echo " prefix: $prefix"
1106echo " exec_prefix: $exec_prefix"
1107echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07001108echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001109
1110dnl Driver info
1111echo ""
1112echo " Driver: $mesa_driver"
Dan Nicholson544ab202007-12-30 08:41:53 -08001113if echo "$DRIVER_DIRS" | grep 'osmesa' >/dev/null 2>&1; then
1114 echo " OSMesa: lib$OSMESA_LIB"
1115else
1116 echo " OSMesa: no"
1117fi
1118if test "$mesa_driver" = dri; then
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001119 # cleanup the drivers var
1120 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001121if test "x$DRI_DIRS" = x; then
1122 echo " DRI drivers: no"
1123else
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001124 echo " DRI drivers: $dri_dirs"
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001125fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001126 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08001127fi
RALOVICH, Kristóf5f19f5c2008-11-04 11:53:32 +01001128echo " Use XCB: $enable_xcb"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001129
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001130echo ""
1131if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
1132 echo " Gallium: yes"
1133 echo " Gallium dirs: $GALLIUM_DIRS"
1134 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
1135 echo " Winsys drm dirs: $GALLIUM_WINSYS_DRM_DIRS"
1136 echo " Auxiliary dirs: $GALLIUM_AUXILIARY_DIRS"
1137 echo " Driver dirs: $GALLIUM_DRIVER_DIRS"
1138 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
1139else
1140 echo " Gallium: no"
1141fi
1142
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001143dnl Libraries
1144echo ""
1145echo " Shared libs: $enable_shared"
1146echo " Static libs: $enable_static"
1147echo " GLU: $enable_glu"
Dan Nicholson776c60d2008-07-18 07:40:41 -07001148echo " GLw: $enable_glw (Motif: $enable_motif)"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08001149echo " glut: $enable_glut"
1150
1151dnl Programs
1152# cleanup the programs var for display
1153program_dirs=`echo $PROGRAM_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1154if test "x$program_dirs" = x; then
1155 echo " Demos: no"
1156else
1157 echo " Demos: $program_dirs"
1158fi
1159
Dan Nicholson16a07fb2007-12-12 09:12:15 -08001160dnl Compiler options
1161# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
1162cflags=`echo $CFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1163 $SED 's/^ *//;s/ */ /;s/ *$//'`
1164cxxflags=`echo $CXXFLAGS $OPT_FLAGS $PIC_FLAGS $ARCH_FLAGS | \
1165 $SED 's/^ *//;s/ */ /;s/ *$//'`
1166defines=`echo $DEFINES $ASM_FLAGS | $SED 's/^ *//;s/ */ /;s/ *$//'`
1167echo ""
1168echo " CFLAGS: $cflags"
1169echo " CXXFLAGS: $cxxflags"
1170echo " Macros: $defines"
1171
Dan Nicholsondca1b792007-10-23 09:25:58 -07001172echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07001173echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001174echo ""