blob: e7c8223383e731ab2ea14fd4c5c12c760dba0d88 [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
Emil Velikov488b3ed2013-07-25 23:45:45 +01009m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION)))
10AC_INIT([Mesa], [MESA_VERSION],
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -080011 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
Dan Nicholson297e16c2008-05-05 15:42:53 -070012AC_CONFIG_AUX_DIR([bin])
Matt Turner7da12422012-09-18 20:21:47 -070013AC_CONFIG_MACRO_DIR([m4])
Thierry Reding9948a332012-10-19 14:03:01 +020014AC_CANONICAL_SYSTEM
Eric Anholta4ff3342012-06-11 12:59:48 -070015AM_INIT_AUTOMAKE([foreign])
Dan Nicholsondca1b792007-10-23 09:25:58 -070016
Colin Walters0d736b22012-01-14 09:16:20 -050017dnl http://people.gnome.org/~walters/docs/build-api.txt
18dnl We don't support srcdir != builddir.
19echo \#buildapi-variable-no-builddir >/dev/null
20
Eric Anholt7fa5c912012-01-12 14:56:56 -080021# Support silent build rules, requires at least automake-1.11. Disable
22# by either passing --disable-silent-rules to configure or passing V=1
23# to make
Lauri Kasanen0a828282013-02-22 22:25:58 +020024m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
25 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
Eric Anholt7fa5c912012-01-12 14:56:56 -080026
Kenneth Graunke4a5d0202012-05-30 21:54:21 -070027m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
28
Johannes Obermayr10a96f42012-09-02 01:35:47 +020029dnl Set internal versions
30OSMESA_VERSION=8
31AC_SUBST([OSMESA_VERSION])
32
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070033dnl Versions for external dependencies
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000034LIBDRM_REQUIRED=2.4.24
Alex Deucher77300ba2013-07-11 18:51:32 -040035LIBDRM_RADEON_REQUIRED=2.4.46
Eric Anholtf0159012012-07-18 10:18:26 -070036LIBDRM_INTEL_REQUIRED=2.4.38
Ben Skeggs2e47d012011-12-23 14:03:49 +100037LIBDRM_NVVIEUX_REQUIRED=2.4.33
Maarten Lankhorst9ba7eac2012-12-02 12:07:35 +010038LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
Rob Clark6173cc12012-10-27 11:07:34 -050039LIBDRM_FREEDRENO_REQUIRED=2.4.39
Jesse Barnes1e39fc72011-05-05 13:09:16 -070040DRI2PROTO_REQUIRED=2.6
41GLPROTO_REQUIRED=1.4.14
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000042LIBDRM_XORG_REQUIRED=2.4.24
Jakob Bornecrantz683a0992010-03-11 19:23:15 +000043LIBKMS_XORG_REQUIRED=1.0.0
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070044
Dan Nicholsondca1b792007-10-23 09:25:58 -070045dnl Check for progs
46AC_PROG_CPP
47AC_PROG_CC
48AC_PROG_CXX
Dylan Noblesmitha3d56732012-04-02 15:35:38 +000049AM_PROG_CC_C_O
Eric Anholtf9d15622012-05-24 13:59:21 -070050AM_PROG_AS
Dan Nicholson297e16c2008-05-05 15:42:53 -070051AC_CHECK_PROGS([MAKE], [gmake make])
Kenneth Graunke3acc8262010-10-25 13:52:58 -070052AC_CHECK_PROGS([PYTHON2], [python2 python])
Andreas Boll410b58c2013-01-18 15:31:57 +010053AX_PYTHON_MODULE([libxml2], [needed])
Matt Turner3a343ef2012-01-11 01:05:56 -050054AC_PROG_SED
Matt Turnerfd827a82012-01-21 22:43:02 -050055AC_PROG_MKDIR_P
Dan Nicholson41b00702007-12-12 08:48:30 -080056
Thierry Reding9948a332012-10-19 14:03:01 +020057LT_PREREQ([2.2])
58LT_INIT([disable-static])
59
Matt Turnerb68b8522012-10-01 13:11:30 -070060AX_PROG_BISON([],
Matt Turner02b6da12013-01-29 11:22:06 -080061 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
Matt Turnerb68b8522012-10-01 13:11:30 -070062 [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
Matt Turner2a710542012-10-01 13:28:51 -070063AX_PROG_FLEX([],
Matt Turner02b6da12013-01-29 11:22:06 -080064 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
Matt Turner2a710542012-10-01 13:28:51 -070065 [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
Brian Paulde1df262011-05-18 07:50:21 -060066
Tom Stellarda75c6162012-01-06 17:38:37 -050067AC_PATH_PROG([PERL], [perl])
68
Kenneth Graunke2224fb62012-05-29 16:03:05 -070069AC_CHECK_PROG(INDENT, indent, indent, cat)
70if test "x$INDENT" != "xcat"; then
Vinson Lee2f358fe2012-12-31 15:19:43 -080071 AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
Kenneth Graunke2224fb62012-05-29 16:03:05 -070072fi
73
Dan Nicholsonbc302b22009-05-22 09:39:02 -070074AC_PROG_INSTALL
Dan Nicholsonbc302b22009-05-22 09:39:02 -070075
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070076dnl We need a POSIX shell for parts of the build. Assume we have one
77dnl in most cases.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070078case "$host_os" in
79solaris*)
80 # Solaris /bin/sh is too old/non-POSIX compliant
81 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070082 SHELL="$POSIX_SHELL"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070083 ;;
84esac
85
nobled2a501872010-08-29 20:03:37 -040086dnl clang is mostly GCC-compatible, but its version is much lower,
87dnl so we have to check for it.
88AC_MSG_CHECKING([if compiling with clang])
89
90AC_COMPILE_IFELSE(
91[AC_LANG_PROGRAM([], [[
92#ifndef __clang__
93 not clang
94#endif
95]])],
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070096[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
nobled2a501872010-08-29 20:03:37 -040097
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070098AC_MSG_RESULT([$acv_mesa_CLANG])
nobled2a501872010-08-29 20:03:37 -040099
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800100dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
101dnl versions are explictly not supported.
Mike Frysinger73c9b4b2013-02-04 21:27:40 -0500102GEN_ASM_OFFSETS=no
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
Mike Frysinger73c9b4b2013-02-04 21:27:40 -0500120
121 if test "x$cross_compiling" = xyes; then
122 GEN_ASM_OFFSETS=yes
123 fi
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800124fi
Mike Frysinger73c9b4b2013-02-04 21:27:40 -0500125AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes)
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800126
Dan Nicholson41b00702007-12-12 08:48:30 -0800127dnl Make sure the pkg-config macros are defined
Dan Nicholson356f3112009-04-29 06:49:27 -0700128m4_ifndef([PKG_PROG_PKG_CONFIG],
129 [m4_fatal([Could not locate the pkg-config autoconf macros.
130 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
131 are in a different location, try setting the environment variable
132 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700133PKG_PROG_PKG_CONFIG()
134
135dnl LIB_DIR - library basename
136LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -0700137AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700138
Matt Turnerd12b07e2012-08-14 12:33:32 -0700139dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
Dan Nicholsondca1b792007-10-23 09:25:58 -0700140_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700141_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700142
143dnl Compiler macros
144DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -0700145AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700146case "$host_os" in
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700147linux*|*-gnu*|gnu*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700148 DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700149 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700150solaris*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700151 DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700152 ;;
Brian Paul97988902010-02-18 12:46:12 -0700153cygwin*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700154 DEFINES="$DEFINES -DHAVE_PTHREAD"
Brian Paul97988902010-02-18 12:46:12 -0700155 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -0700156esac
157
158dnl Add flags for gcc and g++
159if test "x$GCC" = xyes; then
Vinson Lee53e36d32012-10-11 18:19:49 -0700160 case "$host_os" in
161 cygwin*)
162 CFLAGS="$CFLAGS -Wall -std=gnu99"
163 ;;
164 *)
165 CFLAGS="$CFLAGS -Wall -std=c99"
166 ;;
167 esac
Eric Anholtb9aab8b2012-01-26 18:48:20 -0800168
169 # Enable -Werror=implicit-function-declaration and
170 # -Werror=missing-prototypes, if available, or otherwise, just
171 # -Wmissing-prototypes. This is particularly useful to avoid
172 # generating a loadable driver module that has undefined symbols.
173 save_CFLAGS="$CFLAGS"
174 AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
175 CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
176 CFLAGS="$CFLAGS -Werror=missing-prototypes"
177 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
178 AC_MSG_RESULT([yes]),
179 [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
180 AC_MSG_RESULT([no])]);
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800181
182 # Enable -fvisibility=hidden if using a gcc that supports it
183 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800184 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100185 VISIBILITY_CFLAGS="-fvisibility=hidden"
186 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800187 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100188 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
189
190 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
191 CFLAGS=$save_CFLAGS
Dan Nicholson0c275b62008-01-15 22:52:25 -0800192
193 # Work around aliasing bugs - developers should comment this out
194 CFLAGS="$CFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100195
196 # gcc's builtin memcmp is slower than glibc's
197 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
198 CFLAGS="$CFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700199fi
200if test "x$GXX" = xyes; then
201 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800202
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400203 # Enable -fvisibility=hidden if using a gcc that supports it
204 save_CXXFLAGS="$CXXFLAGS"
205 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100206 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
207 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
Jon TURNEY560f7622011-04-26 11:49:01 +0100208 AC_LANG_PUSH([C++])
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400209 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100210 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
Jon TURNEY560f7622011-04-26 11:49:01 +0100211 AC_LANG_POP([C++])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100212
213 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
214 CXXFLAGS=$save_CXXFLAGS
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400215
Dan Nicholson0c275b62008-01-15 22:52:25 -0800216 # Work around aliasing bugs - developers should comment this out
217 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100218
219 # gcc's builtin memcmp is slower than glibc's
220 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
221 CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700222fi
223
Jon TURNEYdb786432011-04-26 11:56:02 +0100224dnl even if the compiler appears to support it, using visibility attributes isn't
225dnl going to do anything useful currently on cygwin apart from emit lots of warnings
226case "$host_os" in
227cygwin*)
228 VISIBILITY_CFLAGS=""
229 VISIBILITY_CXXFLAGS=""
230 ;;
231esac
232
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100233AC_SUBST([VISIBILITY_CFLAGS])
234AC_SUBST([VISIBILITY_CXXFLAGS])
235
Dan Nicholsondca1b792007-10-23 09:25:58 -0700236dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600237dnl Hacks to enable 32 or 64 bit build
238dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700239AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600240 [AS_HELP_STRING([--enable-32-bit],
241 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700242 [enable_32bit="$enableval"],
243 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600244)
245if test "x$enable_32bit" = xyes; then
246 if test "x$GCC" = xyes; then
247 CFLAGS="$CFLAGS -m32"
Tapani Pällia9cfd952012-05-31 09:32:45 +0300248 CCASFLAGS="$CCASFLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600249 fi
250 if test "x$GXX" = xyes; then
251 CXXFLAGS="$CXXFLAGS -m32"
252 fi
253fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700254AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600255 [AS_HELP_STRING([--enable-64-bit],
256 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700257 [enable_64bit="$enableval"],
258 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600259)
260if test "x$enable_64bit" = xyes; then
261 if test "x$GCC" = xyes; then
262 CFLAGS="$CFLAGS -m64"
263 fi
264 if test "x$GXX" = xyes; then
265 CXXFLAGS="$CXXFLAGS -m64"
266 fi
267fi
268
Dan Nicholson88586332007-11-15 08:59:57 -0800269dnl Can't have static and shared libraries, default to static if user
270dnl explicitly requested. If both disabled, set to static since shared
Matt Turner0c178232012-01-14 11:10:06 -0500271dnl was explicitly requested.
Dan Nicholson88586332007-11-15 08:59:57 -0800272case "x$enable_static$enable_shared" in
273xyesyes )
Matt Turner14819eb2012-08-01 08:32:49 -0700274 AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
Dan Nicholson88586332007-11-15 08:59:57 -0800275 enable_shared=no
276 ;;
277xnono )
Matt Turner14819eb2012-08-01 08:32:49 -0700278 AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
Dan Nicholson88586332007-11-15 08:59:57 -0800279 enable_static=yes
280 ;;
281esac
282
Matt Turnerdf4dccc2012-08-22 11:51:31 -0700283AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
284
Dan Nicholson88586332007-11-15 08:59:57 -0800285dnl
Dan Nicholson23656c42007-12-12 09:02:31 -0800286dnl other compiler options
287dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700288AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800289 [AS_HELP_STRING([--enable-debug],
290 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700291 [enable_debug="$enableval"],
292 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800293)
294if test "x$enable_debug" = xyes; then
295 DEFINES="$DEFINES -DDEBUG"
296 if test "x$GCC" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000297 CFLAGS="$CFLAGS -g -O0"
Dan Nicholson23656c42007-12-12 09:02:31 -0800298 fi
299 if test "x$GXX" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000300 CXXFLAGS="$CXXFLAGS -g -O0"
Dan Nicholson23656c42007-12-12 09:02:31 -0800301 fi
302fi
Dan Nicholson88586332007-11-15 08:59:57 -0800303
304dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700305dnl library names
306dnl
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100307LIB_PREFIX_GLOB='lib'
308LIB_VERSION_SEPARATOR='.'
Dan Nicholson88586332007-11-15 08:59:57 -0800309if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800310 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800311else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700312 case "$host_os" in
313 darwin* )
314 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100315 cygwin* )
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100316 dnl prefix can be 'cyg' or 'lib'
317 LIB_PREFIX_GLOB='???'
318 LIB_VERSION_SEPARATOR='-'
319 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700320 aix* )
321 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700322 * )
323 LIB_EXTENSION='so' ;;
324 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800325fi
Brad Kingf3cdcb82012-06-05 13:59:58 -0400326AC_ARG_WITH([gl-lib-name],
327 [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
328 [specify GL library name @<:@default=GL@:>@])],
329 [GL_LIB=$withval],
330 [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400331AC_ARG_WITH([osmesa-lib-name],
332 [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
333 [specify OSMesa library name @<:@default=OSMesa@:>@])],
334 [OSMESA_LIB=$withval],
335 [OSMESA_LIB=OSMesa])
336AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400337AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
Dan Nicholson8217f242009-02-11 15:16:00 -0800338
Marek Olšák848f7d32011-04-01 01:12:41 +0200339dnl
Tom Fogalc0573fb2011-10-10 10:33:18 -0600340dnl Mangled Mesa support
341dnl
342AC_ARG_ENABLE([mangling],
343 [AS_HELP_STRING([--enable-mangling],
344 [enable mangled symbols and library name @<:@default=disabled@:>@])],
345 [enable_mangling="${enableval}"],
346 [enable_mangling=no]
347)
Tom Fogalc0573fb2011-10-10 10:33:18 -0600348if test "x${enable_mangling}" = "xyes" ; then
349 DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400350 GL_LIB="Mangled${GL_LIB}"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400351 OSMESA_LIB="Mangled${OSMESA_LIB}"
Tom Fogalc0573fb2011-10-10 10:33:18 -0600352fi
353AC_SUBST([GL_LIB])
Tom Fogalc0573fb2011-10-10 10:33:18 -0600354AC_SUBST([OSMESA_LIB])
355
356dnl
Marek Olšák848f7d32011-04-01 01:12:41 +0200357dnl potentially-infringing-but-nobody-knows-for-sure stuff
358dnl
359AC_ARG_ENABLE([texture-float],
360 [AS_HELP_STRING([--enable-texture-float],
361 [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
362 [enable_texture_float="$enableval"],
363 [enable_texture_float=no]
364)
365if test "x$enable_texture_float" = xyes; then
366 AC_MSG_WARN([Floating-point textures enabled.])
367 AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
368 DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
369fi
370
Dan Nicholson8217f242009-02-11 15:16:00 -0800371GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800372OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800373EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500374GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
375GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
Chia-I Wu874ccd52010-05-04 22:43:05 +0800376VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800377GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800378
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100379GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100380EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
381EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
382GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
383GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
384VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800385GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800386
Dan Nicholson297e16c2008-05-05 15:42:53 -0700387AC_SUBST([GL_LIB_NAME])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700388AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800389AC_SUBST([EGL_LIB_NAME])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500390AC_SUBST([GLESv1_CM_LIB_NAME])
391AC_SUBST([GLESv2_LIB_NAME])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800392AC_SUBST([VG_LIB_NAME])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800393AC_SUBST([GLAPI_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700394
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700395AC_SUBST([GL_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800396AC_SUBST([EGL_LIB_GLOB])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500397AC_SUBST([GLESv1_CM_LIB_GLOB])
398AC_SUBST([GLESv2_LIB_GLOB])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800399AC_SUBST([VG_LIB_GLOB])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800400AC_SUBST([GLAPI_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700401
Dan Nicholsondca1b792007-10-23 09:25:58 -0700402dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700403dnl Arch/platform-specific settings
404dnl
405AC_ARG_ENABLE([asm],
406 [AS_HELP_STRING([--disable-asm],
407 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
408 [enable_asm="$enableval"],
409 [enable_asm=yes]
410)
411asm_arch=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700412AC_MSG_CHECKING([whether to enable assembly])
413test "x$enable_asm" = xno && AC_MSG_RESULT([no])
414# disable if cross compiling on x86/x86_64 since we must run gen_matypes
415if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
416 case "$host_cpu" in
Jean-Sébastien Pédron148f0de2013-06-05 13:27:37 +0200417 i?86 | x86_64 | amd64)
Dan Nicholson871125a2008-06-04 13:00:35 -0700418 enable_asm=no
419 AC_MSG_RESULT([no, cross compiling])
420 ;;
421 esac
422fi
423# check for supported arches
424if test "x$enable_asm" = xyes; then
425 case "$host_cpu" in
426 i?86)
427 case "$host_os" in
Jonathan Gray78fbb412013-06-26 17:11:57 +1000428 linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700429 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
430 ;;
Andreas Boll06fff292013-03-16 13:50:19 +0100431 gnu*)
432 asm_arch=x86
433 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700434 esac
435 ;;
Jean-Sébastien Pédron148f0de2013-06-05 13:27:37 +0200436 x86_64|amd64)
Dan Nicholson871125a2008-06-04 13:00:35 -0700437 case "$host_os" in
Jonathan Gray78fbb412013-06-26 17:11:57 +1000438 linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700439 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
440 ;;
441 esac
442 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800443 sparc*)
444 case "$host_os" in
445 linux*)
446 asm_arch=sparc
447 ;;
448 esac
449 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700450 esac
451
452 case "$asm_arch" in
453 x86)
Eric Anholte4269492012-06-11 10:25:05 -0700454 DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholson871125a2008-06-04 13:00:35 -0700455 AC_MSG_RESULT([yes, x86])
456 ;;
Jean-Sébastien Pédron148f0de2013-06-05 13:27:37 +0200457 x86_64|amd64)
Eric Anholte4269492012-06-11 10:25:05 -0700458 DEFINES="$DEFINES -DUSE_X86_64_ASM"
Dan Nicholson871125a2008-06-04 13:00:35 -0700459 AC_MSG_RESULT([yes, x86_64])
460 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800461 sparc)
Eric Anholte4269492012-06-11 10:25:05 -0700462 DEFINES="$DEFINES -DUSE_SPARC_ASM"
David S. Miller857ac1e2009-02-26 05:35:15 -0800463 AC_MSG_RESULT([yes, sparc])
464 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700465 *)
466 AC_MSG_RESULT([no, platform not supported])
467 ;;
468 esac
469fi
Dan Nicholson871125a2008-06-04 13:00:35 -0700470
Dan Nicholson871125a2008-06-04 13:00:35 -0700471dnl Check to see if dlopen is in default libraries (like Solaris, which
472dnl has it in libc), or if libdl is needed to get it.
Tapani Pälli57c57df2012-08-16 13:59:12 +0300473AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
474 [AC_CHECK_LIB([dl], [dlopen],
475 [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
Chia-I Wu08f4bc02010-07-16 20:09:29 +0800476AC_SUBST([DLOPEN_LIBS])
Dan Nicholson871125a2008-06-04 13:00:35 -0700477
Vinson Lee990bd492013-01-26 22:50:05 -0800478case "$host_os" in
Vinson Leec403a522013-02-19 00:52:40 -0800479darwin*|mingw*)
Vinson Lee990bd492013-01-26 22:50:05 -0800480 ;;
481*)
482 AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
483 [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
484 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
485 AC_SUBST([CLOCK_LIB])
486 ;;
487esac
Dave Airlieec835352012-12-04 09:25:13 +1000488
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700489dnl See if posix_memalign is available
490AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
491
Matt Turner7da12422012-09-18 20:21:47 -0700492dnl Check for pthreads
493AX_PTHREAD
Matt Turnerdd4fde82012-09-27 15:49:52 -0700494dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
495dnl to -pthread, which causes problems if we need -lpthread to appear in
496dnl pkgconfig files.
497test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
Matt Turner7da12422012-09-18 20:21:47 -0700498
Dan Nicholson871125a2008-06-04 13:00:35 -0700499dnl SELinux awareness.
500AC_ARG_ENABLE([selinux],
501 [AS_HELP_STRING([--enable-selinux],
502 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
503 [MESA_SELINUX="$enableval"],
504 [MESA_SELINUX=no])
505if test "x$enable_selinux" = "xyes"; then
506 AC_CHECK_HEADER([selinux/selinux.h],[],
507 [AC_MSG_ERROR([SELinux headers not found])])
508 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
509 [AC_MSG_ERROR([SELinux library not found])])
510 SELINUX_LIBS="-lselinux"
511 DEFINES="$DEFINES -DMESA_SELINUX"
512fi
Matt Turner9ed00072012-09-18 20:22:37 -0700513AC_SUBST([SELINUX_LIBS])
Dan Nicholson871125a2008-06-04 13:00:35 -0700514
Marek Olšák440d71d2011-06-14 05:38:58 +0200515dnl Options for APIs
Chia-I Wube5f34a2010-10-27 16:14:27 +0800516AC_ARG_ENABLE([opengl],
517 [AS_HELP_STRING([--disable-opengl],
518 [disable support for standard OpenGL API @<:@default=no@:>@])],
519 [enable_opengl="$enableval"],
520 [enable_opengl=yes])
521AC_ARG_ENABLE([gles1],
522 [AS_HELP_STRING([--enable-gles1],
523 [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
524 [enable_gles1="$enableval"],
525 [enable_gles1=no])
526AC_ARG_ENABLE([gles2],
527 [AS_HELP_STRING([--enable-gles2],
528 [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
529 [enable_gles2="$enableval"],
530 [enable_gles2=no])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800531AC_ARG_ENABLE([openvg],
532 [AS_HELP_STRING([--enable-openvg],
533 [enable support for OpenVG API @<:@default=no@:>@])],
534 [enable_openvg="$enableval"],
535 [enable_openvg=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900536
537AC_ARG_ENABLE([dri],
538 [AS_HELP_STRING([--enable-dri],
Matt Turner32e8ce62012-08-17 14:05:56 -0700539 [enable DRI modules @<:@default=enabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900540 [enable_dri="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700541 [enable_dri=yes])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900542AC_ARG_ENABLE([glx],
543 [AS_HELP_STRING([--enable-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700544 [enable GLX library @<:@default=enabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900545 [enable_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700546 [enable_glx=yes])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900547AC_ARG_ENABLE([osmesa],
548 [AS_HELP_STRING([--enable-osmesa],
Matt Turner32e8ce62012-08-17 14:05:56 -0700549 [enable OSMesa library @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900550 [enable_osmesa="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700551 [enable_osmesa=no])
Matt Turner2f142d52013-08-20 14:16:17 -0700552AC_ARG_ENABLE([gallium-osmesa],
553 [AS_HELP_STRING([--enable-gallium-osmesa],
554 [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])],
555 [enable_gallium_osmesa="$enableval"],
556 [enable_gallium_osmesa=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900557AC_ARG_ENABLE([egl],
558 [AS_HELP_STRING([--disable-egl],
559 [disable EGL library @<:@default=enabled@:>@])],
560 [enable_egl="$enableval"],
561 [enable_egl=yes])
562
Marek Olšák440d71d2011-06-14 05:38:58 +0200563AC_ARG_ENABLE([xorg],
564 [AS_HELP_STRING([--enable-xorg],
565 [enable support for X.Org DDX API @<:@default=no@:>@])],
566 [enable_xorg="$enableval"],
567 [enable_xorg=no])
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200568AC_ARG_ENABLE([xa],
569 [AS_HELP_STRING([--enable-xa],
570 [enable build of the XA X Acceleration API @<:@default=no@:>@])],
571 [enable_xa="$enableval"],
572 [enable_xa=no])
Benjamin Franzkeeddcecb2011-05-26 15:09:39 +0200573AC_ARG_ENABLE([gbm],
574 [AS_HELP_STRING([--enable-gbm],
575 [enable gbm library @<:@default=auto@:>@])],
576 [enable_gbm="$enableval"],
577 [enable_gbm=auto])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900578
Christian Königc3b22302011-07-04 15:04:41 +0200579AC_ARG_ENABLE([xvmc],
580 [AS_HELP_STRING([--enable-xvmc],
581 [enable xvmc library @<:@default=auto@:>@])],
582 [enable_xvmc="$enableval"],
583 [enable_xvmc=auto])
584AC_ARG_ENABLE([vdpau],
585 [AS_HELP_STRING([--enable-vdpau],
586 [enable vdpau library @<:@default=auto@:>@])],
587 [enable_vdpau="$enableval"],
588 [enable_vdpau=auto])
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200589AC_ARG_ENABLE([opencl],
590 [AS_HELP_STRING([--enable-opencl],
Tom Stellardcf69a592013-01-18 16:26:12 +0000591 [enable OpenCL library NOTE: Enabling this option will also enable
592 --with-llvm-shared-libs
593 @<:@default=no@:>@])],
Quentin Glidic1e857132013-01-25 15:02:04 +0100594 [],
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200595 [enable_opencl=no])
Matt Turnerc09a4cb2013-03-09 17:35:12 -0800596AC_ARG_ENABLE([xlib-glx],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900597 [AS_HELP_STRING([--enable-xlib-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700598 [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900599 [enable_xlib_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700600 [enable_xlib_glx=no])
Matt Turnerc09a4cb2013-03-09 17:35:12 -0800601AC_ARG_ENABLE([gallium-egl],
Marek Olšák1251e1d2011-06-18 20:33:55 +0200602 [AS_HELP_STRING([--enable-gallium-egl],
603 [enable optional EGL state tracker (not required
604 for EGL support in Gallium with OpenGL and OpenGL ES)
605 @<:@default=disable@:>@])],
606 [enable_gallium_egl="$enableval"],
607 [enable_gallium_egl=no])
Matt Turnerc09a4cb2013-03-09 17:35:12 -0800608AC_ARG_ENABLE([gallium-gbm],
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200609 [AS_HELP_STRING([--enable-gallium-gbm],
610 [enable optional gbm state tracker (not required for
611 gbm support in Gallium)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200612 @<:@default=auto@:>@])],
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200613 [enable_gallium_gbm="$enableval"],
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200614 [enable_gallium_gbm=auto])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800615
Tom Stellardced73ea2012-04-17 09:26:28 -0400616AC_ARG_ENABLE([r600-llvm-compiler],
Homer Hsing40507562012-05-15 18:56:17 -0400617 [AS_HELP_STRING([--enable-r600-llvm-compiler],
618 [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
Tom Stellardced73ea2012-04-17 09:26:28 -0400619 [enable_r600_llvm="$enableval"],
620 [enable_r600_llvm=no])
621
Matt Turnerc09a4cb2013-03-09 17:35:12 -0800622AC_ARG_ENABLE([gallium-tests],
Francisco Jerez66f7fd92012-04-25 22:16:26 +0200623 [AS_HELP_STRING([--enable-gallium-tests],
624 [Enable optional Gallium tests) @<:@default=disable@:>@])],
625 [enable_gallium_tests="$enableval"],
626 [enable_gallium_tests=no])
627
Marek Olšák58b6a192011-06-14 07:46:59 +0200628# Option for Gallium drivers
Damien Lespiau164a04e2013-01-14 13:54:57 +0000629
630# Keep this in sync with the --with-gallium-drivers help string default value
Thomas Hellstrom87118d82012-01-12 12:10:53 +0100631GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
Marek Olšák58b6a192011-06-14 07:46:59 +0200632
633AC_ARG_WITH([gallium-drivers],
634 [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
635 [comma delimited Gallium drivers list, e.g.
Chia-I Wu5816a472012-12-13 06:01:23 +0800636 "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
Damien Lespiau164a04e2013-01-14 13:54:57 +0000637 @<:@default=r300,r600,svga,swrast@:>@])],
Marek Olšák58b6a192011-06-14 07:46:59 +0200638 [with_gallium_drivers="$withval"],
639 [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
Chia-I Wu156e9552010-10-30 14:26:01 +0800640
Ian Romanickdb311b42011-06-22 11:35:27 -0700641# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
642# here so that the script doesn't choke on an unknown driver name later.
643case "$with_gallium_drivers" in
644 yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
645 no) with_gallium_drivers='' ;;
646esac
647
Chia-I Wube5f34a2010-10-27 16:14:27 +0800648if test "x$enable_opengl" = xno -a \
649 "x$enable_gles1" = xno -a \
650 "x$enable_gles2" = xno -a \
Marek Olšák440d71d2011-06-14 05:38:58 +0200651 "x$enable_openvg" = xno -a \
652 "x$enable_xorg" = xno -a \
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200653 "x$enable_xa" = xno -a \
Christian Königc3b22302011-07-04 15:04:41 +0200654 "x$enable_xvmc" = xno -a \
655 "x$enable_vdpau" = xno -a \
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200656 "x$enable_opencl" = xno; then
Chia-I Wube5f34a2010-10-27 16:14:27 +0800657 AC_MSG_ERROR([at least one API should be enabled])
658fi
659
Andreas Boll723b7832013-02-01 13:39:42 +0100660# Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
661if test "x$enable_opengl" = xno -a \
662 "x$enable_gles1" = xyes; then
663 AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
664fi
665
666if test "x$enable_opengl" = xno -a \
667 "x$enable_gles2" = xyes; then
668 AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
669fi
670
Matt Turner691c3042013-01-18 23:43:05 -0800671AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
672AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
673AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
674AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
675 "x$enable_gles1" = xyes -o \
676 "x$enable_gles2" = xyes)
677
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800678if test "x$enable_glx" = xno; then
Matt Turner32e8ce62012-08-17 14:05:56 -0700679 AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800680 enable_xlib_glx=no
681fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900682
Matt Turner32e8ce62012-08-17 14:05:56 -0700683if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
684 AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
685fi
686
Michel Dänzer3b888f52013-01-31 11:47:55 +0100687if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
688 AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
689fi
690
691# Disable GLX if OpenGL is not enabled
692if test "x$enable_glx$enable_opengl" = xyesno; then
693 AC_MSG_WARN([OpenGL not enabled, disabling GLX])
694 enable_glx=no
695fi
696
Matt Turner32e8ce62012-08-17 14:05:56 -0700697# Disable GLX if DRI and Xlib-GLX are not enabled
698if test "x$enable_glx" = xyes -a \
699 "x$enable_dri" = xno -a \
700 "x$enable_xlib_glx" = xno; then
701 AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
702 enable_glx=no
703fi
704
Matt Turnera9676ae2013-01-18 23:59:49 -0800705AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \
706 "x$enable_dri" = xyes)
Matt Turner00f3d9b2012-08-21 22:06:17 -0700707AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
Matt Turner8cdce6c2012-08-21 22:26:52 -0700708AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
709 "x$enable_osmesa" = xyes)
Matt Turner06ad64a2012-01-15 21:30:26 -0500710
Matt Turner8c9b78a2012-08-17 14:22:47 -0700711AC_ARG_ENABLE([shared-glapi],
712 [AS_HELP_STRING([--enable-shared-glapi],
713 [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
714 [enable_shared_glapi="$enableval"],
715 [enable_shared_glapi="$enable_dri"])
716
717# Shared GLAPI is only useful for DRI
718if test "x$enable_dri" = xno; then
719 AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
720 enable_shared_glapi=no
721fi
722
Matt Turner8c9b78a2012-08-17 14:22:47 -0700723AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
724
Dan Nicholson44d99142007-12-05 18:47:01 -0800725dnl
726dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700727dnl
Keith Whitwell51bff092010-03-11 14:43:00 +0000728GALLIUM_TARGET_DIRS=""
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000729GALLIUM_WINSYS_DIRS="sw"
Kai Wasserbäch0a22fb62011-11-29 22:36:02 +0100730GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100731GALLIUM_STATE_TRACKERS_DIRS=""
732
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900733case "x$enable_glx$enable_xlib_glx" in
734xyesyes)
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000735 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
Keith Whitwell51bff092010-03-11 14:43:00 +0000736 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
Marek Olšák440d71d2011-06-14 05:38:58 +0200737 GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
Matt Turnerb3f1f662013-01-20 15:32:08 -0800738 NEED_WINSYS_XLIB="yes"
Dan Nicholson44d99142007-12-05 18:47:01 -0800739 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900740esac
741
742if test "x$enable_dri" = xyes; then
Emil Velikov4ef9c3d2011-07-11 15:58:29 +0100743 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
Marek Olšák440d71d2011-06-14 05:38:58 +0200744 GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900745fi
746
Matt Turner2f142d52013-08-20 14:16:17 -0700747if test "x$enable_gallium_osmesa" = xyes; then
748 if test -z "$with_gallium_drivers"; then
749 AC_MSG_ERROR([Cannot enable gallium_osmesa without Gallium])
750 fi
751 if test "x$enable_osmesa" = xyes; then
752 AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations])
753 fi
Brian Paul79eac7d2013-03-11 18:31:21 -0600754 GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
755 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900756fi
757
Dave Airlie81fe1982010-04-22 14:59:29 +1000758AC_SUBST([MESA_LLVM])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700759
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900760# Check for libdrm
761PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
762 [have_libdrm=yes], [have_libdrm=no])
763
764if test "x$enable_dri" = xyes; then
765 # DRI must be shared, I think
766 if test "$enable_static" = yes; then
Matt Turner14819eb2012-08-01 08:32:49 -0700767 AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900768 fi
769
Chia-I Wu81239342011-07-02 09:49:17 +0900770 # not a hard requirement as swrast does not depend on it
771 if test "x$have_libdrm" = xyes; then
772 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900773 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900774fi
775
Samuel Thibault75856172011-03-14 22:08:21 +0000776dnl Direct rendering or just indirect rendering
noblede7d18ed2011-03-14 22:08:22 +0000777case "$host_os" in
778gnu*)
779 dnl Disable by default on GNU/Hurd
780 driglx_direct_default="no"
781 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +0000782cygwin*)
783 dnl Disable by default on cygwin
784 driglx_direct_default="no"
785 ;;
noblede7d18ed2011-03-14 22:08:22 +0000786*)
787 driglx_direct_default="yes"
788 ;;
789esac
Samuel Thibault75856172011-03-14 22:08:21 +0000790AC_ARG_ENABLE([driglx-direct],
791 [AS_HELP_STRING([--disable-driglx-direct],
Andreas Boll5ecbc3a2012-11-10 17:58:49 +0100792 [disable direct rendering in GLX and EGL for DRI \
noblede7d18ed2011-03-14 22:08:22 +0000793 @<:@default=auto@:>@])],
Samuel Thibault75856172011-03-14 22:08:21 +0000794 [driglx_direct="$enableval"],
noblede7d18ed2011-03-14 22:08:22 +0000795 [driglx_direct="$driglx_direct_default"])
Samuel Thibault75856172011-03-14 22:08:21 +0000796
Dan Nicholson44d99142007-12-05 18:47:01 -0800797dnl
798dnl libGL configuration per driver
799dnl
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900800case "x$enable_glx$enable_xlib_glx" in
801xyesyes)
802 # Xlib-based GLX
Matt Turnere273ed32012-08-14 12:24:31 -0700803 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
804 GL_PC_REQ_PRIV="x11 xext"
805 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
806 GL_LIB_DEPS="$XLIBGL_LIBS"
Matt Turnerb6651ae2012-09-18 21:51:25 -0700807 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
808 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800809 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900810xyesno)
811 # DRI-based GLX
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500812 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Samuel Thibault75856172011-03-14 22:08:21 +0000813 if test x"$driglx_direct" = xyes; then
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900814 if test "x$have_libdrm" != xyes; then
815 AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
816 fi
Samuel Thibault75856172011-03-14 22:08:21 +0000817 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Matt Turneraf6aeae2012-09-11 17:08:17 -0700818 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
Samuel Thibault75856172011-03-14 22:08:21 +0000819 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800820
821 # find the DRI deps for libGL
Eric Anholtbb01f672012-09-25 08:43:44 -0700822 dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100823
Matt Turnere273ed32012-08-14 12:24:31 -0700824 # add xf86vidmode if available
825 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
826 if test "$HAVE_XF86VIDMODE" = yes ; then
827 dri_modules="$dri_modules xxf86vm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800828 fi
829
Matt Turnere273ed32012-08-14 12:24:31 -0700830 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
831 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
832 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
833 GL_LIB_DEPS="$DRIGL_LIBS"
834
Matt Turnerb6651ae2012-09-18 21:51:25 -0700835 # need DRM libs, $PTHREAD_LIBS, etc.
836 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
837 GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800838 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800839esac
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900840
Ian Romanick4becf672012-01-03 11:35:59 -0800841# This is outside the case (above) so that it is invoked even for non-GLX
842# builds.
Eric Anholt8ffb0982012-02-05 06:10:56 +0100843AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
Ian Romanick4becf672012-01-03 11:35:59 -0800844
Matt Turnerb6651ae2012-09-18 21:51:25 -0700845GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
846GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
847GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
848GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900849
Robert Braggdda49c32012-09-19 16:12:08 +0100850AC_SUBST([X11_INCLUDES])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700851AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800852AC_SUBST([GL_PC_REQ_PRIV])
853AC_SUBST([GL_PC_LIB_PRIV])
854AC_SUBST([GL_PC_CFLAGS])
855AC_SUBST([DRI_PC_REQ_PRIV])
Li Pengc33c1912010-07-30 12:26:15 +0800856AC_SUBST([GLESv1_CM_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400857AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500858AC_SUBST([GLESv2_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400859AC_SUBST([GLESv2_PC_LIB_PRIV])
860
Matt Turnerbee2edb2012-08-17 16:24:32 -0700861DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100862
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100863AC_SUBST([HAVE_XF86VIDMODE])
864
Dan Nicholsondca1b792007-10-23 09:25:58 -0700865dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900866dnl More GLX setup
Dan Nicholsondca1b792007-10-23 09:25:58 -0700867dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900868case "x$enable_glx$enable_xlib_glx" in
869xyesyes)
Dan Nicholsondca1b792007-10-23 09:25:58 -0700870 DEFINES="$DEFINES -DUSE_XSHM"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900871 ;;
872xyesno)
873 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
874 if test "x$driglx_direct" = xyes; then
875 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
876 fi
877 ;;
878esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700879
880dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700881dnl TLS detection
Dan Nicholson44d99142007-12-05 18:47:01 -0800882dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700883
Dan Nicholson297e16c2008-05-05 15:42:53 -0700884AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800885 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800886 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700887 [GLX_USE_TLS="$enableval"],
888 [GLX_USE_TLS=no])
Tom Fogal31351dc2010-12-05 17:58:32 -0700889AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
890
Matt Turner814345f2012-09-18 22:09:26 -0700891AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
Matt Turner9a51edf2012-10-11 10:57:26 -0700892 [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
Tom Fogal44842972011-02-21 22:32:18 -0700893
Tom Fogal31351dc2010-12-05 17:58:32 -0700894dnl
895dnl More DRI setup
896dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800897dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700898AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800899 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700900 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700901 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700902 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700903AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800904dnl Extra search path for DRI drivers
905AC_ARG_WITH([dri-searchpath],
906 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
907 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
908 [DRI_DRIVER_SEARCH_DIR="$withval"],
909 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
910AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800911dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700912AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800913 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700914 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200915 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700916 [with_dri_drivers="$withval"],
917 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800918if test "x$with_dri_drivers" = x; then
919 with_dri_drivers=no
920fi
921
922dnl If $with_dri_drivers is yes, directories will be added through
923dnl platform checks
924DRI_DIRS=""
925case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100926no) ;;
927yes)
Brian Paul4ede5fb2013-02-26 08:49:34 -0700928 # classic DRI drivers
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900929 if test "x$enable_opengl" = xyes; then
930 DRI_DIRS="yes"
931 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100932 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800933*)
934 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700935 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800936 for driver in $dri_drivers; do
937 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
Matt Turner14819eb2012-08-01 08:32:49 -0700938 AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800939 done
940 DRI_DIRS="$dri_drivers"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900941 if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
942 AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
943 fi
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800944 ;;
945esac
946
Dan Nicholson44d99142007-12-05 18:47:01 -0800947dnl Set DRI_DIRS, DEFINES and LIB_DEPS
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900948if test "x$enable_dri" = xyes; then
Dan Nicholson44d99142007-12-05 18:47:01 -0800949 # Platform specific settings and drivers to build
950 case "$host_os" in
951 linux*)
Brian Paul7f8434b2013-02-26 08:49:34 -0700952 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900953 DEFINES="$DEFINES -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800954
955 case "$host_cpu" in
Jean-Sébastien Pédron148f0de2013-06-05 13:27:37 +0200956 x86_64|amd64)
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100957 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -0700958 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800959 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800960 ;;
961 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800962 # Build only the drivers for cards that exist on PowerPC.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100963 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -0700964 DRI_DIRS="r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800965 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800966 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000967 sparc*)
Ian Romanicke4344162011-08-24 15:21:58 -0700968 # Build only the drivers for cards that exist on sparc
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100969 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -0700970 DRI_DIRS="r200 radeon swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +1000971 fi
972 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800973 esac
974 ;;
Jonathan Gray78fbb412013-06-26 17:11:57 +1000975 freebsd* | dragonfly* | *netbsd* | openbsd*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700976 DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
Brian Paul7f8434b2013-02-26 08:49:34 -0700977 DEFINES="$DEFINES -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800978
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100979 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -0700980 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800981 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800982 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700983 gnu*)
Brian Paul7f8434b2013-02-26 08:49:34 -0700984 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900985 DEFINES="$DEFINES -DHAVE_ALIAS"
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700986 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700987 solaris*)
Brian Paul7f8434b2013-02-26 08:49:34 -0700988 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700989 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +0000990 cygwin*)
Brian Paul7f8434b2013-02-26 08:49:34 -0700991 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1"
Jon TURNEYc6e33ca2011-03-14 22:08:23 +0000992 if test "x$DRI_DIRS" = "xyes"; then
993 DRI_DIRS="swrast"
994 fi
995 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800996 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -0800997
998 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100999 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001000 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -08001001 fi
1002
Dan Nicholson44d99142007-12-05 18:47:01 -08001003 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1004
1005 # Check for expat
Matt Turner7de78ce52013-03-05 10:27:22 -08001006 EXPAT_INCLUDES=""
1007 EXPAT_LIB=-lexpat
1008 AC_ARG_WITH([expat],
1009 [AS_HELP_STRING([--with-expat=DIR],
1010 [expat install directory])],[
1011 EXPAT_INCLUDES="-I$withval/include"
1012 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
1013 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
1014 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
1015 ])
1016 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
1017 save_LIBS="$LIBS"
1018 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1019 [AC_MSG_ERROR([Expat required for DRI.])])
1020 LIBS="$save_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001021
Matt Turner07f2dee2013-03-05 10:25:55 -08001022 # If we are building any DRI driver other than swrast.
Matt Turner7de78ce52013-03-05 10:27:22 -08001023 if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
Jon TURNEYffc84942012-02-02 10:39:04 +00001024 # ... libdrm is required
Chia-I Wu81239342011-07-02 09:49:17 +09001025 if test "x$have_libdrm" != xyes; then
1026 AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
1027 fi
Jon TURNEYffc84942012-02-02 10:39:04 +00001028 # ... and build dricommon
1029 HAVE_COMMON_DRI=yes
Chia-I Wu81239342011-07-02 09:49:17 +09001030 fi
1031
Matt Turner2b3a8cb2012-01-13 14:30:36 -05001032 # put all the necessary libs together
Matt Turnerb6651ae2012-09-18 21:51:25 -07001033 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
Dave Airlieec835352012-12-04 09:25:13 +10001034 GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
Eric Anholt11e494a2013-09-20 12:37:04 -07001035
1036 DRI_DRIVER_LDFLAGS="-module -avoid-version -shared -Wl,-Bsymbolic"
Dan Nicholson44d99142007-12-05 18:47:01 -08001037fi
Matt Turner523c0152012-09-20 15:08:02 -07001038AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
Dan Nicholson297e16c2008-05-05 15:42:53 -07001039AC_SUBST([EXPAT_INCLUDES])
1040AC_SUBST([DRI_LIB_DEPS])
Eric Anholt11e494a2013-09-20 12:37:04 -07001041AC_SUBST([DRI_DRIVER_LDFLAGS])
Jon TURNEYdefadf22012-07-08 12:19:24 +01001042AC_SUBST([GALLIUM_DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -08001043
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001044case $DRI_DIRS in
1045*i915*|*i965*)
Tormod Volden903185b2011-01-25 13:25:18 -08001046 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Eric Anholte3264802012-01-12 14:28:37 -08001047
Matt Turner3c87dfc2012-01-14 21:57:32 -05001048 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1049 case $d in
1050 i915)
1051 HAVE_I915_DRI=yes;
1052 ;;
1053 i965)
1054 HAVE_I965_DRI=yes;
1055 ;;
1056 esac
1057 done
Eric Anholte3264802012-01-12 14:28:37 -08001058
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001059 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -05001060esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001061
Matt Turnere0ee8182012-01-14 22:21:30 -05001062case $DRI_DIRS in
Matt Turner3f964342012-01-15 10:20:30 -05001063*nouveau*)
Ben Skeggs2e47d012011-12-23 14:03:49 +10001064 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
Matt Turner3f964342012-01-15 10:20:30 -05001065 HAVE_NOUVEAU_DRI=yes;
1066 ;;
1067esac
1068
1069case $DRI_DIRS in
Matt Turnerb38d7a02012-01-15 10:04:58 -05001070*radeon*|*r200*)
Matt Turnere0ee8182012-01-14 22:21:30 -05001071 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1072
1073 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1074 case $d in
1075 radeon)
1076 HAVE_RADEON_DRI=yes;
1077 ;;
Matt Turnerb38d7a02012-01-15 10:04:58 -05001078 r200)
1079 HAVE_R200_DRI=yes;
1080 ;;
Matt Turnere0ee8182012-01-14 22:21:30 -05001081 esac
1082 done
1083
1084 ;;
1085esac
1086
Matt Turner349845f2012-01-15 11:39:48 -05001087case $DRI_DIRS in
1088*swrast*)
1089 HAVE_SWRAST_DRI=yes;
1090 ;;
1091esac
1092
Dan Nicholson44d99142007-12-05 18:47:01 -08001093dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -07001094dnl OSMesa configuration
1095dnl
Dan Nicholson979ff512007-12-05 18:47:01 -08001096
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001097dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -07001098AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001099 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1100 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001101 [osmesa_bits="$withval"],
1102 [osmesa_bits=8])
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001103if test "x$osmesa_bits" != x8; then
1104 if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
1105 AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
1106 osmesa_bits=8
1107 fi
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001108fi
1109case "x$osmesa_bits" in
1110x8)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001111 OSMESA_LIB="${OSMESA_LIB}"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001112 ;;
1113x16|x32)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001114 OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001115 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1116 ;;
1117*)
1118 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1119 ;;
1120esac
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001121
Matt Turner2f142d52013-08-20 14:16:17 -07001122if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001123 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -08001124 if test "$enable_static" = no; then
Matt Turnerb6651ae2012-09-18 21:51:25 -07001125 OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -08001126 else
1127 OSMESA_LIB_DEPS=""
1128 fi
Matt Turner7ef94c62012-01-31 21:34:42 -05001129 OSMESA_MESA_DEPS=""
Matt Turnerb6651ae2012-09-18 21:51:25 -07001130 OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001131fi
Laurent Carlier284325d2012-06-24 09:51:27 +02001132
Dan Nicholson297e16c2008-05-05 15:42:53 -07001133AC_SUBST([OSMESA_LIB_DEPS])
Matt Turner7ef94c62012-01-31 21:34:42 -05001134AC_SUBST([OSMESA_MESA_DEPS])
1135AC_SUBST([OSMESA_PC_REQ])
Dan Nicholson8be02fc2008-12-14 09:35:29 -08001136AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001137
1138dnl
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001139dnl gbm configuration
1140dnl
1141if test "x$enable_gbm" = xauto; then
1142 case "$with_egl_platforms" in
1143 *drm*)
1144 enable_gbm=yes ;;
1145 *)
1146 enable_gbm=no ;;
1147 esac
1148fi
1149if test "x$enable_gbm" = xyes; then
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001150 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1151 AC_MSG_ERROR([gbm needs udev]))
Matt Turner027ce0c2012-01-24 11:34:42 -05001152
1153 if test "x$enable_dri" = xyes; then
1154 GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
Matt Turner8c9b78a2012-08-17 14:22:47 -07001155 if test "x$enable_shared_glapi" = xno; then
Matt Turner027ce0c2012-01-24 11:34:42 -05001156 AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
1157 fi
1158 fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001159fi
Matt Turnera9676ae2013-01-18 23:59:49 -08001160AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001161GBM_PC_REQ_PRIV="libudev"
1162GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001163AC_SUBST([GBM_PC_REQ_PRIV])
1164AC_SUBST([GBM_PC_LIB_PRIV])
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001165
1166dnl
Dan Nicholson53b37342009-02-25 17:45:34 -08001167dnl EGL configuration
1168dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001169EGL_CLIENT_APIS=""
1170
Dan Nicholson66f97862009-04-29 12:11:43 -07001171if test "x$enable_egl" = xyes; then
Matt Turnerb6651ae2012-09-18 21:51:25 -07001172 EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
Marek Olšákad50abba2011-06-14 05:14:27 +02001173
Benjamin Franzke85fe9482011-08-09 14:23:18 +02001174 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
1175
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +08001176 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +08001177 # build egl_glx when libGL is built
Benjamin Franzke184bb092011-04-30 11:18:23 +02001178 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1179 [have_libudev=yes],[have_libudev=no])
Benjamin Franzkea7cd65f2011-05-31 11:14:46 +02001180 if test "$have_libudev" = yes; then
1181 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1182 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001183
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001184 if test "x$enable_dri" = xyes; then
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001185 HAVE_EGL_DRIVER_DRI2=1
Chia-I Wu39ae9652010-07-16 19:48:52 +08001186 fi
Kristian Høgsberg2168b872010-06-02 22:48:06 -04001187
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001188 fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001189fi
Matt Turnera9676ae2013-01-18 23:59:49 -08001190AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
Dan Nicholson53b37342009-02-25 17:45:34 -08001191AC_SUBST([EGL_LIB_DEPS])
1192
1193dnl
Marek Olšák1251e1d2011-06-18 20:33:55 +02001194dnl EGL Gallium configuration
1195dnl
1196if test "x$enable_gallium_egl" = xyes; then
1197 if test "x$with_gallium_drivers" = x; then
1198 AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
1199 fi
1200 if test "x$enable_egl" = xno; then
1201 AC_MSG_ERROR([cannot enable egl_gallium without EGL])
1202 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +09001203 if test "x$have_libdrm" != xyes; then
1204 AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
1205 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001206
1207 GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
Chia-I Wub8f097f2011-06-20 12:01:39 +09001208 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
Marek Olšák1251e1d2011-06-18 20:33:55 +02001209fi
Matt Turner69b69b12013-01-19 11:23:51 -08001210AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes)
Marek Olšák1251e1d2011-06-18 20:33:55 +02001211
1212dnl
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001213dnl gbm Gallium configuration
1214dnl
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001215if test "x$enable_gallium_gbm" = xauto; then
Matt Turner69b69b12013-01-19 11:23:51 -08001216 case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in
Chia-I Wu95ef0692011-11-05 15:09:36 +08001217 yesyesyes*drm*)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001218 enable_gallium_gbm=yes ;;
1219 *)
1220 enable_gallium_gbm=no ;;
1221 esac
1222fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001223if test "x$enable_gallium_gbm" = xyes; then
1224 if test "x$with_gallium_drivers" = x; then
1225 AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
1226 fi
1227 if test "x$enable_gbm" = xno; then
1228 AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
1229 fi
Chia-I Wu95ef0692011-11-05 15:09:36 +08001230 # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
1231 if test "x$enable_dri" = xno; then
1232 AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
1233 fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001234
1235 GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
1236 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
Francisco Jerezb52a0f22012-04-20 16:31:23 +02001237 enable_gallium_loader=yes
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001238fi
Matt Turner69b69b12013-01-19 11:23:51 -08001239AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes)
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001240
1241dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001242dnl X.Org DDX configuration
1243dnl
1244if test "x$enable_xorg" = xyes; then
1245 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1246 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1247 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1248 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1249 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1250 HAVE_XEXTPROTO_71="no")
1251 GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
Marek Olšák440d71d2011-06-14 05:38:58 +02001252fi
Matt Turner69b69b12013-01-19 11:23:51 -08001253AM_CONDITIONAL(HAVE_ST_XORG, test "x$enable_xorg" = xyes)
Marek Olšák440d71d2011-06-14 05:38:58 +02001254
1255dnl
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001256dnl XA configuration
1257dnl
1258if test "x$enable_xa" = xyes; then
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001259AC_PROG_AWK
1260AC_PROG_GREP
1261AC_CHECK_PROG(NM, nm, "nm")
1262if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
1263AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
1264enable_xa=no
1265fi
1266fi
1267if test "x$enable_xa" = xyes; then
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001268 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001269 AC_SUBST(AWK)
1270 AC_SUBST(GREP)
1271 AC_SUBST(NM)
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001272fi
Matt Turner69b69b12013-01-19 11:23:51 -08001273AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes)
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001274
1275dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001276dnl OpenVG configuration
1277dnl
1278VG_LIB_DEPS=""
1279
1280if test "x$enable_openvg" = xyes; then
1281 if test "x$enable_egl" = xno; then
1282 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1283 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001284 if test "x$with_gallium_drivers" = x; then
Marek Olšák440d71d2011-06-14 05:38:58 +02001285 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1286 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001287 if test "x$enable_gallium_egl" = xno; then
1288 AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
1289 fi
Marek Olšák440d71d2011-06-14 05:38:58 +02001290
1291 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
Matt Turnerb6651ae2012-09-18 21:51:25 -07001292 VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
Marek Olšák440d71d2011-06-14 05:38:58 +02001293 GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
Dave Airlieec835352012-12-04 09:25:13 +10001294 VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
Matt Turner261719b2012-08-22 16:57:38 -07001295 AC_SUBST([VG_PC_LIB_PRIV])
Marek Olšák440d71d2011-06-14 05:38:58 +02001296fi
Matt Turnercdee0e82012-09-10 11:21:26 -07001297AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
Marek Olšák440d71d2011-06-14 05:38:58 +02001298
1299dnl
Christian Königc3b22302011-07-04 15:04:41 +02001300dnl Gallium G3DVL configuration
1301dnl
Matt Turner34efd9292013-04-17 18:21:47 -07001302if test -n "$with_gallium_drivers"; then
Christian Königc3b22302011-07-04 15:04:41 +02001303 if test "x$enable_xvmc" = xauto; then
Christian Königa8ae8cf2011-07-14 12:42:17 +02001304 PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
Christian Königc3b22302011-07-04 15:04:41 +02001305 fi
1306
1307 if test "x$enable_vdpau" = xauto; then
Christian König33bf4102011-07-14 13:57:23 +02001308 PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
Christian Königc3b22302011-07-04 15:04:41 +02001309 fi
Christian Königc3b22302011-07-04 15:04:41 +02001310fi
1311
Christian Königc3b22302011-07-04 15:04:41 +02001312if test "x$enable_xvmc" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001313 PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
Christian Königdcf8ee72012-02-15 17:30:58 +01001314 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
Christian Königc3b22302011-07-04 15:04:41 +02001315fi
Matt Turner69b69b12013-01-19 11:23:51 -08001316AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes)
Christian Königc3b22302011-07-04 15:04:41 +02001317
Christian Königc3b22302011-07-04 15:04:41 +02001318if test "x$enable_vdpau" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001319 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
Christian Königc3b22302011-07-04 15:04:41 +02001320 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
Christian Königc3b22302011-07-04 15:04:41 +02001321fi
Matt Turner69b69b12013-01-19 11:23:51 -08001322AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes)
Christian Königc3b22302011-07-04 15:04:41 +02001323
Christian Königc3b22302011-07-04 15:04:41 +02001324dnl
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001325dnl OpenCL configuration
1326dnl
1327
Tom Stellardc79e7662012-03-12 13:53:20 -04001328AC_ARG_WITH([libclc-path],
1329 [AS_HELP_STRING([--with-libclc-path],
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001330 [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
Tom Stellardc79e7662012-03-12 13:53:20 -04001331 [LIBCLC_PATH="$withval"],
1332 [LIBCLC_PATH=""])
1333
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001334if test "x$LIBCLC_PATH" != x; then
1335 AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
1336 Please review the updated build instructions for clover:
1337 http://dri.freedesktop.org/wiki/GalliumCompute])
1338fi
1339
1340
Tom Stellardea76f032012-06-15 16:52:16 -04001341AC_ARG_WITH([clang-libdir],
1342 [AS_HELP_STRING([--with-clang-libdir],
1343 [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
1344 [CLANG_LIBDIR="$withval"],
1345 [CLANG_LIBDIR=""])
1346
Tom Stellarda64d3dd2013-09-05 16:26:17 -07001347PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
Tom Stellardc79e7662012-03-12 13:53:20 -04001348
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001349if test "x$enable_opencl" = xyes; then
1350 if test "x$with_gallium_drivers" = x; then
1351 AC_MSG_ERROR([cannot enable OpenCL without Gallium])
1352 fi
Tom Stellard79d77b32012-04-20 16:56:46 +02001353
1354 if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
1355 AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
1356 fi
1357
Tom Stellarda64d3dd2013-09-05 16:26:17 -07001358 if test "x$have_libclc" = xno; then
1359 AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover.
1360 Make sure the directory containing libclc.pc is specified in your
1361 PKG_CONFIG_PATH environment variable.
1362 By default libclc.pc is installed to /usr/local/share/pkgconfig/])
1363 else
1364 LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
1365 LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
1366 AC_SUBST([LIBCLC_INCLUDEDIR])
1367 AC_SUBST([LIBCLC_LIBEXECDIR])
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001368 fi
1369
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001370 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
1371 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
Tom Stellard79d77b32012-04-20 16:56:46 +02001372 enable_gallium_loader=yes
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001373fi
Matt Turner69b69b12013-01-19 11:23:51 -08001374AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001375
1376dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001377dnl Gallium configuration
1378dnl
Matt Turnera9676ae2013-01-18 23:59:49 -08001379AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers")
Dan Nicholsondca1b792007-10-23 09:25:58 -07001380
Tom Stellarda75c6162012-01-06 17:38:37 -05001381AC_SUBST([LLVM_BINDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001382AC_SUBST([LLVM_CFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001383AC_SUBST([LLVM_CPPFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001384AC_SUBST([LLVM_CXXFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001385AC_SUBST([LLVM_LIBDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001386AC_SUBST([LLVM_LIBS])
1387AC_SUBST([LLVM_LDFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001388AC_SUBST([LLVM_INCLUDEDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001389AC_SUBST([LLVM_VERSION])
Tom Stellardea76f032012-06-15 16:52:16 -04001390AC_SUBST([CLANG_RESOURCE_DIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001391
Chia-I Wube5f34a2010-10-27 16:14:27 +08001392case "x$enable_opengl$enable_gles1$enable_gles2" in
1393x*yes*)
1394 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
1395 ;;
1396esac
Chia-I Wube5f34a2010-10-27 16:14:27 +08001397
Chia-I Wu874ccd52010-05-04 22:43:05 +08001398AC_SUBST([VG_LIB_DEPS])
Chia-I Wu63ab2502010-05-05 15:38:02 +08001399AC_SUBST([EGL_CLIENT_APIS])
1400
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001401dnl
1402dnl EGL Platforms configuration
1403dnl
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001404AC_ARG_WITH([egl-platforms],
1405 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1406 [comma delimited native platforms libEGL supports, e.g.
Chia-I Wue7424d72010-09-19 16:54:39 +08001407 "x11,drm" @<:@default=auto@:>@])],
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001408 [with_egl_platforms="$withval"],
Eric Anholt28d92ef2012-02-05 07:54:38 +01001409 [if test "x$enable_egl" = xyes; then
1410 with_egl_platforms="x11"
1411 else
1412 with_egl_platforms=""
1413 fi])
Chia-I Wu49381d62010-01-11 01:23:01 +08001414
Eric Anholt28d92ef2012-02-05 07:54:38 +01001415if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
1416 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1417fi
1418
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001419# Do per-EGL platform setups and checks
Eric Anholt28d92ef2012-02-05 07:54:38 +01001420egl_platforms=`IFS=', '; echo $with_egl_platforms`
1421for plat in $egl_platforms; do
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001422 case "$plat" in
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001423 wayland)
Fabio Pedrettiaa390542013-08-12 13:48:04 +02001424 PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.2.0 wayland-server >= 1.2.0])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001425 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
Benjamin Franzke8b902052012-01-24 20:38:01 +01001426
Kristian Høgsberg426a23a2012-07-13 11:06:32 -04001427 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
1428 AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
1429 [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001430 ;;
1431
1432 x11)
Eric Anholtb4773842012-09-25 09:09:47 -07001433 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= 1.8 xcb-xfixes])
Kristian Høgsbergb5c53242012-11-29 15:11:13 -05001434
1435 if test "x$enable_glx" = xyes; then
1436 HAVE_EGL_DRIVER_GLX=1
1437 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001438 ;;
1439
1440 drm)
1441 test "x$enable_gbm" = "xno" &&
1442 AC_MSG_ERROR([EGL platform drm needs gbm])
1443 ;;
1444
Matt Turnerb3f1f662013-01-20 15:32:08 -08001445 android|fbdev|gdi|null)
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001446 ;;
1447
1448 *)
1449 AC_MSG_ERROR([EGL platform '$plat' does not exist])
1450 ;;
1451 esac
1452
Benjamin Franzke7ed18262011-07-02 13:46:42 +02001453 case "$plat$have_libudev" in
1454 waylandno|drmno)
1455 AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
1456 esac
Eric Anholt28d92ef2012-02-05 07:54:38 +01001457done
1458
Eric Anholt88612022012-02-05 10:46:13 +01001459# libEGL wants to default to the first platform specified in
1460# ./configure. parse that here.
1461if test "x$egl_platforms" != "x"; then
1462 FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
1463 EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
1464else
1465 EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
1466fi
1467
Matt Turnerb3f1f662013-01-20 15:32:08 -08001468if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then
1469 NEED_WINSYS_XLIB=yes
1470fi
Eric Anholt88612022012-02-05 10:46:13 +01001471AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
1472AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
1473AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
1474AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
1475AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
1476
1477AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
1478AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
1479
1480AC_SUBST([EGL_NATIVE_PLATFORM])
Eric Anholt88612022012-02-05 10:46:13 +01001481AC_SUBST([EGL_CFLAGS])
Chia-I Wu49381d62010-01-11 01:23:01 +08001482
Ross Burton1a7275d2013-06-27 12:35:07 +01001483# If we don't have the X11 platform, set this define so we don't try to include
1484# the X11 headers.
1485if ! echo "$egl_platforms" | grep -q 'x11'; then
1486 DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS"
1487 GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS"
1488fi
1489
Chia-I Wu28c3e572010-01-23 20:18:43 +08001490AC_ARG_WITH([egl-driver-dir],
1491 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1492 [directory for EGL drivers [[default=${libdir}/egl]]])],
1493 [EGL_DRIVER_INSTALL_DIR="$withval"],
1494 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1495AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1496
Joel Bosveld8acca482009-03-06 08:46:08 +09001497AC_ARG_WITH([xorg-driver-dir],
1498 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1499 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1500 [XORG_DRIVER_INSTALL_DIR="$withval"],
1501 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1502AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1503
Tom Fogal7085dce2009-08-13 19:40:30 -06001504AC_ARG_WITH([max-width],
1505 [AS_HELP_STRING([--with-max-width=N],
1506 [Maximum framebuffer width (4096)])],
1507 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1508 AS_IF([test "${withval}" -gt "4096"],
1509 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1510)
1511AC_ARG_WITH([max-height],
1512 [AS_HELP_STRING([--with-max-height=N],
1513 [Maximum framebuffer height (4096)])],
1514 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1515 AS_IF([test "${withval}" -gt "4096"],
1516 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1517)
1518
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001519dnl
Dave Airlie81fe1982010-04-22 14:59:29 +10001520dnl Gallium LLVM
1521dnl
1522AC_ARG_ENABLE([gallium-llvm],
1523 [AS_HELP_STRING([--enable-gallium-llvm],
Marek Olšáka86fc712011-04-21 13:27:55 +02001524 [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
Dave Airlie81fe1982010-04-22 14:59:29 +10001525 [enable_gallium_llvm="$enableval"],
1526 [enable_gallium_llvm=auto])
Tom Stellard7d87c712012-03-27 22:24:39 -04001527
1528AC_ARG_WITH([llvm-shared-libs],
1529 [AS_HELP_STRING([--with-llvm-shared-libs],
1530 [link with LLVM shared libraries @<:@default=disabled@:>@])],
Quentin Glidic1e857132013-01-25 15:02:04 +01001531 [],
Tom Stellard7d87c712012-03-27 22:24:39 -04001532 [with_llvm_shared_libs=no])
Quentin Glidic1e857132013-01-25 15:02:04 +01001533AS_IF([test x$enable_opencl = xyes],
1534 [
1535 AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
1536 with_llvm_shared_libs=yes
1537 ])
Tom Stellard7d87c712012-03-27 22:24:39 -04001538
Tom Stellard17f6c912012-07-17 18:32:56 +00001539AC_ARG_WITH([llvm-prefix],
1540 [AS_HELP_STRING([--with-llvm-prefix],
1541 [Prefix for LLVM installations in non-standard locations])],
1542 [llvm_prefix="$withval"],
1543 [llvm_prefix=""])
1544
1545
Marek Olšák9b67a342012-11-27 23:38:01 +01001546# Call this inside ` ` to get the return value.
1547# $1 is the llvm-config command with arguments.
1548strip_unwanted_llvm_flags() {
Marek Olšák3d59cde2012-11-27 23:56:04 +01001549 # Use \> (marks the end of the word)
Marek Olšák9b67a342012-11-27 23:38:01 +01001550 echo `$1` | sed \
1551 -e 's/-DNDEBUG\>//g' \
Marek Olšák3d59cde2012-11-27 23:56:04 +01001552 -e 's/-pedantic\>//g' \
1553 -e 's/-Wcovered-switch-default\>//g' \
1554 -e 's/-O.\>//g' \
1555 -e 's/-g\>//g' \
Marek Olšákf9429e32012-11-28 00:28:18 +01001556 -e 's/-Wall\>//g' \
1557 -e 's/-fomit-frame-pointer\>//g'
Marek Olšák9b67a342012-11-27 23:38:01 +01001558}
1559
1560
Marek Olšák58b6a192011-06-14 07:46:59 +02001561if test "x$with_gallium_drivers" = x; then
1562 enable_gallium_llvm=no
1563fi
Marek Olšáka86fc712011-04-21 13:27:55 +02001564if test "x$enable_gallium_llvm" = xauto; then
1565 case "$host_cpu" in
Jean-Sébastien Pédron148f0de2013-06-05 13:27:37 +02001566 i*86|x86_64|amd64) enable_gallium_llvm=yes;;
Marek Olšáka86fc712011-04-21 13:27:55 +02001567 esac
1568fi
Dave Airlie81fe1982010-04-22 14:59:29 +10001569if test "x$enable_gallium_llvm" = xyes; then
Tom Stellard17f6c912012-07-17 18:32:56 +00001570 if test "x$llvm_prefix" != x; then
1571 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
1572 else
1573 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1574 fi
Marek Olšák99fba502011-07-23 15:57:51 +02001575
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001576 if test "x$LLVM_CONFIG" != xno; then
Klemens Baum45574ab2013-06-27 23:13:37 +02001577 LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
1578 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
1579 LLVM_BINDIR=`$LLVM_CONFIG --bindir`
1580 LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
1581 LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
1582 LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
1583 LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
1584 LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
1585
1586 AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR],
1587 [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
1588 AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR],
1589 [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"])
1590
1591 if test "x${LLVM_VERSION_MAJOR}" != x; then
1592 LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}"
1593 else
1594 LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
1595 fi
1596
Tom Stellard08980472013-01-25 16:43:11 +01001597 LLVM_COMPONENTS="engine bitwriter"
Jonathan Grayf96c07a2013-06-20 20:14:33 +10001598 if $LLVM_CONFIG --components | grep -qw 'mcjit'; then
Tom Stellard08980472013-01-25 16:43:11 +01001599 LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
1600 fi
Johannes Obermayrc2958742013-04-09 17:38:42 +01001601
Tom Stellard08980472013-01-25 16:43:11 +01001602 if test "x$enable_opencl" = xyes; then
1603 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
Niels Ole Salscheiderb336f512013-04-04 23:26:45 +02001604 # LLVM 3.3 >= 177971 requires IRReader
Jonathan Grayf96c07a2013-06-20 20:14:33 +10001605 if $LLVM_CONFIG --components | grep -qw 'irreader'; then
Niels Ole Salscheiderb336f512013-04-04 23:26:45 +02001606 LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
1607 fi
Niels Ole Salscheider5394ee82013-08-07 17:48:48 +02001608 # LLVM 3.4 requires Option
1609 if $LLVM_CONFIG --components | grep -qw 'option'; then
1610 LLVM_COMPONENTS="${LLVM_COMPONENTS} option"
1611 fi
Tom Stellard08980472013-01-25 16:43:11 +01001612 fi
Klemens Baum45574ab2013-06-27 23:13:37 +02001613 DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
1614 MESA_LLVM=1
Tom Stellardea76f032012-06-15 16:52:16 -04001615
Klemens Baum45574ab2013-06-27 23:13:37 +02001616 dnl Check for Clang internal headers
Tom Stellardea76f032012-06-15 16:52:16 -04001617 if test "x$enable_opencl" = xyes; then
1618 if test "x$CLANG_LIBDIR" = x; then
1619 CLANG_LIBDIR=${LLVM_LIBDIR}
1620 fi
1621 CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
Jonathan Liuaf16f732013-06-04 23:04:44 +10001622 AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
1623 [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.])])
Tom Stellardea76f032012-06-15 16:52:16 -04001624 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001625 else
Klemens Baum45574ab2013-06-27 23:13:37 +02001626 MESA_LLVM=0
1627 LLVM_VERSION_INT=0
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001628 fi
1629else
1630 MESA_LLVM=0
Tom Stellard80d290d2012-08-24 11:48:32 -07001631 LLVM_VERSION_INT=0
Dave Airlie81fe1982010-04-22 14:59:29 +10001632fi
1633
Alexandre Demers3ea36952012-04-04 10:54:56 +02001634dnl Directory for XVMC libs
1635AC_ARG_WITH([xvmc-libdir],
1636 [AS_HELP_STRING([--with-xvmc-libdir=DIR],
1637 [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
1638 [XVMC_LIB_INSTALL_DIR="$withval"],
1639 [XVMC_LIB_INSTALL_DIR='${libdir}'])
1640AC_SUBST([XVMC_LIB_INSTALL_DIR])
1641
Tom Stellard79d77b32012-04-20 16:56:46 +02001642dnl
1643dnl Gallium Tests
1644dnl
1645if test "x$enable_gallium_tests" = xyes; then
Tom Stellard79d77b32012-04-20 16:56:46 +02001646 enable_gallium_loader=yes
1647fi
Matt Turnera9676ae2013-01-18 23:59:49 -08001648AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes)
Tom Stellard79d77b32012-04-20 16:56:46 +02001649
Matt Turner2f7a37d2013-01-20 12:54:31 -08001650if test "x$enable_gallium_loader" = xyes; then
1651 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
1652fi
Matt Turner3a6e5482013-01-20 13:06:24 -08001653AM_CONDITIONAL(NEED_GALLIUM_LOADER, test "x$enable_gallium_loader" = xyes)
Matt Turner2f7a37d2013-01-20 12:54:31 -08001654
Thomas Balling Sørensen32999972010-07-14 00:34:56 +02001655dnl Directory for VDPAU libs
1656AC_ARG_WITH([vdpau-libdir],
1657 [AS_HELP_STRING([--with-vdpau-libdir=DIR],
1658 [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
1659 [VDPAU_LIB_INSTALL_DIR="$withval"],
1660 [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
1661AC_SUBST([VDPAU_LIB_INSTALL_DIR])
Younes Manton40cd0822010-03-05 23:11:05 -05001662
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001663dnl Directory for OpenCL libs
1664AC_ARG_WITH([opencl-libdir],
1665 [AS_HELP_STRING([--with-opencl-libdir=DIR],
Francisco Jerez4deefd92013-02-27 12:26:13 +01001666 [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])],
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001667 [OPENCL_LIB_INSTALL_DIR="$withval"],
1668 [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
1669AC_SUBST([OPENCL_LIB_INSTALL_DIR])
1670
Dave Airlie81fe1982010-04-22 14:59:29 +10001671dnl
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001672dnl Gallium helper functions
1673dnl
1674gallium_check_st() {
Matt Turnerb3f1f662013-01-20 15:32:08 -08001675 if test "x$NEED_NONNULL_WINSYS" = xyes; then
Chia-I Wu81239342011-07-02 09:49:17 +09001676 if test "x$have_libdrm" != xyes; then
1677 AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
1678 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001679 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1680 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001681 if test "x$enable_dri" = xyes && test "x$2" != x; then
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001682 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
Matt Turner07f2dee2013-03-05 10:25:55 -08001683 HAVE_COMMON_DRI=yes
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001684 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001685 if test "x$enable_xorg" = xyes && test "x$3" != x; then
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001686 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1687 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001688 if test "x$enable_xa" = xyes && test "x$4" != x; then
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001689 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
1690 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001691 if test "x$enable_xvmc" = xyes && test "x$5" != x; then
Christian Königc3b22302011-07-04 15:04:41 +02001692 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
1693 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001694 if test "x$enable_vdpau" = xyes && test "x$6" != x; then
Christian Königc3b22302011-07-04 15:04:41 +02001695 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
1696 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001697}
1698
Marek Olšákc17fb852011-06-14 04:03:17 +02001699gallium_require_llvm() {
1700 if test "x$MESA_LLVM" = x0; then
1701 case "$host_cpu" in
Jean-Sébastien Pédron148f0de2013-06-05 13:27:37 +02001702 i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
Marek Olšákc17fb852011-06-14 04:03:17 +02001703 esac
1704 fi
1705}
1706
Tom Stellard79d77b32012-04-20 16:56:46 +02001707gallium_require_drm_loader() {
1708 if test "x$enable_gallium_loader" = xyes; then
1709 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
Andreas Bollf416b382012-11-27 10:25:54 +01001710 AC_MSG_ERROR([Gallium drm loader requires libudev]))
Tom Stellard79d77b32012-04-20 16:56:46 +02001711 if test "x$have_libdrm" != xyes; then
1712 AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
1713 fi
1714 enable_gallium_drm_loader=yes
1715 fi
1716}
1717
Tom Stellard8d977852012-05-10 10:21:54 -04001718radeon_llvm_check() {
Vincent Lejeune1feb6b72012-10-31 21:02:29 +01001719 LLVM_REQUIRED_VERSION_MAJOR="3"
Tom Stellarda5a76782013-04-08 07:43:34 -07001720 LLVM_REQUIRED_VERSION_MINOR="3"
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001721 if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
Tom Stellarda5a76782013-04-08 07:43:34 -07001722 AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required for r600g and radeonsi.])
Tom Stellard8d977852012-05-10 10:21:54 -04001723 fi
Jonathan Grayf96c07a2013-06-20 20:14:33 +10001724 if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001725 AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
1726 sources with the --enable-experimental-targets=R600
1727 configure flag])
Tom Stellard8d977852012-05-10 10:21:54 -04001728 fi
Andreas Hartmetzf43f07d2013-05-28 23:59:41 +02001729 LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
Christian König5b2855b2013-04-03 10:18:35 +02001730 NEED_RADEON_LLVM=yes
Tom Stellard9277b042013-04-04 13:02:51 -07001731 AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
1732 [AC_MSG_ERROR([radeonsi and r600g require libelf when using LLVM])])
Tom Stellard8d977852012-05-10 10:21:54 -04001733}
1734
Marek Olšák58b6a192011-06-14 07:46:59 +02001735dnl Gallium drivers
Matt Turnerb3f1f662013-01-20 15:32:08 -08001736if test "x$enable_dri" = xyes -o "x$enable_xorg" = xyes -o \
1737 "x$enable_xa" = xyes -o "x$enable_xvmc" = xyes -o \
1738 "x$enable_vdpau" = xyes; then
1739 NEED_NONNULL_WINSYS=yes
1740fi
1741AM_CONDITIONAL(NEED_NONNULL_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes)
1742
Marek Olšák02c8ee22011-06-27 08:02:31 +02001743dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
Marek Olšák58b6a192011-06-14 07:46:59 +02001744if test "x$with_gallium_drivers" != x; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001745 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
1746 for driver in $gallium_drivers; do
1747 case "x$driver" in
1748 xsvga)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001749 HAVE_GALLIUM_SVGA=yes
Marek Olšák02c8ee22011-06-27 08:02:31 +02001750 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
Thomas Hellstromd742a642011-09-29 21:41:21 +02001751 gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
Marek Olšák58b6a192011-06-14 07:46:59 +02001752 ;;
1753 xi915)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001754 HAVE_GALLIUM_I915=yes
Emil Velikovc2426bb2011-07-14 23:07:19 +01001755 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Marek Olšák02c8ee22011-06-27 08:02:31 +02001756 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
1757 if test "x$MESA_LLVM" = x1; then
1758 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1759 fi
1760 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
Marek Olšák58b6a192011-06-14 07:46:59 +02001761 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1762 ;;
Chia-I Wu5816a472012-12-13 06:01:23 +08001763 xilo)
1764 HAVE_GALLIUM_ILO=yes
1765 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
1766 gallium_require_drm_loader
1767 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo"
1768 gallium_check_st "intel/drm" "dri-ilo"
1769 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001770 xr300)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001771 HAVE_GALLIUM_R300=yes
Jerome Glissec0c979e2012-01-30 17:22:13 -05001772 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Marek Olšák58b6a192011-06-14 07:46:59 +02001773 gallium_require_llvm "Gallium R300"
Marek Olšák02c8ee22011-06-27 08:02:31 +02001774 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Christian König533e9a02013-09-25 11:49:49 +02001775 gallium_check_st "radeon/drm" "r300/dri" "" "" "r300/xvmc" "r300/vdpau"
Marek Olšák58b6a192011-06-14 07:46:59 +02001776 ;;
1777 xr600)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001778 HAVE_GALLIUM_R600=yes
Jerome Glissec0c979e2012-01-30 17:22:13 -05001779 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001780 gallium_require_drm_loader
Marek Olšák58b6a192011-06-14 07:46:59 +02001781 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
Adam Rak6a829a12011-11-30 22:20:41 +01001782 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
Tom Stellard8d977852012-05-10 10:21:54 -04001783 radeon_llvm_check
Andreas Hartmetzf43f07d2013-05-28 23:59:41 +02001784 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
Adam Rak6a829a12011-11-30 22:20:41 +01001785 fi
1786 if test "x$enable_r600_llvm" = xyes; then
Tom Stellardced73ea2012-04-17 09:26:28 -04001787 USE_R600_LLVM_COMPILER=yes;
1788 fi
Tom Stellard08980472013-01-25 16:43:11 +01001789 if test "x$enable_opencl" = xyes; then
1790 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
1791 fi
Christian König015853b2013-09-25 11:34:39 +02001792 gallium_check_st "radeon/drm" "r600/dri" "r600/xorg" "" "r600/xvmc" "r600/vdpau"
Marek Olšák58b6a192011-06-14 07:46:59 +02001793 ;;
Tom Stellarda75c6162012-01-06 17:38:37 -05001794 xradeonsi)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001795 HAVE_GALLIUM_RADEONSI=yes
Michel Dänzer24bc3822012-05-12 12:12:21 +02001796 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1797 gallium_require_drm_loader
Tom Stellarda75c6162012-01-06 17:38:37 -05001798 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
Tom Stellard8d977852012-05-10 10:21:54 -04001799 radeon_llvm_check
Christian Königf6e2aa02013-09-25 12:28:09 +02001800 gallium_check_st "radeon/drm" "radeonsi/dri" "radeonsi/xorg" "" "" "radeonsi/vdpau" ""
Tom Stellarda75c6162012-01-06 17:38:37 -05001801 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001802 xnouveau)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001803 HAVE_GALLIUM_NOUVEAU=yes
Emil Velikovc2426bb2011-07-14 23:07:19 +01001804 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001805 gallium_require_drm_loader
Johannes Obermayr5eb7ff12013-08-20 20:14:00 +02001806 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau"
Maarten Lankhorstdf8f8642011-10-18 14:24:30 +02001807 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
Marek Olšák58b6a192011-06-14 07:46:59 +02001808 ;;
Rob Clark6173cc12012-10-27 11:07:34 -05001809 xfreedreno)
1810 HAVE_GALLIUM_FREEDRENO=yes
1811 PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
1812 gallium_require_drm_loader
1813 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
1814 gallium_check_st "freedreno/drm" "dri-freedreno" "" "" "" ""
1815 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001816 xswrast)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001817 HAVE_GALLIUM_SOFTPIPE=yes
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001818 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
1819 if test "x$MESA_LLVM" = x1; then
Matt Turner2cbb94b2012-09-07 21:04:44 -07001820 HAVE_GALLIUM_LLVMPIPE=yes
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001821 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1822 fi
1823
Matt Turner69b69b12013-01-19 11:23:51 -08001824 if test "x$enable_dri" = xyes; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001825 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1826 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001827 if test "x$enable_vdpau" = xyes; then
Christian Königc3b22302011-07-04 15:04:41 +02001828 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
1829 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001830 if test "x$enable_xvmc" = xyes; then
Christian Königc3b22302011-07-04 15:04:41 +02001831 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
1832 fi
Matt Turner69b69b12013-01-19 11:23:51 -08001833 if test "x$enable_vdpau" = xyes -o "x$enable_xvmc" = xyes; then
Matt Turnerb3f1f662013-01-20 15:32:08 -08001834 NEED_WINSYS_XLIB=yes
1835 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
Younes Mantonb97816d2011-07-14 12:22:20 -04001836 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001837 ;;
1838 *)
1839 AC_MSG_ERROR([Unknown Gallium driver: $driver])
1840 ;;
1841 esac
1842 done
Chia-I Wua1306f42010-01-22 15:51:51 +08001843fi
Tom Stellard69d639b2013-01-18 15:08:28 +00001844
1845dnl Set LLVM_LIBS - This is done after the driver configuration so
1846dnl that drivers can add additonal components to LLVM_COMPONENTS.
1847dnl Previously, gallium drivers were updating LLVM_LIBS directly
1848dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
1849dnl this was causing the same libraries to be appear multiple times
1850dnl in LLVM_LIBS.
1851
Tom Stellard7a850c52013-01-25 12:46:55 -05001852if test "x$MESA_LLVM" != x0; then
Tom Stellardcf69a592013-01-18 16:26:12 +00001853
Tom Stellard7a850c52013-01-25 12:46:55 -05001854 LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
Tom Stellardcf69a592013-01-18 16:26:12 +00001855
Tom Stellard7a850c52013-01-25 12:46:55 -05001856 if test "x$with_llvm_shared_libs" = xyes; then
1857 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
1858 LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
Jonathan Liuaf16f732013-06-04 23:04:44 +10001859 AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes])
Tom Stellard7a850c52013-01-25 12:46:55 -05001860
1861 if test "x$llvm_have_one_so" = xyes; then
1862 dnl LLVM was built using auto*, so there is only one shared object.
1863 LLVM_LIBS="-l$LLVM_SO_NAME"
1864 else
1865 dnl If LLVM was built with CMake, there will be one shared object per
1866 dnl component.
Jonathan Liuaf16f732013-06-04 23:04:44 +10001867 AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"],
1868 [AC_MSG_ERROR([Could not find llvm shared libraries:
Tom Stellardcf69a592013-01-18 16:26:12 +00001869 Please make sure you have built llvm with the --enable-shared option
1870 and that your llvm libraries are installed in $LLVM_LIBDIR
1871 If you have installed your llvm libraries to a different directory you
1872 can use the --with-llvm-prefix= configure flag to specify this directory.
1873 NOTE: Mesa is attempting to use llvm shared libraries because you have
1874 passed one of the following options to configure:
1875 --with-llvm-shared-libs
1876 --enable-opencl
1877 If you do not want to build with llvm shared libraries and instead want to
1878 use llvm static libraries then remove these options from your configure
Jonathan Liuaf16f732013-06-04 23:04:44 +10001879 invocation and reconfigure.])])
Tom Stellardcf69a592013-01-18 16:26:12 +00001880
Tom Stellard7a850c52013-01-25 12:46:55 -05001881 dnl We don't need to update LLVM_LIBS in this case because the LLVM
1882 dnl install uses a shared object for each compoenent and we have
1883 dnl already added all of these objects to LLVM_LIBS.
1884 fi
Tom Stellardcf69a592013-01-18 16:26:12 +00001885 fi
Tom Stellard69d639b2013-01-18 15:08:28 +00001886fi
1887
Matt Turner2cbb94b2012-09-07 21:04:44 -07001888AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
1889AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
Chia-I Wu5816a472012-12-13 06:01:23 +08001890AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001891AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
1892AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
1893AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
1894AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
Rob Clark6173cc12012-10-27 11:07:34 -05001895AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001896AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
1897AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
Chia-I Wua1306f42010-01-22 15:51:51 +08001898
Matt Turner0d3b1b02013-01-20 11:46:02 -08001899AM_CONDITIONAL(NEED_GALLIUM_SOFTPIPE_DRIVER, test "x$HAVE_GALLIUM_SVGA" = xyes -o \
1900 "x$HAVE_GALLIUM_I915" = xyes -o \
1901 "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
1902AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes -o \
Kristian Lehmanncec7b5c2013-08-26 21:19:50 +02001903 "x$HAVE_GALLIUM_SOFTPIPE" = xyes \
1904 && test "x$MESA_LLVM" = x1)
Matt Turner0d3b1b02013-01-20 11:46:02 -08001905
Francisco Jereze1364532012-04-25 22:16:00 +02001906if test "x$enable_gallium_loader" = xyes; then
1907 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
Francisco Jereze1364532012-04-25 22:16:00 +02001908
Francisco Jereze1364532012-04-25 22:16:00 +02001909 if test "x$enable_gallium_drm_loader" = xyes; then
1910 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
Tom Stellard044de402012-07-17 18:36:06 +00001911 PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
1912 pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
1913 if test "x$pipe_loader_have_xcb" = xyes; then
Matt Turner24280992013-04-22 11:50:29 -07001914 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XCB"
Tom Stellard044de402012-07-17 18:36:06 +00001915 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
1916 fi
Francisco Jereze1364532012-04-25 22:16:00 +02001917 fi
1918
1919 AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
1920 AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
1921fi
1922
Matt Turner07f2dee2013-03-05 10:25:55 -08001923AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
1924AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
1925AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
1926AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
1927AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
1928AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
1929AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
1930
Matt Turnerb3f1f662013-01-20 15:32:08 -08001931AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$NEED_NONNULL_WINSYS" = xyes -a \
1932 "x$HAVE_GALLIUM_R300" = xyes -o \
1933 "x$HAVE_GALLIUM_R600" = xyes -o \
1934 "x$HAVE_GALLIUM_RADEONSI" = xyes)
1935AM_CONDITIONAL(NEED_WINSYS_WRAPPER, test "x$HAVE_GALLIUM_I915" = xyes -o \
1936 "x$HAVE_GALLIUM_SVGA" = xyes)
1937AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes)
Christian König5b2855b2013-04-03 10:18:35 +02001938AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
Tom Stellardced73ea2012-04-17 09:26:28 -04001939AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
Francisco Jereze1364532012-04-25 22:16:00 +02001940AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
1941AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
Tom Stellardd85e5122012-04-20 14:46:45 -04001942AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
Tom Stellard80d290d2012-08-24 11:48:32 -07001943AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
1944AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
1945
Tom Stellard9277b042013-04-04 13:02:51 -07001946AC_SUBST([ELF_LIB])
Tom Stellard26ab7472012-03-03 20:02:05 -05001947
Quentin Glidicc5e93962012-11-28 16:33:47 +01001948AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
1949 "x$enable_xlib_glx" = xyes -o \
Matt Turner2f142d52013-08-20 14:16:17 -07001950 "x$enable_osmesa" = xyes -o \
1951 "x$enable_gallium_osmesa" = xyes)
Matt Turner13a70102013-01-19 00:35:43 -08001952AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes)
1953AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes)
Matt Turner2f142d52013-08-20 14:16:17 -07001954AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes)
Eric Anholtf9d15622012-05-24 13:59:21 -07001955
Eric Anholte4269492012-06-11 10:25:05 -07001956AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
1957AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
1958AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07001959
Matt Turnercc9f6092013-01-14 16:16:00 -08001960AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
1961
Matt Turner184b2f02012-09-05 17:06:16 -07001962AC_SUBST([VDPAU_MAJOR], 1)
1963AC_SUBST([VDPAU_MINOR], 0)
1964
Matt Turner0b132df2012-09-07 20:47:04 -07001965AC_SUBST([XVMC_MAJOR], 1)
1966AC_SUBST([XVMC_MINOR], 0)
1967
Rob Clark890e27e2013-06-05 16:16:27 -04001968AC_SUBST([XA_MAJOR], 2)
Matt Turnerd53901c2012-09-07 15:24:24 -07001969AC_SUBST([XA_MINOR], 0)
1970AC_SUBST([XA_TINY], 0)
1971AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
1972
Dan Nicholsondca1b792007-10-23 09:25:58 -07001973dnl Restore LDFLAGS and CPPFLAGS
1974LDFLAGS="$_SAVE_LDFLAGS"
1975CPPFLAGS="$_SAVE_CPPFLAGS"
1976
Johannes Obermayr6016dab2013-09-12 00:32:40 +02001977dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS
1978if test "x$acv_mesa_CLANG" = xyes; then
1979 CFLAGS="$CFLAGS -Qunused-arguments"
1980 CXXFLAGS="$CXXFLAGS -Qunused-arguments"
1981fi
1982
Marcin Baczyńskiff2efdf2011-07-13 21:26:49 +02001983dnl Add user CFLAGS and CXXFLAGS
1984CFLAGS="$CFLAGS $USER_CFLAGS"
1985CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
1986
Dan Nicholsondca1b792007-10-23 09:25:58 -07001987dnl Substitute the config
Matt Turnerc8747402012-09-05 20:29:20 -07001988AC_CONFIG_FILES([Makefile
Matt Turner63c3a052012-09-24 14:30:21 -07001989 src/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001990 src/egl/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01001991 src/egl/drivers/Makefile
Eric Anholte5f89542012-02-06 12:12:53 +01001992 src/egl/drivers/dri2/Makefile
1993 src/egl/drivers/glx/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01001994 src/egl/main/Makefile
1995 src/egl/main/egl.pc
Benjamin Franzke8b902052012-01-24 20:38:01 +01001996 src/egl/wayland/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07001997 src/egl/wayland/wayland-drm/Makefile
Benjamin Franzke8b902052012-01-24 20:38:01 +01001998 src/egl/wayland/wayland-egl/Makefile
1999 src/egl/wayland/wayland-egl/wayland-egl.pc
Tom Stellard80d290d2012-08-24 11:48:32 -07002000 src/gallium/auxiliary/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002001 src/gallium/auxiliary/pipe-loader/Makefile
2002 src/gallium/drivers/Makefile
Matt Turner5c6e1e92013-03-12 17:09:55 -07002003 src/gallium/drivers/freedreno/Makefile
Rob Clark18c317b2013-05-26 17:13:27 -04002004 src/gallium/drivers/freedreno/a2xx/Makefile
Rob Clark2855f3f2013-05-26 17:13:44 -04002005 src/gallium/drivers/freedreno/a3xx/Makefile
Emil Velikov1918c372013-06-05 23:42:16 +01002006 src/gallium/drivers/galahad/Makefile
Matt Turner7d5496a2012-08-29 10:31:29 -07002007 src/gallium/drivers/i915/Makefile
Emil Velikovd7c66ff2013-06-05 23:28:11 +01002008 src/gallium/drivers/identity/Makefile
Chia-I Wu5816a472012-12-13 06:01:23 +08002009 src/gallium/drivers/ilo/Makefile
Matt Turner960cbd82012-08-29 12:04:45 -07002010 src/gallium/drivers/llvmpipe/Makefile
Emil Velikov38d80c02013-06-05 23:33:38 +01002011 src/gallium/drivers/noop/Makefile
Matt Turner1cf66322012-08-29 12:33:57 -07002012 src/gallium/drivers/nouveau/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002013 src/gallium/drivers/r300/Makefile
2014 src/gallium/drivers/r600/Makefile
Tom Stellard0dcb9ae2012-08-30 12:55:29 -04002015 src/gallium/drivers/radeon/Makefile
Matt Turnerda2d98f2012-08-29 14:29:08 -07002016 src/gallium/drivers/radeonsi/Makefile
Matt Turnerb51cdfa2012-08-29 11:42:45 -07002017 src/gallium/drivers/rbug/Makefile
Matt Turnerf781d4c2012-08-29 12:17:57 -07002018 src/gallium/drivers/softpipe/Makefile
Matt Turner0a421312012-08-29 12:29:47 -07002019 src/gallium/drivers/svga/Makefile
Tom Stellard047fe042012-08-24 11:46:32 -07002020 src/gallium/drivers/trace/Makefile
Matt Turner9b357582012-08-31 15:45:07 -07002021 src/gallium/state_trackers/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002022 src/gallium/state_trackers/clover/Makefile
Matt Turner2ff51cd2012-08-29 20:30:22 -07002023 src/gallium/state_trackers/dri/Makefile
Matt Turnerd9884812012-08-29 20:34:39 -07002024 src/gallium/state_trackers/dri/drm/Makefile
Matt Turnerf4b1f282012-08-29 20:46:02 -07002025 src/gallium/state_trackers/dri/sw/Makefile
Matt Turner8443efd2012-08-31 17:11:35 -07002026 src/gallium/state_trackers/egl/Makefile
Matt Turnerc0b90812012-09-04 11:41:22 -07002027 src/gallium/state_trackers/gbm/Makefile
Emil Velikov921fdf12013-09-22 16:14:06 +01002028 src/gallium/state_trackers/glx/xlib/Makefile
Brian Paul79eac7d2013-03-11 18:31:21 -06002029 src/gallium/state_trackers/osmesa/Makefile
Matt Turnerd2ca32e2012-09-04 13:13:51 -07002030 src/gallium/state_trackers/vdpau/Makefile
Matt Turner68c03112012-09-04 13:24:33 -07002031 src/gallium/state_trackers/vega/Makefile
Matt Turner2ad26032012-09-04 15:17:11 -07002032 src/gallium/state_trackers/xa/Makefile
Matt Turner405a9da2012-09-04 20:59:34 -07002033 src/gallium/state_trackers/xorg/Makefile
Matt Turner984562d2012-09-04 21:08:19 -07002034 src/gallium/state_trackers/xvmc/Makefile
Matt Turner9bf0d492012-08-23 15:55:53 -07002035 src/gallium/targets/Makefile
Matt Turner5c6e1e92013-03-12 17:09:55 -07002036 src/gallium/targets/dri-freedreno/Makefile
Matt Turner2cd5bf72012-09-04 21:26:39 -07002037 src/gallium/targets/dri-i915/Makefile
Chia-I Wu5816a472012-12-13 06:01:23 +08002038 src/gallium/targets/dri-ilo/Makefile
Matt Turner6ed9f9f2012-09-05 11:07:30 -07002039 src/gallium/targets/dri-nouveau/Makefile
Matt Turnerb3068d82012-09-05 11:17:33 -07002040 src/gallium/targets/dri-swrast/Makefile
Matt Turnerc14c8012012-09-05 11:19:11 -07002041 src/gallium/targets/dri-vmwgfx/Makefile
Matt Turnercdee0e82012-09-10 11:21:26 -07002042 src/gallium/targets/egl-static/Makefile
Matt Turner53c62d32012-09-13 10:10:14 -07002043 src/gallium/targets/gbm/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002044 src/gallium/targets/opencl/Makefile
Brian Paul79eac7d2013-03-11 18:31:21 -06002045 src/gallium/targets/osmesa/Makefile
Jon Severinssonc8111902013-08-23 11:18:59 +02002046 src/gallium/targets/osmesa/osmesa.pc
Matt Turner45270fb2012-09-13 10:45:01 -07002047 src/gallium/targets/pipe-loader/Makefile
Christian Königf6e2aa02013-09-25 12:28:09 +02002048 src/gallium/targets/radeonsi/dri/Makefile
2049 src/gallium/targets/radeonsi/vdpau/Makefile
2050 src/gallium/targets/radeonsi/xorg/Makefile
Christian König533e9a02013-09-25 11:49:49 +02002051 src/gallium/targets/r300/dri/Makefile
2052 src/gallium/targets/r300/vdpau/Makefile
2053 src/gallium/targets/r300/xvmc/Makefile
Christian König015853b2013-09-25 11:34:39 +02002054 src/gallium/targets/r600/dri/Makefile
2055 src/gallium/targets/r600/vdpau/Makefile
2056 src/gallium/targets/r600/xorg/Makefile
2057 src/gallium/targets/r600/xvmc/Makefile
Matt Turner0470fb42012-09-05 15:19:30 -07002058 src/gallium/targets/libgl-xlib/Makefile
Matt Turnerd0df9e82012-09-05 15:55:49 -07002059 src/gallium/targets/vdpau-nouveau/Makefile
Matt Turner7f244832012-09-05 16:52:41 -07002060 src/gallium/targets/vdpau-softpipe/Makefile
Matt Turnerd53901c2012-09-07 15:24:24 -07002061 src/gallium/targets/xa-vmwgfx/Makefile
2062 src/gallium/targets/xa-vmwgfx/xatracker.pc
Matt Turner1a434912012-09-06 16:56:06 -07002063 src/gallium/targets/xorg-i915/Makefile
Matt Turnerf984d122012-09-07 13:19:45 -07002064 src/gallium/targets/xorg-nouveau/Makefile
Matt Turnerb173b162012-09-07 13:50:43 -07002065 src/gallium/targets/xvmc-nouveau/Makefile
Matt Turneraf6a2e42012-09-07 14:03:27 -07002066 src/gallium/targets/xvmc-softpipe/Makefile
Andreas Boll59088a22012-11-26 19:58:12 +01002067 src/gallium/tests/trivial/Makefile
Andreas Bollcb4d5022012-11-27 19:18:25 +01002068 src/gallium/tests/unit/Makefile
Matt Turner9bf0d492012-08-23 15:55:53 -07002069 src/gallium/winsys/Makefile
Matt Turner5c6e1e92013-03-12 17:09:55 -07002070 src/gallium/winsys/freedreno/drm/Makefile
Matt Turner266d6392012-08-29 10:37:07 -07002071 src/gallium/winsys/i915/drm/Makefile
Matt Turner3bfe7c22012-08-29 10:53:46 -07002072 src/gallium/winsys/i915/sw/Makefile
Chia-I Wu5816a472012-12-13 06:01:23 +08002073 src/gallium/winsys/intel/drm/Makefile
Matt Turner77fc30b2012-08-29 14:39:48 -07002074 src/gallium/winsys/nouveau/drm/Makefile
Tom Stellard34a61502012-08-24 11:44:57 -07002075 src/gallium/winsys/radeon/drm/Makefile
Matt Turner2b5a1c02012-08-29 14:48:25 -07002076 src/gallium/winsys/svga/drm/Makefile
Matt Turnera6b3cd12012-08-29 15:24:40 -07002077 src/gallium/winsys/sw/dri/Makefile
Matt Turner5c4ade52012-08-29 15:28:45 -07002078 src/gallium/winsys/sw/fbdev/Makefile
Matt Turner1c9fb3c2012-08-29 15:32:43 -07002079 src/gallium/winsys/sw/null/Makefile
Matt Turner1d0ef532012-08-29 15:44:25 -07002080 src/gallium/winsys/sw/wayland/Makefile
Matt Turner24c2fe92012-08-29 15:46:57 -07002081 src/gallium/winsys/sw/wrapper/Makefile
Matt Turner44653c02012-08-29 15:51:40 -07002082 src/gallium/winsys/sw/xlib/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002083 src/gbm/Makefile
2084 src/gbm/main/gbm.pc
Jon TURNEY68e04cc2012-06-28 23:15:48 +01002085 src/glsl/Makefile
Eric Anholt8ffb0982012-02-05 06:10:56 +01002086 src/glx/Makefile
Ian Romanick2e8c8662012-05-23 15:23:22 -07002087 src/glx/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002088 src/gtest/Makefile
Matt Turner691c3042013-01-18 23:43:05 -08002089 src/mapi/Makefile
Matt Turnera6b8b702012-08-21 14:36:44 -07002090 src/mapi/es1api/Makefile
2091 src/mapi/es1api/glesv1_cm.pc
Matt Turner0f8110c2012-08-21 14:52:59 -07002092 src/mapi/es2api/Makefile
2093 src/mapi/es2api/glesv2.pc
Jon TURNEYb2a37e22012-06-29 18:09:37 +01002094 src/mapi/glapi/Makefile
Eric Anholt3a70f752012-06-11 12:59:21 -07002095 src/mapi/glapi/gen/Makefile
Ian Romanicka29ad2b2012-05-29 11:28:11 -07002096 src/mapi/glapi/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002097 src/mapi/shared-glapi/Makefile
Ian Romanick45d3d0a2012-08-01 14:48:27 -07002098 src/mapi/shared-glapi/tests/Makefile
Matt Turner261719b2012-08-22 16:57:38 -07002099 src/mapi/vgapi/Makefile
2100 src/mapi/vgapi/vg.pc
Eric Anholt417c1a62012-06-12 12:10:58 -07002101 src/mesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002102 src/mesa/gl.pc
Matt Turner129213e2012-01-15 11:50:20 -05002103 src/mesa/drivers/dri/dri.pc
Matt Turner80aa7812012-01-26 19:31:12 -05002104 src/mesa/drivers/dri/common/Makefile
Carl Worthb587a752012-12-03 15:43:19 -08002105 src/mesa/drivers/dri/common/xmlpool/Makefile
Matt Turner3c87dfc2012-01-14 21:57:32 -05002106 src/mesa/drivers/dri/i915/Makefile
Eric Anholte3264802012-01-12 14:28:37 -08002107 src/mesa/drivers/dri/i965/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002108 src/mesa/drivers/dri/Makefile
Matt Turner3f964342012-01-15 10:20:30 -05002109 src/mesa/drivers/dri/nouveau/Makefile
Matt Turnerb38d7a02012-01-15 10:04:58 -05002110 src/mesa/drivers/dri/r200/Makefile
Matt Turnere0ee8182012-01-14 22:21:30 -05002111 src/mesa/drivers/dri/radeon/Makefile
Eric Anholt2d4b77c2012-06-12 11:38:19 -07002112 src/mesa/drivers/dri/swrast/Makefile
Laurent Carlier284325d2012-06-24 09:51:27 +02002113 src/mesa/drivers/osmesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002114 src/mesa/drivers/osmesa/osmesa.pc
Eric Anholtfa4cf4d2012-05-15 12:23:00 -07002115 src/mesa/drivers/x11/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002116 src/mesa/libdricore/Makefile
2117 src/mesa/main/tests/Makefile
Eric Anholt35fd61b2012-11-06 23:18:41 -08002118 src/mesa/main/tests/hash_table/Makefile
Eric Anholt90784412012-11-07 16:33:39 -08002119 src/mesa/program/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002120 src/mesa/x86-64/Makefile
2121 src/mesa/x86/Makefile])
Dan Nicholsondca1b792007-10-23 09:25:58 -07002122
Marek Olšák618dbc82011-06-27 03:12:57 +02002123dnl Sort the dirs alphabetically
Marek Olšák3c799622011-09-27 16:51:05 +02002124GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2125GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2126GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2127GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák618dbc82011-06-27 03:12:57 +02002128
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07002129AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08002130
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002131dnl
2132dnl Output some configuration info for the user
2133dnl
2134echo ""
2135echo " prefix: $prefix"
2136echo " exec_prefix: $exec_prefix"
2137echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07002138echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002139
Chia-I Wu815faa42010-10-29 12:34:44 +08002140dnl API info
2141echo ""
2142echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
Chia-I Wu815faa42010-10-29 12:34:44 +08002143echo " OpenVG: $enable_openvg"
2144
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002145dnl Driver info
2146echo ""
Matt Turner2f142d52013-08-20 14:16:17 -07002147case "x$enable_osmesa$enable_gallium_osmesa" in
2148xnoyes)
2149 echo " OSMesa: lib$OSMESA_LIB (Gallium)"
2150 ;;
2151xyesno)
Chia-I Wu815faa42010-10-29 12:34:44 +08002152 echo " OSMesa: lib$OSMESA_LIB"
Matt Turner2f142d52013-08-20 14:16:17 -07002153 ;;
2154xnono)
Chia-I Wu815faa42010-10-29 12:34:44 +08002155 echo " OSMesa: no"
Matt Turner2f142d52013-08-20 14:16:17 -07002156 ;;
2157esac
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002158
2159if test "x$enable_dri" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002160 # cleanup the drivers var
2161 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
2162 if test "x$DRI_DIRS" = x; then
2163 echo " DRI drivers: no"
2164 else
2165 echo " DRI drivers: $dri_dirs"
2166 fi
2167 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08002168fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002169
2170case "x$enable_glx$enable_xlib_glx" in
2171xyesyes)
2172 echo " GLX: Xlib-based"
2173 ;;
2174xyesno)
2175 echo " GLX: DRI-based"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002176 ;;
2177*)
2178 echo " GLX: $enable_glx"
2179 ;;
2180esac
2181
Chia-I Wu815faa42010-10-29 12:34:44 +08002182dnl EGL
2183echo ""
2184echo " EGL: $enable_egl"
2185if test "$enable_egl" = yes; then
Matt Turner3647efa2013-03-09 17:26:43 -08002186 echo " EGL platforms: $egl_platforms"
Chia-I Wu12300502010-10-31 21:01:54 +08002187
2188 egl_drivers=""
Eric Anholt88612022012-02-05 10:46:13 +01002189 if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then
2190 egl_drivers="$egl_drivers builtin:egl_glx"
2191 fi
2192 if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
2193 egl_drivers="$egl_drivers builtin:egl_dri2"
2194 fi
Chia-I Wu12300502010-10-31 21:01:54 +08002195
Matt Turner69b69b12013-01-19 11:23:51 -08002196 if test "x$enable_gallium_egl" = xyes; then
Chia-I Wu12300502010-10-31 21:01:54 +08002197 echo " EGL drivers: ${egl_drivers} egl_gallium"
2198 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
Chia-I Wu815faa42010-10-29 12:34:44 +08002199 else
Chia-I Wu12300502010-10-31 21:01:54 +08002200 echo " EGL drivers: $egl_drivers"
Chia-I Wu815faa42010-10-29 12:34:44 +08002201 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +01002202fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002203
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002204echo ""
Eric Anholt1a8b1272010-05-21 12:17:24 -07002205if test "x$MESA_LLVM" = x1; then
Jakob Bornecrantzfe0fe672010-04-28 13:38:58 +01002206 echo " llvm: yes"
2207 echo " llvm-config: $LLVM_CONFIG"
2208 echo " llvm-version: $LLVM_VERSION"
2209else
2210 echo " llvm: no"
2211fi
2212
2213echo ""
Matt Turnera9676ae2013-01-18 23:59:49 -08002214if test -n "$with_gallium_drivers"; then
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002215 echo " Gallium: yes"
Keith Whitwell51bff092010-03-11 14:43:00 +00002216 echo " Target dirs: $GALLIUM_TARGET_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002217 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00002218 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002219 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
2220else
2221 echo " Gallium: no"
2222fi
2223
Daniel Vetter8f15c312011-11-28 22:24:26 +01002224
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002225dnl Libraries
2226echo ""
2227echo " Shared libs: $enable_shared"
2228echo " Static libs: $enable_static"
Matt Turner53248e52012-08-17 11:25:14 -07002229echo " Shared-glapi: $enable_shared_glapi"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002230
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002231dnl Compiler options
2232# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
Matt Turner3ed95dc2012-09-05 20:41:08 -07002233cflags=`echo $CFLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002234 $SED 's/^ *//;s/ */ /;s/ *$//'`
Matt Turner3ed95dc2012-09-05 20:41:08 -07002235cxxflags=`echo $CXXFLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002236 $SED 's/^ *//;s/ */ /;s/ *$//'`
Eric Anholte4269492012-06-11 10:25:05 -07002237defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002238echo ""
2239echo " CFLAGS: $cflags"
2240echo " CXXFLAGS: $cxxflags"
2241echo " Macros: $defines"
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002242echo ""
Marek Olšáka84a8da2012-11-27 22:32:50 +01002243if test "x$MESA_LLVM" = x1; then
2244 echo " LLVM_CFLAGS: $LLVM_CFLAGS"
2245 echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
2246 echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
2247 echo ""
2248fi
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002249echo " PYTHON2: $PYTHON2"
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002250
Dan Nicholsondca1b792007-10-23 09:25:58 -07002251echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07002252echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07002253echo ""