blob: 6e67ec039e934766821f63284dce2a1d58ac7095 [file] [log] [blame]
Matt Turner2f1ab632012-01-03 21:58:37 -05001dnl Process this file with autoconf to create configure.
Dan Nicholsondca1b792007-10-23 09:25:58 -07002
Matt Turner51723832011-12-23 19:21:04 -05003AC_PREREQ([2.60])
Dan Nicholsondca1b792007-10-23 09:25:58 -07004
Dan Nicholsone97ab722008-07-01 08:55:42 -07005dnl Tell the user about autoconf.html in the --help output
6m4_divert_once([HELP_END], [
7See docs/autoconf.html for more details on the options for Mesa.])
8
Andreas Boll3678f892012-08-31 16:43:56 +02009AC_INIT([Mesa], [9.0.0],
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -080010 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
Dan Nicholson297e16c2008-05-05 15:42:53 -070011AC_CONFIG_AUX_DIR([bin])
Dan Nicholsondca1b792007-10-23 09:25:58 -070012AC_CANONICAL_HOST
Eric Anholta4ff3342012-06-11 12:59:48 -070013AM_INIT_AUTOMAKE([foreign])
Dan Nicholsondca1b792007-10-23 09:25:58 -070014
Colin Walters0d736b22012-01-14 09:16:20 -050015dnl http://people.gnome.org/~walters/docs/build-api.txt
16dnl We don't support srcdir != builddir.
17echo \#buildapi-variable-no-builddir >/dev/null
18
Eric Anholt7fa5c912012-01-12 14:56:56 -080019# Support silent build rules, requires at least automake-1.11. Disable
20# by either passing --disable-silent-rules to configure or passing V=1
21# to make
22m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
23
Kenneth Graunke4a5d0202012-05-30 21:54:21 -070024m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
25
Eric Anholte3264802012-01-12 14:28:37 -080026LT_PREREQ([2.2])
27LT_INIT([disable-static])
28
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070029dnl Versions for external dependencies
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000030LIBDRM_REQUIRED=2.4.24
Marek Olšák1ff5f082012-08-27 00:22:31 +020031LIBDRM_RADEON_REQUIRED=2.4.39
Eric Anholtf0159012012-07-18 10:18:26 -070032LIBDRM_INTEL_REQUIRED=2.4.38
Ben Skeggs2e47d012011-12-23 14:03:49 +100033LIBDRM_NVVIEUX_REQUIRED=2.4.33
Christoph Bumiller6d1cdec2012-04-06 15:41:55 +020034LIBDRM_NOUVEAU_REQUIRED=2.4.33
Jesse Barnes1e39fc72011-05-05 13:09:16 -070035DRI2PROTO_REQUIRED=2.6
36GLPROTO_REQUIRED=1.4.14
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000037LIBDRM_XORG_REQUIRED=2.4.24
Jakob Bornecrantz683a0992010-03-11 19:23:15 +000038LIBKMS_XORG_REQUIRED=1.0.0
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070039
Dan Nicholsondca1b792007-10-23 09:25:58 -070040dnl Check for progs
41AC_PROG_CPP
42AC_PROG_CC
43AC_PROG_CXX
Dylan Noblesmitha3d56732012-04-02 15:35:38 +000044AM_PROG_CC_C_O
Eric Anholtf9d15622012-05-24 13:59:21 -070045AM_PROG_AS
Dan Nicholson297e16c2008-05-05 15:42:53 -070046AC_CHECK_PROGS([MAKE], [gmake make])
Kenneth Graunke3acc8262010-10-25 13:52:58 -070047AC_CHECK_PROGS([PYTHON2], [python2 python])
Matt Turner3a343ef2012-01-11 01:05:56 -050048AC_PROG_SED
Matt Turnerfd827a82012-01-21 22:43:02 -050049AC_PROG_MKDIR_P
Dan Nicholson297e16c2008-05-05 15:42:53 -070050AC_PATH_PROG([MKDEP], [makedepend])
Dan Nicholson41b00702007-12-12 08:48:30 -080051
Luca Barbierif762f7b2010-09-24 10:10:09 +020052if test "x$MKDEP" = "x"; then
53 AC_MSG_ERROR([makedepend is required to build Mesa])
54fi
55
Matt Turnerdfb61422012-01-13 14:31:39 -050056AC_PROG_YACC
57AC_PATH_PROG([YACC_INST], $YACC)
Matt Turnerba4a36d2012-08-22 15:08:01 -070058if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"; then
Matt Turnerdfb61422012-01-13 14:31:39 -050059 if test -z "$YACC_INST"; then
60 AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y])
61 fi
62fi
63AC_PROG_LEX
Brian Paulde1df262011-05-18 07:50:21 -060064
Tom Stellarda75c6162012-01-06 17:38:37 -050065AC_PATH_PROG([PERL], [perl])
66
Kenneth Graunke2224fb62012-05-29 16:03:05 -070067AC_CHECK_PROG(INDENT, indent, indent, cat)
68if test "x$INDENT" != "xcat"; then
69 AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool')
70fi
71
Dan Nicholsonbc302b22009-05-22 09:39:02 -070072dnl Our fallback install-sh is a symlink to minstall. Use the existing
73dnl configuration in that case.
74AC_PROG_INSTALL
75test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)'
76
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070077dnl We need a POSIX shell for parts of the build. Assume we have one
78dnl in most cases.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070079case "$host_os" in
80solaris*)
81 # Solaris /bin/sh is too old/non-POSIX compliant
82 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070083 SHELL="$POSIX_SHELL"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070084 ;;
85esac
86
nobled2a501872010-08-29 20:03:37 -040087dnl clang is mostly GCC-compatible, but its version is much lower,
88dnl so we have to check for it.
89AC_MSG_CHECKING([if compiling with clang])
90
91AC_COMPILE_IFELSE(
92[AC_LANG_PROGRAM([], [[
93#ifndef __clang__
94 not clang
95#endif
96]])],
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070097[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
nobled2a501872010-08-29 20:03:37 -040098
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070099AC_MSG_RESULT([$acv_mesa_CLANG])
nobled2a501872010-08-29 20:03:37 -0400100
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800101dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
102dnl versions are explictly not supported.
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -0700103if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800104 AC_MSG_CHECKING([whether gcc version is sufficient])
105 major=0
106 minor=0
107
108 GCC_VERSION=`$CC -dumpversion`
109 if test $? -eq 0; then
Tom Stellard79d77b32012-04-20 16:56:46 +0200110 GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
111 GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800112 fi
113
Tom Stellard79d77b32012-04-20 16:56:46 +0200114 if test $GCC_VERSION_MAJOR -lt 3 -o $GCC_VERSION_MAJOR -eq 3 -a $GCC_VERSION_MINOR -lt 3 ; then
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800115 AC_MSG_RESULT([no])
116 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
117 else
118 AC_MSG_RESULT([yes])
119 fi
120fi
121
122
Dan Nicholsondb7fc632008-03-07 11:48:09 -0800123MKDEP_OPTIONS=-fdepend
Kristian Høgsbergbcecea62008-02-25 18:50:26 -0500124dnl Ask gcc where it's keeping its secret headers
125if test "x$GCC" = xyes; then
Dan Nicholsona3d223f2009-01-30 10:52:09 -0800126 for dir in include include-fixed; do
127 GCC_INCLUDES=`$CC -print-file-name=$dir`
128 if test "x$GCC_INCLUDES" != x && \
129 test "$GCC_INCLUDES" != "$dir" && \
130 test -d "$GCC_INCLUDES"; then
131 MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES"
132 fi
133 done
Kristian Høgsbergbcecea62008-02-25 18:50:26 -0500134fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700135AC_SUBST([MKDEP_OPTIONS])
Kristian Høgsbergbcecea62008-02-25 18:50:26 -0500136
Dan Nicholson41b00702007-12-12 08:48:30 -0800137dnl Make sure the pkg-config macros are defined
Dan Nicholson356f3112009-04-29 06:49:27 -0700138m4_ifndef([PKG_PROG_PKG_CONFIG],
139 [m4_fatal([Could not locate the pkg-config autoconf macros.
140 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
141 are in a different location, try setting the environment variable
142 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700143PKG_PROG_PKG_CONFIG()
144
145dnl LIB_DIR - library basename
146LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -0700147AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700148
Matt Turnerd12b07e2012-08-14 12:33:32 -0700149dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
Dan Nicholsondca1b792007-10-23 09:25:58 -0700150_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700151_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700152
153dnl Compiler macros
154DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -0700155AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700156case "$host_os" in
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700157linux*|*-gnu*|gnu*)
Dan Nicholson29f603a2009-01-12 11:10:31 -0800158 DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700159 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700160solaris*)
161 DEFINES="$DEFINES -DPTHREADS -DSVR4"
162 ;;
Brian Paul97988902010-02-18 12:46:12 -0700163cygwin*)
164 DEFINES="$DEFINES -DPTHREADS"
165 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -0700166esac
167
168dnl Add flags for gcc and g++
169if test "x$GCC" = xyes; then
Eric Anholtb9aab8b2012-01-26 18:48:20 -0800170 CFLAGS="$CFLAGS -Wall -std=c99"
171
172 # Enable -Werror=implicit-function-declaration and
173 # -Werror=missing-prototypes, if available, or otherwise, just
174 # -Wmissing-prototypes. This is particularly useful to avoid
175 # generating a loadable driver module that has undefined symbols.
176 save_CFLAGS="$CFLAGS"
177 AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
178 CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
179 CFLAGS="$CFLAGS -Werror=missing-prototypes"
180 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
181 AC_MSG_RESULT([yes]),
182 [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
183 AC_MSG_RESULT([no])]);
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800184
185 # Enable -fvisibility=hidden if using a gcc that supports it
186 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800187 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100188 VISIBILITY_CFLAGS="-fvisibility=hidden"
189 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800190 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100191 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
192
193 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
194 CFLAGS=$save_CFLAGS
Dan Nicholson0c275b62008-01-15 22:52:25 -0800195
196 # Work around aliasing bugs - developers should comment this out
197 CFLAGS="$CFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100198
199 # gcc's builtin memcmp is slower than glibc's
200 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
201 CFLAGS="$CFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700202fi
203if test "x$GXX" = xyes; then
204 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800205
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400206 # Enable -fvisibility=hidden if using a gcc that supports it
207 save_CXXFLAGS="$CXXFLAGS"
208 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100209 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
210 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
Jon TURNEY560f7622011-04-26 11:49:01 +0100211 AC_LANG_PUSH([C++])
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400212 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100213 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
Jon TURNEY560f7622011-04-26 11:49:01 +0100214 AC_LANG_POP([C++])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100215
216 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
217 CXXFLAGS=$save_CXXFLAGS
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400218
Dan Nicholson0c275b62008-01-15 22:52:25 -0800219 # Work around aliasing bugs - developers should comment this out
220 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100221
222 # gcc's builtin memcmp is slower than glibc's
223 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
224 CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700225fi
226
Jon TURNEYdb786432011-04-26 11:56:02 +0100227dnl even if the compiler appears to support it, using visibility attributes isn't
228dnl going to do anything useful currently on cygwin apart from emit lots of warnings
229case "$host_os" in
230cygwin*)
231 VISIBILITY_CFLAGS=""
232 VISIBILITY_CXXFLAGS=""
233 ;;
234esac
235
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100236AC_SUBST([VISIBILITY_CFLAGS])
237AC_SUBST([VISIBILITY_CXXFLAGS])
238
Dan Nicholsondca1b792007-10-23 09:25:58 -0700239dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600240dnl Hacks to enable 32 or 64 bit build
241dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700242AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600243 [AS_HELP_STRING([--enable-32-bit],
244 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700245 [enable_32bit="$enableval"],
246 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600247)
248if test "x$enable_32bit" = xyes; then
249 if test "x$GCC" = xyes; then
250 CFLAGS="$CFLAGS -m32"
Tapani Pällia9cfd952012-05-31 09:32:45 +0300251 CCASFLAGS="$CCASFLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600252 fi
253 if test "x$GXX" = xyes; then
254 CXXFLAGS="$CXXFLAGS -m32"
255 fi
256fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700257AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600258 [AS_HELP_STRING([--enable-64-bit],
259 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700260 [enable_64bit="$enableval"],
261 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600262)
263if test "x$enable_64bit" = xyes; then
264 if test "x$GCC" = xyes; then
265 CFLAGS="$CFLAGS -m64"
266 fi
267 if test "x$GXX" = xyes; then
268 CXXFLAGS="$CXXFLAGS -m64"
269 fi
270fi
271
Dan Nicholson88586332007-11-15 08:59:57 -0800272dnl Can't have static and shared libraries, default to static if user
273dnl explicitly requested. If both disabled, set to static since shared
Matt Turner0c178232012-01-14 11:10:06 -0500274dnl was explicitly requested.
Dan Nicholson88586332007-11-15 08:59:57 -0800275case "x$enable_static$enable_shared" in
276xyesyes )
Matt Turner14819eb2012-08-01 08:32:49 -0700277 AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
Dan Nicholson88586332007-11-15 08:59:57 -0800278 enable_shared=no
279 ;;
280xnono )
Matt Turner14819eb2012-08-01 08:32:49 -0700281 AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
Dan Nicholson88586332007-11-15 08:59:57 -0800282 enable_static=yes
283 ;;
284esac
285
Matt Turnerdf4dccc2012-08-22 11:51:31 -0700286AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
287
Dan Nicholson88586332007-11-15 08:59:57 -0800288dnl
289dnl mklib options
290dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700291AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib])
Dan Nicholson88586332007-11-15 08:59:57 -0800292if test "$enable_static" = yes; then
293 MKLIB_OPTIONS="$MKLIB_OPTIONS -static"
294fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700295AC_SUBST([MKLIB_OPTIONS])
Dan Nicholson88586332007-11-15 08:59:57 -0800296
Dan Nicholson23656c42007-12-12 09:02:31 -0800297dnl
298dnl other compiler options
299dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700300AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800301 [AS_HELP_STRING([--enable-debug],
302 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700303 [enable_debug="$enableval"],
304 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800305)
306if test "x$enable_debug" = xyes; then
307 DEFINES="$DEFINES -DDEBUG"
308 if test "x$GCC" = xyes; then
309 CFLAGS="$CFLAGS -g"
310 fi
311 if test "x$GXX" = xyes; then
312 CXXFLAGS="$CXXFLAGS -g"
313 fi
314fi
Dan Nicholson88586332007-11-15 08:59:57 -0800315
316dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700317dnl library names
318dnl
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100319LIB_PREFIX_GLOB='lib'
320LIB_VERSION_SEPARATOR='.'
Dan Nicholson88586332007-11-15 08:59:57 -0800321if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800322 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800323else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700324 case "$host_os" in
325 darwin* )
326 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100327 cygwin* )
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100328 dnl prefix can be 'cyg' or 'lib'
329 LIB_PREFIX_GLOB='???'
330 LIB_VERSION_SEPARATOR='-'
331 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700332 aix* )
333 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700334 * )
335 LIB_EXTENSION='so' ;;
336 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800337fi
Brad Kingf3cdcb82012-06-05 13:59:58 -0400338AC_ARG_WITH([gl-lib-name],
339 [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
340 [specify GL library name @<:@default=GL@:>@])],
341 [GL_LIB=$withval],
342 [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400343AC_ARG_WITH([osmesa-lib-name],
344 [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
345 [specify OSMesa library name @<:@default=OSMesa@:>@])],
346 [OSMESA_LIB=$withval],
347 [OSMESA_LIB=OSMesa])
348AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400349AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
Dan Nicholson8217f242009-02-11 15:16:00 -0800350
Marek Olšák848f7d32011-04-01 01:12:41 +0200351dnl
Tom Fogalc0573fb2011-10-10 10:33:18 -0600352dnl Mangled Mesa support
353dnl
354AC_ARG_ENABLE([mangling],
355 [AS_HELP_STRING([--enable-mangling],
356 [enable mangled symbols and library name @<:@default=disabled@:>@])],
357 [enable_mangling="${enableval}"],
358 [enable_mangling=no]
359)
Tom Fogalc0573fb2011-10-10 10:33:18 -0600360if test "x${enable_mangling}" = "xyes" ; then
361 DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400362 GL_LIB="Mangled${GL_LIB}"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400363 OSMESA_LIB="Mangled${OSMESA_LIB}"
Tom Fogalc0573fb2011-10-10 10:33:18 -0600364fi
365AC_SUBST([GL_LIB])
Tom Fogalc0573fb2011-10-10 10:33:18 -0600366AC_SUBST([OSMESA_LIB])
367
368dnl
Marek Olšák848f7d32011-04-01 01:12:41 +0200369dnl potentially-infringing-but-nobody-knows-for-sure stuff
370dnl
371AC_ARG_ENABLE([texture-float],
372 [AS_HELP_STRING([--enable-texture-float],
373 [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
374 [enable_texture_float="$enableval"],
375 [enable_texture_float=no]
376)
377if test "x$enable_texture_float" = xyes; then
378 AC_MSG_WARN([Floating-point textures enabled.])
379 AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
380 DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
381fi
382
Dan Nicholson8217f242009-02-11 15:16:00 -0800383GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800384OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800385EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500386GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
387GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
Chia-I Wu874ccd52010-05-04 22:43:05 +0800388VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800389GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800390
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100391GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100392EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
393EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
394GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
395GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
396VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800397GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800398
Dan Nicholson297e16c2008-05-05 15:42:53 -0700399AC_SUBST([GL_LIB_NAME])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700400AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800401AC_SUBST([EGL_LIB_NAME])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500402AC_SUBST([GLESv1_CM_LIB_NAME])
403AC_SUBST([GLESv2_LIB_NAME])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800404AC_SUBST([VG_LIB_NAME])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800405AC_SUBST([GLAPI_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700406
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700407AC_SUBST([GL_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800408AC_SUBST([EGL_LIB_GLOB])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500409AC_SUBST([GLESv1_CM_LIB_GLOB])
410AC_SUBST([GLESv2_LIB_GLOB])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800411AC_SUBST([VG_LIB_GLOB])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800412AC_SUBST([GLAPI_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700413
Dan Nicholsondca1b792007-10-23 09:25:58 -0700414dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700415dnl Arch/platform-specific settings
416dnl
417AC_ARG_ENABLE([asm],
418 [AS_HELP_STRING([--disable-asm],
419 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
420 [enable_asm="$enableval"],
421 [enable_asm=yes]
422)
423asm_arch=""
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700424MESA_ASM_FILES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700425AC_MSG_CHECKING([whether to enable assembly])
426test "x$enable_asm" = xno && AC_MSG_RESULT([no])
427# disable if cross compiling on x86/x86_64 since we must run gen_matypes
428if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
429 case "$host_cpu" in
430 i?86 | x86_64)
431 enable_asm=no
432 AC_MSG_RESULT([no, cross compiling])
433 ;;
434 esac
435fi
436# check for supported arches
437if test "x$enable_asm" = xyes; then
438 case "$host_cpu" in
439 i?86)
440 case "$host_os" in
Pierre Allegraud8fd8de32011-01-06 07:58:57 -0700441 linux* | *freebsd* | dragonfly* | *netbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700442 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
443 ;;
444 esac
445 ;;
446 x86_64)
447 case "$host_os" in
Pierre Allegraud8fd8de32011-01-06 07:58:57 -0700448 linux* | *freebsd* | dragonfly* | *netbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700449 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
450 ;;
451 esac
452 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800453 sparc*)
454 case "$host_os" in
455 linux*)
456 asm_arch=sparc
457 ;;
458 esac
459 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700460 esac
461
462 case "$asm_arch" in
463 x86)
Eric Anholte4269492012-06-11 10:25:05 -0700464 DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700465 MESA_ASM_FILES='$(X86_FILES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700466 AC_MSG_RESULT([yes, x86])
467 ;;
468 x86_64)
Eric Anholte4269492012-06-11 10:25:05 -0700469 DEFINES="$DEFINES -DUSE_X86_64_ASM"
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700470 MESA_ASM_FILES='$(X86_64_FILES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700471 AC_MSG_RESULT([yes, x86_64])
472 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800473 sparc)
Eric Anholte4269492012-06-11 10:25:05 -0700474 DEFINES="$DEFINES -DUSE_SPARC_ASM"
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700475 MESA_ASM_FILES='$(SPARC_FILES)'
David S. Miller857ac1e2009-02-26 05:35:15 -0800476 AC_MSG_RESULT([yes, sparc])
477 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700478 *)
479 AC_MSG_RESULT([no, platform not supported])
480 ;;
481 esac
482fi
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700483AC_SUBST([MESA_ASM_FILES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700484
485dnl PIC code macro
486MESA_PIC_FLAGS
487
488dnl Check to see if dlopen is in default libraries (like Solaris, which
489dnl has it in libc), or if libdl is needed to get it.
Tapani Pälli57c57df2012-08-16 13:59:12 +0300490AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
491 [AC_CHECK_LIB([dl], [dlopen],
492 [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
Chia-I Wu08f4bc02010-07-16 20:09:29 +0800493AC_SUBST([DLOPEN_LIBS])
Dan Nicholson871125a2008-06-04 13:00:35 -0700494
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700495dnl See if posix_memalign is available
496AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
497
Dan Nicholson871125a2008-06-04 13:00:35 -0700498dnl SELinux awareness.
499AC_ARG_ENABLE([selinux],
500 [AS_HELP_STRING([--enable-selinux],
501 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
502 [MESA_SELINUX="$enableval"],
503 [MESA_SELINUX=no])
504if test "x$enable_selinux" = "xyes"; then
505 AC_CHECK_HEADER([selinux/selinux.h],[],
506 [AC_MSG_ERROR([SELinux headers not found])])
507 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
508 [AC_MSG_ERROR([SELinux library not found])])
509 SELINUX_LIBS="-lselinux"
510 DEFINES="$DEFINES -DMESA_SELINUX"
511fi
512
Marek Olšák440d71d2011-06-14 05:38:58 +0200513dnl Options for APIs
Chia-I Wube5f34a2010-10-27 16:14:27 +0800514AC_ARG_ENABLE([opengl],
515 [AS_HELP_STRING([--disable-opengl],
516 [disable support for standard OpenGL API @<:@default=no@:>@])],
517 [enable_opengl="$enableval"],
518 [enable_opengl=yes])
519AC_ARG_ENABLE([gles1],
520 [AS_HELP_STRING([--enable-gles1],
521 [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
522 [enable_gles1="$enableval"],
523 [enable_gles1=no])
524AC_ARG_ENABLE([gles2],
525 [AS_HELP_STRING([--enable-gles2],
526 [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
527 [enable_gles2="$enableval"],
528 [enable_gles2=no])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800529AC_ARG_ENABLE([openvg],
530 [AS_HELP_STRING([--enable-openvg],
531 [enable support for OpenVG API @<:@default=no@:>@])],
532 [enable_openvg="$enableval"],
533 [enable_openvg=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900534
535AC_ARG_ENABLE([dri],
536 [AS_HELP_STRING([--enable-dri],
Matt Turner32e8ce62012-08-17 14:05:56 -0700537 [enable DRI modules @<:@default=enabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900538 [enable_dri="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700539 [enable_dri=yes])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900540AC_ARG_ENABLE([glx],
541 [AS_HELP_STRING([--enable-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700542 [enable GLX library @<:@default=enabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900543 [enable_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700544 [enable_glx=yes])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900545AC_ARG_ENABLE([osmesa],
546 [AS_HELP_STRING([--enable-osmesa],
Matt Turner32e8ce62012-08-17 14:05:56 -0700547 [enable OSMesa library @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900548 [enable_osmesa="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700549 [enable_osmesa=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900550AC_ARG_ENABLE([egl],
551 [AS_HELP_STRING([--disable-egl],
552 [disable EGL library @<:@default=enabled@:>@])],
553 [enable_egl="$enableval"],
554 [enable_egl=yes])
555
Marek Olšák440d71d2011-06-14 05:38:58 +0200556AC_ARG_ENABLE([xorg],
557 [AS_HELP_STRING([--enable-xorg],
558 [enable support for X.Org DDX API @<:@default=no@:>@])],
559 [enable_xorg="$enableval"],
560 [enable_xorg=no])
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200561AC_ARG_ENABLE([xa],
562 [AS_HELP_STRING([--enable-xa],
563 [enable build of the XA X Acceleration API @<:@default=no@:>@])],
564 [enable_xa="$enableval"],
565 [enable_xa=no])
Marek Olšák440d71d2011-06-14 05:38:58 +0200566AC_ARG_ENABLE([d3d1x],
567 [AS_HELP_STRING([--enable-d3d1x],
568 [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
569 [enable_d3d1x="$enableval"],
570 [enable_d3d1x=no])
Benjamin Franzkeeddcecb2011-05-26 15:09:39 +0200571AC_ARG_ENABLE([gbm],
572 [AS_HELP_STRING([--enable-gbm],
573 [enable gbm library @<:@default=auto@:>@])],
574 [enable_gbm="$enableval"],
575 [enable_gbm=auto])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900576
Christian Königc3b22302011-07-04 15:04:41 +0200577AC_ARG_ENABLE([xvmc],
578 [AS_HELP_STRING([--enable-xvmc],
579 [enable xvmc library @<:@default=auto@:>@])],
580 [enable_xvmc="$enableval"],
581 [enable_xvmc=auto])
582AC_ARG_ENABLE([vdpau],
583 [AS_HELP_STRING([--enable-vdpau],
584 [enable vdpau library @<:@default=auto@:>@])],
585 [enable_vdpau="$enableval"],
586 [enable_vdpau=auto])
587AC_ARG_ENABLE([va],
588 [AS_HELP_STRING([--enable-va],
589 [enable va library @<:@default=auto@:>@])],
590 [enable_va="$enableval"],
591 [enable_va=auto])
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200592AC_ARG_ENABLE([opencl],
593 [AS_HELP_STRING([--enable-opencl],
594 [enable OpenCL library @<:@default=no@:>@])],
595 [enable_opencl="$enableval"],
596 [enable_opencl=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900597AC_ARG_ENABLE([xlib_glx],
598 [AS_HELP_STRING([--enable-xlib-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700599 [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900600 [enable_xlib_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700601 [enable_xlib_glx=no])
Marek Olšák1251e1d2011-06-18 20:33:55 +0200602AC_ARG_ENABLE([gallium_egl],
603 [AS_HELP_STRING([--enable-gallium-egl],
604 [enable optional EGL state tracker (not required
605 for EGL support in Gallium with OpenGL and OpenGL ES)
606 @<:@default=disable@:>@])],
607 [enable_gallium_egl="$enableval"],
608 [enable_gallium_egl=no])
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200609AC_ARG_ENABLE([gallium_gbm],
610 [AS_HELP_STRING([--enable-gallium-gbm],
611 [enable optional gbm state tracker (not required for
612 gbm support in Gallium)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200613 @<:@default=auto@:>@])],
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200614 [enable_gallium_gbm="$enableval"],
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200615 [enable_gallium_gbm=auto])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800616
Tom Stellardced73ea2012-04-17 09:26:28 -0400617AC_ARG_ENABLE([r600-llvm-compiler],
Homer Hsing40507562012-05-15 18:56:17 -0400618 [AS_HELP_STRING([--enable-r600-llvm-compiler],
619 [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
Tom Stellardced73ea2012-04-17 09:26:28 -0400620 [enable_r600_llvm="$enableval"],
621 [enable_r600_llvm=no])
622
Francisco Jerez66f7fd92012-04-25 22:16:26 +0200623AC_ARG_ENABLE([gallium_tests],
624 [AS_HELP_STRING([--enable-gallium-tests],
625 [Enable optional Gallium tests) @<:@default=disable@:>@])],
626 [enable_gallium_tests="$enableval"],
627 [enable_gallium_tests=no])
628
Marek Olšák58b6a192011-06-14 07:46:59 +0200629# Option for Gallium drivers
Thomas Hellstrom87118d82012-01-12 12:10:53 +0100630GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
Marek Olšák58b6a192011-06-14 07:46:59 +0200631
632AC_ARG_WITH([gallium-drivers],
633 [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
634 [comma delimited Gallium drivers list, e.g.
Andreas Boll17f09b62012-08-28 17:28:19 +0200635 "i915,nouveau,r300,r600,radeonsi,svga,swrast"
Marek Olšák0c7c5b62011-06-14 08:31:11 +0200636 @<:@default=r300,r600,swrast@:>@])],
Marek Olšák58b6a192011-06-14 07:46:59 +0200637 [with_gallium_drivers="$withval"],
638 [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
Chia-I Wu156e9552010-10-30 14:26:01 +0800639
Ian Romanickdb311b42011-06-22 11:35:27 -0700640# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
641# here so that the script doesn't choke on an unknown driver name later.
642case "$with_gallium_drivers" in
643 yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
644 no) with_gallium_drivers='' ;;
645esac
646
Chia-I Wube5f34a2010-10-27 16:14:27 +0800647if test "x$enable_opengl" = xno -a \
648 "x$enable_gles1" = xno -a \
649 "x$enable_gles2" = xno -a \
Marek Olšák440d71d2011-06-14 05:38:58 +0200650 "x$enable_openvg" = xno -a \
651 "x$enable_xorg" = xno -a \
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200652 "x$enable_xa" = xno -a \
Christian Königc3b22302011-07-04 15:04:41 +0200653 "x$enable_d3d1x" = xno -a \
654 "x$enable_xvmc" = xno -a \
655 "x$enable_vdpau" = xno -a \
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200656 "x$enable_va" = xno -a \
657 "x$enable_opencl" = xno; then
Chia-I Wube5f34a2010-10-27 16:14:27 +0800658 AC_MSG_ERROR([at least one API should be enabled])
659fi
660
661API_DEFINES=""
Chia-I Wube5f34a2010-10-27 16:14:27 +0800662if test "x$enable_opengl" = xno; then
663 API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
664else
665 API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
666fi
667if test "x$enable_gles1" = xyes; then
668 API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
669fi
670if test "x$enable_gles2" = xyes; then
671 API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
672fi
Chia-I Wube5f34a2010-10-27 16:14:27 +0800673AC_SUBST([API_DEFINES])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800674
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800675if test "x$enable_glx" = xno; then
Matt Turner32e8ce62012-08-17 14:05:56 -0700676 AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800677 enable_xlib_glx=no
678fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900679
Matt Turner32e8ce62012-08-17 14:05:56 -0700680if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
681 AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
682fi
683
684# Disable GLX if DRI and Xlib-GLX are not enabled
685if test "x$enable_glx" = xyes -a \
686 "x$enable_dri" = xno -a \
687 "x$enable_xlib_glx" = xno; then
688 AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
689 enable_glx=no
690fi
691
Matt Turner00f3d9b2012-08-21 22:06:17 -0700692AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
Matt Turner8cdce6c2012-08-21 22:26:52 -0700693AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
694 "x$enable_osmesa" = xyes)
Matt Turner06ad64a2012-01-15 21:30:26 -0500695
Matt Turner8c9b78a2012-08-17 14:22:47 -0700696AC_ARG_ENABLE([shared-glapi],
697 [AS_HELP_STRING([--enable-shared-glapi],
698 [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
699 [enable_shared_glapi="$enableval"],
700 [enable_shared_glapi="$enable_dri"])
701
702# Shared GLAPI is only useful for DRI
703if test "x$enable_dri" = xno; then
704 AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
705 enable_shared_glapi=no
706fi
707
708# TODO: Get rid of SHARED_GLAPI variable
709SHARED_GLAPI="0"
710if test "x$enable_shared_glapi" = xyes; then
711 SHARED_GLAPI="1"
712 # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
713 # the remap table)
714 DEFINES="$DEFINES -DIN_DRI_DRIVER"
Matt Turnerd9b10982012-08-17 14:54:25 -0700715 CORE_DIRS="mapi/shared-glapi"
Matt Turner8c9b78a2012-08-17 14:22:47 -0700716fi
717AC_SUBST([SHARED_GLAPI])
718AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
719
Dan Nicholson44d99142007-12-05 18:47:01 -0800720dnl
721dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700722dnl
Eric Anholt94726d22012-03-05 17:01:13 -0800723SRC_DIRS="gtest"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100724GALLIUM_DIRS="auxiliary drivers state_trackers"
Keith Whitwell51bff092010-03-11 14:43:00 +0000725GALLIUM_TARGET_DIRS=""
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000726GALLIUM_WINSYS_DIRS="sw"
Kai Wasserbäch0a22fb62011-11-29 22:36:02 +0100727GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100728GALLIUM_STATE_TRACKERS_DIRS=""
729
Chia-I Wube5f34a2010-10-27 16:14:27 +0800730# build glapi if OpenGL is enabled
731if test "x$enable_opengl" = xyes; then
732 CORE_DIRS="$CORE_DIRS mapi/glapi"
733fi
734
Chia-I Wu12583172011-01-07 17:24:16 +0800735# build es1api if OpenGL ES 1.x is enabled
736if test "x$enable_gles1" = xyes; then
737 CORE_DIRS="$CORE_DIRS mapi/es1api"
738fi
739
740# build es2api if OpenGL ES 2.x is enabled
741if test "x$enable_gles2" = xyes; then
742 CORE_DIRS="$CORE_DIRS mapi/es2api"
743fi
Chia-I Wube5f34a2010-10-27 16:14:27 +0800744
Chia-I Wube5f34a2010-10-27 16:14:27 +0800745# build glsl and mesa if OpenGL or OpenGL ES is enabled
Chia-I Wu12583172011-01-07 17:24:16 +0800746case "x$enable_opengl$enable_gles1$enable_gles2" in
Chia-I Wube5f34a2010-10-27 16:14:27 +0800747x*yes*)
Eric Anholt0ce0f7c2012-05-15 13:06:22 -0700748 CORE_DIRS="mapi/glapi/gen $CORE_DIRS glsl mesa"
Chia-I Wube5f34a2010-10-27 16:14:27 +0800749 ;;
750esac
751
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900752case "x$enable_glx$enable_xlib_glx" in
753xyesyes)
754 DRIVER_DIRS="$DRIVER_DIRS x11"
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000755 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
Keith Whitwell51bff092010-03-11 14:43:00 +0000756 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
Marek Olšák440d71d2011-06-14 05:38:58 +0200757 GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
Younes Mantonb97816d2011-07-14 12:22:20 -0400758 HAVE_WINSYS_XLIB="yes"
Dan Nicholson44d99142007-12-05 18:47:01 -0800759 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900760xyesno)
761 # DRI-based GLX
Kristian Høgsberg6e8897f2010-02-09 09:58:36 -0500762 SRC_DIRS="$SRC_DIRS glx"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900763 ;;
764esac
765
766if test "x$enable_dri" = xyes; then
767 DRIVER_DIRS="$DRIVER_DIRS dri"
768
Emil Velikov4ef9c3d2011-07-11 15:58:29 +0100769 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
Marek Olšák440d71d2011-06-14 05:38:58 +0200770 GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
771 HAVE_ST_DRI="yes"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900772fi
773
774if test "x$enable_osmesa" = xyes; then
Eric Anholt2d51ac82012-06-12 12:51:32 -0700775 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900776fi
777
Dan Nicholson297e16c2008-05-05 15:42:53 -0700778AC_SUBST([SRC_DIRS])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700779AC_SUBST([DRIVER_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100780AC_SUBST([GALLIUM_DIRS])
Keith Whitwell51bff092010-03-11 14:43:00 +0000781AC_SUBST([GALLIUM_TARGET_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100782AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +0000783AC_SUBST([GALLIUM_DRIVERS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100784AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dave Airlie81fe1982010-04-22 14:59:29 +1000785AC_SUBST([MESA_LLVM])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700786
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900787# Check for libdrm
788PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
789 [have_libdrm=yes], [have_libdrm=no])
790
791if test "x$enable_dri" = xyes; then
792 # DRI must be shared, I think
793 if test "$enable_static" = yes; then
Matt Turner14819eb2012-08-01 08:32:49 -0700794 AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900795 fi
796
Chia-I Wu81239342011-07-02 09:49:17 +0900797 # not a hard requirement as swrast does not depend on it
798 if test "x$have_libdrm" = xyes; then
799 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900800 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900801fi
802
Matt Turnere273ed32012-08-14 12:24:31 -0700803dnl Find out if X is available.
804PKG_CHECK_MODULES([X11], [x11])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700805
Dan Nicholson99803a42008-07-01 09:03:15 -0700806dnl Try to tell the user that the --x-* options are only used when
807dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
808m4_divert_once([HELP_BEGIN],
809[These options are only used when the X libraries cannot be found by the
810pkg-config utility.])
811
Dan Nicholson44d99142007-12-05 18:47:01 -0800812dnl We need X for xlib and dri, so bomb now if it's not found
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900813if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
814 AC_MSG_ERROR([X11 development libraries needed for GLX])
815fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700816
Ian Romanickb518dfb2012-01-02 17:44:30 -0800817if test "x$enable_glx" = xyes; then
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700818 DEFINES="$DEFINES -DUSE_XCB"
Dan Nicholson2d709fe2008-05-06 10:51:49 -0700819fi
820
Samuel Thibault75856172011-03-14 22:08:21 +0000821dnl Direct rendering or just indirect rendering
noblede7d18ed2011-03-14 22:08:22 +0000822case "$host_os" in
823gnu*)
824 dnl Disable by default on GNU/Hurd
825 driglx_direct_default="no"
826 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +0000827cygwin*)
828 dnl Disable by default on cygwin
829 driglx_direct_default="no"
830 ;;
noblede7d18ed2011-03-14 22:08:22 +0000831*)
832 driglx_direct_default="yes"
833 ;;
834esac
Samuel Thibault75856172011-03-14 22:08:21 +0000835AC_ARG_ENABLE([driglx-direct],
836 [AS_HELP_STRING([--disable-driglx-direct],
837 [enable direct rendering in GLX and EGL for DRI \
noblede7d18ed2011-03-14 22:08:22 +0000838 @<:@default=auto@:>@])],
Samuel Thibault75856172011-03-14 22:08:21 +0000839 [driglx_direct="$enableval"],
noblede7d18ed2011-03-14 22:08:22 +0000840 [driglx_direct="$driglx_direct_default"])
Samuel Thibault75856172011-03-14 22:08:21 +0000841
Dan Nicholson44d99142007-12-05 18:47:01 -0800842dnl
843dnl libGL configuration per driver
844dnl
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900845case "x$enable_glx$enable_xlib_glx" in
846xyesyes)
847 # Xlib-based GLX
Matt Turnere273ed32012-08-14 12:24:31 -0700848 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
849 GL_PC_REQ_PRIV="x11 xext"
850 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
851 GL_LIB_DEPS="$XLIBGL_LIBS"
Marek Olšák0aed27e2011-07-26 01:05:51 +0200852 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
Kenneth Graunked1d812052011-01-16 16:01:54 -0800853 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
Dan Nicholson44d99142007-12-05 18:47:01 -0800854 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900855xyesno)
856 # DRI-based GLX
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500857 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Samuel Thibault75856172011-03-14 22:08:21 +0000858 GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
Samuel Thibault75856172011-03-14 22:08:21 +0000859 if test x"$driglx_direct" = xyes; then
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900860 if test "x$have_libdrm" != xyes; then
861 AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
862 fi
Samuel Thibault75856172011-03-14 22:08:21 +0000863 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
864 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
Samuel Thibault75856172011-03-14 22:08:21 +0000865 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800866
867 # find the DRI deps for libGL
Matt Turnere273ed32012-08-14 12:24:31 -0700868 dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1"
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100869
Matt Turnere273ed32012-08-14 12:24:31 -0700870 # add xf86vidmode if available
871 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
872 if test "$HAVE_XF86VIDMODE" = yes ; then
873 dri_modules="$dri_modules xxf86vm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800874 fi
875
Matt Turnere273ed32012-08-14 12:24:31 -0700876 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
877 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
878 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
879 GL_LIB_DEPS="$DRIGL_LIBS"
880
Dan Nicholson44d99142007-12-05 18:47:01 -0800881 # need DRM libs, -lpthread, etc.
Alan Coopersmith3cf6e622009-03-23 16:51:54 -0700882 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
883 GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800884 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800885esac
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900886
Ian Romanick4becf672012-01-03 11:35:59 -0800887# This is outside the case (above) so that it is invoked even for non-GLX
888# builds.
Eric Anholt8ffb0982012-02-05 06:10:56 +0100889AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
Ian Romanick4becf672012-01-03 11:35:59 -0800890
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900891GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
892GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
893GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
894GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
895
Dan Nicholson297e16c2008-05-05 15:42:53 -0700896AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800897AC_SUBST([GL_PC_REQ_PRIV])
898AC_SUBST([GL_PC_LIB_PRIV])
899AC_SUBST([GL_PC_CFLAGS])
900AC_SUBST([DRI_PC_REQ_PRIV])
Li Pengc33c1912010-07-30 12:26:15 +0800901AC_SUBST([GLESv1_CM_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400902AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500903AC_SUBST([GLESv2_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400904AC_SUBST([GLESv2_PC_LIB_PRIV])
905
Chia-I Wu0c771e22011-11-04 16:32:17 +0800906GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800907AC_SUBST([GLAPI_LIB_DEPS])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700908
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100909
Matt Turnerbee2edb2012-08-17 16:24:32 -0700910DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100911
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100912AC_SUBST([HAVE_XF86VIDMODE])
913
Dan Nicholsondca1b792007-10-23 09:25:58 -0700914dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900915dnl More GLX setup
Dan Nicholsondca1b792007-10-23 09:25:58 -0700916dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900917case "x$enable_glx$enable_xlib_glx" in
918xyesyes)
Dan Nicholsondca1b792007-10-23 09:25:58 -0700919 DEFINES="$DEFINES -DUSE_XSHM"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900920 ;;
921xyesno)
922 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
923 if test "x$driglx_direct" = xyes; then
924 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
925 fi
926 ;;
927esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700928
929dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700930dnl TLS detection
Dan Nicholson44d99142007-12-05 18:47:01 -0800931dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700932
Dan Nicholson297e16c2008-05-05 15:42:53 -0700933AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800934 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800935 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700936 [GLX_USE_TLS="$enableval"],
937 [GLX_USE_TLS=no])
Tom Fogal31351dc2010-12-05 17:58:32 -0700938AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
939
Tom Fogal44842972011-02-21 22:32:18 -0700940AS_IF([test "x$GLX_USE_TLS" = xyes],
941 [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
942
Tom Fogal31351dc2010-12-05 17:58:32 -0700943dnl
944dnl More DRI setup
945dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800946dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700947AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800948 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700949 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700950 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700951 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700952AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800953dnl Extra search path for DRI drivers
954AC_ARG_WITH([dri-searchpath],
955 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
956 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
957 [DRI_DRIVER_SEARCH_DIR="$withval"],
958 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
959AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800960dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700961AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800962 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700963 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200964 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700965 [with_dri_drivers="$withval"],
966 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800967if test "x$with_dri_drivers" = x; then
968 with_dri_drivers=no
969fi
970
971dnl If $with_dri_drivers is yes, directories will be added through
972dnl platform checks
973DRI_DIRS=""
974case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100975no) ;;
976yes)
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900977 # classic DRI drivers require FEATURE_GL to build
978 if test "x$enable_opengl" = xyes; then
979 DRI_DIRS="yes"
980 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100981 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800982*)
983 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700984 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800985 for driver in $dri_drivers; do
986 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
Matt Turner14819eb2012-08-01 08:32:49 -0700987 AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800988 done
989 DRI_DIRS="$dri_drivers"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900990 if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
991 AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
992 fi
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800993 ;;
994esac
995
Dan Nicholson44d99142007-12-05 18:47:01 -0800996dnl Set DRI_DIRS, DEFINES and LIB_DEPS
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900997if test "x$enable_dri" = xyes; then
Dan Nicholson44d99142007-12-05 18:47:01 -0800998 # Platform specific settings and drivers to build
999 case "$host_os" in
1000 linux*)
1001 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Chia-I Wu5029ea42011-06-27 13:06:39 +09001002 DEFINES="$DEFINES -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001003
1004 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -08001005 x86_64)
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001006 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001007 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001008 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001009 ;;
1010 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -08001011 # Build only the drivers for cards that exist on PowerPC.
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001012 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001013 DRI_DIRS="r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001014 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001015 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +10001016 sparc*)
Ian Romanicke4344162011-08-24 15:21:58 -07001017 # Build only the drivers for cards that exist on sparc
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001018 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001019 DRI_DIRS="r200 radeon swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +10001020 fi
1021 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -08001022 esac
1023 ;;
Pierre Allegraud8fd8de32011-01-06 07:58:57 -07001024 freebsd* | dragonfly* | *netbsd*)
Dan Nicholson44d99142007-12-05 18:47:01 -08001025 DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
1026 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001027
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001028 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001029 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001030 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001031 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -07001032 gnu*)
1033 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Chia-I Wu5029ea42011-06-27 13:06:39 +09001034 DEFINES="$DEFINES -DHAVE_ALIAS"
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -07001035 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001036 solaris*)
1037 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001038 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +00001039 cygwin*)
1040 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Jon TURNEYc6e33ca2011-03-14 22:08:23 +00001041 if test "x$DRI_DIRS" = "xyes"; then
1042 DRI_DIRS="swrast"
1043 fi
1044 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -08001045 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -08001046
1047 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001048 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001049 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -08001050 fi
1051
Dan Nicholson44d99142007-12-05 18:47:01 -08001052 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1053
1054 # Check for expat
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001055 if test "x$enable_dri" = xyes; then
Chia-I Wube5f34a2010-10-27 16:14:27 +08001056 EXPAT_INCLUDES=""
1057 EXPAT_LIB=-lexpat
1058 AC_ARG_WITH([expat],
1059 [AS_HELP_STRING([--with-expat=DIR],
1060 [expat install directory])],[
1061 EXPAT_INCLUDES="-I$withval/include"
1062 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
1063 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
1064 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
1065 ])
1066 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
Eric Anholt36473392012-01-18 11:27:24 -08001067 save_LIBS="$LIBS"
Chia-I Wube5f34a2010-10-27 16:14:27 +08001068 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1069 [AC_MSG_ERROR([Expat required for DRI.])])
Eric Anholt36473392012-01-18 11:27:24 -08001070 LIBS="$save_LIBS"
Chia-I Wube5f34a2010-10-27 16:14:27 +08001071 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001072
Jon TURNEYffc84942012-02-02 10:39:04 +00001073 # if we are building any dri driver other than swrast ...
Chia-I Wu81239342011-07-02 09:49:17 +09001074 if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
Jon TURNEYffc84942012-02-02 10:39:04 +00001075 # ... libdrm is required
Chia-I Wu81239342011-07-02 09:49:17 +09001076 if test "x$have_libdrm" != xyes; then
1077 AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
1078 fi
Jon TURNEYffc84942012-02-02 10:39:04 +00001079 # ... and build dricommon
1080 HAVE_COMMON_DRI=yes
Chia-I Wu81239342011-07-02 09:49:17 +09001081 fi
1082
Matt Turner2b3a8cb2012-01-13 14:30:36 -05001083 # put all the necessary libs together
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +11001084 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Jon TURNEYdefadf22012-07-08 12:19:24 +01001085 GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001086fi
Dan Nicholson297e16c2008-05-05 15:42:53 -07001087AC_SUBST([DRI_DIRS])
1088AC_SUBST([EXPAT_INCLUDES])
1089AC_SUBST([DRI_LIB_DEPS])
Jon TURNEYdefadf22012-07-08 12:19:24 +01001090AC_SUBST([GALLIUM_DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -08001091
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001092case $DRI_DIRS in
1093*i915*|*i965*)
Tormod Volden903185b2011-01-25 13:25:18 -08001094 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Eric Anholte3264802012-01-12 14:28:37 -08001095
Matt Turner3c87dfc2012-01-14 21:57:32 -05001096 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1097 case $d in
1098 i915)
1099 HAVE_I915_DRI=yes;
1100 ;;
1101 i965)
1102 HAVE_I965_DRI=yes;
1103 ;;
1104 esac
1105 done
Eric Anholte3264802012-01-12 14:28:37 -08001106
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001107 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -05001108esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001109
Matt Turnere0ee8182012-01-14 22:21:30 -05001110case $DRI_DIRS in
Matt Turner3f964342012-01-15 10:20:30 -05001111*nouveau*)
Ben Skeggs2e47d012011-12-23 14:03:49 +10001112 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
Matt Turner3f964342012-01-15 10:20:30 -05001113 HAVE_NOUVEAU_DRI=yes;
1114 ;;
1115esac
1116
1117case $DRI_DIRS in
Matt Turnerb38d7a02012-01-15 10:04:58 -05001118*radeon*|*r200*)
Matt Turnere0ee8182012-01-14 22:21:30 -05001119 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1120
1121 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1122 case $d in
1123 radeon)
1124 HAVE_RADEON_DRI=yes;
1125 ;;
Matt Turnerb38d7a02012-01-15 10:04:58 -05001126 r200)
1127 HAVE_R200_DRI=yes;
1128 ;;
Matt Turnere0ee8182012-01-14 22:21:30 -05001129 esac
1130 done
1131
1132 ;;
1133esac
1134
Matt Turner349845f2012-01-15 11:39:48 -05001135case $DRI_DIRS in
1136*swrast*)
1137 HAVE_SWRAST_DRI=yes;
1138 ;;
1139esac
1140
Matt Turner3c87dfc2012-01-14 21:57:32 -05001141AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
Eric Anholte3264802012-01-12 14:28:37 -08001142AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
Matt Turner3f964342012-01-15 10:20:30 -05001143AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
Matt Turnerb38d7a02012-01-15 10:04:58 -05001144AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
Matt Turnere0ee8182012-01-14 22:21:30 -05001145AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
Matt Turner349845f2012-01-15 11:39:48 -05001146AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
Jon TURNEYffc84942012-02-02 10:39:04 +00001147AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
Eric Anholte3264802012-01-12 14:28:37 -08001148
Dan Nicholson44d99142007-12-05 18:47:01 -08001149dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -07001150dnl OSMesa configuration
1151dnl
Dan Nicholson979ff512007-12-05 18:47:01 -08001152
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001153dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -07001154AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001155 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1156 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001157 [osmesa_bits="$withval"],
1158 [osmesa_bits=8])
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001159if test "x$osmesa_bits" != x8; then
1160 if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
1161 AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
1162 osmesa_bits=8
1163 fi
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001164fi
1165case "x$osmesa_bits" in
1166x8)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001167 OSMESA_LIB="${OSMESA_LIB}"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001168 ;;
1169x16|x32)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001170 OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001171 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1172 ;;
1173*)
1174 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1175 ;;
1176esac
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001177
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001178if test "x$enable_osmesa" = xyes; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001179 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -08001180 if test "$enable_static" = no; then
Kenneth Graunked1d812052011-01-16 16:01:54 -08001181 OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -08001182 else
1183 OSMESA_LIB_DEPS=""
1184 fi
Matt Turner7ef94c62012-01-31 21:34:42 -05001185 OSMESA_MESA_DEPS=""
Kenneth Graunked1d812052011-01-16 16:01:54 -08001186 OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001187fi
Laurent Carlier284325d2012-06-24 09:51:27 +02001188
Dan Nicholson297e16c2008-05-05 15:42:53 -07001189AC_SUBST([OSMESA_LIB_DEPS])
Matt Turner7ef94c62012-01-31 21:34:42 -05001190AC_SUBST([OSMESA_MESA_DEPS])
1191AC_SUBST([OSMESA_PC_REQ])
Dan Nicholson8be02fc2008-12-14 09:35:29 -08001192AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001193
1194dnl
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001195dnl gbm configuration
1196dnl
1197if test "x$enable_gbm" = xauto; then
1198 case "$with_egl_platforms" in
1199 *drm*)
1200 enable_gbm=yes ;;
1201 *)
1202 enable_gbm=no ;;
1203 esac
1204fi
1205if test "x$enable_gbm" = xyes; then
1206 SRC_DIRS="$SRC_DIRS gbm"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001207
1208 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1209 AC_MSG_ERROR([gbm needs udev]))
Matt Turner027ce0c2012-01-24 11:34:42 -05001210
1211 if test "x$enable_dri" = xyes; then
1212 GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
Matt Turner8c9b78a2012-08-17 14:22:47 -07001213 if test "x$enable_shared_glapi" = xno; then
Matt Turner027ce0c2012-01-24 11:34:42 -05001214 AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
1215 fi
Jakob Bornecrantza669a502012-08-13 15:55:23 +02001216 PKG_CHECK_MODULES([LIBKMS], [libkms], [],
1217 AC_MSG_ERROR([gbm needs libkms]))
Matt Turner027ce0c2012-01-24 11:34:42 -05001218 fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001219fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001220GBM_PC_REQ_PRIV="libudev"
1221GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001222AC_SUBST([GBM_PC_REQ_PRIV])
1223AC_SUBST([GBM_PC_LIB_PRIV])
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001224
1225dnl
Dan Nicholson53b37342009-02-25 17:45:34 -08001226dnl EGL configuration
1227dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001228EGL_CLIENT_APIS=""
1229
Dan Nicholson66f97862009-04-29 12:11:43 -07001230if test "x$enable_egl" = xyes; then
1231 SRC_DIRS="$SRC_DIRS egl"
Tapani Pälli2758e652011-05-16 16:56:43 +03001232 EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
Marek Olšákad50abba2011-06-14 05:14:27 +02001233
Benjamin Franzke85fe9482011-08-09 14:23:18 +02001234 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
1235
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +08001236 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +08001237 # build egl_glx when libGL is built
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001238 if test "x$enable_glx" = xyes; then
Eric Anholt88612022012-02-05 10:46:13 +01001239 HAVE_EGL_DRIVER_GLX=1
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +08001240 fi
1241
Benjamin Franzke184bb092011-04-30 11:18:23 +02001242 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1243 [have_libudev=yes],[have_libudev=no])
Benjamin Franzkea7cd65f2011-05-31 11:14:46 +02001244 if test "$have_libudev" = yes; then
1245 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1246 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001247
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001248 if test "x$enable_dri" = xyes; then
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001249 HAVE_EGL_DRIVER_DRI2=1
Chia-I Wu39ae9652010-07-16 19:48:52 +08001250 fi
Kristian Høgsberg2168b872010-06-02 22:48:06 -04001251
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001252 fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001253fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001254AC_SUBST([EGL_LIB_DEPS])
1255
1256dnl
Marek Olšák1251e1d2011-06-18 20:33:55 +02001257dnl EGL Gallium configuration
1258dnl
1259if test "x$enable_gallium_egl" = xyes; then
1260 if test "x$with_gallium_drivers" = x; then
1261 AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
1262 fi
1263 if test "x$enable_egl" = xno; then
1264 AC_MSG_ERROR([cannot enable egl_gallium without EGL])
1265 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +09001266 if test "x$have_libdrm" != xyes; then
1267 AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
1268 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001269
1270 GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
Chia-I Wub8f097f2011-06-20 12:01:39 +09001271 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
Marek Olšák1251e1d2011-06-18 20:33:55 +02001272 HAVE_ST_EGL="yes"
1273fi
1274
1275dnl
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001276dnl gbm Gallium configuration
1277dnl
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001278if test "x$enable_gallium_gbm" = xauto; then
Chia-I Wu95ef0692011-11-05 15:09:36 +08001279 case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in
1280 yesyesyes*drm*)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001281 enable_gallium_gbm=yes ;;
1282 *)
1283 enable_gallium_gbm=no ;;
1284 esac
1285fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001286if test "x$enable_gallium_gbm" = xyes; then
1287 if test "x$with_gallium_drivers" = x; then
1288 AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
1289 fi
1290 if test "x$enable_gbm" = xno; then
1291 AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
1292 fi
Chia-I Wu95ef0692011-11-05 15:09:36 +08001293 # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
1294 if test "x$enable_dri" = xno; then
1295 AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
1296 fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001297
1298 GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
1299 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
1300 HAVE_ST_GBM="yes"
Francisco Jerezb52a0f22012-04-20 16:31:23 +02001301 enable_gallium_loader=yes
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001302fi
1303
1304dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001305dnl X.Org DDX configuration
1306dnl
1307if test "x$enable_xorg" = xyes; then
1308 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1309 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1310 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1311 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1312 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1313 HAVE_XEXTPROTO_71="no")
1314 GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
1315 HAVE_ST_XORG=yes
1316fi
1317
1318dnl
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001319dnl XA configuration
1320dnl
1321if test "x$enable_xa" = xyes; then
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001322AC_PROG_AWK
1323AC_PROG_GREP
1324AC_CHECK_PROG(NM, nm, "nm")
1325if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
1326AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
1327enable_xa=no
1328fi
1329fi
1330if test "x$enable_xa" = xyes; then
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001331 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
1332 HAVE_ST_XA=yes
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001333 AC_SUBST(AWK)
1334 AC_SUBST(GREP)
1335 AC_SUBST(NM)
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001336fi
1337
1338dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001339dnl OpenVG configuration
1340dnl
1341VG_LIB_DEPS=""
1342
1343if test "x$enable_openvg" = xyes; then
1344 if test "x$enable_egl" = xno; then
1345 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1346 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001347 if test "x$with_gallium_drivers" = x; then
Marek Olšák440d71d2011-06-14 05:38:58 +02001348 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1349 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001350 if test "x$enable_gallium_egl" = xno; then
1351 AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
1352 fi
Marek Olšák440d71d2011-06-14 05:38:58 +02001353
1354 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
1355 VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
1356 CORE_DIRS="$CORE_DIRS mapi/vgapi"
1357 GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
1358 HAVE_ST_VEGA=yes
Matt Turner261719b2012-08-22 16:57:38 -07001359 VG_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
1360 AC_SUBST([VG_PC_LIB_PRIV])
Marek Olšák440d71d2011-06-14 05:38:58 +02001361fi
1362
1363dnl
1364dnl D3D1X configuration
1365dnl
1366
1367if test "x$enable_d3d1x" = xyes; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001368 if test "x$with_gallium_drivers" = x; then
1369 AC_MSG_ERROR([cannot enable D3D1X without Gallium])
1370 fi
1371
Marek Olšák440d71d2011-06-14 05:38:58 +02001372 GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
1373 HAVE_ST_D3D1X=yes
1374fi
1375
1376dnl
Christian Königc3b22302011-07-04 15:04:41 +02001377dnl Gallium G3DVL configuration
1378dnl
1379AC_ARG_ENABLE([gallium-g3dvl],
1380 [AS_HELP_STRING([--enable-gallium-g3dvl],
1381 [build gallium g3dvl @<:@default=disabled@:>@])],
1382 [enable_gallium_g3dvl="$enableval"],
1383 [enable_gallium_g3dvl=no])
1384if test "x$enable_gallium_g3dvl" = xyes; then
1385 if test "x$with_gallium_drivers" = x; then
1386 AC_MSG_ERROR([cannot enable G3DVL without Gallium])
1387 fi
1388
1389 if test "x$enable_xvmc" = xauto; then
Christian Königa8ae8cf2011-07-14 12:42:17 +02001390 PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
Christian Königc3b22302011-07-04 15:04:41 +02001391 fi
1392
1393 if test "x$enable_vdpau" = xauto; then
Christian König33bf4102011-07-14 13:57:23 +02001394 PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
Christian Königc3b22302011-07-04 15:04:41 +02001395 fi
1396
1397 if test "x$enable_va" = xauto; then
Christian König8619aa52011-07-14 14:09:25 +02001398 #don't enable vaapi state tracker even if package exists
1399 #PKG_CHECK_EXISTS([libva], [enable_vdpau=yes], [enable_vdpau=no])
Christian Königc3b22302011-07-04 15:04:41 +02001400 enable_va=no
1401 fi
1402fi
1403
Christian Königc3b22302011-07-04 15:04:41 +02001404if test "x$enable_xvmc" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001405 PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
Christian Königdcf8ee72012-02-15 17:30:58 +01001406 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
Christian Königc3b22302011-07-04 15:04:41 +02001407 HAVE_ST_XVMC="yes"
1408fi
1409
Christian Königc3b22302011-07-04 15:04:41 +02001410if test "x$enable_vdpau" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001411 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
Christian Königc3b22302011-07-04 15:04:41 +02001412 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
1413 HAVE_ST_VDPAU="yes"
1414fi
1415
Christian Königc3b22302011-07-04 15:04:41 +02001416if test "x$enable_va" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001417 PKG_CHECK_MODULES([LIBVA], [libva = 0.31.1 x11-xcb xcb-dri2 >= 1.8])
Christian König8619aa52011-07-14 14:09:25 +02001418 AC_MSG_WARN([vaapi state tracker currently unmaintained])
Christian Königc3b22302011-07-04 15:04:41 +02001419 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va"
1420 HAVE_ST_VA="yes"
1421fi
1422
Christian Königc3b22302011-07-04 15:04:41 +02001423dnl
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001424dnl OpenCL configuration
1425dnl
1426
Tom Stellardc79e7662012-03-12 13:53:20 -04001427AC_ARG_WITH([libclc-path],
1428 [AS_HELP_STRING([--with-libclc-path],
1429 [Path to libclc builtins library. Example: --with-libclc-path=\$HOME/libclc/])],
1430 [LIBCLC_PATH="$withval"],
1431 [LIBCLC_PATH=""])
1432
Tom Stellardea76f032012-06-15 16:52:16 -04001433AC_ARG_WITH([clang-libdir],
1434 [AS_HELP_STRING([--with-clang-libdir],
1435 [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
1436 [CLANG_LIBDIR="$withval"],
1437 [CLANG_LIBDIR=""])
1438
Tom Stellardc79e7662012-03-12 13:53:20 -04001439AC_SUBST([LIBCLC_PATH])
1440
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001441if test "x$enable_opencl" = xyes; then
1442 if test "x$with_gallium_drivers" = x; then
1443 AC_MSG_ERROR([cannot enable OpenCL without Gallium])
1444 fi
Tom Stellard79d77b32012-04-20 16:56:46 +02001445
1446 if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
1447 AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
1448 fi
1449
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001450 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
1451 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
Tom Stellard79d77b32012-04-20 16:56:46 +02001452 enable_gallium_loader=yes
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001453fi
1454
1455dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001456dnl Gallium configuration
1457dnl
Marek Olšák58b6a192011-06-14 07:46:59 +02001458if test "x$with_gallium_drivers" != x; then
Jakob Bornecrantzbe38b322010-03-23 13:23:26 +00001459 SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001460fi
Matt Turnerbfd7d6f2012-08-17 15:51:59 -07001461AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x)
Dan Nicholsondca1b792007-10-23 09:25:58 -07001462
Tom Stellarda75c6162012-01-06 17:38:37 -05001463AC_SUBST([LLVM_BINDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001464AC_SUBST([LLVM_CFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001465AC_SUBST([LLVM_CPPFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001466AC_SUBST([LLVM_CXXFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001467AC_SUBST([LLVM_LIBDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001468AC_SUBST([LLVM_LIBS])
1469AC_SUBST([LLVM_LDFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001470AC_SUBST([LLVM_INCLUDEDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001471AC_SUBST([LLVM_VERSION])
Tom Stellardea76f032012-06-15 16:52:16 -04001472AC_SUBST([CLANG_RESOURCE_DIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001473
Chia-I Wube5f34a2010-10-27 16:14:27 +08001474case "x$enable_opengl$enable_gles1$enable_gles2" in
1475x*yes*)
1476 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
1477 ;;
1478esac
Chia-I Wube5f34a2010-10-27 16:14:27 +08001479
Chia-I Wu874ccd52010-05-04 22:43:05 +08001480AC_SUBST([VG_LIB_DEPS])
Chia-I Wu63ab2502010-05-05 15:38:02 +08001481AC_SUBST([EGL_CLIENT_APIS])
1482
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001483dnl
1484dnl EGL Platforms configuration
1485dnl
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001486AC_ARG_WITH([egl-platforms],
1487 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1488 [comma delimited native platforms libEGL supports, e.g.
Chia-I Wue7424d72010-09-19 16:54:39 +08001489 "x11,drm" @<:@default=auto@:>@])],
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001490 [with_egl_platforms="$withval"],
Eric Anholt28d92ef2012-02-05 07:54:38 +01001491 [if test "x$enable_egl" = xyes; then
1492 with_egl_platforms="x11"
1493 else
1494 with_egl_platforms=""
1495 fi])
Chia-I Wu49381d62010-01-11 01:23:01 +08001496
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001497EGL_PLATFORMS=""
Benjamin Franzke214fc6e2011-02-04 12:24:08 +01001498
Eric Anholt28d92ef2012-02-05 07:54:38 +01001499if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
1500 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1501fi
1502
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001503# Do per-EGL platform setups and checks
Eric Anholt28d92ef2012-02-05 07:54:38 +01001504egl_platforms=`IFS=', '; echo $with_egl_platforms`
1505for plat in $egl_platforms; do
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001506 case "$plat" in
1507 fbdev|null)
1508 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat"
1509 ;;
1510
1511 wayland)
Benjamin Franzke6b369c42011-02-21 16:22:34 +01001512 PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
Benjamin Franzkee586c4b2011-02-04 12:22:58 +01001513 [AC_MSG_ERROR([cannot find libwayland-client])])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001514 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
Benjamin Franzke8b902052012-01-24 20:38:01 +01001515
Kristian Høgsberg426a23a2012-07-13 11:06:32 -04001516 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
1517 AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
1518 [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001519 ;;
1520
1521 x11)
1522 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes])
1523 # workaround a bug in xcb-dri2 generated by xcb-proto 1.6
1524 save_LIBS="$LIBS"
1525 AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [],
1526 [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"])
1527 LIBS="$save_LIBS"
1528 ;;
1529
1530 drm)
1531 test "x$enable_gbm" = "xno" &&
1532 AC_MSG_ERROR([EGL platform drm needs gbm])
1533 ;;
1534
1535 android|gdi)
1536 ;;
1537
1538 *)
1539 AC_MSG_ERROR([EGL platform '$plat' does not exist])
1540 ;;
1541 esac
1542
Benjamin Franzke7ed18262011-07-02 13:46:42 +02001543 case "$plat$have_libudev" in
1544 waylandno|drmno)
1545 AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
1546 esac
Eric Anholt28d92ef2012-02-05 07:54:38 +01001547done
1548
Eric Anholt88612022012-02-05 10:46:13 +01001549# libEGL wants to default to the first platform specified in
1550# ./configure. parse that here.
1551if test "x$egl_platforms" != "x"; then
1552 FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
1553 EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
1554else
1555 EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
1556fi
1557
Eric Anholt28d92ef2012-02-05 07:54:38 +01001558EGL_PLATFORMS="$egl_platforms"
Eric Anholt88612022012-02-05 10:46:13 +01001559
1560AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
1561AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
1562AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
1563AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
1564AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
1565
1566AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
1567AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
1568
1569AC_SUBST([EGL_NATIVE_PLATFORM])
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001570AC_SUBST([EGL_PLATFORMS])
Eric Anholt88612022012-02-05 10:46:13 +01001571AC_SUBST([EGL_CFLAGS])
Chia-I Wu49381d62010-01-11 01:23:01 +08001572
Chia-I Wu28c3e572010-01-23 20:18:43 +08001573AC_ARG_WITH([egl-driver-dir],
1574 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1575 [directory for EGL drivers [[default=${libdir}/egl]]])],
1576 [EGL_DRIVER_INSTALL_DIR="$withval"],
1577 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1578AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1579
Joel Bosveld8acca482009-03-06 08:46:08 +09001580AC_ARG_WITH([xorg-driver-dir],
1581 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1582 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1583 [XORG_DRIVER_INSTALL_DIR="$withval"],
1584 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1585AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1586
Tom Fogal7085dce2009-08-13 19:40:30 -06001587AC_ARG_WITH([max-width],
1588 [AS_HELP_STRING([--with-max-width=N],
1589 [Maximum framebuffer width (4096)])],
1590 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1591 AS_IF([test "${withval}" -gt "4096"],
1592 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1593)
1594AC_ARG_WITH([max-height],
1595 [AS_HELP_STRING([--with-max-height=N],
1596 [Maximum framebuffer height (4096)])],
1597 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1598 AS_IF([test "${withval}" -gt "4096"],
1599 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1600)
1601
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001602dnl
Dave Airlie81fe1982010-04-22 14:59:29 +10001603dnl Gallium LLVM
1604dnl
1605AC_ARG_ENABLE([gallium-llvm],
1606 [AS_HELP_STRING([--enable-gallium-llvm],
Marek Olšáka86fc712011-04-21 13:27:55 +02001607 [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
Dave Airlie81fe1982010-04-22 14:59:29 +10001608 [enable_gallium_llvm="$enableval"],
1609 [enable_gallium_llvm=auto])
Tom Stellard7d87c712012-03-27 22:24:39 -04001610
1611AC_ARG_WITH([llvm-shared-libs],
1612 [AS_HELP_STRING([--with-llvm-shared-libs],
1613 [link with LLVM shared libraries @<:@default=disabled@:>@])],
1614 [with_llvm_shared_libs=yes],
1615 [with_llvm_shared_libs=no])
1616
Tom Stellard17f6c912012-07-17 18:32:56 +00001617AC_ARG_WITH([llvm-prefix],
1618 [AS_HELP_STRING([--with-llvm-prefix],
1619 [Prefix for LLVM installations in non-standard locations])],
1620 [llvm_prefix="$withval"],
1621 [llvm_prefix=""])
1622
1623
Marek Olšák58b6a192011-06-14 07:46:59 +02001624if test "x$with_gallium_drivers" = x; then
1625 enable_gallium_llvm=no
1626fi
Marek Olšáka86fc712011-04-21 13:27:55 +02001627if test "x$enable_gallium_llvm" = xauto; then
1628 case "$host_cpu" in
1629 i*86|x86_64) enable_gallium_llvm=yes;;
1630 esac
1631fi
Dave Airlie81fe1982010-04-22 14:59:29 +10001632if test "x$enable_gallium_llvm" = xyes; then
Tom Stellard17f6c912012-07-17 18:32:56 +00001633 if test "x$llvm_prefix" != x; then
1634 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
1635 else
1636 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1637 fi
Marek Olšák99fba502011-07-23 15:57:51 +02001638
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001639 if test "x$LLVM_CONFIG" != xno; then
ojab2fe6c252012-01-05 14:18:34 +04001640 LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
ojab3d2bf912012-05-13 14:56:00 +04001641 LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'`
Tom Stellard7d87c712012-03-27 22:24:39 -04001642 if test "x$with_llvm_shared_libs" = xyes; then
1643 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
1644 LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`"
1645 else
José Fonsecabd9bf7a2012-07-21 11:43:06 +01001646 LLVM_COMPONENTS="engine bitwriter"
1647 if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
1648 LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
Tom Stellard7a6b5d42012-05-02 11:06:13 -04001649 fi
José Fonsecabd9bf7a2012-07-21 11:43:06 +01001650 if test "x$enable_opencl" = xyes; then
1651 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
1652 fi
1653 LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
Tom Stellard7d87c712012-03-27 22:24:39 -04001654 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001655 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
Tom Stellarda75c6162012-01-06 17:38:37 -05001656 LLVM_BINDIR=`$LLVM_CONFIG --bindir`
1657 LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags`
Tom Stellardd4167802012-04-24 10:34:57 -04001658 LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags`
Tom Stellarda75c6162012-01-06 17:38:37 -05001659 LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
Tom Stellardd4167802012-04-24 10:34:57 -04001660 LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
Tom Stellardadb8eca2012-04-17 09:24:29 -04001661 DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`"
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001662 MESA_LLVM=1
Tom Stellardea76f032012-06-15 16:52:16 -04001663
1664 dnl Check for Clang interanl headers
1665 if test "x$enable_opencl" = xyes; then
1666 if test "x$CLANG_LIBDIR" = x; then
1667 CLANG_LIBDIR=${LLVM_LIBDIR}
1668 fi
1669 CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
1670 AC_CHECK_FILE("$CLANG_RESOURCE_DIR/include/stddef.h",,
1671 AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.]))
1672 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001673 else
Dave Airlie81fe1982010-04-22 14:59:29 +10001674 MESA_LLVM=0
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001675 fi
1676else
1677 MESA_LLVM=0
Dave Airlie81fe1982010-04-22 14:59:29 +10001678fi
1679
Alexandre Demers3ea36952012-04-04 10:54:56 +02001680dnl Directory for XVMC libs
1681AC_ARG_WITH([xvmc-libdir],
1682 [AS_HELP_STRING([--with-xvmc-libdir=DIR],
1683 [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
1684 [XVMC_LIB_INSTALL_DIR="$withval"],
1685 [XVMC_LIB_INSTALL_DIR='${libdir}'])
1686AC_SUBST([XVMC_LIB_INSTALL_DIR])
1687
Tom Stellard79d77b32012-04-20 16:56:46 +02001688dnl
1689dnl Gallium Tests
1690dnl
1691if test "x$enable_gallium_tests" = xyes; then
1692 SRC_DIRS="$SRC_DIRS gallium/tests/trivial"
1693 enable_gallium_loader=yes
1694fi
1695
Thomas Balling Sørensen32999972010-07-14 00:34:56 +02001696dnl Directory for VDPAU libs
1697AC_ARG_WITH([vdpau-libdir],
1698 [AS_HELP_STRING([--with-vdpau-libdir=DIR],
1699 [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
1700 [VDPAU_LIB_INSTALL_DIR="$withval"],
1701 [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
1702AC_SUBST([VDPAU_LIB_INSTALL_DIR])
Younes Manton40cd0822010-03-05 23:11:05 -05001703
Thomas Balling Sørensen501ac572010-10-24 19:27:29 +02001704dnl Directory for VA libs
1705AC_ARG_WITH([va-libdir],
1706 [AS_HELP_STRING([--with-va-libdir=DIR],
1707 [directory for the VA libraries @<:@default=${libdir}/va@:>@])],
1708 [VA_LIB_INSTALL_DIR="$withval"],
1709 [VA_LIB_INSTALL_DIR='${libdir}/va'])
1710AC_SUBST([VA_LIB_INSTALL_DIR])
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07001711
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001712dnl Directory for OpenCL libs
1713AC_ARG_WITH([opencl-libdir],
1714 [AS_HELP_STRING([--with-opencl-libdir=DIR],
1715 [directory for the OpenCL libraries @<:@default=${libdir}/opencl@:>@])],
1716 [OPENCL_LIB_INSTALL_DIR="$withval"],
1717 [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
1718AC_SUBST([OPENCL_LIB_INSTALL_DIR])
1719
Dave Airlie81fe1982010-04-22 14:59:29 +10001720dnl
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001721dnl Gallium helper functions
1722dnl
1723gallium_check_st() {
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001724 if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
Christian Königc3b22302011-07-04 15:04:41 +02001725 test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
1726 test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then
Chia-I Wu81239342011-07-02 09:49:17 +09001727 if test "x$have_libdrm" != xyes; then
1728 AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
1729 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001730 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1731 fi
1732 if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
1733 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
1734 fi
Chia-I Wud8e0e112010-06-29 14:04:27 +08001735 if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001736 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1737 fi
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001738 if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
1739 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
1740 fi
Christian Königc3b22302011-07-04 15:04:41 +02001741 if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
1742 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
1743 fi
1744 if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
1745 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
1746 fi
1747 if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then
1748 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7"
1749 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001750}
1751
Marek Olšákc17fb852011-06-14 04:03:17 +02001752gallium_require_llvm() {
1753 if test "x$MESA_LLVM" = x0; then
1754 case "$host_cpu" in
1755 i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
1756 esac
1757 fi
1758}
1759
Tom Stellard79d77b32012-04-20 16:56:46 +02001760gallium_require_drm_loader() {
1761 if test "x$enable_gallium_loader" = xyes; then
1762 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1763 AC_MSG_ERROR([Gallium drm loader requrires libudev]))
1764 if test "x$have_libdrm" != xyes; then
1765 AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
1766 fi
1767 enable_gallium_drm_loader=yes
1768 fi
1769}
1770
Marek Olšák58b6a192011-06-14 07:46:59 +02001771dnl Gallium drivers
Marek Olšák02c8ee22011-06-27 08:02:31 +02001772dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
Marek Olšák58b6a192011-06-14 07:46:59 +02001773if test "x$with_gallium_drivers" != x; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001774 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
1775 for driver in $gallium_drivers; do
1776 case "x$driver" in
1777 xsvga)
Marek Olšák02c8ee22011-06-27 08:02:31 +02001778 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
Thomas Hellstromd742a642011-09-29 21:41:21 +02001779 gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
Marek Olšák58b6a192011-06-14 07:46:59 +02001780 ;;
1781 xi915)
Emil Velikovc2426bb2011-07-14 23:07:19 +01001782 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Marek Olšák02c8ee22011-06-27 08:02:31 +02001783 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
1784 if test "x$MESA_LLVM" = x1; then
1785 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1786 fi
1787 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
Marek Olšák58b6a192011-06-14 07:46:59 +02001788 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1789 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001790 xr300)
Jerome Glissec0c979e2012-01-30 17:22:13 -05001791 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Marek Olšák58b6a192011-06-14 07:46:59 +02001792 gallium_require_llvm "Gallium R300"
Marek Olšák02c8ee22011-06-27 08:02:31 +02001793 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
1794 gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" "va-r300"
Marek Olšák58b6a192011-06-14 07:46:59 +02001795 ;;
1796 xr600)
Jerome Glissec0c979e2012-01-30 17:22:13 -05001797 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001798 gallium_require_drm_loader
Marek Olšák58b6a192011-06-14 07:46:59 +02001799 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
Adam Rak6a829a12011-11-30 22:20:41 +01001800 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
Tom Stellardced73ea2012-04-17 09:26:28 -04001801 if test "x$LLVM_VERSION" != "x3.1"; then
1802 AC_MSG_ERROR([LLVM 3.1 is required for the r600 llvm compiler.])
1803 fi
1804 NEED_RADEON_GALLIUM=yes;
Adam Rak6a829a12011-11-30 22:20:41 +01001805 fi
1806 if test "x$enable_r600_llvm" = xyes; then
Tom Stellardced73ea2012-04-17 09:26:28 -04001807 USE_R600_LLVM_COMPILER=yes;
1808 fi
Adam Rak6a829a12011-11-30 22:20:41 +01001809 if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then
Michel Dänzer761131c2012-07-17 18:30:13 +02001810 LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs bitreader asmparser`"
Adam Rak6a829a12011-11-30 22:20:41 +01001811 fi
Marek Olšákbf0baa72011-09-27 16:42:01 +02001812 gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600"
Marek Olšák58b6a192011-06-14 07:46:59 +02001813 ;;
Tom Stellarda75c6162012-01-06 17:38:37 -05001814 xradeonsi)
Michel Dänzer24bc3822012-05-12 12:12:21 +02001815 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1816 gallium_require_drm_loader
Tom Stellarda75c6162012-01-06 17:38:37 -05001817 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
1818 if test "x$LLVM_VERSION" != "x3.1"; then
1819 AC_MSG_ERROR([LLVM 3.1 is required to build the radeonsi driver.])
1820 fi
1821 NEED_RADEON_GALLIUM=yes;
Christian König41625af2012-07-13 11:23:10 +02001822 gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
Tom Stellarda75c6162012-01-06 17:38:37 -05001823 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001824 xnouveau)
Emil Velikovc2426bb2011-07-14 23:07:19 +01001825 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001826 gallium_require_drm_loader
Ben Skeggsa2fc42b2012-01-11 12:42:07 +01001827 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0"
Maarten Lankhorstdf8f8642011-10-18 14:24:30 +02001828 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
Marek Olšák58b6a192011-06-14 07:46:59 +02001829 ;;
1830 xswrast)
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001831 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
1832 if test "x$MESA_LLVM" = x1; then
1833 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1834 fi
1835
Marek Olšák58b6a192011-06-14 07:46:59 +02001836 if test "x$HAVE_ST_DRI" = xyes; then
1837 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1838 fi
Christian Königc3b22302011-07-04 15:04:41 +02001839 if test "x$HAVE_ST_VDPAU" = xyes; then
1840 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
1841 fi
1842 if test "x$HAVE_ST_XVMC" = xyes; then
1843 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
1844 fi
1845 if test "x$HAVE_ST_VA" = xyes; then
1846 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe"
1847 fi
Eric Anholt48c99252011-10-14 14:33:00 -07001848 if test "x$HAVE_ST_VDPAU" = xyes ||
1849 test "x$HAVE_ST_XVMC" = xyes ||
1850 test "x$HAVE_ST_VA" = xyes; then
Younes Mantonb97816d2011-07-14 12:22:20 -04001851 if test "x$HAVE_WINSYS_XLIB" != xyes; then
1852 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
1853 fi
1854 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001855 ;;
1856 *)
1857 AC_MSG_ERROR([Unknown Gallium driver: $driver])
1858 ;;
1859 esac
1860 done
Chia-I Wua1306f42010-01-22 15:51:51 +08001861fi
1862
Francisco Jereze1364532012-04-25 22:16:00 +02001863if test "x$enable_gallium_loader" = xyes; then
1864 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
1865 GALLIUM_PIPE_LOADER_DEFINES="-DHAVE_PIPE_LOADER_SW"
1866 GALLIUM_PIPE_LOADER_LIBS="\$(TOP)/src/gallium/auxiliary/pipe-loader/libpipe_loader.a"
1867 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(TOP)/src/gallium/winsys/sw/null/libws_null.a"
1868
1869 if test "x$HAVE_WINSYS_XLIB" = xyes; then
1870 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
1871 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a"
1872 fi
1873
1874 if test "x$enable_gallium_drm_loader" = xyes; then
1875 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
Tom Stellard044de402012-07-17 18:36:06 +00001876 PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
1877 pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
1878 if test "x$pipe_loader_have_xcb" = xyes; then
1879 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB"
1880 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
1881 fi
Francisco Jereze1364532012-04-25 22:16:00 +02001882 fi
1883
1884 AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
1885 AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
1886fi
1887
Tom Stellard26ab7472012-03-03 20:02:05 -05001888dnl Tell Automake which drivers to build
1889for driver in $GALLIUM_DRIVERS_DIRS; do
1890 case "x$driver" in
1891 xgalahad)
1892 HAVE_GALAHAD_GALLIUM=yes;
1893 ;;
Tom Stellard3f3f10f2012-03-03 20:14:00 -05001894 xidentity)
1895 HAVE_IDENTITY_GALLIUM=yes;
1896 ;;
Tom Stellarddc382e52012-03-03 20:35:39 -05001897 xnoop)
1898 HAVE_NOOP_GALLIUM=yes;
1899 ;;
Tom Stellard26ab7472012-03-03 20:02:05 -05001900 *)
1901 GALLIUM_MAKE_DIRS="$GALLIUM_MAKE_DIRS $driver"
1902 ;;
1903 esac
1904done
1905
1906AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes)
Tom Stellard3f3f10f2012-03-03 20:14:00 -05001907AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes)
Tom Stellarddc382e52012-03-03 20:35:39 -05001908AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes)
Tom Stellarda75c6162012-01-06 17:38:37 -05001909AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes)
Tom Stellardced73ea2012-04-17 09:26:28 -04001910AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
Francisco Jereze1364532012-04-25 22:16:00 +02001911AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
1912AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
Tom Stellardd85e5122012-04-20 14:46:45 -04001913AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
Tom Stellard26ab7472012-03-03 20:02:05 -05001914AC_SUBST([GALLIUM_MAKE_DIRS])
1915
Eric Anholtf9d15622012-05-24 13:59:21 -07001916AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07001917
Eric Anholte4269492012-06-11 10:25:05 -07001918AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
1919AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
1920AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07001921
Matt Turnera8fd8cb2012-08-22 11:43:05 -07001922# To pass as an argument to libtool's -version-number flag
1923VERSION_NUMBER=`echo "$VERSION" | $SED 's/\./:/g'`
1924AC_SUBST([VERSION_NUMBER])
1925
Chia-I Wu99a37ed2010-01-05 17:39:05 +08001926dnl prepend CORE_DIRS to SRC_DIRS
1927SRC_DIRS="$CORE_DIRS $SRC_DIRS"
Dan Nicholsondca1b792007-10-23 09:25:58 -07001928
1929dnl Restore LDFLAGS and CPPFLAGS
1930LDFLAGS="$_SAVE_LDFLAGS"
1931CPPFLAGS="$_SAVE_CPPFLAGS"
1932
Marcin Baczyńskiff2efdf2011-07-13 21:26:49 +02001933dnl Add user CFLAGS and CXXFLAGS
1934CFLAGS="$CFLAGS $USER_CFLAGS"
1935CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
1936
Dan Nicholsondca1b792007-10-23 09:25:58 -07001937dnl Substitute the config
Eric Anholt9ff27092012-06-11 10:49:38 -07001938AC_CONFIG_FILES([configs/current
Eric Anholt07abd912012-05-14 18:38:54 -07001939 Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001940 src/egl/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01001941 src/egl/drivers/Makefile
Eric Anholte5f89542012-02-06 12:12:53 +01001942 src/egl/drivers/dri2/Makefile
1943 src/egl/drivers/glx/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01001944 src/egl/main/Makefile
1945 src/egl/main/egl.pc
Benjamin Franzke8b902052012-01-24 20:38:01 +01001946 src/egl/wayland/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001947 src/egl/wayland/wayland-drm/Makefile
Benjamin Franzke8b902052012-01-24 20:38:01 +01001948 src/egl/wayland/wayland-egl/Makefile
1949 src/egl/wayland/wayland-egl/wayland-egl.pc
Matt Turner383a70b2012-08-22 10:01:42 -07001950 src/gallium/Makefile
1951 src/gallium/auxiliary/pipe-loader/Makefile
1952 src/gallium/drivers/Makefile
1953 src/gallium/drivers/r300/Makefile
1954 src/gallium/drivers/r600/Makefile
1955 src/gallium/state_trackers/clover/Makefile
1956 src/gallium/targets/opencl/Makefile
1957 src/gbm/Makefile
1958 src/gbm/main/gbm.pc
Jon TURNEY68e04cc2012-06-28 23:15:48 +01001959 src/glsl/Makefile
1960 src/glsl/glcpp/Makefile
Eric Anholtcc7e0de2012-04-16 09:53:29 -07001961 src/glsl/tests/Makefile
Eric Anholt8ffb0982012-02-05 06:10:56 +01001962 src/glx/Makefile
Ian Romanick2e8c8662012-05-23 15:23:22 -07001963 src/glx/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001964 src/gtest/Makefile
1965 src/Makefile
Matt Turnera6b8b702012-08-21 14:36:44 -07001966 src/mapi/es1api/Makefile
1967 src/mapi/es1api/glesv1_cm.pc
Matt Turner0f8110c2012-08-21 14:52:59 -07001968 src/mapi/es2api/Makefile
1969 src/mapi/es2api/glesv2.pc
Jon TURNEYb2a37e22012-06-29 18:09:37 +01001970 src/mapi/glapi/Makefile
Eric Anholt3a70f752012-06-11 12:59:21 -07001971 src/mapi/glapi/gen/Makefile
Ian Romanicka29ad2b2012-05-29 11:28:11 -07001972 src/mapi/glapi/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001973 src/mapi/shared-glapi/Makefile
Ian Romanick45d3d0a2012-08-01 14:48:27 -07001974 src/mapi/shared-glapi/tests/Makefile
Matt Turner261719b2012-08-22 16:57:38 -07001975 src/mapi/vgapi/Makefile
1976 src/mapi/vgapi/vg.pc
Eric Anholt417c1a62012-06-12 12:10:58 -07001977 src/mesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001978 src/mesa/gl.pc
Eric Anholtd59149d2012-06-11 10:53:09 -07001979 src/mesa/drivers/Makefile
Matt Turner129213e2012-01-15 11:50:20 -05001980 src/mesa/drivers/dri/dri.pc
Matt Turner80aa7812012-01-26 19:31:12 -05001981 src/mesa/drivers/dri/common/Makefile
Matt Turner3c87dfc2012-01-14 21:57:32 -05001982 src/mesa/drivers/dri/i915/Makefile
Eric Anholte3264802012-01-12 14:28:37 -08001983 src/mesa/drivers/dri/i965/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001984 src/mesa/drivers/dri/Makefile
Matt Turner3f964342012-01-15 10:20:30 -05001985 src/mesa/drivers/dri/nouveau/Makefile
Matt Turnerb38d7a02012-01-15 10:04:58 -05001986 src/mesa/drivers/dri/r200/Makefile
Matt Turnere0ee8182012-01-14 22:21:30 -05001987 src/mesa/drivers/dri/radeon/Makefile
Eric Anholt2d4b77c2012-06-12 11:38:19 -07001988 src/mesa/drivers/dri/swrast/Makefile
Laurent Carlier284325d2012-06-24 09:51:27 +02001989 src/mesa/drivers/osmesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001990 src/mesa/drivers/osmesa/osmesa.pc
Eric Anholtfa4cf4d2012-05-15 12:23:00 -07001991 src/mesa/drivers/x11/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001992 src/mesa/libdricore/Makefile
1993 src/mesa/main/tests/Makefile
1994 src/mesa/x86-64/Makefile
1995 src/mesa/x86/Makefile])
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -08001996
Marek Olšák618dbc82011-06-27 03:12:57 +02001997dnl Sort the dirs alphabetically
Marek Olšák3c799622011-09-27 16:51:05 +02001998GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
1999GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2000GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Tom Stellard26ab7472012-03-03 20:02:05 -05002001GALLIUM_MAKE_DIRS=`echo $GALLIUM_MAKE_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák3c799622011-09-27 16:51:05 +02002002GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák618dbc82011-06-27 03:12:57 +02002003
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07002004AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08002005
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002006dnl
2007dnl Output some configuration info for the user
2008dnl
2009echo ""
2010echo " prefix: $prefix"
2011echo " exec_prefix: $exec_prefix"
2012echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07002013echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002014
Chia-I Wu815faa42010-10-29 12:34:44 +08002015dnl API info
2016echo ""
2017echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
Chia-I Wu815faa42010-10-29 12:34:44 +08002018echo " OpenVG: $enable_openvg"
2019
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002020dnl Driver info
2021echo ""
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002022if test "x$enable_osmesa" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002023 echo " OSMesa: lib$OSMESA_LIB"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002024else
Chia-I Wu815faa42010-10-29 12:34:44 +08002025 echo " OSMesa: no"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002026fi
2027
2028if test "x$enable_dri" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002029 # cleanup the drivers var
2030 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
2031 if test "x$DRI_DIRS" = x; then
2032 echo " DRI drivers: no"
2033 else
2034 echo " DRI drivers: $dri_dirs"
2035 fi
2036 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08002037fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002038
2039case "x$enable_glx$enable_xlib_glx" in
2040xyesyes)
2041 echo " GLX: Xlib-based"
2042 ;;
2043xyesno)
2044 echo " GLX: DRI-based"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002045 ;;
2046*)
2047 echo " GLX: $enable_glx"
2048 ;;
2049esac
2050
Chia-I Wu815faa42010-10-29 12:34:44 +08002051dnl EGL
2052echo ""
2053echo " EGL: $enable_egl"
2054if test "$enable_egl" = yes; then
2055 echo " EGL platforms: $EGL_PLATFORMS"
Chia-I Wu12300502010-10-31 21:01:54 +08002056
2057 egl_drivers=""
Eric Anholt88612022012-02-05 10:46:13 +01002058 if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then
2059 egl_drivers="$egl_drivers builtin:egl_glx"
2060 fi
2061 if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
2062 egl_drivers="$egl_drivers builtin:egl_dri2"
2063 fi
Chia-I Wu12300502010-10-31 21:01:54 +08002064
Marek Olšák1251e1d2011-06-18 20:33:55 +02002065 if test "x$HAVE_ST_EGL" = xyes; then
Chia-I Wu12300502010-10-31 21:01:54 +08002066 echo " EGL drivers: ${egl_drivers} egl_gallium"
2067 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
Chia-I Wu815faa42010-10-29 12:34:44 +08002068 else
Chia-I Wu12300502010-10-31 21:01:54 +08002069 echo " EGL drivers: $egl_drivers"
Chia-I Wu815faa42010-10-29 12:34:44 +08002070 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +01002071fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002072
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002073echo ""
Eric Anholt1a8b1272010-05-21 12:17:24 -07002074if test "x$MESA_LLVM" = x1; then
Jakob Bornecrantzfe0fe672010-04-28 13:38:58 +01002075 echo " llvm: yes"
2076 echo " llvm-config: $LLVM_CONFIG"
2077 echo " llvm-version: $LLVM_VERSION"
2078else
2079 echo " llvm: no"
2080fi
2081
2082echo ""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002083if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
2084 echo " Gallium: yes"
2085 echo " Gallium dirs: $GALLIUM_DIRS"
Keith Whitwell51bff092010-03-11 14:43:00 +00002086 echo " Target dirs: $GALLIUM_TARGET_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002087 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00002088 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002089 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
2090else
2091 echo " Gallium: no"
2092fi
2093
Daniel Vetter8f15c312011-11-28 22:24:26 +01002094
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002095dnl Libraries
2096echo ""
2097echo " Shared libs: $enable_shared"
2098echo " Static libs: $enable_static"
Matt Turner53248e52012-08-17 11:25:14 -07002099echo " Shared-glapi: $enable_shared_glapi"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002100
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002101dnl Compiler options
2102# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
Eric Anholt11ff18f2012-07-26 09:35:36 -07002103cflags=`echo $CFLAGS $PIC_FLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002104 $SED 's/^ *//;s/ */ /;s/ *$//'`
Eric Anholt11ff18f2012-07-26 09:35:36 -07002105cxxflags=`echo $CXXFLAGS $PIC_FLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002106 $SED 's/^ *//;s/ */ /;s/ *$//'`
Eric Anholte4269492012-06-11 10:25:05 -07002107defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002108echo ""
2109echo " CFLAGS: $cflags"
2110echo " CXXFLAGS: $cxxflags"
2111echo " Macros: $defines"
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002112echo ""
2113echo " PYTHON2: $PYTHON2"
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002114
Dan Nicholsondca1b792007-10-23 09:25:58 -07002115echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07002116echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07002117echo ""