blob: d08bc2779a4307fb3a5d8bf1008b64508ada4099 [file] [log] [blame]
Matt Turner2f1ab632012-01-03 21:58:37 -05001dnl Process this file with autoconf to create configure.
Dan Nicholsondca1b792007-10-23 09:25:58 -07002
Matt Turner51723832011-12-23 19:21:04 -05003AC_PREREQ([2.60])
Dan Nicholsondca1b792007-10-23 09:25:58 -07004
Dan Nicholsone97ab722008-07-01 08:55:42 -07005dnl Tell the user about autoconf.html in the --help output
6m4_divert_once([HELP_END], [
7See docs/autoconf.html for more details on the options for Mesa.])
8
Andreas Boll6ea753b2013-01-30 21:07:54 +01009AC_INIT([Mesa], [9.2.0],
Dan Nicholsonf64d6fe2007-12-12 17:57:45 -080010 [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
Dan Nicholson297e16c2008-05-05 15:42:53 -070011AC_CONFIG_AUX_DIR([bin])
Matt Turner7da12422012-09-18 20:21:47 -070012AC_CONFIG_MACRO_DIR([m4])
Thierry Reding9948a332012-10-19 14:03:01 +020013AC_CANONICAL_SYSTEM
Eric Anholta4ff3342012-06-11 12:59:48 -070014AM_INIT_AUTOMAKE([foreign])
Dan Nicholsondca1b792007-10-23 09:25:58 -070015
Colin Walters0d736b22012-01-14 09:16:20 -050016dnl http://people.gnome.org/~walters/docs/build-api.txt
17dnl We don't support srcdir != builddir.
18echo \#buildapi-variable-no-builddir >/dev/null
19
Eric Anholt7fa5c912012-01-12 14:56:56 -080020# Support silent build rules, requires at least automake-1.11. Disable
21# by either passing --disable-silent-rules to configure or passing V=1
22# to make
23m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
24
Kenneth Graunke4a5d0202012-05-30 21:54:21 -070025m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
26
Johannes Obermayr10a96f42012-09-02 01:35:47 +020027dnl Set internal versions
28OSMESA_VERSION=8
29AC_SUBST([OSMESA_VERSION])
30
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070031dnl Versions for external dependencies
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000032LIBDRM_REQUIRED=2.4.24
Michel Dänzer02a423b2013-02-05 15:12:14 +010033LIBDRM_RADEON_REQUIRED=2.4.42
Eric Anholtf0159012012-07-18 10:18:26 -070034LIBDRM_INTEL_REQUIRED=2.4.38
Ben Skeggs2e47d012011-12-23 14:03:49 +100035LIBDRM_NVVIEUX_REQUIRED=2.4.33
Maarten Lankhorst9ba7eac2012-12-02 12:07:35 +010036LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
Jesse Barnes1e39fc72011-05-05 13:09:16 -070037DRI2PROTO_REQUIRED=2.6
38GLPROTO_REQUIRED=1.4.14
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000039LIBDRM_XORG_REQUIRED=2.4.24
Jakob Bornecrantz683a0992010-03-11 19:23:15 +000040LIBKMS_XORG_REQUIRED=1.0.0
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070041
Dan Nicholsondca1b792007-10-23 09:25:58 -070042dnl Check for progs
43AC_PROG_CPP
44AC_PROG_CC
Thierry Reding9948a332012-10-19 14:03:01 +020045AX_PROG_CC_FOR_BUILD
Dan Nicholsondca1b792007-10-23 09:25:58 -070046AC_PROG_CXX
Thierry Reding9948a332012-10-19 14:03:01 +020047AX_PROG_CXX_FOR_BUILD
Dylan Noblesmitha3d56732012-04-02 15:35:38 +000048AM_PROG_CC_C_O
Eric Anholtf9d15622012-05-24 13:59:21 -070049AM_PROG_AS
Dan Nicholson297e16c2008-05-05 15:42:53 -070050AC_CHECK_PROGS([MAKE], [gmake make])
Kenneth Graunke3acc8262010-10-25 13:52:58 -070051AC_CHECK_PROGS([PYTHON2], [python2 python])
Andreas Boll410b58c2013-01-18 15:31:57 +010052AX_PYTHON_MODULE([libxml2], [needed])
Matt Turner3a343ef2012-01-11 01:05:56 -050053AC_PROG_SED
Matt Turnerfd827a82012-01-21 22:43:02 -050054AC_PROG_MKDIR_P
Dan Nicholson41b00702007-12-12 08:48:30 -080055
Thierry Reding9948a332012-10-19 14:03:01 +020056LT_PREREQ([2.2])
57LT_INIT([disable-static])
58
Matt Turnerb68b8522012-10-01 13:11:30 -070059AX_PROG_BISON([],
Matt Turner02b6da12013-01-29 11:22:06 -080060 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
Matt Turnerb68b8522012-10-01 13:11:30 -070061 [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
Matt Turner2a710542012-10-01 13:28:51 -070062AX_PROG_FLEX([],
Matt Turner02b6da12013-01-29 11:22:06 -080063 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
Matt Turner2a710542012-10-01 13:28:51 -070064 [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
Brian Paulde1df262011-05-18 07:50:21 -060065
Tom Stellarda75c6162012-01-06 17:38:37 -050066AC_PATH_PROG([PERL], [perl])
67
Kenneth Graunke2224fb62012-05-29 16:03:05 -070068AC_CHECK_PROG(INDENT, indent, indent, cat)
69if test "x$INDENT" != "xcat"; then
Vinson Lee2f358fe2012-12-31 15:19:43 -080070 AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
Kenneth Graunke2224fb62012-05-29 16:03:05 -070071fi
72
Dan Nicholsonbc302b22009-05-22 09:39:02 -070073AC_PROG_INSTALL
Dan Nicholsonbc302b22009-05-22 09:39:02 -070074
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070075dnl We need a POSIX shell for parts of the build. Assume we have one
76dnl in most cases.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070077case "$host_os" in
78solaris*)
79 # Solaris /bin/sh is too old/non-POSIX compliant
80 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070081 SHELL="$POSIX_SHELL"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070082 ;;
83esac
84
nobled2a501872010-08-29 20:03:37 -040085dnl clang is mostly GCC-compatible, but its version is much lower,
86dnl so we have to check for it.
87AC_MSG_CHECKING([if compiling with clang])
88
89AC_COMPILE_IFELSE(
90[AC_LANG_PROGRAM([], [[
91#ifndef __clang__
92 not clang
93#endif
94]])],
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070095[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
nobled2a501872010-08-29 20:03:37 -040096
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070097AC_MSG_RESULT([$acv_mesa_CLANG])
nobled2a501872010-08-29 20:03:37 -040098
Ian Romanick9aa3aa72010-03-03 15:59:37 -080099dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
100dnl versions are explictly not supported.
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -0700101if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800102 AC_MSG_CHECKING([whether gcc version is sufficient])
103 major=0
104 minor=0
105
106 GCC_VERSION=`$CC -dumpversion`
107 if test $? -eq 0; then
Tom Stellard79d77b32012-04-20 16:56:46 +0200108 GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
109 GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800110 fi
111
Tom Stellard79d77b32012-04-20 16:56:46 +0200112 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 -0800113 AC_MSG_RESULT([no])
114 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
115 else
116 AC_MSG_RESULT([yes])
117 fi
118fi
119
Dan Nicholson41b00702007-12-12 08:48:30 -0800120dnl Make sure the pkg-config macros are defined
Dan Nicholson356f3112009-04-29 06:49:27 -0700121m4_ifndef([PKG_PROG_PKG_CONFIG],
122 [m4_fatal([Could not locate the pkg-config autoconf macros.
123 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
124 are in a different location, try setting the environment variable
125 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700126PKG_PROG_PKG_CONFIG()
127
128dnl LIB_DIR - library basename
129LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -0700130AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700131
Matt Turnerd12b07e2012-08-14 12:33:32 -0700132dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
Dan Nicholsondca1b792007-10-23 09:25:58 -0700133_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700134_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700135
Thierry Reding9948a332012-10-19 14:03:01 +0200136dnl build host compiler macros
137DEFINES_FOR_BUILD=""
138AC_SUBST([DEFINES_FOR_BUILD])
139case "$build_os" in
140linux*|*-gnu*|gnu*)
141 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -D_GNU_SOURCE"
142 ;;
143solaris*)
144 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DSVR4"
145 ;;
146cygwin*)
147 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD"
148 ;;
149esac
150
Dan Nicholsondca1b792007-10-23 09:25:58 -0700151dnl Compiler macros
152DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -0700153AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700154case "$host_os" in
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700155linux*|*-gnu*|gnu*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700156 DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700157 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700158solaris*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700159 DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700160 ;;
Brian Paul97988902010-02-18 12:46:12 -0700161cygwin*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700162 DEFINES="$DEFINES -DHAVE_PTHREAD"
Brian Paul97988902010-02-18 12:46:12 -0700163 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -0700164esac
165
166dnl Add flags for gcc and g++
167if test "x$GCC" = xyes; then
Vinson Lee53e36d32012-10-11 18:19:49 -0700168 case "$host_os" in
169 cygwin*)
170 CFLAGS="$CFLAGS -Wall -std=gnu99"
171 ;;
172 *)
Thierry Reding9948a332012-10-19 14:03:01 +0200173 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -Wall -std=c99"
Vinson Lee53e36d32012-10-11 18:19:49 -0700174 CFLAGS="$CFLAGS -Wall -std=c99"
175 ;;
176 esac
Eric Anholtb9aab8b2012-01-26 18:48:20 -0800177
178 # Enable -Werror=implicit-function-declaration and
179 # -Werror=missing-prototypes, if available, or otherwise, just
180 # -Wmissing-prototypes. This is particularly useful to avoid
181 # generating a loadable driver module that has undefined symbols.
182 save_CFLAGS="$CFLAGS"
183 AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
184 CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
185 CFLAGS="$CFLAGS -Werror=missing-prototypes"
186 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
187 AC_MSG_RESULT([yes]),
188 [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
189 AC_MSG_RESULT([no])]);
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800190
191 # Enable -fvisibility=hidden if using a gcc that supports it
192 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800193 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100194 VISIBILITY_CFLAGS="-fvisibility=hidden"
195 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800196 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100197 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
198
199 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
200 CFLAGS=$save_CFLAGS
Dan Nicholson0c275b62008-01-15 22:52:25 -0800201
202 # Work around aliasing bugs - developers should comment this out
Thierry Reding9948a332012-10-19 14:03:01 +0200203 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-strict-aliasing"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800204 CFLAGS="$CFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100205
206 # gcc's builtin memcmp is slower than glibc's
207 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
Thierry Reding9948a332012-10-19 14:03:01 +0200208 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-builtin-memcmp"
José Fonseca1448bdf2011-10-14 18:28:55 +0100209 CFLAGS="$CFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700210fi
211if test "x$GXX" = xyes; then
Thierry Reding9948a332012-10-19 14:03:01 +0200212 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -Wall"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700213 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800214
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400215 # Enable -fvisibility=hidden if using a gcc that supports it
216 save_CXXFLAGS="$CXXFLAGS"
217 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100218 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
219 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
Jon TURNEY560f7622011-04-26 11:49:01 +0100220 AC_LANG_PUSH([C++])
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400221 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100222 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
Jon TURNEY560f7622011-04-26 11:49:01 +0100223 AC_LANG_POP([C++])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100224
225 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
226 CXXFLAGS=$save_CXXFLAGS
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400227
Dan Nicholson0c275b62008-01-15 22:52:25 -0800228 # Work around aliasing bugs - developers should comment this out
Thierry Reding9948a332012-10-19 14:03:01 +0200229 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-strict-aliasing"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800230 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100231
232 # gcc's builtin memcmp is slower than glibc's
233 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
Thierry Reding9948a332012-10-19 14:03:01 +0200234 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-builtin-memcmp"
José Fonseca1448bdf2011-10-14 18:28:55 +0100235 CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700236fi
237
Jon TURNEYdb786432011-04-26 11:56:02 +0100238dnl even if the compiler appears to support it, using visibility attributes isn't
239dnl going to do anything useful currently on cygwin apart from emit lots of warnings
240case "$host_os" in
241cygwin*)
242 VISIBILITY_CFLAGS=""
243 VISIBILITY_CXXFLAGS=""
244 ;;
245esac
246
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100247AC_SUBST([VISIBILITY_CFLAGS])
248AC_SUBST([VISIBILITY_CXXFLAGS])
249
Dan Nicholsondca1b792007-10-23 09:25:58 -0700250dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600251dnl Hacks to enable 32 or 64 bit build
252dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700253AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600254 [AS_HELP_STRING([--enable-32-bit],
255 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700256 [enable_32bit="$enableval"],
257 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600258)
259if test "x$enable_32bit" = xyes; then
260 if test "x$GCC" = xyes; then
261 CFLAGS="$CFLAGS -m32"
Tapani Pällia9cfd952012-05-31 09:32:45 +0300262 CCASFLAGS="$CCASFLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600263 fi
264 if test "x$GXX" = xyes; then
265 CXXFLAGS="$CXXFLAGS -m32"
266 fi
267fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700268AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600269 [AS_HELP_STRING([--enable-64-bit],
270 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700271 [enable_64bit="$enableval"],
272 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600273)
274if test "x$enable_64bit" = xyes; then
275 if test "x$GCC" = xyes; then
276 CFLAGS="$CFLAGS -m64"
277 fi
278 if test "x$GXX" = xyes; then
279 CXXFLAGS="$CXXFLAGS -m64"
280 fi
281fi
282
Dan Nicholson88586332007-11-15 08:59:57 -0800283dnl Can't have static and shared libraries, default to static if user
284dnl explicitly requested. If both disabled, set to static since shared
Matt Turner0c178232012-01-14 11:10:06 -0500285dnl was explicitly requested.
Dan Nicholson88586332007-11-15 08:59:57 -0800286case "x$enable_static$enable_shared" in
287xyesyes )
Matt Turner14819eb2012-08-01 08:32:49 -0700288 AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
Dan Nicholson88586332007-11-15 08:59:57 -0800289 enable_shared=no
290 ;;
291xnono )
Matt Turner14819eb2012-08-01 08:32:49 -0700292 AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
Dan Nicholson88586332007-11-15 08:59:57 -0800293 enable_static=yes
294 ;;
295esac
296
Matt Turnerdf4dccc2012-08-22 11:51:31 -0700297AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
298
Dan Nicholson88586332007-11-15 08:59:57 -0800299dnl
Dan Nicholson23656c42007-12-12 09:02:31 -0800300dnl other compiler options
301dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700302AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800303 [AS_HELP_STRING([--enable-debug],
304 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700305 [enable_debug="$enableval"],
306 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800307)
308if test "x$enable_debug" = xyes; then
Thierry Reding9948a332012-10-19 14:03:01 +0200309 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DDEBUG"
310 if test "x$GCC_FOR_BUILD" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000311 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -g -O0"
Thierry Reding9948a332012-10-19 14:03:01 +0200312 fi
313 if test "x$GXX_FOR_BUILD" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000314 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -g -O0"
Thierry Reding9948a332012-10-19 14:03:01 +0200315 fi
316
Dan Nicholson23656c42007-12-12 09:02:31 -0800317 DEFINES="$DEFINES -DDEBUG"
318 if test "x$GCC" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000319 CFLAGS="$CFLAGS -g -O0"
Dan Nicholson23656c42007-12-12 09:02:31 -0800320 fi
321 if test "x$GXX" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000322 CXXFLAGS="$CXXFLAGS -g -O0"
Dan Nicholson23656c42007-12-12 09:02:31 -0800323 fi
324fi
Dan Nicholson88586332007-11-15 08:59:57 -0800325
326dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700327dnl library names
328dnl
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100329LIB_PREFIX_GLOB='lib'
330LIB_VERSION_SEPARATOR='.'
Dan Nicholson88586332007-11-15 08:59:57 -0800331if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800332 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800333else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700334 case "$host_os" in
335 darwin* )
336 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100337 cygwin* )
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100338 dnl prefix can be 'cyg' or 'lib'
339 LIB_PREFIX_GLOB='???'
340 LIB_VERSION_SEPARATOR='-'
341 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700342 aix* )
343 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700344 * )
345 LIB_EXTENSION='so' ;;
346 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800347fi
Brad Kingf3cdcb82012-06-05 13:59:58 -0400348AC_ARG_WITH([gl-lib-name],
349 [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
350 [specify GL library name @<:@default=GL@:>@])],
351 [GL_LIB=$withval],
352 [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400353AC_ARG_WITH([osmesa-lib-name],
354 [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
355 [specify OSMesa library name @<:@default=OSMesa@:>@])],
356 [OSMESA_LIB=$withval],
357 [OSMESA_LIB=OSMesa])
358AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400359AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
Dan Nicholson8217f242009-02-11 15:16:00 -0800360
Marek Olšák848f7d32011-04-01 01:12:41 +0200361dnl
Tom Fogalc0573fb2011-10-10 10:33:18 -0600362dnl Mangled Mesa support
363dnl
364AC_ARG_ENABLE([mangling],
365 [AS_HELP_STRING([--enable-mangling],
366 [enable mangled symbols and library name @<:@default=disabled@:>@])],
367 [enable_mangling="${enableval}"],
368 [enable_mangling=no]
369)
Tom Fogalc0573fb2011-10-10 10:33:18 -0600370if test "x${enable_mangling}" = "xyes" ; then
371 DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400372 GL_LIB="Mangled${GL_LIB}"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400373 OSMESA_LIB="Mangled${OSMESA_LIB}"
Tom Fogalc0573fb2011-10-10 10:33:18 -0600374fi
375AC_SUBST([GL_LIB])
Tom Fogalc0573fb2011-10-10 10:33:18 -0600376AC_SUBST([OSMESA_LIB])
377
378dnl
Marek Olšák848f7d32011-04-01 01:12:41 +0200379dnl potentially-infringing-but-nobody-knows-for-sure stuff
380dnl
381AC_ARG_ENABLE([texture-float],
382 [AS_HELP_STRING([--enable-texture-float],
383 [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
384 [enable_texture_float="$enableval"],
385 [enable_texture_float=no]
386)
387if test "x$enable_texture_float" = xyes; then
388 AC_MSG_WARN([Floating-point textures enabled.])
389 AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
390 DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
391fi
392
Dan Nicholson8217f242009-02-11 15:16:00 -0800393GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800394OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800395EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500396GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
397GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
Chia-I Wu874ccd52010-05-04 22:43:05 +0800398VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800399GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800400
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100401GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100402EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
403EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
404GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
405GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
406VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800407GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800408
Dan Nicholson297e16c2008-05-05 15:42:53 -0700409AC_SUBST([GL_LIB_NAME])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700410AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800411AC_SUBST([EGL_LIB_NAME])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500412AC_SUBST([GLESv1_CM_LIB_NAME])
413AC_SUBST([GLESv2_LIB_NAME])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800414AC_SUBST([VG_LIB_NAME])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800415AC_SUBST([GLAPI_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700416
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700417AC_SUBST([GL_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800418AC_SUBST([EGL_LIB_GLOB])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500419AC_SUBST([GLESv1_CM_LIB_GLOB])
420AC_SUBST([GLESv2_LIB_GLOB])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800421AC_SUBST([VG_LIB_GLOB])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800422AC_SUBST([GLAPI_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700423
Dan Nicholsondca1b792007-10-23 09:25:58 -0700424dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700425dnl Arch/platform-specific settings
426dnl
427AC_ARG_ENABLE([asm],
428 [AS_HELP_STRING([--disable-asm],
429 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
430 [enable_asm="$enableval"],
431 [enable_asm=yes]
432)
433asm_arch=""
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700434MESA_ASM_FILES=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700435AC_MSG_CHECKING([whether to enable assembly])
436test "x$enable_asm" = xno && AC_MSG_RESULT([no])
437# disable if cross compiling on x86/x86_64 since we must run gen_matypes
438if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
439 case "$host_cpu" in
440 i?86 | x86_64)
441 enable_asm=no
442 AC_MSG_RESULT([no, cross compiling])
443 ;;
444 esac
445fi
446# check for supported arches
447if test "x$enable_asm" = xyes; then
448 case "$host_cpu" in
449 i?86)
450 case "$host_os" in
Pierre Allegraud8fd8de32011-01-06 07:58:57 -0700451 linux* | *freebsd* | dragonfly* | *netbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700452 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
453 ;;
454 esac
455 ;;
456 x86_64)
457 case "$host_os" in
Pierre Allegraud8fd8de32011-01-06 07:58:57 -0700458 linux* | *freebsd* | dragonfly* | *netbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700459 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
460 ;;
461 esac
462 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800463 sparc*)
464 case "$host_os" in
465 linux*)
466 asm_arch=sparc
467 ;;
468 esac
469 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700470 esac
471
472 case "$asm_arch" in
473 x86)
Eric Anholte4269492012-06-11 10:25:05 -0700474 DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700475 MESA_ASM_FILES='$(X86_FILES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700476 AC_MSG_RESULT([yes, x86])
477 ;;
478 x86_64)
Eric Anholte4269492012-06-11 10:25:05 -0700479 DEFINES="$DEFINES -DUSE_X86_64_ASM"
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700480 MESA_ASM_FILES='$(X86_64_FILES)'
Dan Nicholson871125a2008-06-04 13:00:35 -0700481 AC_MSG_RESULT([yes, x86_64])
482 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800483 sparc)
Eric Anholte4269492012-06-11 10:25:05 -0700484 DEFINES="$DEFINES -DUSE_SPARC_ASM"
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700485 MESA_ASM_FILES='$(SPARC_FILES)'
David S. Miller857ac1e2009-02-26 05:35:15 -0800486 AC_MSG_RESULT([yes, sparc])
487 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700488 *)
489 AC_MSG_RESULT([no, platform not supported])
490 ;;
491 esac
492fi
Eric Anholt7d7fe1b2012-05-16 09:09:18 -0700493AC_SUBST([MESA_ASM_FILES])
Dan Nicholson871125a2008-06-04 13:00:35 -0700494
Dan Nicholson871125a2008-06-04 13:00:35 -0700495dnl Check to see if dlopen is in default libraries (like Solaris, which
496dnl has it in libc), or if libdl is needed to get it.
Tapani Pälli57c57df2012-08-16 13:59:12 +0300497AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
498 [AC_CHECK_LIB([dl], [dlopen],
499 [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
Chia-I Wu08f4bc02010-07-16 20:09:29 +0800500AC_SUBST([DLOPEN_LIBS])
Dan Nicholson871125a2008-06-04 13:00:35 -0700501
Vinson Lee990bd492013-01-26 22:50:05 -0800502case "$host_os" in
503darwin*)
504 ;;
505*)
506 AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
507 [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
508 [AC_MSG_ERROR([Couldn't find clock_gettime])])])
509 AC_SUBST([CLOCK_LIB])
510 ;;
511esac
Dave Airlieec835352012-12-04 09:25:13 +1000512
Dan Nicholson985e1cd2008-06-04 13:17:06 -0700513dnl See if posix_memalign is available
514AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
515
Matt Turner7da12422012-09-18 20:21:47 -0700516dnl Check for pthreads
517AX_PTHREAD
Matt Turnerdd4fde82012-09-27 15:49:52 -0700518dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
519dnl to -pthread, which causes problems if we need -lpthread to appear in
520dnl pkgconfig files.
521test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
Matt Turner7da12422012-09-18 20:21:47 -0700522
Dan Nicholson871125a2008-06-04 13:00:35 -0700523dnl SELinux awareness.
524AC_ARG_ENABLE([selinux],
525 [AS_HELP_STRING([--enable-selinux],
526 [Build SELinux-aware Mesa @<:@default=disabled@:>@])],
527 [MESA_SELINUX="$enableval"],
528 [MESA_SELINUX=no])
529if test "x$enable_selinux" = "xyes"; then
530 AC_CHECK_HEADER([selinux/selinux.h],[],
531 [AC_MSG_ERROR([SELinux headers not found])])
532 AC_CHECK_LIB([selinux],[is_selinux_enabled],[],
533 [AC_MSG_ERROR([SELinux library not found])])
534 SELINUX_LIBS="-lselinux"
535 DEFINES="$DEFINES -DMESA_SELINUX"
536fi
Matt Turner9ed00072012-09-18 20:22:37 -0700537AC_SUBST([SELINUX_LIBS])
Dan Nicholson871125a2008-06-04 13:00:35 -0700538
Marek Olšák440d71d2011-06-14 05:38:58 +0200539dnl Options for APIs
Chia-I Wube5f34a2010-10-27 16:14:27 +0800540AC_ARG_ENABLE([opengl],
541 [AS_HELP_STRING([--disable-opengl],
542 [disable support for standard OpenGL API @<:@default=no@:>@])],
543 [enable_opengl="$enableval"],
544 [enable_opengl=yes])
545AC_ARG_ENABLE([gles1],
546 [AS_HELP_STRING([--enable-gles1],
547 [enable support for OpenGL ES 1.x API @<:@default=no@:>@])],
548 [enable_gles1="$enableval"],
549 [enable_gles1=no])
550AC_ARG_ENABLE([gles2],
551 [AS_HELP_STRING([--enable-gles2],
552 [enable support for OpenGL ES 2.x API @<:@default=no@:>@])],
553 [enable_gles2="$enableval"],
554 [enable_gles2=no])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800555AC_ARG_ENABLE([openvg],
556 [AS_HELP_STRING([--enable-openvg],
557 [enable support for OpenVG API @<:@default=no@:>@])],
558 [enable_openvg="$enableval"],
559 [enable_openvg=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900560
561AC_ARG_ENABLE([dri],
562 [AS_HELP_STRING([--enable-dri],
Matt Turner32e8ce62012-08-17 14:05:56 -0700563 [enable DRI modules @<:@default=enabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900564 [enable_dri="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700565 [enable_dri=yes])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900566AC_ARG_ENABLE([glx],
567 [AS_HELP_STRING([--enable-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700568 [enable GLX library @<:@default=enabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900569 [enable_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700570 [enable_glx=yes])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900571AC_ARG_ENABLE([osmesa],
572 [AS_HELP_STRING([--enable-osmesa],
Matt Turner32e8ce62012-08-17 14:05:56 -0700573 [enable OSMesa library @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900574 [enable_osmesa="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700575 [enable_osmesa=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900576AC_ARG_ENABLE([egl],
577 [AS_HELP_STRING([--disable-egl],
578 [disable EGL library @<:@default=enabled@:>@])],
579 [enable_egl="$enableval"],
580 [enable_egl=yes])
581
Marek Olšák440d71d2011-06-14 05:38:58 +0200582AC_ARG_ENABLE([xorg],
583 [AS_HELP_STRING([--enable-xorg],
584 [enable support for X.Org DDX API @<:@default=no@:>@])],
585 [enable_xorg="$enableval"],
586 [enable_xorg=no])
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200587AC_ARG_ENABLE([xa],
588 [AS_HELP_STRING([--enable-xa],
589 [enable build of the XA X Acceleration API @<:@default=no@:>@])],
590 [enable_xa="$enableval"],
591 [enable_xa=no])
Matt Turner058fb002012-09-06 16:17:21 -0700592dnl Broken, unmaintained. Don't want to see bug reports about it without patches.
593enable_d3d1x=no
594dnl AC_ARG_ENABLE([d3d1x],
595dnl [AS_HELP_STRING([--enable-d3d1x],
596dnl [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])],
597dnl [enable_d3d1x="$enableval"],
598dnl [enable_d3d1x=no])
Benjamin Franzkeeddcecb2011-05-26 15:09:39 +0200599AC_ARG_ENABLE([gbm],
600 [AS_HELP_STRING([--enable-gbm],
601 [enable gbm library @<:@default=auto@:>@])],
602 [enable_gbm="$enableval"],
603 [enable_gbm=auto])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900604
Christian Königc3b22302011-07-04 15:04:41 +0200605AC_ARG_ENABLE([xvmc],
606 [AS_HELP_STRING([--enable-xvmc],
607 [enable xvmc library @<:@default=auto@:>@])],
608 [enable_xvmc="$enableval"],
609 [enable_xvmc=auto])
610AC_ARG_ENABLE([vdpau],
611 [AS_HELP_STRING([--enable-vdpau],
612 [enable vdpau library @<:@default=auto@:>@])],
613 [enable_vdpau="$enableval"],
614 [enable_vdpau=auto])
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200615AC_ARG_ENABLE([opencl],
616 [AS_HELP_STRING([--enable-opencl],
Tom Stellardcf69a592013-01-18 16:26:12 +0000617 [enable OpenCL library NOTE: Enabling this option will also enable
618 --with-llvm-shared-libs
619 @<:@default=no@:>@])],
Quentin Glidic1e857132013-01-25 15:02:04 +0100620 [],
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200621 [enable_opencl=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900622AC_ARG_ENABLE([xlib_glx],
623 [AS_HELP_STRING([--enable-xlib-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700624 [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900625 [enable_xlib_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700626 [enable_xlib_glx=no])
Marek Olšák1251e1d2011-06-18 20:33:55 +0200627AC_ARG_ENABLE([gallium_egl],
628 [AS_HELP_STRING([--enable-gallium-egl],
629 [enable optional EGL state tracker (not required
630 for EGL support in Gallium with OpenGL and OpenGL ES)
631 @<:@default=disable@:>@])],
632 [enable_gallium_egl="$enableval"],
633 [enable_gallium_egl=no])
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200634AC_ARG_ENABLE([gallium_gbm],
635 [AS_HELP_STRING([--enable-gallium-gbm],
636 [enable optional gbm state tracker (not required for
637 gbm support in Gallium)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200638 @<:@default=auto@:>@])],
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200639 [enable_gallium_gbm="$enableval"],
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200640 [enable_gallium_gbm=auto])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800641
Tom Stellardced73ea2012-04-17 09:26:28 -0400642AC_ARG_ENABLE([r600-llvm-compiler],
Homer Hsing40507562012-05-15 18:56:17 -0400643 [AS_HELP_STRING([--enable-r600-llvm-compiler],
644 [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
Tom Stellardced73ea2012-04-17 09:26:28 -0400645 [enable_r600_llvm="$enableval"],
646 [enable_r600_llvm=no])
647
Francisco Jerez66f7fd92012-04-25 22:16:26 +0200648AC_ARG_ENABLE([gallium_tests],
649 [AS_HELP_STRING([--enable-gallium-tests],
650 [Enable optional Gallium tests) @<:@default=disable@:>@])],
651 [enable_gallium_tests="$enableval"],
652 [enable_gallium_tests=no])
653
Marek Olšák58b6a192011-06-14 07:46:59 +0200654# Option for Gallium drivers
Damien Lespiau164a04e2013-01-14 13:54:57 +0000655
656# Keep this in sync with the --with-gallium-drivers help string default value
Thomas Hellstrom87118d82012-01-12 12:10:53 +0100657GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
Marek Olšák58b6a192011-06-14 07:46:59 +0200658
659AC_ARG_WITH([gallium-drivers],
660 [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
661 [comma delimited Gallium drivers list, e.g.
Andreas Boll17f09b62012-08-28 17:28:19 +0200662 "i915,nouveau,r300,r600,radeonsi,svga,swrast"
Damien Lespiau164a04e2013-01-14 13:54:57 +0000663 @<:@default=r300,r600,svga,swrast@:>@])],
Marek Olšák58b6a192011-06-14 07:46:59 +0200664 [with_gallium_drivers="$withval"],
665 [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
Chia-I Wu156e9552010-10-30 14:26:01 +0800666
Ian Romanickdb311b42011-06-22 11:35:27 -0700667# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
668# here so that the script doesn't choke on an unknown driver name later.
669case "$with_gallium_drivers" in
670 yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
671 no) with_gallium_drivers='' ;;
672esac
673
Chia-I Wube5f34a2010-10-27 16:14:27 +0800674if test "x$enable_opengl" = xno -a \
675 "x$enable_gles1" = xno -a \
676 "x$enable_gles2" = xno -a \
Marek Olšák440d71d2011-06-14 05:38:58 +0200677 "x$enable_openvg" = xno -a \
678 "x$enable_xorg" = xno -a \
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200679 "x$enable_xa" = xno -a \
Christian Königc3b22302011-07-04 15:04:41 +0200680 "x$enable_d3d1x" = xno -a \
681 "x$enable_xvmc" = xno -a \
682 "x$enable_vdpau" = xno -a \
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200683 "x$enable_opencl" = xno; then
Chia-I Wube5f34a2010-10-27 16:14:27 +0800684 AC_MSG_ERROR([at least one API should be enabled])
685fi
686
687API_DEFINES=""
Chia-I Wube5f34a2010-10-27 16:14:27 +0800688if test "x$enable_opengl" = xno; then
689 API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
690else
691 API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
692fi
693if test "x$enable_gles1" = xyes; then
694 API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
695fi
696if test "x$enable_gles2" = xyes; then
697 API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
698fi
Chia-I Wube5f34a2010-10-27 16:14:27 +0800699AC_SUBST([API_DEFINES])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800700
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800701if test "x$enable_glx" = xno; then
Matt Turner32e8ce62012-08-17 14:05:56 -0700702 AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800703 enable_xlib_glx=no
704fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900705
Matt Turner32e8ce62012-08-17 14:05:56 -0700706if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
707 AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
708fi
709
Michel Dänzer3b888f52013-01-31 11:47:55 +0100710if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
711 AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
712fi
713
714# Disable GLX if OpenGL is not enabled
715if test "x$enable_glx$enable_opengl" = xyesno; then
716 AC_MSG_WARN([OpenGL not enabled, disabling GLX])
717 enable_glx=no
718fi
719
Matt Turner32e8ce62012-08-17 14:05:56 -0700720# Disable GLX if DRI and Xlib-GLX are not enabled
721if test "x$enable_glx" = xyes -a \
722 "x$enable_dri" = xno -a \
723 "x$enable_xlib_glx" = xno; then
724 AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
725 enable_glx=no
726fi
727
Matt Turner00f3d9b2012-08-21 22:06:17 -0700728AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
Matt Turner8cdce6c2012-08-21 22:26:52 -0700729AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
730 "x$enable_osmesa" = xyes)
Matt Turner06ad64a2012-01-15 21:30:26 -0500731
Matt Turner8c9b78a2012-08-17 14:22:47 -0700732AC_ARG_ENABLE([shared-glapi],
733 [AS_HELP_STRING([--enable-shared-glapi],
734 [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
735 [enable_shared_glapi="$enableval"],
736 [enable_shared_glapi="$enable_dri"])
737
738# Shared GLAPI is only useful for DRI
739if test "x$enable_dri" = xno; then
740 AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
741 enable_shared_glapi=no
742fi
743
Matt Turner8c9b78a2012-08-17 14:22:47 -0700744if test "x$enable_shared_glapi" = xyes; then
Matt Turner8c9b78a2012-08-17 14:22:47 -0700745 # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
746 # the remap table)
747 DEFINES="$DEFINES -DIN_DRI_DRIVER"
Matt Turnerd9b10982012-08-17 14:54:25 -0700748 CORE_DIRS="mapi/shared-glapi"
Matt Turner8c9b78a2012-08-17 14:22:47 -0700749fi
Matt Turner8c9b78a2012-08-17 14:22:47 -0700750AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
751
Dan Nicholson44d99142007-12-05 18:47:01 -0800752dnl
753dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700754dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100755GALLIUM_DIRS="auxiliary drivers state_trackers"
Keith Whitwell51bff092010-03-11 14:43:00 +0000756GALLIUM_TARGET_DIRS=""
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000757GALLIUM_WINSYS_DIRS="sw"
Kai Wasserbäch0a22fb62011-11-29 22:36:02 +0100758GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100759GALLIUM_STATE_TRACKERS_DIRS=""
760
Chia-I Wube5f34a2010-10-27 16:14:27 +0800761# build glapi if OpenGL is enabled
762if test "x$enable_opengl" = xyes; then
763 CORE_DIRS="$CORE_DIRS mapi/glapi"
764fi
765
Chia-I Wu12583172011-01-07 17:24:16 +0800766# build es1api if OpenGL ES 1.x is enabled
767if test "x$enable_gles1" = xyes; then
768 CORE_DIRS="$CORE_DIRS mapi/es1api"
769fi
770
771# build es2api if OpenGL ES 2.x is enabled
772if test "x$enable_gles2" = xyes; then
773 CORE_DIRS="$CORE_DIRS mapi/es2api"
774fi
Chia-I Wube5f34a2010-10-27 16:14:27 +0800775
Chia-I Wube5f34a2010-10-27 16:14:27 +0800776# build glsl and mesa if OpenGL or OpenGL ES is enabled
Chia-I Wu12583172011-01-07 17:24:16 +0800777case "x$enable_opengl$enable_gles1$enable_gles2" in
Chia-I Wube5f34a2010-10-27 16:14:27 +0800778x*yes*)
Matt Turner99629732013-01-14 14:38:01 -0800779 CORE_DIRS="mapi/glapi/gen $CORE_DIRS gtest glsl mesa"
Chia-I Wube5f34a2010-10-27 16:14:27 +0800780 ;;
781esac
782
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900783case "x$enable_glx$enable_xlib_glx" in
784xyesyes)
785 DRIVER_DIRS="$DRIVER_DIRS x11"
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000786 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
Keith Whitwell51bff092010-03-11 14:43:00 +0000787 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
Marek Olšák440d71d2011-06-14 05:38:58 +0200788 GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
Younes Mantonb97816d2011-07-14 12:22:20 -0400789 HAVE_WINSYS_XLIB="yes"
Dan Nicholson44d99142007-12-05 18:47:01 -0800790 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900791xyesno)
792 # DRI-based GLX
Kristian Høgsberg6e8897f2010-02-09 09:58:36 -0500793 SRC_DIRS="$SRC_DIRS glx"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900794 ;;
795esac
796
797if test "x$enable_dri" = xyes; then
798 DRIVER_DIRS="$DRIVER_DIRS dri"
799
Emil Velikov4ef9c3d2011-07-11 15:58:29 +0100800 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
Marek Olšák440d71d2011-06-14 05:38:58 +0200801 GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
802 HAVE_ST_DRI="yes"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900803fi
804
805if test "x$enable_osmesa" = xyes; then
Eric Anholt2d51ac82012-06-12 12:51:32 -0700806 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900807fi
808
Dan Nicholson297e16c2008-05-05 15:42:53 -0700809AC_SUBST([SRC_DIRS])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700810AC_SUBST([DRIVER_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100811AC_SUBST([GALLIUM_DIRS])
Keith Whitwell51bff092010-03-11 14:43:00 +0000812AC_SUBST([GALLIUM_TARGET_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100813AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +0000814AC_SUBST([GALLIUM_DRIVERS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100815AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dave Airlie81fe1982010-04-22 14:59:29 +1000816AC_SUBST([MESA_LLVM])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700817
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900818# Check for libdrm
819PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
820 [have_libdrm=yes], [have_libdrm=no])
821
822if test "x$enable_dri" = xyes; then
823 # DRI must be shared, I think
824 if test "$enable_static" = yes; then
Matt Turner14819eb2012-08-01 08:32:49 -0700825 AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900826 fi
827
Chia-I Wu81239342011-07-02 09:49:17 +0900828 # not a hard requirement as swrast does not depend on it
829 if test "x$have_libdrm" = xyes; then
830 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900831 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900832fi
833
Matt Turnere273ed32012-08-14 12:24:31 -0700834dnl Find out if X is available.
Daniel Stone40046202012-10-09 14:27:06 +1100835PKG_CHECK_MODULES([X11], [x11], [no_x=no], [no_x=yes])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700836
Dan Nicholson99803a42008-07-01 09:03:15 -0700837dnl Try to tell the user that the --x-* options are only used when
838dnl pkg-config is not available. This must be right after AC_PATH_XTRA.
839m4_divert_once([HELP_BEGIN],
840[These options are only used when the X libraries cannot be found by the
841pkg-config utility.])
842
Dan Nicholson44d99142007-12-05 18:47:01 -0800843dnl We need X for xlib and dri, so bomb now if it's not found
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900844if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then
845 AC_MSG_ERROR([X11 development libraries needed for GLX])
846fi
Dan Nicholsondca1b792007-10-23 09:25:58 -0700847
Samuel Thibault75856172011-03-14 22:08:21 +0000848dnl Direct rendering or just indirect rendering
noblede7d18ed2011-03-14 22:08:22 +0000849case "$host_os" in
850gnu*)
851 dnl Disable by default on GNU/Hurd
852 driglx_direct_default="no"
853 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +0000854cygwin*)
855 dnl Disable by default on cygwin
856 driglx_direct_default="no"
857 ;;
noblede7d18ed2011-03-14 22:08:22 +0000858*)
859 driglx_direct_default="yes"
860 ;;
861esac
Samuel Thibault75856172011-03-14 22:08:21 +0000862AC_ARG_ENABLE([driglx-direct],
863 [AS_HELP_STRING([--disable-driglx-direct],
Andreas Boll5ecbc3a2012-11-10 17:58:49 +0100864 [disable direct rendering in GLX and EGL for DRI \
noblede7d18ed2011-03-14 22:08:22 +0000865 @<:@default=auto@:>@])],
Samuel Thibault75856172011-03-14 22:08:21 +0000866 [driglx_direct="$enableval"],
noblede7d18ed2011-03-14 22:08:22 +0000867 [driglx_direct="$driglx_direct_default"])
Samuel Thibault75856172011-03-14 22:08:21 +0000868
Dan Nicholson44d99142007-12-05 18:47:01 -0800869dnl
870dnl libGL configuration per driver
871dnl
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900872case "x$enable_glx$enable_xlib_glx" in
873xyesyes)
874 # Xlib-based GLX
Matt Turnere273ed32012-08-14 12:24:31 -0700875 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
876 GL_PC_REQ_PRIV="x11 xext"
877 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
878 GL_LIB_DEPS="$XLIBGL_LIBS"
Matt Turnerb6651ae2012-09-18 21:51:25 -0700879 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
880 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800881 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900882xyesno)
883 # DRI-based GLX
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500884 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Samuel Thibault75856172011-03-14 22:08:21 +0000885 if test x"$driglx_direct" = xyes; then
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900886 if test "x$have_libdrm" != xyes; then
887 AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
888 fi
Samuel Thibault75856172011-03-14 22:08:21 +0000889 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Matt Turneraf6aeae2012-09-11 17:08:17 -0700890 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
Samuel Thibault75856172011-03-14 22:08:21 +0000891 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800892
893 # find the DRI deps for libGL
Eric Anholtbb01f672012-09-25 08:43:44 -0700894 dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100895
Matt Turnere273ed32012-08-14 12:24:31 -0700896 # add xf86vidmode if available
897 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
898 if test "$HAVE_XF86VIDMODE" = yes ; then
899 dri_modules="$dri_modules xxf86vm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800900 fi
901
Matt Turnere273ed32012-08-14 12:24:31 -0700902 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
903 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
904 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
905 GL_LIB_DEPS="$DRIGL_LIBS"
906
Matt Turnerb6651ae2012-09-18 21:51:25 -0700907 # need DRM libs, $PTHREAD_LIBS, etc.
908 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
909 GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800910 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800911esac
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900912
Ian Romanick4becf672012-01-03 11:35:59 -0800913# This is outside the case (above) so that it is invoked even for non-GLX
914# builds.
Eric Anholt8ffb0982012-02-05 06:10:56 +0100915AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
Ian Romanick4becf672012-01-03 11:35:59 -0800916
Matt Turnerb6651ae2012-09-18 21:51:25 -0700917GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
918GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
919GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
920GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900921
Robert Braggdda49c32012-09-19 16:12:08 +0100922AC_SUBST([X11_INCLUDES])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700923AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800924AC_SUBST([GL_PC_REQ_PRIV])
925AC_SUBST([GL_PC_LIB_PRIV])
926AC_SUBST([GL_PC_CFLAGS])
927AC_SUBST([DRI_PC_REQ_PRIV])
Li Pengc33c1912010-07-30 12:26:15 +0800928AC_SUBST([GLESv1_CM_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400929AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500930AC_SUBST([GLESv2_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400931AC_SUBST([GLESv2_PC_LIB_PRIV])
932
Matt Turnerbee2edb2012-08-17 16:24:32 -0700933DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100934
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100935AC_SUBST([HAVE_XF86VIDMODE])
936
Dan Nicholsondca1b792007-10-23 09:25:58 -0700937dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900938dnl More GLX setup
Dan Nicholsondca1b792007-10-23 09:25:58 -0700939dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900940case "x$enable_glx$enable_xlib_glx" in
941xyesyes)
Dan Nicholsondca1b792007-10-23 09:25:58 -0700942 DEFINES="$DEFINES -DUSE_XSHM"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900943 ;;
944xyesno)
945 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
946 if test "x$driglx_direct" = xyes; then
947 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
948 fi
949 ;;
950esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700951
952dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700953dnl TLS detection
Dan Nicholson44d99142007-12-05 18:47:01 -0800954dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700955
Dan Nicholson297e16c2008-05-05 15:42:53 -0700956AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800957 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800958 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700959 [GLX_USE_TLS="$enableval"],
960 [GLX_USE_TLS=no])
Tom Fogal31351dc2010-12-05 17:58:32 -0700961AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
962
Matt Turner814345f2012-09-18 22:09:26 -0700963AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
Matt Turner9a51edf2012-10-11 10:57:26 -0700964 [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
Tom Fogal44842972011-02-21 22:32:18 -0700965
Tom Fogal31351dc2010-12-05 17:58:32 -0700966dnl
967dnl More DRI setup
968dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800969dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700970AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800971 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700972 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700973 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700974 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700975AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800976dnl Extra search path for DRI drivers
977AC_ARG_WITH([dri-searchpath],
978 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
979 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
980 [DRI_DRIVER_SEARCH_DIR="$withval"],
981 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
982AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800983dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700984AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800985 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700986 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200987 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700988 [with_dri_drivers="$withval"],
989 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800990if test "x$with_dri_drivers" = x; then
991 with_dri_drivers=no
992fi
993
994dnl If $with_dri_drivers is yes, directories will be added through
995dnl platform checks
996DRI_DIRS=""
997case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100998no) ;;
999yes)
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001000 # classic DRI drivers require FEATURE_GL to build
1001 if test "x$enable_opengl" = xyes; then
1002 DRI_DIRS="yes"
1003 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001004 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001005*)
1006 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -07001007 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001008 for driver in $dri_drivers; do
1009 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
Matt Turner14819eb2012-08-01 08:32:49 -07001010 AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001011 done
1012 DRI_DIRS="$dri_drivers"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001013 if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
1014 AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
1015 fi
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001016 ;;
1017esac
1018
Dan Nicholson44d99142007-12-05 18:47:01 -08001019dnl Set DRI_DIRS, DEFINES and LIB_DEPS
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001020if test "x$enable_dri" = xyes; then
Dan Nicholson44d99142007-12-05 18:47:01 -08001021 # Platform specific settings and drivers to build
1022 case "$host_os" in
1023 linux*)
1024 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Chia-I Wu5029ea42011-06-27 13:06:39 +09001025 DEFINES="$DEFINES -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001026
1027 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -08001028 x86_64)
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001029 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001030 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001031 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001032 ;;
1033 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -08001034 # Build only the drivers for cards that exist on PowerPC.
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001035 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001036 DRI_DIRS="r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001037 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001038 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +10001039 sparc*)
Ian Romanicke4344162011-08-24 15:21:58 -07001040 # Build only the drivers for cards that exist on sparc
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001041 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001042 DRI_DIRS="r200 radeon swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +10001043 fi
1044 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -08001045 esac
1046 ;;
Pierre Allegraud8fd8de32011-01-06 07:58:57 -07001047 freebsd* | dragonfly* | *netbsd*)
Matt Turner9a51edf2012-10-11 10:57:26 -07001048 DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
Dan Nicholson44d99142007-12-05 18:47:01 -08001049 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001050
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001051 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001052 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001053 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001054 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -07001055 gnu*)
1056 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Chia-I Wu5029ea42011-06-27 13:06:39 +09001057 DEFINES="$DEFINES -DHAVE_ALIAS"
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -07001058 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001059 solaris*)
1060 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001061 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +00001062 cygwin*)
1063 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Jon TURNEYc6e33ca2011-03-14 22:08:23 +00001064 if test "x$DRI_DIRS" = "xyes"; then
1065 DRI_DIRS="swrast"
1066 fi
1067 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -08001068 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -08001069
1070 # default drivers
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001071 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001072 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -08001073 fi
1074
Dan Nicholson44d99142007-12-05 18:47:01 -08001075 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1076
1077 # Check for expat
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001078 if test "x$enable_dri" = xyes; then
Chia-I Wube5f34a2010-10-27 16:14:27 +08001079 EXPAT_INCLUDES=""
1080 EXPAT_LIB=-lexpat
1081 AC_ARG_WITH([expat],
1082 [AS_HELP_STRING([--with-expat=DIR],
1083 [expat install directory])],[
1084 EXPAT_INCLUDES="-I$withval/include"
1085 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
1086 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
1087 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
1088 ])
1089 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
Eric Anholt36473392012-01-18 11:27:24 -08001090 save_LIBS="$LIBS"
Chia-I Wube5f34a2010-10-27 16:14:27 +08001091 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1092 [AC_MSG_ERROR([Expat required for DRI.])])
Eric Anholt36473392012-01-18 11:27:24 -08001093 LIBS="$save_LIBS"
Chia-I Wube5f34a2010-10-27 16:14:27 +08001094 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001095
Alexandre Demers67ef7552013-01-12 01:21:44 -05001096 # if we are building any dri driver other than swrast or using the dri state tracker ...
1097 if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast || test "x$enable_dri" = xyes; then
Jon TURNEYffc84942012-02-02 10:39:04 +00001098 # ... libdrm is required
Chia-I Wu81239342011-07-02 09:49:17 +09001099 if test "x$have_libdrm" != xyes; then
1100 AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
1101 fi
Jon TURNEYffc84942012-02-02 10:39:04 +00001102 # ... and build dricommon
1103 HAVE_COMMON_DRI=yes
Chia-I Wu81239342011-07-02 09:49:17 +09001104 fi
1105
Matt Turner2b3a8cb2012-01-13 14:30:36 -05001106 # put all the necessary libs together
Matt Turnerb6651ae2012-09-18 21:51:25 -07001107 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
Dave Airlieec835352012-12-04 09:25:13 +10001108 GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001109fi
Matt Turner523c0152012-09-20 15:08:02 -07001110AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
Dan Nicholson297e16c2008-05-05 15:42:53 -07001111AC_SUBST([DRI_DIRS])
1112AC_SUBST([EXPAT_INCLUDES])
1113AC_SUBST([DRI_LIB_DEPS])
Jon TURNEYdefadf22012-07-08 12:19:24 +01001114AC_SUBST([GALLIUM_DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -08001115
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001116case $DRI_DIRS in
1117*i915*|*i965*)
Tormod Volden903185b2011-01-25 13:25:18 -08001118 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Eric Anholte3264802012-01-12 14:28:37 -08001119
Matt Turner3c87dfc2012-01-14 21:57:32 -05001120 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1121 case $d in
1122 i915)
1123 HAVE_I915_DRI=yes;
1124 ;;
1125 i965)
1126 HAVE_I965_DRI=yes;
1127 ;;
1128 esac
1129 done
Eric Anholte3264802012-01-12 14:28:37 -08001130
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001131 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -05001132esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001133
Matt Turnere0ee8182012-01-14 22:21:30 -05001134case $DRI_DIRS in
Matt Turner3f964342012-01-15 10:20:30 -05001135*nouveau*)
Ben Skeggs2e47d012011-12-23 14:03:49 +10001136 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
Matt Turner3f964342012-01-15 10:20:30 -05001137 HAVE_NOUVEAU_DRI=yes;
1138 ;;
1139esac
1140
1141case $DRI_DIRS in
Matt Turnerb38d7a02012-01-15 10:04:58 -05001142*radeon*|*r200*)
Matt Turnere0ee8182012-01-14 22:21:30 -05001143 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1144
1145 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1146 case $d in
1147 radeon)
1148 HAVE_RADEON_DRI=yes;
1149 ;;
Matt Turnerb38d7a02012-01-15 10:04:58 -05001150 r200)
1151 HAVE_R200_DRI=yes;
1152 ;;
Matt Turnere0ee8182012-01-14 22:21:30 -05001153 esac
1154 done
1155
1156 ;;
1157esac
1158
Matt Turner349845f2012-01-15 11:39:48 -05001159case $DRI_DIRS in
1160*swrast*)
1161 HAVE_SWRAST_DRI=yes;
1162 ;;
1163esac
1164
Matt Turner3c87dfc2012-01-14 21:57:32 -05001165AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
Eric Anholte3264802012-01-12 14:28:37 -08001166AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
Matt Turner3f964342012-01-15 10:20:30 -05001167AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
Matt Turnerb38d7a02012-01-15 10:04:58 -05001168AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
Matt Turnere0ee8182012-01-14 22:21:30 -05001169AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
Matt Turner349845f2012-01-15 11:39:48 -05001170AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
Jon TURNEYffc84942012-02-02 10:39:04 +00001171AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
Eric Anholte3264802012-01-12 14:28:37 -08001172
Dan Nicholson44d99142007-12-05 18:47:01 -08001173dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -07001174dnl OSMesa configuration
1175dnl
Dan Nicholson979ff512007-12-05 18:47:01 -08001176
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001177dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -07001178AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001179 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1180 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001181 [osmesa_bits="$withval"],
1182 [osmesa_bits=8])
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001183if test "x$osmesa_bits" != x8; then
1184 if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
1185 AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
1186 osmesa_bits=8
1187 fi
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001188fi
1189case "x$osmesa_bits" in
1190x8)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001191 OSMESA_LIB="${OSMESA_LIB}"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001192 ;;
1193x16|x32)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001194 OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001195 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1196 ;;
1197*)
1198 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1199 ;;
1200esac
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001201
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001202if test "x$enable_osmesa" = xyes; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001203 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -08001204 if test "$enable_static" = no; then
Matt Turnerb6651ae2012-09-18 21:51:25 -07001205 OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -08001206 else
1207 OSMESA_LIB_DEPS=""
1208 fi
Matt Turner7ef94c62012-01-31 21:34:42 -05001209 OSMESA_MESA_DEPS=""
Matt Turnerb6651ae2012-09-18 21:51:25 -07001210 OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001211fi
Laurent Carlier284325d2012-06-24 09:51:27 +02001212
Dan Nicholson297e16c2008-05-05 15:42:53 -07001213AC_SUBST([OSMESA_LIB_DEPS])
Matt Turner7ef94c62012-01-31 21:34:42 -05001214AC_SUBST([OSMESA_MESA_DEPS])
1215AC_SUBST([OSMESA_PC_REQ])
Dan Nicholson8be02fc2008-12-14 09:35:29 -08001216AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001217
1218dnl
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001219dnl gbm configuration
1220dnl
1221if test "x$enable_gbm" = xauto; then
1222 case "$with_egl_platforms" in
1223 *drm*)
1224 enable_gbm=yes ;;
1225 *)
1226 enable_gbm=no ;;
1227 esac
1228fi
1229if test "x$enable_gbm" = xyes; then
1230 SRC_DIRS="$SRC_DIRS gbm"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001231
1232 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1233 AC_MSG_ERROR([gbm needs udev]))
Matt Turner027ce0c2012-01-24 11:34:42 -05001234
1235 if test "x$enable_dri" = xyes; then
1236 GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
Matt Turner8c9b78a2012-08-17 14:22:47 -07001237 if test "x$enable_shared_glapi" = xno; then
Matt Turner027ce0c2012-01-24 11:34:42 -05001238 AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
1239 fi
1240 fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001241fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001242GBM_PC_REQ_PRIV="libudev"
1243GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001244AC_SUBST([GBM_PC_REQ_PRIV])
1245AC_SUBST([GBM_PC_LIB_PRIV])
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001246
1247dnl
Dan Nicholson53b37342009-02-25 17:45:34 -08001248dnl EGL configuration
1249dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001250EGL_CLIENT_APIS=""
1251
Dan Nicholson66f97862009-04-29 12:11:43 -07001252if test "x$enable_egl" = xyes; then
1253 SRC_DIRS="$SRC_DIRS egl"
Matt Turnerb6651ae2012-09-18 21:51:25 -07001254 EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
Marek Olšákad50abba2011-06-14 05:14:27 +02001255
Benjamin Franzke85fe9482011-08-09 14:23:18 +02001256 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
1257
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +08001258 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +08001259 # build egl_glx when libGL is built
Benjamin Franzke184bb092011-04-30 11:18:23 +02001260 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1261 [have_libudev=yes],[have_libudev=no])
Benjamin Franzkea7cd65f2011-05-31 11:14:46 +02001262 if test "$have_libudev" = yes; then
1263 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1264 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001265
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001266 if test "x$enable_dri" = xyes; then
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001267 HAVE_EGL_DRIVER_DRI2=1
Chia-I Wu39ae9652010-07-16 19:48:52 +08001268 fi
Kristian Høgsberg2168b872010-06-02 22:48:06 -04001269
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001270 fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001271fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001272AC_SUBST([EGL_LIB_DEPS])
1273
1274dnl
Marek Olšák1251e1d2011-06-18 20:33:55 +02001275dnl EGL Gallium configuration
1276dnl
1277if test "x$enable_gallium_egl" = xyes; then
1278 if test "x$with_gallium_drivers" = x; then
1279 AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
1280 fi
1281 if test "x$enable_egl" = xno; then
1282 AC_MSG_ERROR([cannot enable egl_gallium without EGL])
1283 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +09001284 if test "x$have_libdrm" != xyes; then
1285 AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
1286 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001287
1288 GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
Chia-I Wub8f097f2011-06-20 12:01:39 +09001289 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
Marek Olšák1251e1d2011-06-18 20:33:55 +02001290 HAVE_ST_EGL="yes"
1291fi
1292
1293dnl
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001294dnl gbm Gallium configuration
1295dnl
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001296if test "x$enable_gallium_gbm" = xauto; then
Chia-I Wu95ef0692011-11-05 15:09:36 +08001297 case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in
1298 yesyesyes*drm*)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001299 enable_gallium_gbm=yes ;;
1300 *)
1301 enable_gallium_gbm=no ;;
1302 esac
1303fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001304if test "x$enable_gallium_gbm" = xyes; then
1305 if test "x$with_gallium_drivers" = x; then
1306 AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
1307 fi
1308 if test "x$enable_gbm" = xno; then
1309 AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
1310 fi
Chia-I Wu95ef0692011-11-05 15:09:36 +08001311 # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
1312 if test "x$enable_dri" = xno; then
1313 AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
1314 fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001315
1316 GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
1317 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
1318 HAVE_ST_GBM="yes"
Francisco Jerezb52a0f22012-04-20 16:31:23 +02001319 enable_gallium_loader=yes
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001320fi
1321
1322dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001323dnl X.Org DDX configuration
1324dnl
1325if test "x$enable_xorg" = xyes; then
1326 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1327 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1328 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1329 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1330 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1331 HAVE_XEXTPROTO_71="no")
1332 GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
1333 HAVE_ST_XORG=yes
1334fi
1335
1336dnl
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001337dnl XA configuration
1338dnl
1339if test "x$enable_xa" = xyes; then
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001340AC_PROG_AWK
1341AC_PROG_GREP
1342AC_CHECK_PROG(NM, nm, "nm")
1343if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
1344AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
1345enable_xa=no
1346fi
1347fi
1348if test "x$enable_xa" = xyes; then
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001349 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
1350 HAVE_ST_XA=yes
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001351 AC_SUBST(AWK)
1352 AC_SUBST(GREP)
1353 AC_SUBST(NM)
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001354fi
1355
1356dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001357dnl OpenVG configuration
1358dnl
1359VG_LIB_DEPS=""
1360
1361if test "x$enable_openvg" = xyes; then
1362 if test "x$enable_egl" = xno; then
1363 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1364 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001365 if test "x$with_gallium_drivers" = x; then
Marek Olšák440d71d2011-06-14 05:38:58 +02001366 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1367 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001368 if test "x$enable_gallium_egl" = xno; then
1369 AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
1370 fi
Marek Olšák440d71d2011-06-14 05:38:58 +02001371
1372 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
Matt Turnerb6651ae2012-09-18 21:51:25 -07001373 VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
Marek Olšák440d71d2011-06-14 05:38:58 +02001374 CORE_DIRS="$CORE_DIRS mapi/vgapi"
1375 GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
1376 HAVE_ST_VEGA=yes
Dave Airlieec835352012-12-04 09:25:13 +10001377 VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
Matt Turner261719b2012-08-22 16:57:38 -07001378 AC_SUBST([VG_PC_LIB_PRIV])
Marek Olšák440d71d2011-06-14 05:38:58 +02001379fi
Matt Turnercdee0e82012-09-10 11:21:26 -07001380AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
Marek Olšák440d71d2011-06-14 05:38:58 +02001381
1382dnl
1383dnl D3D1X configuration
1384dnl
1385
1386if test "x$enable_d3d1x" = xyes; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001387 if test "x$with_gallium_drivers" = x; then
1388 AC_MSG_ERROR([cannot enable D3D1X without Gallium])
1389 fi
1390
Marek Olšák440d71d2011-06-14 05:38:58 +02001391 GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS"
1392 HAVE_ST_D3D1X=yes
1393fi
1394
1395dnl
Christian Königc3b22302011-07-04 15:04:41 +02001396dnl Gallium G3DVL configuration
1397dnl
1398AC_ARG_ENABLE([gallium-g3dvl],
1399 [AS_HELP_STRING([--enable-gallium-g3dvl],
1400 [build gallium g3dvl @<:@default=disabled@:>@])],
1401 [enable_gallium_g3dvl="$enableval"],
1402 [enable_gallium_g3dvl=no])
1403if test "x$enable_gallium_g3dvl" = xyes; then
1404 if test "x$with_gallium_drivers" = x; then
1405 AC_MSG_ERROR([cannot enable G3DVL without Gallium])
1406 fi
1407
1408 if test "x$enable_xvmc" = xauto; then
Christian Königa8ae8cf2011-07-14 12:42:17 +02001409 PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
Christian Königc3b22302011-07-04 15:04:41 +02001410 fi
1411
1412 if test "x$enable_vdpau" = xauto; then
Christian König33bf4102011-07-14 13:57:23 +02001413 PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
Christian Königc3b22302011-07-04 15:04:41 +02001414 fi
Christian Königc3b22302011-07-04 15:04:41 +02001415fi
1416
Christian Königc3b22302011-07-04 15:04:41 +02001417if test "x$enable_xvmc" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001418 PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
Christian Königdcf8ee72012-02-15 17:30:58 +01001419 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
Christian Königc3b22302011-07-04 15:04:41 +02001420 HAVE_ST_XVMC="yes"
1421fi
1422
Christian Königc3b22302011-07-04 15:04:41 +02001423if test "x$enable_vdpau" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001424 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
Christian Königc3b22302011-07-04 15:04:41 +02001425 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
1426 HAVE_ST_VDPAU="yes"
1427fi
1428
Christian Königc3b22302011-07-04 15:04:41 +02001429dnl
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001430dnl OpenCL configuration
1431dnl
1432
Tom Stellardc79e7662012-03-12 13:53:20 -04001433AC_ARG_WITH([libclc-path],
1434 [AS_HELP_STRING([--with-libclc-path],
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001435 [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
Tom Stellardc79e7662012-03-12 13:53:20 -04001436 [LIBCLC_PATH="$withval"],
1437 [LIBCLC_PATH=""])
1438
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001439if test "x$LIBCLC_PATH" != x; then
1440 AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
1441 Please review the updated build instructions for clover:
1442 http://dri.freedesktop.org/wiki/GalliumCompute])
1443fi
1444
1445
Tom Stellardea76f032012-06-15 16:52:16 -04001446AC_ARG_WITH([clang-libdir],
1447 [AS_HELP_STRING([--with-clang-libdir],
1448 [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
1449 [CLANG_LIBDIR="$withval"],
1450 [CLANG_LIBDIR=""])
1451
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001452LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
1453LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
1454AC_SUBST([LIBCLC_INCLUDEDIR])
1455AC_SUBST([LIBCLC_LIBEXECDIR])
Tom Stellardc79e7662012-03-12 13:53:20 -04001456
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001457if test "x$enable_opencl" = xyes; then
1458 if test "x$with_gallium_drivers" = x; then
1459 AC_MSG_ERROR([cannot enable OpenCL without Gallium])
1460 fi
Tom Stellard79d77b32012-04-20 16:56:46 +02001461
1462 if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
1463 AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
1464 fi
1465
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001466 if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
1467 AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
1468 fi
1469
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001470 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
1471 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
Tom Stellard79d77b32012-04-20 16:56:46 +02001472 enable_gallium_loader=yes
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001473fi
1474
Matt Turner45270fb2012-09-13 10:45:01 -07001475if test "x$enable_gallium_gbm" = xyes || test "x$enable_opencl" = xyes; then
1476 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
1477fi
1478
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001479dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001480dnl Gallium configuration
1481dnl
Marek Olšák58b6a192011-06-14 07:46:59 +02001482if test "x$with_gallium_drivers" != x; then
Jakob Bornecrantzbe38b322010-03-23 13:23:26 +00001483 SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001484fi
Matt Turnerbfd7d6f2012-08-17 15:51:59 -07001485AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x)
Dan Nicholsondca1b792007-10-23 09:25:58 -07001486
Tom Stellarda75c6162012-01-06 17:38:37 -05001487AC_SUBST([LLVM_BINDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001488AC_SUBST([LLVM_CFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001489AC_SUBST([LLVM_CPPFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001490AC_SUBST([LLVM_CXXFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001491AC_SUBST([LLVM_LIBDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001492AC_SUBST([LLVM_LIBS])
1493AC_SUBST([LLVM_LDFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001494AC_SUBST([LLVM_INCLUDEDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001495AC_SUBST([LLVM_VERSION])
Tom Stellardea76f032012-06-15 16:52:16 -04001496AC_SUBST([CLANG_RESOURCE_DIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001497
Chia-I Wube5f34a2010-10-27 16:14:27 +08001498case "x$enable_opengl$enable_gles1$enable_gles2" in
1499x*yes*)
1500 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
Matt Turnercdee0e82012-09-10 11:21:26 -07001501 HAVE_OPENGL=yes
Chia-I Wube5f34a2010-10-27 16:14:27 +08001502 ;;
1503esac
Matt Turnercdee0e82012-09-10 11:21:26 -07001504AM_CONDITIONAL(HAVE_OPENGL, test "x$HAVE_OPENGL" = xyes)
Chia-I Wube5f34a2010-10-27 16:14:27 +08001505
Chia-I Wu874ccd52010-05-04 22:43:05 +08001506AC_SUBST([VG_LIB_DEPS])
Chia-I Wu63ab2502010-05-05 15:38:02 +08001507AC_SUBST([EGL_CLIENT_APIS])
1508
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001509dnl
1510dnl EGL Platforms configuration
1511dnl
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001512AC_ARG_WITH([egl-platforms],
1513 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1514 [comma delimited native platforms libEGL supports, e.g.
Chia-I Wue7424d72010-09-19 16:54:39 +08001515 "x11,drm" @<:@default=auto@:>@])],
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001516 [with_egl_platforms="$withval"],
Eric Anholt28d92ef2012-02-05 07:54:38 +01001517 [if test "x$enable_egl" = xyes; then
1518 with_egl_platforms="x11"
1519 else
1520 with_egl_platforms=""
1521 fi])
Chia-I Wu49381d62010-01-11 01:23:01 +08001522
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001523EGL_PLATFORMS=""
Benjamin Franzke214fc6e2011-02-04 12:24:08 +01001524
Eric Anholt28d92ef2012-02-05 07:54:38 +01001525if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
1526 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1527fi
1528
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001529# Do per-EGL platform setups and checks
Eric Anholt28d92ef2012-02-05 07:54:38 +01001530egl_platforms=`IFS=', '; echo $with_egl_platforms`
1531for plat in $egl_platforms; do
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001532 case "$plat" in
1533 fbdev|null)
1534 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat"
1535 ;;
1536
1537 wayland)
Ander Conselvan de Oliveira60a11e22012-11-22 15:34:49 +02001538 PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.0.2 wayland-server >= 1.0.2])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001539 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
Benjamin Franzke8b902052012-01-24 20:38:01 +01001540
Kristian Høgsberg426a23a2012-07-13 11:06:32 -04001541 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
1542 AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
1543 [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001544 ;;
1545
1546 x11)
Eric Anholtb4773842012-09-25 09:09:47 -07001547 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= 1.8 xcb-xfixes])
Kristian Høgsbergb5c53242012-11-29 15:11:13 -05001548
1549 if test "x$enable_glx" = xyes; then
1550 HAVE_EGL_DRIVER_GLX=1
1551 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001552 ;;
1553
1554 drm)
1555 test "x$enable_gbm" = "xno" &&
1556 AC_MSG_ERROR([EGL platform drm needs gbm])
1557 ;;
1558
1559 android|gdi)
1560 ;;
1561
1562 *)
1563 AC_MSG_ERROR([EGL platform '$plat' does not exist])
1564 ;;
1565 esac
1566
Benjamin Franzke7ed18262011-07-02 13:46:42 +02001567 case "$plat$have_libudev" in
1568 waylandno|drmno)
1569 AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
1570 esac
Eric Anholt28d92ef2012-02-05 07:54:38 +01001571done
1572
Eric Anholt88612022012-02-05 10:46:13 +01001573# libEGL wants to default to the first platform specified in
1574# ./configure. parse that here.
1575if test "x$egl_platforms" != "x"; then
1576 FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
1577 EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
1578else
1579 EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
1580fi
1581
Eric Anholt28d92ef2012-02-05 07:54:38 +01001582EGL_PLATFORMS="$egl_platforms"
Eric Anholt88612022012-02-05 10:46:13 +01001583
1584AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
1585AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
1586AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
1587AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
1588AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
1589
1590AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
1591AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
1592
1593AC_SUBST([EGL_NATIVE_PLATFORM])
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001594AC_SUBST([EGL_PLATFORMS])
Eric Anholt88612022012-02-05 10:46:13 +01001595AC_SUBST([EGL_CFLAGS])
Chia-I Wu49381d62010-01-11 01:23:01 +08001596
Chia-I Wu28c3e572010-01-23 20:18:43 +08001597AC_ARG_WITH([egl-driver-dir],
1598 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1599 [directory for EGL drivers [[default=${libdir}/egl]]])],
1600 [EGL_DRIVER_INSTALL_DIR="$withval"],
1601 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1602AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1603
Joel Bosveld8acca482009-03-06 08:46:08 +09001604AC_ARG_WITH([xorg-driver-dir],
1605 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1606 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1607 [XORG_DRIVER_INSTALL_DIR="$withval"],
1608 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1609AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1610
Tom Fogal7085dce2009-08-13 19:40:30 -06001611AC_ARG_WITH([max-width],
1612 [AS_HELP_STRING([--with-max-width=N],
1613 [Maximum framebuffer width (4096)])],
1614 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1615 AS_IF([test "${withval}" -gt "4096"],
1616 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1617)
1618AC_ARG_WITH([max-height],
1619 [AS_HELP_STRING([--with-max-height=N],
1620 [Maximum framebuffer height (4096)])],
1621 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1622 AS_IF([test "${withval}" -gt "4096"],
1623 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1624)
1625
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001626dnl
Dave Airlie81fe1982010-04-22 14:59:29 +10001627dnl Gallium LLVM
1628dnl
1629AC_ARG_ENABLE([gallium-llvm],
1630 [AS_HELP_STRING([--enable-gallium-llvm],
Marek Olšáka86fc712011-04-21 13:27:55 +02001631 [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
Dave Airlie81fe1982010-04-22 14:59:29 +10001632 [enable_gallium_llvm="$enableval"],
1633 [enable_gallium_llvm=auto])
Tom Stellard7d87c712012-03-27 22:24:39 -04001634
1635AC_ARG_WITH([llvm-shared-libs],
1636 [AS_HELP_STRING([--with-llvm-shared-libs],
1637 [link with LLVM shared libraries @<:@default=disabled@:>@])],
Quentin Glidic1e857132013-01-25 15:02:04 +01001638 [],
Tom Stellard7d87c712012-03-27 22:24:39 -04001639 [with_llvm_shared_libs=no])
Quentin Glidic1e857132013-01-25 15:02:04 +01001640AS_IF([test x$enable_opencl = xyes],
1641 [
1642 AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
1643 with_llvm_shared_libs=yes
1644 ])
Tom Stellard7d87c712012-03-27 22:24:39 -04001645
Tom Stellard17f6c912012-07-17 18:32:56 +00001646AC_ARG_WITH([llvm-prefix],
1647 [AS_HELP_STRING([--with-llvm-prefix],
1648 [Prefix for LLVM installations in non-standard locations])],
1649 [llvm_prefix="$withval"],
1650 [llvm_prefix=""])
1651
1652
Marek Olšák9b67a342012-11-27 23:38:01 +01001653# Call this inside ` ` to get the return value.
1654# $1 is the llvm-config command with arguments.
1655strip_unwanted_llvm_flags() {
Marek Olšák3d59cde2012-11-27 23:56:04 +01001656 # Use \> (marks the end of the word)
Marek Olšák9b67a342012-11-27 23:38:01 +01001657 echo `$1` | sed \
1658 -e 's/-DNDEBUG\>//g' \
Marek Olšák3d59cde2012-11-27 23:56:04 +01001659 -e 's/-pedantic\>//g' \
1660 -e 's/-Wcovered-switch-default\>//g' \
1661 -e 's/-O.\>//g' \
1662 -e 's/-g\>//g' \
Marek Olšákf9429e32012-11-28 00:28:18 +01001663 -e 's/-Wall\>//g' \
1664 -e 's/-fomit-frame-pointer\>//g'
Marek Olšák9b67a342012-11-27 23:38:01 +01001665}
1666
1667
Marek Olšák58b6a192011-06-14 07:46:59 +02001668if test "x$with_gallium_drivers" = x; then
1669 enable_gallium_llvm=no
1670fi
Marek Olšáka86fc712011-04-21 13:27:55 +02001671if test "x$enable_gallium_llvm" = xauto; then
1672 case "$host_cpu" in
1673 i*86|x86_64) enable_gallium_llvm=yes;;
1674 esac
1675fi
Dave Airlie81fe1982010-04-22 14:59:29 +10001676if test "x$enable_gallium_llvm" = xyes; then
Tom Stellard17f6c912012-07-17 18:32:56 +00001677 if test "x$llvm_prefix" != x; then
1678 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
1679 else
1680 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1681 fi
Marek Olšák99fba502011-07-23 15:57:51 +02001682
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001683 if test "x$LLVM_CONFIG" != xno; then
ojab2fe6c252012-01-05 14:18:34 +04001684 LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001685 LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
Tom Stellard69d639b2013-01-18 15:08:28 +00001686 if test "x$with_llvm_shared_libs" != xyes; then
José Fonsecabd9bf7a2012-07-21 11:43:06 +01001687 LLVM_COMPONENTS="engine bitwriter"
1688 if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
1689 LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
Tom Stellard7a6b5d42012-05-02 11:06:13 -04001690 fi
Tom Stellard00d80b32012-10-01 16:19:43 -04001691
José Fonsecabd9bf7a2012-07-21 11:43:06 +01001692 if test "x$enable_opencl" = xyes; then
1693 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
1694 fi
Tom Stellard7d87c712012-03-27 22:24:39 -04001695 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001696 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
Tom Stellarda75c6162012-01-06 17:38:37 -05001697 LLVM_BINDIR=`$LLVM_CONFIG --bindir`
Marek Olšák9b67a342012-11-27 23:38:01 +01001698 LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
1699 LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
1700 LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
Tom Stellarda75c6162012-01-06 17:38:37 -05001701 LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
Tom Stellardd4167802012-04-24 10:34:57 -04001702 LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
Tom Stellard80d290d2012-08-24 11:48:32 -07001703 DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001704 MESA_LLVM=1
Tom Stellardea76f032012-06-15 16:52:16 -04001705
1706 dnl Check for Clang interanl headers
1707 if test "x$enable_opencl" = xyes; then
1708 if test "x$CLANG_LIBDIR" = x; then
1709 CLANG_LIBDIR=${LLVM_LIBDIR}
1710 fi
1711 CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
1712 AC_CHECK_FILE("$CLANG_RESOURCE_DIR/include/stddef.h",,
1713 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.]))
1714 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001715 else
Dave Airlie81fe1982010-04-22 14:59:29 +10001716 MESA_LLVM=0
Tom Stellard80d290d2012-08-24 11:48:32 -07001717 LLVM_VERSION_INT=0
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001718 fi
1719else
1720 MESA_LLVM=0
Tom Stellard80d290d2012-08-24 11:48:32 -07001721 LLVM_VERSION_INT=0
Dave Airlie81fe1982010-04-22 14:59:29 +10001722fi
1723
Alexandre Demers3ea36952012-04-04 10:54:56 +02001724dnl Directory for XVMC libs
1725AC_ARG_WITH([xvmc-libdir],
1726 [AS_HELP_STRING([--with-xvmc-libdir=DIR],
1727 [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
1728 [XVMC_LIB_INSTALL_DIR="$withval"],
1729 [XVMC_LIB_INSTALL_DIR='${libdir}'])
1730AC_SUBST([XVMC_LIB_INSTALL_DIR])
1731
Tom Stellard79d77b32012-04-20 16:56:46 +02001732dnl
1733dnl Gallium Tests
1734dnl
1735if test "x$enable_gallium_tests" = xyes; then
Andreas Bollcb4d5022012-11-27 19:18:25 +01001736 SRC_DIRS="$SRC_DIRS gallium/tests/trivial gallium/tests/unit"
Tom Stellard79d77b32012-04-20 16:56:46 +02001737 enable_gallium_loader=yes
1738fi
1739
Thomas Balling Sørensen32999972010-07-14 00:34:56 +02001740dnl Directory for VDPAU libs
1741AC_ARG_WITH([vdpau-libdir],
1742 [AS_HELP_STRING([--with-vdpau-libdir=DIR],
1743 [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
1744 [VDPAU_LIB_INSTALL_DIR="$withval"],
1745 [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
1746AC_SUBST([VDPAU_LIB_INSTALL_DIR])
Younes Manton40cd0822010-03-05 23:11:05 -05001747
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001748dnl Directory for OpenCL libs
1749AC_ARG_WITH([opencl-libdir],
1750 [AS_HELP_STRING([--with-opencl-libdir=DIR],
1751 [directory for the OpenCL libraries @<:@default=${libdir}/opencl@:>@])],
1752 [OPENCL_LIB_INSTALL_DIR="$withval"],
1753 [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
1754AC_SUBST([OPENCL_LIB_INSTALL_DIR])
1755
Dave Airlie81fe1982010-04-22 14:59:29 +10001756dnl
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001757dnl Gallium helper functions
1758dnl
1759gallium_check_st() {
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001760 if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
Christian Königc3b22302011-07-04 15:04:41 +02001761 test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
Matt Turner900cc7c2012-09-07 11:12:11 -07001762 test "x$HAVE_ST_VDPAU" = xyes; then
Chia-I Wu81239342011-07-02 09:49:17 +09001763 if test "x$have_libdrm" != xyes; then
1764 AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
1765 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001766 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1767 fi
1768 if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
1769 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
1770 fi
Chia-I Wud8e0e112010-06-29 14:04:27 +08001771 if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001772 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1773 fi
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001774 if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
1775 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
1776 fi
Christian Königc3b22302011-07-04 15:04:41 +02001777 if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
1778 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
1779 fi
1780 if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
1781 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
1782 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001783}
1784
Marek Olšákc17fb852011-06-14 04:03:17 +02001785gallium_require_llvm() {
1786 if test "x$MESA_LLVM" = x0; then
1787 case "$host_cpu" in
1788 i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
1789 esac
1790 fi
1791}
1792
Tom Stellard79d77b32012-04-20 16:56:46 +02001793gallium_require_drm_loader() {
1794 if test "x$enable_gallium_loader" = xyes; then
1795 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
Andreas Bollf416b382012-11-27 10:25:54 +01001796 AC_MSG_ERROR([Gallium drm loader requires libudev]))
Tom Stellard79d77b32012-04-20 16:56:46 +02001797 if test "x$have_libdrm" != xyes; then
1798 AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
1799 fi
1800 enable_gallium_drm_loader=yes
1801 fi
1802}
1803
Tom Stellard8d977852012-05-10 10:21:54 -04001804radeon_llvm_check() {
Vincent Lejeune1feb6b72012-10-31 21:02:29 +01001805 LLVM_REQUIRED_VERSION_MAJOR="3"
1806 LLVM_REQUIRED_VERSION_MINOR="2"
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001807 if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
1808 AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer with R600 target enabled is required.
Vincent Lejeune1feb6b72012-10-31 21:02:29 +01001809 To use the r600/radeonsi LLVM backend, you need to fetch the LLVM source from:
1810 git://people.freedesktop.org/~tstellar/llvm master
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001811 and build with --enable-experimental-targets=R600])
Tom Stellard8d977852012-05-10 10:21:54 -04001812 fi
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001813 if test true && $LLVM_CONFIG --targets-built | grep -qv '\<R600\>' ; then
1814 AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
1815 sources with the --enable-experimental-targets=R600
1816 configure flag])
Tom Stellard8d977852012-05-10 10:21:54 -04001817 fi
Vincent Lejeune1feb6b72012-10-31 21:02:29 +01001818 AC_MSG_WARN([Please ensure you use the latest llvm tree from git://people.freedesktop.org/~tstellar/llvm master before submitting a bug])
Tom Stellard69d639b2013-01-18 15:08:28 +00001819 LLVM_COMPONENTS="${LLVM_COMPONENTS} r600"
Tom Stellard8d977852012-05-10 10:21:54 -04001820}
1821
Marek Olšák58b6a192011-06-14 07:46:59 +02001822dnl Gallium drivers
Marek Olšák02c8ee22011-06-27 08:02:31 +02001823dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
Marek Olšák58b6a192011-06-14 07:46:59 +02001824if test "x$with_gallium_drivers" != x; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001825 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
1826 for driver in $gallium_drivers; do
1827 case "x$driver" in
1828 xsvga)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001829 HAVE_GALLIUM_SVGA=yes
Marek Olšák02c8ee22011-06-27 08:02:31 +02001830 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
Thomas Hellstromd742a642011-09-29 21:41:21 +02001831 gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
Marek Olšák58b6a192011-06-14 07:46:59 +02001832 ;;
1833 xi915)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001834 HAVE_GALLIUM_I915=yes
Emil Velikovc2426bb2011-07-14 23:07:19 +01001835 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Marek Olšák02c8ee22011-06-27 08:02:31 +02001836 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
1837 if test "x$MESA_LLVM" = x1; then
1838 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1839 fi
1840 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
Marek Olšák58b6a192011-06-14 07:46:59 +02001841 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1842 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001843 xr300)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001844 HAVE_GALLIUM_R300=yes
Jerome Glissec0c979e2012-01-30 17:22:13 -05001845 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Marek Olšák58b6a192011-06-14 07:46:59 +02001846 gallium_require_llvm "Gallium R300"
Marek Olšák02c8ee22011-06-27 08:02:31 +02001847 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Marek Olšák4d6faf52013-01-13 22:58:08 +01001848 gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300"
Marek Olšák58b6a192011-06-14 07:46:59 +02001849 ;;
1850 xr600)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001851 HAVE_GALLIUM_R600=yes
Jerome Glissec0c979e2012-01-30 17:22:13 -05001852 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001853 gallium_require_drm_loader
Marek Olšák58b6a192011-06-14 07:46:59 +02001854 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
Adam Rak6a829a12011-11-30 22:20:41 +01001855 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
Tom Stellard8d977852012-05-10 10:21:54 -04001856 radeon_llvm_check
Tom Stellardced73ea2012-04-17 09:26:28 -04001857 NEED_RADEON_GALLIUM=yes;
Tom Stellard91a160b2013-01-25 20:50:31 -05001858 R600_NEED_RADEON_GALLIUM=yes;
1859 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo bitreader asmparser"
Adam Rak6a829a12011-11-30 22:20:41 +01001860 fi
1861 if test "x$enable_r600_llvm" = xyes; then
Tom Stellardced73ea2012-04-17 09:26:28 -04001862 USE_R600_LLVM_COMPILER=yes;
1863 fi
Matt Turner900cc7c2012-09-07 11:12:11 -07001864 gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
Marek Olšák58b6a192011-06-14 07:46:59 +02001865 ;;
Tom Stellarda75c6162012-01-06 17:38:37 -05001866 xradeonsi)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001867 HAVE_GALLIUM_RADEONSI=yes
Michel Dänzer24bc3822012-05-12 12:12:21 +02001868 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1869 gallium_require_drm_loader
Tom Stellarda75c6162012-01-06 17:38:37 -05001870 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
Tom Stellard8d977852012-05-10 10:21:54 -04001871 radeon_llvm_check
Tom Stellarda75c6162012-01-06 17:38:37 -05001872 NEED_RADEON_GALLIUM=yes;
Christian König41625af2012-07-13 11:23:10 +02001873 gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
Tom Stellarda75c6162012-01-06 17:38:37 -05001874 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001875 xnouveau)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001876 HAVE_GALLIUM_NOUVEAU=yes
Emil Velikovc2426bb2011-07-14 23:07:19 +01001877 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001878 gallium_require_drm_loader
Ben Skeggsa2fc42b2012-01-11 12:42:07 +01001879 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0"
Maarten Lankhorstdf8f8642011-10-18 14:24:30 +02001880 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
Marek Olšák58b6a192011-06-14 07:46:59 +02001881 ;;
1882 xswrast)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001883 HAVE_GALLIUM_SOFTPIPE=yes
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001884 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
1885 if test "x$MESA_LLVM" = x1; then
Matt Turner2cbb94b2012-09-07 21:04:44 -07001886 HAVE_GALLIUM_LLVMPIPE=yes
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001887 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1888 fi
1889
Marek Olšák58b6a192011-06-14 07:46:59 +02001890 if test "x$HAVE_ST_DRI" = xyes; then
1891 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1892 fi
Christian Königc3b22302011-07-04 15:04:41 +02001893 if test "x$HAVE_ST_VDPAU" = xyes; then
1894 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
1895 fi
1896 if test "x$HAVE_ST_XVMC" = xyes; then
1897 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
1898 fi
Eric Anholt48c99252011-10-14 14:33:00 -07001899 if test "x$HAVE_ST_VDPAU" = xyes ||
Matt Turner900cc7c2012-09-07 11:12:11 -07001900 test "x$HAVE_ST_XVMC" = xyes; then
Younes Mantonb97816d2011-07-14 12:22:20 -04001901 if test "x$HAVE_WINSYS_XLIB" != xyes; then
1902 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
1903 fi
1904 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001905 ;;
1906 *)
1907 AC_MSG_ERROR([Unknown Gallium driver: $driver])
1908 ;;
1909 esac
1910 done
Chia-I Wua1306f42010-01-22 15:51:51 +08001911fi
Tom Stellard69d639b2013-01-18 15:08:28 +00001912
1913dnl Set LLVM_LIBS - This is done after the driver configuration so
1914dnl that drivers can add additonal components to LLVM_COMPONENTS.
1915dnl Previously, gallium drivers were updating LLVM_LIBS directly
1916dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
1917dnl this was causing the same libraries to be appear multiple times
1918dnl in LLVM_LIBS.
1919
Tom Stellard7a850c52013-01-25 12:46:55 -05001920if test "x$MESA_LLVM" != x0; then
Tom Stellardcf69a592013-01-18 16:26:12 +00001921
Tom Stellard7a850c52013-01-25 12:46:55 -05001922 LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
Tom Stellardcf69a592013-01-18 16:26:12 +00001923
Tom Stellard7a850c52013-01-25 12:46:55 -05001924 if test "x$with_llvm_shared_libs" = xyes; then
1925 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
1926 LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
1927 AC_CHECK_FILE("$LLVM_LIBDIR/lib$LLVM_SO_NAME.so", llvm_have_one_so=yes,)
1928
1929 if test "x$llvm_have_one_so" = xyes; then
1930 dnl LLVM was built using auto*, so there is only one shared object.
1931 LLVM_LIBS="-l$LLVM_SO_NAME"
1932 else
1933 dnl If LLVM was built with CMake, there will be one shared object per
1934 dnl component.
1935 AC_CHECK_FILE("$LLVM_LIBDIR/libLLVMTarget.so",,
1936 AC_MSG_ERROR([Could not find llvm shared libraries:
Tom Stellardcf69a592013-01-18 16:26:12 +00001937 Please make sure you have built llvm with the --enable-shared option
1938 and that your llvm libraries are installed in $LLVM_LIBDIR
1939 If you have installed your llvm libraries to a different directory you
1940 can use the --with-llvm-prefix= configure flag to specify this directory.
1941 NOTE: Mesa is attempting to use llvm shared libraries because you have
1942 passed one of the following options to configure:
1943 --with-llvm-shared-libs
1944 --enable-opencl
1945 If you do not want to build with llvm shared libraries and instead want to
1946 use llvm static libraries then remove these options from your configure
1947 invocation and reconfigure.]))
1948
Tom Stellard7a850c52013-01-25 12:46:55 -05001949 dnl We don't need to update LLVM_LIBS in this case because the LLVM
1950 dnl install uses a shared object for each compoenent and we have
1951 dnl already added all of these objects to LLVM_LIBS.
1952 fi
Tom Stellardcf69a592013-01-18 16:26:12 +00001953 fi
Tom Stellard69d639b2013-01-18 15:08:28 +00001954fi
1955
Matt Turner2cbb94b2012-09-07 21:04:44 -07001956AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
1957AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
1958AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
1959AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
1960AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
1961AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
1962AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
1963AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
Chia-I Wua1306f42010-01-22 15:51:51 +08001964
Francisco Jereze1364532012-04-25 22:16:00 +02001965if test "x$enable_gallium_loader" = xyes; then
1966 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
1967 GALLIUM_PIPE_LOADER_DEFINES="-DHAVE_PIPE_LOADER_SW"
Matt Turner53c62d32012-09-13 10:10:14 -07001968 GALLIUM_PIPE_LOADER_LIBS="\$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la"
1969 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/null/libws_null.la"
Francisco Jereze1364532012-04-25 22:16:00 +02001970
1971 if test "x$HAVE_WINSYS_XLIB" = xyes; then
1972 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
Matt Turner53c62d32012-09-13 10:10:14 -07001973 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(top_builddir)/src/gallium/winsys/sw/xlib/libws_xlib.la"
Francisco Jereze1364532012-04-25 22:16:00 +02001974 fi
1975
1976 if test "x$enable_gallium_drm_loader" = xyes; then
1977 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
Tom Stellard044de402012-07-17 18:36:06 +00001978 PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
1979 pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
1980 if test "x$pipe_loader_have_xcb" = xyes; then
1981 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB"
1982 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
1983 fi
Francisco Jereze1364532012-04-25 22:16:00 +02001984 fi
1985
1986 AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
1987 AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
1988fi
1989
Tom Stellard26ab7472012-03-03 20:02:05 -05001990dnl Tell Automake which drivers to build
1991for driver in $GALLIUM_DRIVERS_DIRS; do
1992 case "x$driver" in
1993 xgalahad)
1994 HAVE_GALAHAD_GALLIUM=yes;
1995 ;;
Tom Stellard3f3f10f2012-03-03 20:14:00 -05001996 xidentity)
1997 HAVE_IDENTITY_GALLIUM=yes;
1998 ;;
Tom Stellarddc382e52012-03-03 20:35:39 -05001999 xnoop)
2000 HAVE_NOOP_GALLIUM=yes;
2001 ;;
Tom Stellard26ab7472012-03-03 20:02:05 -05002002 *)
2003 GALLIUM_MAKE_DIRS="$GALLIUM_MAKE_DIRS $driver"
2004 ;;
2005 esac
2006done
2007
2008AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes)
Tom Stellard3f3f10f2012-03-03 20:14:00 -05002009AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes)
Tom Stellarddc382e52012-03-03 20:35:39 -05002010AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes)
Tom Stellarda75c6162012-01-06 17:38:37 -05002011AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes)
Tom Stellard91a160b2013-01-25 20:50:31 -05002012AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
Tom Stellardced73ea2012-04-17 09:26:28 -04002013AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
Francisco Jereze1364532012-04-25 22:16:00 +02002014AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
2015AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
Tom Stellardd85e5122012-04-20 14:46:45 -04002016AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
Tom Stellard80d290d2012-08-24 11:48:32 -07002017AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
2018AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
2019
Tom Stellard26ab7472012-03-03 20:02:05 -05002020AC_SUBST([GALLIUM_MAKE_DIRS])
2021
Quentin Glidicc5e93962012-11-28 16:33:47 +01002022AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
2023 "x$enable_xlib_glx" = xyes -o \
2024 "x$enable_osmesa" = xyes)
Eric Anholtf9d15622012-05-24 13:59:21 -07002025AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07002026
Eric Anholte4269492012-06-11 10:25:05 -07002027AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
2028AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
2029AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07002030
Matt Turnercc9f6092013-01-14 16:16:00 -08002031AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
2032
Matt Turner184b2f02012-09-05 17:06:16 -07002033AC_SUBST([VDPAU_MAJOR], 1)
2034AC_SUBST([VDPAU_MINOR], 0)
2035
Matt Turner0b132df2012-09-07 20:47:04 -07002036AC_SUBST([XVMC_MAJOR], 1)
2037AC_SUBST([XVMC_MINOR], 0)
2038
Matt Turnerd53901c2012-09-07 15:24:24 -07002039AC_SUBST([XA_MAJOR], 1)
2040AC_SUBST([XA_MINOR], 0)
2041AC_SUBST([XA_TINY], 0)
2042AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
2043
Chia-I Wu99a37ed2010-01-05 17:39:05 +08002044dnl prepend CORE_DIRS to SRC_DIRS
2045SRC_DIRS="$CORE_DIRS $SRC_DIRS"
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01002046
Dan Nicholsondca1b792007-10-23 09:25:58 -07002047dnl Restore LDFLAGS and CPPFLAGS
2048LDFLAGS="$_SAVE_LDFLAGS"
2049CPPFLAGS="$_SAVE_CPPFLAGS"
2050
Marcin Baczyńskiff2efdf2011-07-13 21:26:49 +02002051dnl Add user CFLAGS and CXXFLAGS
2052CFLAGS="$CFLAGS $USER_CFLAGS"
2053CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
2054
Dan Nicholsondca1b792007-10-23 09:25:58 -07002055dnl Substitute the config
Matt Turnerc8747402012-09-05 20:29:20 -07002056AC_CONFIG_FILES([Makefile
Matt Turner63c3a052012-09-24 14:30:21 -07002057 src/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002058 src/egl/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01002059 src/egl/drivers/Makefile
Eric Anholte5f89542012-02-06 12:12:53 +01002060 src/egl/drivers/dri2/Makefile
2061 src/egl/drivers/glx/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01002062 src/egl/main/Makefile
2063 src/egl/main/egl.pc
Benjamin Franzke8b902052012-01-24 20:38:01 +01002064 src/egl/wayland/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002065 src/egl/wayland/wayland-drm/Makefile
Benjamin Franzke8b902052012-01-24 20:38:01 +01002066 src/egl/wayland/wayland-egl/Makefile
2067 src/egl/wayland/wayland-egl/wayland-egl.pc
Matt Turner383a70b2012-08-22 10:01:42 -07002068 src/gallium/Makefile
Tom Stellard80d290d2012-08-24 11:48:32 -07002069 src/gallium/auxiliary/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002070 src/gallium/auxiliary/pipe-loader/Makefile
2071 src/gallium/drivers/Makefile
Matt Turner7d5496a2012-08-29 10:31:29 -07002072 src/gallium/drivers/i915/Makefile
Matt Turner960cbd82012-08-29 12:04:45 -07002073 src/gallium/drivers/llvmpipe/Makefile
Matt Turner1cf66322012-08-29 12:33:57 -07002074 src/gallium/drivers/nouveau/Makefile
Matt Turner36066772012-08-29 14:02:13 -07002075 src/gallium/drivers/nv30/Makefile
Matt Turner2a283532012-08-29 14:10:28 -07002076 src/gallium/drivers/nv50/Makefile
Matt Turnerc35cddd2012-08-29 14:14:58 -07002077 src/gallium/drivers/nvc0/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002078 src/gallium/drivers/r300/Makefile
2079 src/gallium/drivers/r600/Makefile
Tom Stellard0dcb9ae2012-08-30 12:55:29 -04002080 src/gallium/drivers/radeon/Makefile
Matt Turnerda2d98f2012-08-29 14:29:08 -07002081 src/gallium/drivers/radeonsi/Makefile
Matt Turnerb51cdfa2012-08-29 11:42:45 -07002082 src/gallium/drivers/rbug/Makefile
Matt Turnerf781d4c2012-08-29 12:17:57 -07002083 src/gallium/drivers/softpipe/Makefile
Matt Turner0a421312012-08-29 12:29:47 -07002084 src/gallium/drivers/svga/Makefile
Tom Stellard047fe042012-08-24 11:46:32 -07002085 src/gallium/drivers/trace/Makefile
Matt Turner9b357582012-08-31 15:45:07 -07002086 src/gallium/state_trackers/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002087 src/gallium/state_trackers/clover/Makefile
Matt Turner2ff51cd2012-08-29 20:30:22 -07002088 src/gallium/state_trackers/dri/Makefile
Matt Turnerd9884812012-08-29 20:34:39 -07002089 src/gallium/state_trackers/dri/drm/Makefile
Matt Turnerf4b1f282012-08-29 20:46:02 -07002090 src/gallium/state_trackers/dri/sw/Makefile
Matt Turner8443efd2012-08-31 17:11:35 -07002091 src/gallium/state_trackers/egl/Makefile
Matt Turnerc0b90812012-09-04 11:41:22 -07002092 src/gallium/state_trackers/gbm/Makefile
Matt Turner083dcdf2012-09-04 11:51:36 -07002093 src/gallium/state_trackers/glx/Makefile
Matt Turnerd2ca32e2012-09-04 13:13:51 -07002094 src/gallium/state_trackers/vdpau/Makefile
Matt Turner68c03112012-09-04 13:24:33 -07002095 src/gallium/state_trackers/vega/Makefile
Matt Turner2ad26032012-09-04 15:17:11 -07002096 src/gallium/state_trackers/xa/Makefile
Matt Turner405a9da2012-09-04 20:59:34 -07002097 src/gallium/state_trackers/xorg/Makefile
Matt Turner984562d2012-09-04 21:08:19 -07002098 src/gallium/state_trackers/xvmc/Makefile
Matt Turner9bf0d492012-08-23 15:55:53 -07002099 src/gallium/targets/Makefile
Matt Turner2cd5bf72012-09-04 21:26:39 -07002100 src/gallium/targets/dri-i915/Makefile
Matt Turner6ed9f9f2012-09-05 11:07:30 -07002101 src/gallium/targets/dri-nouveau/Makefile
Matt Turnerb570f1f2012-09-05 11:09:53 -07002102 src/gallium/targets/dri-r300/Makefile
Matt Turnerab07ae02012-09-05 11:12:29 -07002103 src/gallium/targets/dri-r600/Makefile
Matt Turnerdd657292012-09-05 11:14:51 -07002104 src/gallium/targets/dri-radeonsi/Makefile
Matt Turnerb3068d82012-09-05 11:17:33 -07002105 src/gallium/targets/dri-swrast/Makefile
Matt Turnerc14c8012012-09-05 11:19:11 -07002106 src/gallium/targets/dri-vmwgfx/Makefile
Matt Turnercdee0e82012-09-10 11:21:26 -07002107 src/gallium/targets/egl-static/Makefile
Matt Turner53c62d32012-09-13 10:10:14 -07002108 src/gallium/targets/gbm/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002109 src/gallium/targets/opencl/Makefile
Matt Turner45270fb2012-09-13 10:45:01 -07002110 src/gallium/targets/pipe-loader/Makefile
Matt Turner0470fb42012-09-05 15:19:30 -07002111 src/gallium/targets/libgl-xlib/Makefile
Matt Turnerd0df9e82012-09-05 15:55:49 -07002112 src/gallium/targets/vdpau-nouveau/Makefile
Matt Turner7e0d6ff2012-09-05 15:59:54 -07002113 src/gallium/targets/vdpau-r300/Makefile
Matt Turner98c05132012-09-05 16:12:49 -07002114 src/gallium/targets/vdpau-r600/Makefile
Matt Turnere3b21602012-09-05 16:28:35 -07002115 src/gallium/targets/vdpau-radeonsi/Makefile
Matt Turner7f244832012-09-05 16:52:41 -07002116 src/gallium/targets/vdpau-softpipe/Makefile
Matt Turnerd53901c2012-09-07 15:24:24 -07002117 src/gallium/targets/xa-vmwgfx/Makefile
2118 src/gallium/targets/xa-vmwgfx/xatracker.pc
Matt Turner1a434912012-09-06 16:56:06 -07002119 src/gallium/targets/xorg-i915/Makefile
Matt Turnerf984d122012-09-07 13:19:45 -07002120 src/gallium/targets/xorg-nouveau/Makefile
Matt Turnerff5ab732012-09-07 13:23:50 -07002121 src/gallium/targets/xorg-r600/Makefile
Matt Turnerf2bf0cd2012-09-07 13:25:59 -07002122 src/gallium/targets/xorg-radeonsi/Makefile
Matt Turnerb173b162012-09-07 13:50:43 -07002123 src/gallium/targets/xvmc-nouveau/Makefile
Matt Turnerc2371cc2012-09-07 13:53:51 -07002124 src/gallium/targets/xvmc-r300/Makefile
Matt Turner45bf6aa2012-09-07 13:56:04 -07002125 src/gallium/targets/xvmc-r600/Makefile
Matt Turneraf6a2e42012-09-07 14:03:27 -07002126 src/gallium/targets/xvmc-softpipe/Makefile
Andreas Boll59088a22012-11-26 19:58:12 +01002127 src/gallium/tests/trivial/Makefile
Andreas Bollcb4d5022012-11-27 19:18:25 +01002128 src/gallium/tests/unit/Makefile
Matt Turner9bf0d492012-08-23 15:55:53 -07002129 src/gallium/winsys/Makefile
Matt Turner266d6392012-08-29 10:37:07 -07002130 src/gallium/winsys/i915/drm/Makefile
Matt Turner3bfe7c22012-08-29 10:53:46 -07002131 src/gallium/winsys/i915/sw/Makefile
Matt Turner77fc30b2012-08-29 14:39:48 -07002132 src/gallium/winsys/nouveau/drm/Makefile
Tom Stellard34a61502012-08-24 11:44:57 -07002133 src/gallium/winsys/radeon/drm/Makefile
Matt Turner2b5a1c02012-08-29 14:48:25 -07002134 src/gallium/winsys/svga/drm/Makefile
Matt Turnerb4beea62012-08-29 15:09:30 -07002135 src/gallium/winsys/sw/Makefile
Matt Turnera6b3cd12012-08-29 15:24:40 -07002136 src/gallium/winsys/sw/dri/Makefile
Matt Turner5c4ade52012-08-29 15:28:45 -07002137 src/gallium/winsys/sw/fbdev/Makefile
Matt Turner1c9fb3c2012-08-29 15:32:43 -07002138 src/gallium/winsys/sw/null/Makefile
Matt Turner1d0ef532012-08-29 15:44:25 -07002139 src/gallium/winsys/sw/wayland/Makefile
Matt Turner24c2fe92012-08-29 15:46:57 -07002140 src/gallium/winsys/sw/wrapper/Makefile
Matt Turner44653c02012-08-29 15:51:40 -07002141 src/gallium/winsys/sw/xlib/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002142 src/gbm/Makefile
2143 src/gbm/main/gbm.pc
Jon TURNEY68e04cc2012-06-28 23:15:48 +01002144 src/glsl/Makefile
Thierry Reding9948a332012-10-19 14:03:01 +02002145 src/glsl/builtin_compiler/Makefile
Eric Anholt8ffb0982012-02-05 06:10:56 +01002146 src/glx/Makefile
Ian Romanick2e8c8662012-05-23 15:23:22 -07002147 src/glx/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002148 src/gtest/Makefile
Matt Turnera6b8b702012-08-21 14:36:44 -07002149 src/mapi/es1api/Makefile
2150 src/mapi/es1api/glesv1_cm.pc
Matt Turner0f8110c2012-08-21 14:52:59 -07002151 src/mapi/es2api/Makefile
2152 src/mapi/es2api/glesv2.pc
Jon TURNEYb2a37e22012-06-29 18:09:37 +01002153 src/mapi/glapi/Makefile
Eric Anholt3a70f752012-06-11 12:59:21 -07002154 src/mapi/glapi/gen/Makefile
Ian Romanicka29ad2b2012-05-29 11:28:11 -07002155 src/mapi/glapi/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002156 src/mapi/shared-glapi/Makefile
Ian Romanick45d3d0a2012-08-01 14:48:27 -07002157 src/mapi/shared-glapi/tests/Makefile
Matt Turner261719b2012-08-22 16:57:38 -07002158 src/mapi/vgapi/Makefile
2159 src/mapi/vgapi/vg.pc
Eric Anholt417c1a62012-06-12 12:10:58 -07002160 src/mesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002161 src/mesa/gl.pc
Eric Anholtd59149d2012-06-11 10:53:09 -07002162 src/mesa/drivers/Makefile
Matt Turner129213e2012-01-15 11:50:20 -05002163 src/mesa/drivers/dri/dri.pc
Matt Turner80aa7812012-01-26 19:31:12 -05002164 src/mesa/drivers/dri/common/Makefile
Carl Worthb587a752012-12-03 15:43:19 -08002165 src/mesa/drivers/dri/common/xmlpool/Makefile
Matt Turner3c87dfc2012-01-14 21:57:32 -05002166 src/mesa/drivers/dri/i915/Makefile
Eric Anholte3264802012-01-12 14:28:37 -08002167 src/mesa/drivers/dri/i965/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002168 src/mesa/drivers/dri/Makefile
Matt Turner3f964342012-01-15 10:20:30 -05002169 src/mesa/drivers/dri/nouveau/Makefile
Matt Turnerb38d7a02012-01-15 10:04:58 -05002170 src/mesa/drivers/dri/r200/Makefile
Matt Turnere0ee8182012-01-14 22:21:30 -05002171 src/mesa/drivers/dri/radeon/Makefile
Eric Anholt2d4b77c2012-06-12 11:38:19 -07002172 src/mesa/drivers/dri/swrast/Makefile
Laurent Carlier284325d2012-06-24 09:51:27 +02002173 src/mesa/drivers/osmesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002174 src/mesa/drivers/osmesa/osmesa.pc
Eric Anholtfa4cf4d2012-05-15 12:23:00 -07002175 src/mesa/drivers/x11/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002176 src/mesa/libdricore/Makefile
2177 src/mesa/main/tests/Makefile
Eric Anholt35fd61b2012-11-06 23:18:41 -08002178 src/mesa/main/tests/hash_table/Makefile
Eric Anholt90784412012-11-07 16:33:39 -08002179 src/mesa/program/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002180 src/mesa/x86-64/Makefile
2181 src/mesa/x86/Makefile])
Dan Nicholsondca1b792007-10-23 09:25:58 -07002182
Marek Olšák618dbc82011-06-27 03:12:57 +02002183dnl Sort the dirs alphabetically
Marek Olšák3c799622011-09-27 16:51:05 +02002184GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2185GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2186GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Tom Stellard26ab7472012-03-03 20:02:05 -05002187GALLIUM_MAKE_DIRS=`echo $GALLIUM_MAKE_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák3c799622011-09-27 16:51:05 +02002188GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák618dbc82011-06-27 03:12:57 +02002189
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07002190AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08002191
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002192dnl
2193dnl Output some configuration info for the user
2194dnl
2195echo ""
2196echo " prefix: $prefix"
2197echo " exec_prefix: $exec_prefix"
2198echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07002199echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002200
Chia-I Wu815faa42010-10-29 12:34:44 +08002201dnl API info
2202echo ""
2203echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
Chia-I Wu815faa42010-10-29 12:34:44 +08002204echo " OpenVG: $enable_openvg"
2205
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002206dnl Driver info
2207echo ""
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002208if test "x$enable_osmesa" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002209 echo " OSMesa: lib$OSMESA_LIB"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002210else
Chia-I Wu815faa42010-10-29 12:34:44 +08002211 echo " OSMesa: no"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002212fi
2213
2214if test "x$enable_dri" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002215 # cleanup the drivers var
2216 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
2217 if test "x$DRI_DIRS" = x; then
2218 echo " DRI drivers: no"
2219 else
2220 echo " DRI drivers: $dri_dirs"
2221 fi
2222 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08002223fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002224
2225case "x$enable_glx$enable_xlib_glx" in
2226xyesyes)
2227 echo " GLX: Xlib-based"
2228 ;;
2229xyesno)
2230 echo " GLX: DRI-based"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002231 ;;
2232*)
2233 echo " GLX: $enable_glx"
2234 ;;
2235esac
2236
Chia-I Wu815faa42010-10-29 12:34:44 +08002237dnl EGL
2238echo ""
2239echo " EGL: $enable_egl"
2240if test "$enable_egl" = yes; then
2241 echo " EGL platforms: $EGL_PLATFORMS"
Chia-I Wu12300502010-10-31 21:01:54 +08002242
2243 egl_drivers=""
Eric Anholt88612022012-02-05 10:46:13 +01002244 if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then
2245 egl_drivers="$egl_drivers builtin:egl_glx"
2246 fi
2247 if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
2248 egl_drivers="$egl_drivers builtin:egl_dri2"
2249 fi
Chia-I Wu12300502010-10-31 21:01:54 +08002250
Marek Olšák1251e1d2011-06-18 20:33:55 +02002251 if test "x$HAVE_ST_EGL" = xyes; then
Chia-I Wu12300502010-10-31 21:01:54 +08002252 echo " EGL drivers: ${egl_drivers} egl_gallium"
2253 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
Chia-I Wu815faa42010-10-29 12:34:44 +08002254 else
Chia-I Wu12300502010-10-31 21:01:54 +08002255 echo " EGL drivers: $egl_drivers"
Chia-I Wu815faa42010-10-29 12:34:44 +08002256 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +01002257fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002258
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002259echo ""
Eric Anholt1a8b1272010-05-21 12:17:24 -07002260if test "x$MESA_LLVM" = x1; then
Jakob Bornecrantzfe0fe672010-04-28 13:38:58 +01002261 echo " llvm: yes"
2262 echo " llvm-config: $LLVM_CONFIG"
2263 echo " llvm-version: $LLVM_VERSION"
2264else
2265 echo " llvm: no"
2266fi
2267
2268echo ""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002269if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
2270 echo " Gallium: yes"
2271 echo " Gallium dirs: $GALLIUM_DIRS"
Keith Whitwell51bff092010-03-11 14:43:00 +00002272 echo " Target dirs: $GALLIUM_TARGET_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002273 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00002274 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002275 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
2276else
2277 echo " Gallium: no"
2278fi
2279
Daniel Vetter8f15c312011-11-28 22:24:26 +01002280
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002281dnl Libraries
2282echo ""
2283echo " Shared libs: $enable_shared"
2284echo " Static libs: $enable_static"
Matt Turner53248e52012-08-17 11:25:14 -07002285echo " Shared-glapi: $enable_shared_glapi"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002286
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002287dnl Compiler options
2288# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
Matt Turner3ed95dc2012-09-05 20:41:08 -07002289cflags=`echo $CFLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002290 $SED 's/^ *//;s/ */ /;s/ *$//'`
Matt Turner3ed95dc2012-09-05 20:41:08 -07002291cxxflags=`echo $CXXFLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002292 $SED 's/^ *//;s/ */ /;s/ *$//'`
Eric Anholte4269492012-06-11 10:25:05 -07002293defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002294echo ""
2295echo " CFLAGS: $cflags"
2296echo " CXXFLAGS: $cxxflags"
2297echo " Macros: $defines"
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002298echo ""
Marek Olšáka84a8da2012-11-27 22:32:50 +01002299if test "x$MESA_LLVM" = x1; then
2300 echo " LLVM_CFLAGS: $LLVM_CFLAGS"
2301 echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
2302 echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
2303 echo ""
2304fi
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002305echo " PYTHON2: $PYTHON2"
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002306
Dan Nicholsondca1b792007-10-23 09:25:58 -07002307echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07002308echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07002309echo ""