blob: 95cf7eb5c4749891e3d2335fa89df1a2eac7f708 [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
Lauri Kasanen0a828282013-02-22 22:25:58 +020023m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
24 [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
Eric Anholt7fa5c912012-01-12 14:56:56 -080025
Kenneth Graunke4a5d0202012-05-30 21:54:21 -070026m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
27
Johannes Obermayr10a96f42012-09-02 01:35:47 +020028dnl Set internal versions
29OSMESA_VERSION=8
30AC_SUBST([OSMESA_VERSION])
31
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070032dnl Versions for external dependencies
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000033LIBDRM_REQUIRED=2.4.24
Michel Dänzer02a423b2013-02-05 15:12:14 +010034LIBDRM_RADEON_REQUIRED=2.4.42
Eric Anholtf0159012012-07-18 10:18:26 -070035LIBDRM_INTEL_REQUIRED=2.4.38
Ben Skeggs2e47d012011-12-23 14:03:49 +100036LIBDRM_NVVIEUX_REQUIRED=2.4.33
Maarten Lankhorst9ba7eac2012-12-02 12:07:35 +010037LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
Rob Clark6173cc12012-10-27 11:07:34 -050038LIBDRM_FREEDRENO_REQUIRED=2.4.39
Jesse Barnes1e39fc72011-05-05 13:09:16 -070039DRI2PROTO_REQUIRED=2.6
40GLPROTO_REQUIRED=1.4.14
Chris Wilsonfaf1dda2011-03-01 18:39:15 +000041LIBDRM_XORG_REQUIRED=2.4.24
Jakob Bornecrantz683a0992010-03-11 19:23:15 +000042LIBKMS_XORG_REQUIRED=1.0.0
Dan Nicholsoncc77e8f2008-05-05 14:38:22 -070043
Dan Nicholsondca1b792007-10-23 09:25:58 -070044dnl Check for progs
45AC_PROG_CPP
46AC_PROG_CC
Thierry Reding9948a332012-10-19 14:03:01 +020047AX_PROG_CC_FOR_BUILD
Dan Nicholsondca1b792007-10-23 09:25:58 -070048AC_PROG_CXX
Thierry Reding9948a332012-10-19 14:03:01 +020049AX_PROG_CXX_FOR_BUILD
Dylan Noblesmitha3d56732012-04-02 15:35:38 +000050AM_PROG_CC_C_O
Eric Anholtf9d15622012-05-24 13:59:21 -070051AM_PROG_AS
Dan Nicholson297e16c2008-05-05 15:42:53 -070052AC_CHECK_PROGS([MAKE], [gmake make])
Kenneth Graunke3acc8262010-10-25 13:52:58 -070053AC_CHECK_PROGS([PYTHON2], [python2 python])
Andreas Boll410b58c2013-01-18 15:31:57 +010054AX_PYTHON_MODULE([libxml2], [needed])
Matt Turner3a343ef2012-01-11 01:05:56 -050055AC_PROG_SED
Matt Turnerfd827a82012-01-21 22:43:02 -050056AC_PROG_MKDIR_P
Dan Nicholson41b00702007-12-12 08:48:30 -080057
Thierry Reding9948a332012-10-19 14:03:01 +020058LT_PREREQ([2.2])
59LT_INIT([disable-static])
60
Matt Turnerb68b8522012-10-01 13:11:30 -070061AX_PROG_BISON([],
Matt Turner02b6da12013-01-29 11:22:06 -080062 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
Matt Turnerb68b8522012-10-01 13:11:30 -070063 [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
Matt Turner2a710542012-10-01 13:28:51 -070064AX_PROG_FLEX([],
Matt Turner02b6da12013-01-29 11:22:06 -080065 AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"],
Matt Turner2a710542012-10-01 13:28:51 -070066 [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])]))
Brian Paulde1df262011-05-18 07:50:21 -060067
Tom Stellarda75c6162012-01-06 17:38:37 -050068AC_PATH_PROG([PERL], [perl])
69
Kenneth Graunke2224fb62012-05-29 16:03:05 -070070AC_CHECK_PROG(INDENT, indent, indent, cat)
71if test "x$INDENT" != "xcat"; then
Vinson Lee2f358fe2012-12-31 15:19:43 -080072 AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool')
Kenneth Graunke2224fb62012-05-29 16:03:05 -070073fi
74
Dan Nicholsonbc302b22009-05-22 09:39:02 -070075AC_PROG_INSTALL
Dan Nicholsonbc302b22009-05-22 09:39:02 -070076
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070077dnl We need a POSIX shell for parts of the build. Assume we have one
78dnl in most cases.
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070079case "$host_os" in
80solaris*)
81 # Solaris /bin/sh is too old/non-POSIX compliant
82 AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh])
Dan Nicholsonbfb27b52008-06-30 09:40:30 -070083 SHELL="$POSIX_SHELL"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -070084 ;;
85esac
86
nobled2a501872010-08-29 20:03:37 -040087dnl clang is mostly GCC-compatible, but its version is much lower,
88dnl so we have to check for it.
89AC_MSG_CHECKING([if compiling with clang])
90
91AC_COMPILE_IFELSE(
92[AC_LANG_PROGRAM([], [[
93#ifndef __clang__
94 not clang
95#endif
96]])],
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070097[acv_mesa_CLANG=yes], [acv_mesa_CLANG=no])
nobled2a501872010-08-29 20:03:37 -040098
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -070099AC_MSG_RESULT([$acv_mesa_CLANG])
nobled2a501872010-08-29 20:03:37 -0400100
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800101dnl If we're using GCC, make sure that it is at least version 3.3.0. Older
102dnl versions are explictly not supported.
Jeremy Huddlestonb728eef2011-05-05 14:08:57 -0700103if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800104 AC_MSG_CHECKING([whether gcc version is sufficient])
105 major=0
106 minor=0
107
108 GCC_VERSION=`$CC -dumpversion`
109 if test $? -eq 0; then
Tom Stellard79d77b32012-04-20 16:56:46 +0200110 GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1`
111 GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2`
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800112 fi
113
Tom Stellard79d77b32012-04-20 16:56:46 +0200114 if test $GCC_VERSION_MAJOR -lt 3 -o $GCC_VERSION_MAJOR -eq 3 -a $GCC_VERSION_MINOR -lt 3 ; then
Ian Romanick9aa3aa72010-03-03 15:59:37 -0800115 AC_MSG_RESULT([no])
116 AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.])
117 else
118 AC_MSG_RESULT([yes])
119 fi
120fi
121
Dan Nicholson41b00702007-12-12 08:48:30 -0800122dnl Make sure the pkg-config macros are defined
Dan Nicholson356f3112009-04-29 06:49:27 -0700123m4_ifndef([PKG_PROG_PKG_CONFIG],
124 [m4_fatal([Could not locate the pkg-config autoconf macros.
125 These are usually located in /usr/share/aclocal/pkg.m4. If your macros
126 are in a different location, try setting the environment variable
127 ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700128PKG_PROG_PKG_CONFIG()
129
130dnl LIB_DIR - library basename
131LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
Dan Nicholson297e16c2008-05-05 15:42:53 -0700132AC_SUBST([LIB_DIR])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700133
Matt Turnerd12b07e2012-08-14 12:33:32 -0700134dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
Dan Nicholsondca1b792007-10-23 09:25:58 -0700135_SAVE_LDFLAGS="$LDFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700136_SAVE_CPPFLAGS="$CPPFLAGS"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700137
Thierry Reding9948a332012-10-19 14:03:01 +0200138dnl build host compiler macros
139DEFINES_FOR_BUILD=""
140AC_SUBST([DEFINES_FOR_BUILD])
141case "$build_os" in
142linux*|*-gnu*|gnu*)
143 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -D_GNU_SOURCE"
144 ;;
145solaris*)
146 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DSVR4"
147 ;;
148cygwin*)
149 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD"
150 ;;
151esac
152
Dan Nicholsondca1b792007-10-23 09:25:58 -0700153dnl Compiler macros
154DEFINES=""
Dan Nicholson297e16c2008-05-05 15:42:53 -0700155AC_SUBST([DEFINES])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700156case "$host_os" in
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -0700157linux*|*-gnu*|gnu*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700158 DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700159 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700160solaris*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700161 DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -0700162 ;;
Brian Paul97988902010-02-18 12:46:12 -0700163cygwin*)
Matt Turner9a51edf2012-10-11 10:57:26 -0700164 DEFINES="$DEFINES -DHAVE_PTHREAD"
Brian Paul97988902010-02-18 12:46:12 -0700165 ;;
Dan Nicholsondca1b792007-10-23 09:25:58 -0700166esac
167
168dnl Add flags for gcc and g++
169if test "x$GCC" = xyes; then
Vinson Lee53e36d32012-10-11 18:19:49 -0700170 case "$host_os" in
171 cygwin*)
172 CFLAGS="$CFLAGS -Wall -std=gnu99"
173 ;;
174 *)
Thierry Reding9948a332012-10-19 14:03:01 +0200175 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -Wall -std=c99"
Vinson Lee53e36d32012-10-11 18:19:49 -0700176 CFLAGS="$CFLAGS -Wall -std=c99"
177 ;;
178 esac
Eric Anholtb9aab8b2012-01-26 18:48:20 -0800179
180 # Enable -Werror=implicit-function-declaration and
181 # -Werror=missing-prototypes, if available, or otherwise, just
182 # -Wmissing-prototypes. This is particularly useful to avoid
183 # generating a loadable driver module that has undefined symbols.
184 save_CFLAGS="$CFLAGS"
185 AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes])
186 CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
187 CFLAGS="$CFLAGS -Werror=missing-prototypes"
188 AC_LINK_IFELSE([AC_LANG_PROGRAM()],
189 AC_MSG_RESULT([yes]),
190 [CFLAGS="$save_CFLAGS -Wmissing-prototypes";
191 AC_MSG_RESULT([no])]);
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800192
193 # Enable -fvisibility=hidden if using a gcc that supports it
194 save_CFLAGS="$CFLAGS"
Alan Coopersmithf8107a42010-01-21 16:42:58 -0800195 AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100196 VISIBILITY_CFLAGS="-fvisibility=hidden"
197 CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
Alan Coopersmithadda7f32010-01-16 18:34:23 -0800198 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100199 [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
200
201 # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
202 CFLAGS=$save_CFLAGS
Dan Nicholson0c275b62008-01-15 22:52:25 -0800203
204 # Work around aliasing bugs - developers should comment this out
Thierry Reding9948a332012-10-19 14:03:01 +0200205 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-strict-aliasing"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800206 CFLAGS="$CFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100207
208 # gcc's builtin memcmp is slower than glibc's
209 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
Thierry Reding9948a332012-10-19 14:03:01 +0200210 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -fno-builtin-memcmp"
José Fonseca1448bdf2011-10-14 18:28:55 +0100211 CFLAGS="$CFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700212fi
213if test "x$GXX" = xyes; then
Thierry Reding9948a332012-10-19 14:03:01 +0200214 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -Wall"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700215 CXXFLAGS="$CXXFLAGS -Wall"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800216
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400217 # Enable -fvisibility=hidden if using a gcc that supports it
218 save_CXXFLAGS="$CXXFLAGS"
219 AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100220 VISIBILITY_CXXFLAGS="-fvisibility=hidden"
221 CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS"
Jon TURNEY560f7622011-04-26 11:49:01 +0100222 AC_LANG_PUSH([C++])
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400223 AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100224 [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]);
Jon TURNEY560f7622011-04-26 11:49:01 +0100225 AC_LANG_POP([C++])
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100226
227 # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed.
228 CXXFLAGS=$save_CXXFLAGS
Kristian Høgsberg7b34fcc2010-09-08 20:34:07 -0400229
Dan Nicholson0c275b62008-01-15 22:52:25 -0800230 # Work around aliasing bugs - developers should comment this out
Thierry Reding9948a332012-10-19 14:03:01 +0200231 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-strict-aliasing"
Dan Nicholson0c275b62008-01-15 22:52:25 -0800232 CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
José Fonseca1448bdf2011-10-14 18:28:55 +0100233
234 # gcc's builtin memcmp is slower than glibc's
235 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052
Thierry Reding9948a332012-10-19 14:03:01 +0200236 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -fno-builtin-memcmp"
José Fonseca1448bdf2011-10-14 18:28:55 +0100237 CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp"
Dan Nicholsondca1b792007-10-23 09:25:58 -0700238fi
239
Jon TURNEYdb786432011-04-26 11:56:02 +0100240dnl even if the compiler appears to support it, using visibility attributes isn't
241dnl going to do anything useful currently on cygwin apart from emit lots of warnings
242case "$host_os" in
243cygwin*)
244 VISIBILITY_CFLAGS=""
245 VISIBILITY_CXXFLAGS=""
246 ;;
247esac
248
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100249AC_SUBST([VISIBILITY_CFLAGS])
250AC_SUBST([VISIBILITY_CXXFLAGS])
251
Dan Nicholsondca1b792007-10-23 09:25:58 -0700252dnl
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600253dnl Hacks to enable 32 or 64 bit build
254dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700255AC_ARG_ENABLE([32-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600256 [AS_HELP_STRING([--enable-32-bit],
257 [build 32-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700258 [enable_32bit="$enableval"],
259 [enable_32bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600260)
261if test "x$enable_32bit" = xyes; then
262 if test "x$GCC" = xyes; then
263 CFLAGS="$CFLAGS -m32"
Tapani Pällia9cfd952012-05-31 09:32:45 +0300264 CCASFLAGS="$CCASFLAGS -m32"
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600265 fi
266 if test "x$GXX" = xyes; then
267 CXXFLAGS="$CXXFLAGS -m32"
268 fi
269fi
Dan Nicholson297e16c2008-05-05 15:42:53 -0700270AC_ARG_ENABLE([64-bit],
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600271 [AS_HELP_STRING([--enable-64-bit],
272 [build 64-bit libraries @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700273 [enable_64bit="$enableval"],
274 [enable_64bit=auto]
Dan Nicholsonab57cba2007-12-26 11:12:29 -0600275)
276if test "x$enable_64bit" = xyes; then
277 if test "x$GCC" = xyes; then
278 CFLAGS="$CFLAGS -m64"
279 fi
280 if test "x$GXX" = xyes; then
281 CXXFLAGS="$CXXFLAGS -m64"
282 fi
283fi
284
Dan Nicholson88586332007-11-15 08:59:57 -0800285dnl Can't have static and shared libraries, default to static if user
286dnl explicitly requested. If both disabled, set to static since shared
Matt Turner0c178232012-01-14 11:10:06 -0500287dnl was explicitly requested.
Dan Nicholson88586332007-11-15 08:59:57 -0800288case "x$enable_static$enable_shared" in
289xyesyes )
Matt Turner14819eb2012-08-01 08:32:49 -0700290 AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
Dan Nicholson88586332007-11-15 08:59:57 -0800291 enable_shared=no
292 ;;
293xnono )
Matt Turner14819eb2012-08-01 08:32:49 -0700294 AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
Dan Nicholson88586332007-11-15 08:59:57 -0800295 enable_static=yes
296 ;;
297esac
298
Matt Turnerdf4dccc2012-08-22 11:51:31 -0700299AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
300
Dan Nicholson88586332007-11-15 08:59:57 -0800301dnl
Dan Nicholson23656c42007-12-12 09:02:31 -0800302dnl other compiler options
303dnl
Dan Nicholson297e16c2008-05-05 15:42:53 -0700304AC_ARG_ENABLE([debug],
Dan Nicholson23656c42007-12-12 09:02:31 -0800305 [AS_HELP_STRING([--enable-debug],
306 [use debug compiler flags and macros @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700307 [enable_debug="$enableval"],
308 [enable_debug=no]
Dan Nicholson23656c42007-12-12 09:02:31 -0800309)
310if test "x$enable_debug" = xyes; then
Thierry Reding9948a332012-10-19 14:03:01 +0200311 DEFINES_FOR_BUILD="$DEFINES_FOR_BUILD -DDEBUG"
312 if test "x$GCC_FOR_BUILD" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000313 CFLAGS_FOR_BUILD="$CFLAGS_FOR_BUILD -g -O0"
Thierry Reding9948a332012-10-19 14:03:01 +0200314 fi
315 if test "x$GXX_FOR_BUILD" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000316 CXXFLAGS_FOR_BUILD="$CXXFLAGS_FOR_BUILD -g -O0"
Thierry Reding9948a332012-10-19 14:03:01 +0200317 fi
318
Dan Nicholson23656c42007-12-12 09:02:31 -0800319 DEFINES="$DEFINES -DDEBUG"
320 if test "x$GCC" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000321 CFLAGS="$CFLAGS -g -O0"
Dan Nicholson23656c42007-12-12 09:02:31 -0800322 fi
323 if test "x$GXX" = xyes; then
Emil Velikov12234582012-12-12 14:59:36 +0000324 CXXFLAGS="$CXXFLAGS -g -O0"
Dan Nicholson23656c42007-12-12 09:02:31 -0800325 fi
326fi
Dan Nicholson88586332007-11-15 08:59:57 -0800327
328dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -0700329dnl library names
330dnl
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100331LIB_PREFIX_GLOB='lib'
332LIB_VERSION_SEPARATOR='.'
Dan Nicholson88586332007-11-15 08:59:57 -0800333if test "$enable_static" = yes; then
Dan Nicholson8217f242009-02-11 15:16:00 -0800334 LIB_EXTENSION='a'
Dan Nicholson88586332007-11-15 08:59:57 -0800335else
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700336 case "$host_os" in
337 darwin* )
338 LIB_EXTENSION='dylib' ;;
Jon TURNEY7eed6ab2009-06-08 16:02:18 +0100339 cygwin* )
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100340 dnl prefix can be 'cyg' or 'lib'
341 LIB_PREFIX_GLOB='???'
342 LIB_VERSION_SEPARATOR='-'
343 LIB_EXTENSION='dll' ;;
Tom Fogal9282edf2009-10-13 10:55:33 -0700344 aix* )
345 LIB_EXTENSION='a' ;;
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700346 * )
347 LIB_EXTENSION='so' ;;
348 esac
Dan Nicholson88586332007-11-15 08:59:57 -0800349fi
Brad Kingf3cdcb82012-06-05 13:59:58 -0400350AC_ARG_WITH([gl-lib-name],
351 [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
352 [specify GL library name @<:@default=GL@:>@])],
353 [GL_LIB=$withval],
354 [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400355AC_ARG_WITH([osmesa-lib-name],
356 [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
357 [specify OSMesa library name @<:@default=OSMesa@:>@])],
358 [OSMESA_LIB=$withval],
359 [OSMESA_LIB=OSMesa])
360AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
Brad Kingf3cdcb82012-06-05 13:59:58 -0400361AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
Dan Nicholson8217f242009-02-11 15:16:00 -0800362
Marek Olšák848f7d32011-04-01 01:12:41 +0200363dnl
Tom Fogalc0573fb2011-10-10 10:33:18 -0600364dnl Mangled Mesa support
365dnl
366AC_ARG_ENABLE([mangling],
367 [AS_HELP_STRING([--enable-mangling],
368 [enable mangled symbols and library name @<:@default=disabled@:>@])],
369 [enable_mangling="${enableval}"],
370 [enable_mangling=no]
371)
Tom Fogalc0573fb2011-10-10 10:33:18 -0600372if test "x${enable_mangling}" = "xyes" ; then
373 DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400374 GL_LIB="Mangled${GL_LIB}"
Brad Kingf3cdcb82012-06-05 13:59:58 -0400375 OSMESA_LIB="Mangled${OSMESA_LIB}"
Tom Fogalc0573fb2011-10-10 10:33:18 -0600376fi
377AC_SUBST([GL_LIB])
Tom Fogalc0573fb2011-10-10 10:33:18 -0600378AC_SUBST([OSMESA_LIB])
379
380dnl
Marek Olšák848f7d32011-04-01 01:12:41 +0200381dnl potentially-infringing-but-nobody-knows-for-sure stuff
382dnl
383AC_ARG_ENABLE([texture-float],
384 [AS_HELP_STRING([--enable-texture-float],
385 [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])],
386 [enable_texture_float="$enableval"],
387 [enable_texture_float=no]
388)
389if test "x$enable_texture_float" = xyes; then
390 AC_MSG_WARN([Floating-point textures enabled.])
391 AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.])
392 DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED"
393fi
394
Dan Nicholson8217f242009-02-11 15:16:00 -0800395GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800396OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800397EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500398GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
399GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
Chia-I Wu874ccd52010-05-04 22:43:05 +0800400VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800401GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
Dan Nicholson8217f242009-02-11 15:16:00 -0800402
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100403GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Jon TURNEYc55a8a72010-07-24 12:05:34 +0100404EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
405EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
406GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
407GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
408VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800409GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
Dan Nicholson8217f242009-02-11 15:16:00 -0800410
Dan Nicholson297e16c2008-05-05 15:42:53 -0700411AC_SUBST([GL_LIB_NAME])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700412AC_SUBST([OSMESA_LIB_NAME])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800413AC_SUBST([EGL_LIB_NAME])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500414AC_SUBST([GLESv1_CM_LIB_NAME])
415AC_SUBST([GLESv2_LIB_NAME])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800416AC_SUBST([VG_LIB_NAME])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800417AC_SUBST([GLAPI_LIB_NAME])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700418
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700419AC_SUBST([GL_LIB_GLOB])
Chia-I Wud4c1ee02009-12-21 11:13:18 +0800420AC_SUBST([EGL_LIB_GLOB])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500421AC_SUBST([GLESv1_CM_LIB_GLOB])
422AC_SUBST([GLESv2_LIB_GLOB])
Chia-I Wu874ccd52010-05-04 22:43:05 +0800423AC_SUBST([VG_LIB_GLOB])
Chia-I Wu9767d3b2010-12-26 18:02:59 +0800424AC_SUBST([GLAPI_LIB_GLOB])
Siddhartha Chaudhuri1a46c8a2009-02-09 07:58:38 -0700425
Dan Nicholsondca1b792007-10-23 09:25:58 -0700426dnl
Dan Nicholson871125a2008-06-04 13:00:35 -0700427dnl Arch/platform-specific settings
428dnl
429AC_ARG_ENABLE([asm],
430 [AS_HELP_STRING([--disable-asm],
431 [disable assembly usage @<:@default=enabled on supported plaforms@:>@])],
432 [enable_asm="$enableval"],
433 [enable_asm=yes]
434)
435asm_arch=""
Dan Nicholson871125a2008-06-04 13:00:35 -0700436AC_MSG_CHECKING([whether to enable assembly])
437test "x$enable_asm" = xno && AC_MSG_RESULT([no])
438# disable if cross compiling on x86/x86_64 since we must run gen_matypes
439if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then
440 case "$host_cpu" in
441 i?86 | x86_64)
442 enable_asm=no
443 AC_MSG_RESULT([no, cross compiling])
444 ;;
445 esac
446fi
447# check for supported arches
448if test "x$enable_asm" = xyes; then
449 case "$host_cpu" in
450 i?86)
451 case "$host_os" in
Pierre Allegraud8fd8de32011-01-06 07:58:57 -0700452 linux* | *freebsd* | dragonfly* | *netbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700453 test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86
454 ;;
Andreas Boll06fff292013-03-16 13:50:19 +0100455 gnu*)
456 asm_arch=x86
457 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700458 esac
459 ;;
460 x86_64)
461 case "$host_os" in
Pierre Allegraud8fd8de32011-01-06 07:58:57 -0700462 linux* | *freebsd* | dragonfly* | *netbsd*)
Dan Nicholson871125a2008-06-04 13:00:35 -0700463 test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64
464 ;;
465 esac
466 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800467 sparc*)
468 case "$host_os" in
469 linux*)
470 asm_arch=sparc
471 ;;
472 esac
473 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700474 esac
475
476 case "$asm_arch" in
477 x86)
Eric Anholte4269492012-06-11 10:25:05 -0700478 DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM"
Dan Nicholson871125a2008-06-04 13:00:35 -0700479 AC_MSG_RESULT([yes, x86])
480 ;;
481 x86_64)
Eric Anholte4269492012-06-11 10:25:05 -0700482 DEFINES="$DEFINES -DUSE_X86_64_ASM"
Dan Nicholson871125a2008-06-04 13:00:35 -0700483 AC_MSG_RESULT([yes, x86_64])
484 ;;
David S. Miller857ac1e2009-02-26 05:35:15 -0800485 sparc)
Eric Anholte4269492012-06-11 10:25:05 -0700486 DEFINES="$DEFINES -DUSE_SPARC_ASM"
David S. Miller857ac1e2009-02-26 05:35:15 -0800487 AC_MSG_RESULT([yes, sparc])
488 ;;
Dan Nicholson871125a2008-06-04 13:00:35 -0700489 *)
490 AC_MSG_RESULT([no, platform not supported])
491 ;;
492 esac
493fi
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
Vinson Leec403a522013-02-19 00:52:40 -0800503darwin*|mingw*)
Vinson Lee990bd492013-01-26 22:50:05 -0800504 ;;
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])
Benjamin Franzkeeddcecb2011-05-26 15:09:39 +0200592AC_ARG_ENABLE([gbm],
593 [AS_HELP_STRING([--enable-gbm],
594 [enable gbm library @<:@default=auto@:>@])],
595 [enable_gbm="$enableval"],
596 [enable_gbm=auto])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900597
Christian Königc3b22302011-07-04 15:04:41 +0200598AC_ARG_ENABLE([xvmc],
599 [AS_HELP_STRING([--enable-xvmc],
600 [enable xvmc library @<:@default=auto@:>@])],
601 [enable_xvmc="$enableval"],
602 [enable_xvmc=auto])
603AC_ARG_ENABLE([vdpau],
604 [AS_HELP_STRING([--enable-vdpau],
605 [enable vdpau library @<:@default=auto@:>@])],
606 [enable_vdpau="$enableval"],
607 [enable_vdpau=auto])
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200608AC_ARG_ENABLE([opencl],
609 [AS_HELP_STRING([--enable-opencl],
Tom Stellardcf69a592013-01-18 16:26:12 +0000610 [enable OpenCL library NOTE: Enabling this option will also enable
611 --with-llvm-shared-libs
612 @<:@default=no@:>@])],
Quentin Glidic1e857132013-01-25 15:02:04 +0100613 [],
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200614 [enable_opencl=no])
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900615AC_ARG_ENABLE([xlib_glx],
616 [AS_HELP_STRING([--enable-xlib-glx],
Matt Turner32e8ce62012-08-17 14:05:56 -0700617 [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900618 [enable_xlib_glx="$enableval"],
Matt Turner32e8ce62012-08-17 14:05:56 -0700619 [enable_xlib_glx=no])
Marek Olšák1251e1d2011-06-18 20:33:55 +0200620AC_ARG_ENABLE([gallium_egl],
621 [AS_HELP_STRING([--enable-gallium-egl],
622 [enable optional EGL state tracker (not required
623 for EGL support in Gallium with OpenGL and OpenGL ES)
624 @<:@default=disable@:>@])],
625 [enable_gallium_egl="$enableval"],
626 [enable_gallium_egl=no])
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200627AC_ARG_ENABLE([gallium_gbm],
628 [AS_HELP_STRING([--enable-gallium-gbm],
629 [enable optional gbm state tracker (not required for
630 gbm support in Gallium)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200631 @<:@default=auto@:>@])],
Benjamin Franzke48d4a002011-05-26 15:11:50 +0200632 [enable_gallium_gbm="$enableval"],
Benjamin Franzkeb18b2992011-07-02 13:45:14 +0200633 [enable_gallium_gbm=auto])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800634
Tom Stellardced73ea2012-04-17 09:26:28 -0400635AC_ARG_ENABLE([r600-llvm-compiler],
Homer Hsing40507562012-05-15 18:56:17 -0400636 [AS_HELP_STRING([--enable-r600-llvm-compiler],
637 [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])],
Tom Stellardced73ea2012-04-17 09:26:28 -0400638 [enable_r600_llvm="$enableval"],
639 [enable_r600_llvm=no])
640
Francisco Jerez66f7fd92012-04-25 22:16:26 +0200641AC_ARG_ENABLE([gallium_tests],
642 [AS_HELP_STRING([--enable-gallium-tests],
643 [Enable optional Gallium tests) @<:@default=disable@:>@])],
644 [enable_gallium_tests="$enableval"],
645 [enable_gallium_tests=no])
646
Marek Olšák58b6a192011-06-14 07:46:59 +0200647# Option for Gallium drivers
Damien Lespiau164a04e2013-01-14 13:54:57 +0000648
649# Keep this in sync with the --with-gallium-drivers help string default value
Thomas Hellstrom87118d82012-01-12 12:10:53 +0100650GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
Marek Olšák58b6a192011-06-14 07:46:59 +0200651
652AC_ARG_WITH([gallium-drivers],
653 [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
654 [comma delimited Gallium drivers list, e.g.
Rob Clark6173cc12012-10-27 11:07:34 -0500655 "i915,nouveau,r300,r600,radeonsi,freedreno,svga,swrast"
Damien Lespiau164a04e2013-01-14 13:54:57 +0000656 @<:@default=r300,r600,svga,swrast@:>@])],
Marek Olšák58b6a192011-06-14 07:46:59 +0200657 [with_gallium_drivers="$withval"],
658 [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
Chia-I Wu156e9552010-10-30 14:26:01 +0800659
Ian Romanickdb311b42011-06-22 11:35:27 -0700660# Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it
661# here so that the script doesn't choke on an unknown driver name later.
662case "$with_gallium_drivers" in
663 yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;;
664 no) with_gallium_drivers='' ;;
665esac
666
Chia-I Wube5f34a2010-10-27 16:14:27 +0800667if test "x$enable_opengl" = xno -a \
668 "x$enable_gles1" = xno -a \
669 "x$enable_gles2" = xno -a \
Marek Olšák440d71d2011-06-14 05:38:58 +0200670 "x$enable_openvg" = xno -a \
671 "x$enable_xorg" = xno -a \
Thomas Hellstrom424b1212011-07-04 10:21:35 +0200672 "x$enable_xa" = xno -a \
Christian Königc3b22302011-07-04 15:04:41 +0200673 "x$enable_xvmc" = xno -a \
674 "x$enable_vdpau" = xno -a \
Francisco Jerezc6db1b32012-04-20 16:56:19 +0200675 "x$enable_opencl" = xno; then
Chia-I Wube5f34a2010-10-27 16:14:27 +0800676 AC_MSG_ERROR([at least one API should be enabled])
677fi
678
679API_DEFINES=""
Chia-I Wube5f34a2010-10-27 16:14:27 +0800680if test "x$enable_opengl" = xno; then
681 API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
682else
683 API_DEFINES="$API_DEFINES -DFEATURE_GL=1"
684fi
685if test "x$enable_gles1" = xyes; then
686 API_DEFINES="$API_DEFINES -DFEATURE_ES1=1"
687fi
688if test "x$enable_gles2" = xyes; then
689 API_DEFINES="$API_DEFINES -DFEATURE_ES2=1"
690fi
Chia-I Wube5f34a2010-10-27 16:14:27 +0800691AC_SUBST([API_DEFINES])
Chia-I Wube5f34a2010-10-27 16:14:27 +0800692
Matt Turner691c3042013-01-18 23:43:05 -0800693AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
694AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
695AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
696AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
697 "x$enable_gles1" = xyes -o \
698 "x$enable_gles2" = xyes)
699
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800700if test "x$enable_glx" = xno; then
Matt Turner32e8ce62012-08-17 14:05:56 -0700701 AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
Kenneth Graunke9d21b5d2012-01-04 23:49:18 -0800702 enable_xlib_glx=no
703fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900704
Matt Turner32e8ce62012-08-17 14:05:56 -0700705if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
706 AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
707fi
708
Michel Dänzer3b888f52013-01-31 11:47:55 +0100709if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
710 AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
711fi
712
713# Disable GLX if OpenGL is not enabled
714if test "x$enable_glx$enable_opengl" = xyesno; then
715 AC_MSG_WARN([OpenGL not enabled, disabling GLX])
716 enable_glx=no
717fi
718
Matt Turner32e8ce62012-08-17 14:05:56 -0700719# Disable GLX if DRI and Xlib-GLX are not enabled
720if test "x$enable_glx" = xyes -a \
721 "x$enable_dri" = xno -a \
722 "x$enable_xlib_glx" = xno; then
723 AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
724 enable_glx=no
725fi
726
Matt Turner00f3d9b2012-08-21 22:06:17 -0700727AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
Matt Turner8cdce6c2012-08-21 22:26:52 -0700728AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
729 "x$enable_osmesa" = xyes)
Matt Turner06ad64a2012-01-15 21:30:26 -0500730
Matt Turner8c9b78a2012-08-17 14:22:47 -0700731AC_ARG_ENABLE([shared-glapi],
732 [AS_HELP_STRING([--enable-shared-glapi],
733 [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
734 [enable_shared_glapi="$enableval"],
735 [enable_shared_glapi="$enable_dri"])
736
737# Shared GLAPI is only useful for DRI
738if test "x$enable_dri" = xno; then
739 AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
740 enable_shared_glapi=no
741fi
742
Matt Turner8c9b78a2012-08-17 14:22:47 -0700743if test "x$enable_shared_glapi" = xyes; then
Matt Turner8c9b78a2012-08-17 14:22:47 -0700744 # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
745 # the remap table)
746 DEFINES="$DEFINES -DIN_DRI_DRIVER"
Matt Turner8c9b78a2012-08-17 14:22:47 -0700747fi
Matt Turner8c9b78a2012-08-17 14:22:47 -0700748AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
749
Dan Nicholson44d99142007-12-05 18:47:01 -0800750dnl
751dnl Driver specific build directories
Dan Nicholsondca1b792007-10-23 09:25:58 -0700752dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100753GALLIUM_DIRS="auxiliary drivers state_trackers"
Keith Whitwell51bff092010-03-11 14:43:00 +0000754GALLIUM_TARGET_DIRS=""
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000755GALLIUM_WINSYS_DIRS="sw"
Kai Wasserbäch0a22fb62011-11-29 22:36:02 +0100756GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100757GALLIUM_STATE_TRACKERS_DIRS=""
758
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900759case "x$enable_glx$enable_xlib_glx" in
760xyesyes)
761 DRIVER_DIRS="$DRIVER_DIRS x11"
Jakob Bornecrantzc9f98672010-03-16 13:54:18 +0000762 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
Keith Whitwell51bff092010-03-11 14:43:00 +0000763 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib"
Marek Olšák440d71d2011-06-14 05:38:58 +0200764 GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS"
Younes Mantonb97816d2011-07-14 12:22:20 -0400765 HAVE_WINSYS_XLIB="yes"
Dan Nicholson44d99142007-12-05 18:47:01 -0800766 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900767xyesno)
768 # DRI-based GLX
Kristian Høgsberg6e8897f2010-02-09 09:58:36 -0500769 SRC_DIRS="$SRC_DIRS glx"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900770 ;;
771esac
772
773if test "x$enable_dri" = xyes; then
774 DRIVER_DIRS="$DRIVER_DIRS dri"
775
Emil Velikov4ef9c3d2011-07-11 15:58:29 +0100776 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri"
Marek Olšák440d71d2011-06-14 05:38:58 +0200777 GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS"
778 HAVE_ST_DRI="yes"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900779fi
780
781if test "x$enable_osmesa" = xyes; then
Eric Anholt2d51ac82012-06-12 12:51:32 -0700782 DRIVER_DIRS="$DRIVER_DIRS osmesa"
Brian Paul79eac7d2013-03-11 18:31:21 -0600783 GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS"
784 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900785fi
786
Dan Nicholson297e16c2008-05-05 15:42:53 -0700787AC_SUBST([SRC_DIRS])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700788AC_SUBST([DRIVER_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100789AC_SUBST([GALLIUM_DIRS])
Keith Whitwell51bff092010-03-11 14:43:00 +0000790AC_SUBST([GALLIUM_TARGET_DIRS])
Jerome Glisse14f79d42008-12-18 13:36:07 +0100791AC_SUBST([GALLIUM_WINSYS_DIRS])
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +0000792AC_SUBST([GALLIUM_DRIVERS_DIRS])
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +0100793AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS])
Dave Airlie81fe1982010-04-22 14:59:29 +1000794AC_SUBST([MESA_LLVM])
Dan Nicholsondca1b792007-10-23 09:25:58 -0700795
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900796# Check for libdrm
797PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
798 [have_libdrm=yes], [have_libdrm=no])
799
800if test "x$enable_dri" = xyes; then
801 # DRI must be shared, I think
802 if test "$enable_static" = yes; then
Matt Turner14819eb2012-08-01 08:32:49 -0700803 AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900804 fi
805
Chia-I Wu81239342011-07-02 09:49:17 +0900806 # not a hard requirement as swrast does not depend on it
807 if test "x$have_libdrm" = xyes; then
808 DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900809 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900810fi
811
Samuel Thibault75856172011-03-14 22:08:21 +0000812dnl Direct rendering or just indirect rendering
noblede7d18ed2011-03-14 22:08:22 +0000813case "$host_os" in
814gnu*)
815 dnl Disable by default on GNU/Hurd
816 driglx_direct_default="no"
817 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +0000818cygwin*)
819 dnl Disable by default on cygwin
820 driglx_direct_default="no"
821 ;;
noblede7d18ed2011-03-14 22:08:22 +0000822*)
823 driglx_direct_default="yes"
824 ;;
825esac
Samuel Thibault75856172011-03-14 22:08:21 +0000826AC_ARG_ENABLE([driglx-direct],
827 [AS_HELP_STRING([--disable-driglx-direct],
Andreas Boll5ecbc3a2012-11-10 17:58:49 +0100828 [disable direct rendering in GLX and EGL for DRI \
noblede7d18ed2011-03-14 22:08:22 +0000829 @<:@default=auto@:>@])],
Samuel Thibault75856172011-03-14 22:08:21 +0000830 [driglx_direct="$enableval"],
noblede7d18ed2011-03-14 22:08:22 +0000831 [driglx_direct="$driglx_direct_default"])
Samuel Thibault75856172011-03-14 22:08:21 +0000832
Dan Nicholson44d99142007-12-05 18:47:01 -0800833dnl
834dnl libGL configuration per driver
835dnl
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900836case "x$enable_glx$enable_xlib_glx" in
837xyesyes)
838 # Xlib-based GLX
Matt Turnere273ed32012-08-14 12:24:31 -0700839 PKG_CHECK_MODULES([XLIBGL], [x11 xext])
840 GL_PC_REQ_PRIV="x11 xext"
841 X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
842 GL_LIB_DEPS="$XLIBGL_LIBS"
Matt Turnerb6651ae2012-09-18 21:51:25 -0700843 GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
844 GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800845 ;;
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900846xyesno)
847 # DRI-based GLX
Jesse Barnesf2f83d92010-01-11 17:28:10 -0500848 PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
Samuel Thibault75856172011-03-14 22:08:21 +0000849 if test x"$driglx_direct" = xyes; then
Chia-I Wu94ec5fd2011-06-27 09:19:02 +0900850 if test "x$have_libdrm" != xyes; then
851 AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
852 fi
Samuel Thibault75856172011-03-14 22:08:21 +0000853 PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
Matt Turneraf6aeae2012-09-11 17:08:17 -0700854 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
Samuel Thibault75856172011-03-14 22:08:21 +0000855 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800856
857 # find the DRI deps for libGL
Eric Anholtbb01f672012-09-25 08:43:44 -0700858 dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1 xcb-dri2 >= 1.8"
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100859
Matt Turnere273ed32012-08-14 12:24:31 -0700860 # add xf86vidmode if available
861 PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no)
862 if test "$HAVE_XF86VIDMODE" = yes ; then
863 dri_modules="$dri_modules xxf86vm"
Dan Nicholson44d99142007-12-05 18:47:01 -0800864 fi
865
Matt Turnere273ed32012-08-14 12:24:31 -0700866 PKG_CHECK_MODULES([DRIGL], [$dri_modules])
867 GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules"
868 X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
869 GL_LIB_DEPS="$DRIGL_LIBS"
870
Matt Turnerb6651ae2012-09-18 21:51:25 -0700871 # need DRM libs, $PTHREAD_LIBS, etc.
872 GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
873 GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
Dan Nicholson979ff512007-12-05 18:47:01 -0800874 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -0800875esac
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900876
Ian Romanick4becf672012-01-03 11:35:59 -0800877# This is outside the case (above) so that it is invoked even for non-GLX
878# builds.
Eric Anholt8ffb0982012-02-05 06:10:56 +0100879AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
Ian Romanick4becf672012-01-03 11:35:59 -0800880
Matt Turnerb6651ae2012-09-18 21:51:25 -0700881GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
882GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
883GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
884GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900885
Robert Braggdda49c32012-09-19 16:12:08 +0100886AC_SUBST([X11_INCLUDES])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700887AC_SUBST([GL_LIB_DEPS])
Dan Nicholson71e208b2008-11-24 11:01:57 -0800888AC_SUBST([GL_PC_REQ_PRIV])
889AC_SUBST([GL_PC_LIB_PRIV])
890AC_SUBST([GL_PC_CFLAGS])
891AC_SUBST([DRI_PC_REQ_PRIV])
Li Pengc33c1912010-07-30 12:26:15 +0800892AC_SUBST([GLESv1_CM_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400893AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
Kristian Høgsberg9339c122010-03-05 19:01:43 -0500894AC_SUBST([GLESv2_LIB_DEPS])
Kristian Høgsberg9e4f2da2010-05-04 14:13:11 -0400895AC_SUBST([GLESv2_PC_LIB_PRIV])
896
Matt Turnerbee2edb2012-08-17 16:24:32 -0700897DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
Christopher James Halse Rogersd1e28b22011-02-03 11:19:32 +1100898
Jon TURNEY2b9dac32010-04-21 12:58:54 +0100899AC_SUBST([HAVE_XF86VIDMODE])
900
Dan Nicholsondca1b792007-10-23 09:25:58 -0700901dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900902dnl More GLX setup
Dan Nicholsondca1b792007-10-23 09:25:58 -0700903dnl
Chia-I Wu5029ea42011-06-27 13:06:39 +0900904case "x$enable_glx$enable_xlib_glx" in
905xyesyes)
Dan Nicholsondca1b792007-10-23 09:25:58 -0700906 DEFINES="$DEFINES -DUSE_XSHM"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900907 ;;
908xyesno)
909 DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING"
910 if test "x$driglx_direct" = xyes; then
911 DEFINES="$DEFINES -DGLX_DIRECT_RENDERING"
912 fi
913 ;;
914esac
Dan Nicholsondca1b792007-10-23 09:25:58 -0700915
916dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700917dnl TLS detection
Dan Nicholson44d99142007-12-05 18:47:01 -0800918dnl
Tom Fogal31351dc2010-12-05 17:58:32 -0700919
Dan Nicholson297e16c2008-05-05 15:42:53 -0700920AC_ARG_ENABLE([glx-tls],
Dan Nicholson44d99142007-12-05 18:47:01 -0800921 [AS_HELP_STRING([--enable-glx-tls],
Dan Nicholson79ad4582007-12-07 19:11:01 -0800922 [enable TLS support in GLX @<:@default=disabled@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700923 [GLX_USE_TLS="$enableval"],
924 [GLX_USE_TLS=no])
Tom Fogal31351dc2010-12-05 17:58:32 -0700925AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
926
Matt Turner814345f2012-09-18 22:09:26 -0700927AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
Matt Turner9a51edf2012-10-11 10:57:26 -0700928 [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
Tom Fogal44842972011-02-21 22:32:18 -0700929
Tom Fogal31351dc2010-12-05 17:58:32 -0700930dnl
931dnl More DRI setup
932dnl
Dan Nicholson44d99142007-12-05 18:47:01 -0800933dnl Directory for DRI drivers
Dan Nicholson297e16c2008-05-05 15:42:53 -0700934AC_ARG_WITH([dri-driverdir],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800935 [AS_HELP_STRING([--with-dri-driverdir=DIR],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700936 [directory for the DRI drivers @<:@${libdir}/dri@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700937 [DRI_DRIVER_INSTALL_DIR="$withval"],
Dan Nicholson5dbbde52008-05-06 06:21:41 -0700938 [DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
Dan Nicholson297e16c2008-05-05 15:42:53 -0700939AC_SUBST([DRI_DRIVER_INSTALL_DIR])
Chow Loong Jin35506de2009-10-28 14:34:14 +0800940dnl Extra search path for DRI drivers
941AC_ARG_WITH([dri-searchpath],
942 [AS_HELP_STRING([--with-dri-searchpath=DIRS...],
943 [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
944 [DRI_DRIVER_SEARCH_DIR="$withval"],
945 [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
946AC_SUBST([DRI_DRIVER_SEARCH_DIR])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800947dnl Which drivers to build - default is chosen by platform
Dan Nicholson297e16c2008-05-05 15:42:53 -0700948AC_ARG_WITH([dri-drivers],
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800949 [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@],
Dan Nicholson5cae1b72008-06-30 10:28:02 -0700950 [comma delimited DRI drivers list, e.g.
Michel Dänzercade0712009-07-10 14:49:46 +0200951 "swrast,i965,radeon" @<:@default=auto@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -0700952 [with_dri_drivers="$withval"],
953 [with_dri_drivers=yes])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800954if test "x$with_dri_drivers" = x; then
955 with_dri_drivers=no
956fi
957
958dnl If $with_dri_drivers is yes, directories will be added through
959dnl platform checks
960DRI_DIRS=""
961case "$with_dri_drivers" in
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100962no) ;;
963yes)
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900964 # classic DRI drivers require FEATURE_GL to build
965 if test "x$enable_opengl" = xyes; then
966 DRI_DIRS="yes"
967 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100968 ;;
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800969*)
970 # verify the requested driver directories exist
Dan Nicholsone6e4f252008-07-06 14:17:39 -0700971 dri_drivers=`IFS=', '; echo $with_dri_drivers`
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800972 for driver in $dri_drivers; do
973 test -d "$srcdir/src/mesa/drivers/dri/$driver" || \
Matt Turner14819eb2012-08-01 08:32:49 -0700974 AC_MSG_ERROR([DRI driver directory '$driver' does not exist])
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800975 done
976 DRI_DIRS="$dri_drivers"
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900977 if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then
978 AC_MSG_ERROR([--with-dri-drivers requires OpenGL])
979 fi
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800980 ;;
981esac
982
Dan Nicholson44d99142007-12-05 18:47:01 -0800983dnl Set DRI_DIRS, DEFINES and LIB_DEPS
Chia-I Wu9e7a4142011-06-26 13:24:32 +0900984if test "x$enable_dri" = xyes; then
Dan Nicholson44d99142007-12-05 18:47:01 -0800985 # Platform specific settings and drivers to build
986 case "$host_os" in
987 linux*)
988 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Chia-I Wu5029ea42011-06-27 13:06:39 +0900989 DEFINES="$DEFINES -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -0800990
991 case "$host_cpu" in
Dan Nicholson44d99142007-12-05 18:47:01 -0800992 x86_64)
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100993 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -0700994 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -0800995 fi
Dan Nicholson44d99142007-12-05 18:47:01 -0800996 ;;
997 powerpc*)
Dan Nicholsona76e2452007-12-07 11:25:08 -0800998 # Build only the drivers for cards that exist on PowerPC.
Florent Thoumieb5095ab2008-07-28 14:44:43 +0100999 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001000 DRI_DIRS="r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001001 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001002 ;;
Dave Airlie2b0e75e2008-06-12 12:06:50 +10001003 sparc*)
Ian Romanicke4344162011-08-24 15:21:58 -07001004 # Build only the drivers for cards that exist on sparc
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001005 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001006 DRI_DIRS="r200 radeon swrast"
Dave Airlie2b0e75e2008-06-12 12:06:50 +10001007 fi
1008 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -08001009 esac
1010 ;;
Pierre Allegraud8fd8de32011-01-06 07:58:57 -07001011 freebsd* | dragonfly* | *netbsd*)
Matt Turner9a51edf2012-10-11 10:57:26 -07001012 DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
Dan Nicholson44d99142007-12-05 18:47:01 -08001013 DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001014
Florent Thoumieb5095ab2008-07-28 14:44:43 +01001015 if test "x$DRI_DIRS" = "xyes"; then
Eric Anholt2f4c7eb2011-10-20 14:55:53 -07001016 DRI_DIRS="i915 i965 nouveau r200 radeon swrast"
Dan Nicholsonaf3d2f22007-11-15 08:59:57 -08001017 fi
Dan Nicholson44d99142007-12-05 18:47:01 -08001018 ;;
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -07001019 gnu*)
1020 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Chia-I Wu5029ea42011-06-27 13:06:39 +09001021 DEFINES="$DEFINES -DHAVE_ALIAS"
Samuel Thibaultd18dd6a2009-04-23 05:43:22 -07001022 ;;
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001023 solaris*)
1024 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001025 ;;
Jon TURNEYc6e33ca2011-03-14 22:08:23 +00001026 cygwin*)
1027 DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER"
Jon TURNEYc6e33ca2011-03-14 22:08:23 +00001028 if test "x$DRI_DIRS" = "xyes"; then
1029 DRI_DIRS="swrast"
1030 fi
1031 ;;
Dan Nicholson44d99142007-12-05 18:47:01 -08001032 esac
Dan Nicholson112a40e2008-02-21 10:17:19 -08001033
1034 # default drivers
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="i915 i965 nouveau r200 radeon swrast"
Dan Nicholson112a40e2008-02-21 10:17:19 -08001037 fi
1038
Dan Nicholson44d99142007-12-05 18:47:01 -08001039 DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'`
1040
1041 # Check for expat
Matt Turner7de78ce52013-03-05 10:27:22 -08001042 EXPAT_INCLUDES=""
1043 EXPAT_LIB=-lexpat
1044 AC_ARG_WITH([expat],
1045 [AS_HELP_STRING([--with-expat=DIR],
1046 [expat install directory])],[
1047 EXPAT_INCLUDES="-I$withval/include"
1048 CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES"
1049 LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR"
1050 EXPAT_LIB="-L$withval/$LIB_DIR -lexpat"
1051 ])
1052 AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])])
1053 save_LIBS="$LIBS"
1054 AC_CHECK_LIB([expat],[XML_ParserCreate],[],
1055 [AC_MSG_ERROR([Expat required for DRI.])])
1056 LIBS="$save_LIBS"
Dan Nicholson44d99142007-12-05 18:47:01 -08001057
Matt Turner07f2dee2013-03-05 10:25:55 -08001058 # If we are building any DRI driver other than swrast.
Matt Turner7de78ce52013-03-05 10:27:22 -08001059 if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then
Jon TURNEYffc84942012-02-02 10:39:04 +00001060 # ... libdrm is required
Chia-I Wu81239342011-07-02 09:49:17 +09001061 if test "x$have_libdrm" != xyes; then
1062 AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED])
1063 fi
Jon TURNEYffc84942012-02-02 10:39:04 +00001064 # ... and build dricommon
1065 HAVE_COMMON_DRI=yes
Chia-I Wu81239342011-07-02 09:49:17 +09001066 fi
1067
Matt Turner2b3a8cb2012-01-13 14:30:36 -05001068 # put all the necessary libs together
Matt Turnerb6651ae2012-09-18 21:51:25 -07001069 DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
Dave Airlieec835352012-12-04 09:25:13 +10001070 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 -08001071fi
Matt Turner523c0152012-09-20 15:08:02 -07001072AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
Dan Nicholson297e16c2008-05-05 15:42:53 -07001073AC_SUBST([DRI_DIRS])
1074AC_SUBST([EXPAT_INCLUDES])
1075AC_SUBST([DRI_LIB_DEPS])
Jon TURNEYdefadf22012-07-08 12:19:24 +01001076AC_SUBST([GALLIUM_DRI_LIB_DEPS])
Dan Nicholson44d99142007-12-05 18:47:01 -08001077
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001078case $DRI_DIRS in
1079*i915*|*i965*)
Tormod Volden903185b2011-01-25 13:25:18 -08001080 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Eric Anholte3264802012-01-12 14:28:37 -08001081
Matt Turner3c87dfc2012-01-14 21:57:32 -05001082 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1083 case $d in
1084 i915)
1085 HAVE_I915_DRI=yes;
1086 ;;
1087 i965)
1088 HAVE_I965_DRI=yes;
1089 ;;
1090 esac
1091 done
Eric Anholte3264802012-01-12 14:28:37 -08001092
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001093 ;;
Kristian Høgsberg27fe7a72010-01-07 10:29:29 -05001094esac
Kristian Høgsberg8616cec2010-01-01 17:03:33 -05001095
Matt Turnere0ee8182012-01-14 22:21:30 -05001096case $DRI_DIRS in
Matt Turner3f964342012-01-15 10:20:30 -05001097*nouveau*)
Ben Skeggs2e47d012011-12-23 14:03:49 +10001098 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED])
Matt Turner3f964342012-01-15 10:20:30 -05001099 HAVE_NOUVEAU_DRI=yes;
1100 ;;
1101esac
1102
1103case $DRI_DIRS in
Matt Turnerb38d7a02012-01-15 10:04:58 -05001104*radeon*|*r200*)
Matt Turnere0ee8182012-01-14 22:21:30 -05001105 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1106
1107 for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do
1108 case $d in
1109 radeon)
1110 HAVE_RADEON_DRI=yes;
1111 ;;
Matt Turnerb38d7a02012-01-15 10:04:58 -05001112 r200)
1113 HAVE_R200_DRI=yes;
1114 ;;
Matt Turnere0ee8182012-01-14 22:21:30 -05001115 esac
1116 done
1117
1118 ;;
1119esac
1120
Matt Turner349845f2012-01-15 11:39:48 -05001121case $DRI_DIRS in
1122*swrast*)
1123 HAVE_SWRAST_DRI=yes;
1124 ;;
1125esac
1126
Dan Nicholson44d99142007-12-05 18:47:01 -08001127dnl
Dan Nicholsondca1b792007-10-23 09:25:58 -07001128dnl OSMesa configuration
1129dnl
Dan Nicholson979ff512007-12-05 18:47:01 -08001130
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001131dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...)
Dan Nicholson297e16c2008-05-05 15:42:53 -07001132AC_ARG_WITH([osmesa-bits],
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001133 [AS_HELP_STRING([--with-osmesa-bits=BITS],
1134 [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])],
Dan Nicholson297e16c2008-05-05 15:42:53 -07001135 [osmesa_bits="$withval"],
1136 [osmesa_bits=8])
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001137if test "x$osmesa_bits" != x8; then
1138 if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then
1139 AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver])
1140 osmesa_bits=8
1141 fi
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001142fi
1143case "x$osmesa_bits" in
1144x8)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001145 OSMESA_LIB="${OSMESA_LIB}"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001146 ;;
1147x16|x32)
Tom Fogalc0573fb2011-10-10 10:33:18 -06001148 OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001149 DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
1150 ;;
1151*)
1152 AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
1153 ;;
1154esac
Dan Nicholson6689f9e2007-12-05 21:04:15 -08001155
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001156if test "x$enable_osmesa" = xyes; then
Alan Coopersmithe1f9adc2008-06-20 17:58:53 -07001157 # only link libraries with osmesa if shared
Dan Nicholson88586332007-11-15 08:59:57 -08001158 if test "$enable_static" = no; then
Matt Turnerb6651ae2012-09-18 21:51:25 -07001159 OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
Dan Nicholson88586332007-11-15 08:59:57 -08001160 else
1161 OSMESA_LIB_DEPS=""
1162 fi
Matt Turner7ef94c62012-01-31 21:34:42 -05001163 OSMESA_MESA_DEPS=""
Matt Turnerb6651ae2012-09-18 21:51:25 -07001164 OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001165fi
Laurent Carlier284325d2012-06-24 09:51:27 +02001166
Dan Nicholson297e16c2008-05-05 15:42:53 -07001167AC_SUBST([OSMESA_LIB_DEPS])
Matt Turner7ef94c62012-01-31 21:34:42 -05001168AC_SUBST([OSMESA_MESA_DEPS])
1169AC_SUBST([OSMESA_PC_REQ])
Dan Nicholson8be02fc2008-12-14 09:35:29 -08001170AC_SUBST([OSMESA_PC_LIB_PRIV])
Dan Nicholsondca1b792007-10-23 09:25:58 -07001171
1172dnl
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001173dnl gbm configuration
1174dnl
1175if test "x$enable_gbm" = xauto; then
1176 case "$with_egl_platforms" in
1177 *drm*)
1178 enable_gbm=yes ;;
1179 *)
1180 enable_gbm=no ;;
1181 esac
1182fi
1183if test "x$enable_gbm" = xyes; then
1184 SRC_DIRS="$SRC_DIRS gbm"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001185
1186 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
1187 AC_MSG_ERROR([gbm needs udev]))
Matt Turner027ce0c2012-01-24 11:34:42 -05001188
1189 if test "x$enable_dri" = xyes; then
1190 GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
Matt Turner8c9b78a2012-08-17 14:22:47 -07001191 if test "x$enable_shared_glapi" = xno; then
Matt Turner027ce0c2012-01-24 11:34:42 -05001192 AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
1193 fi
1194 fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001195fi
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001196GBM_PC_REQ_PRIV="libudev"
1197GBM_PC_LIB_PRIV="$DLOPEN_LIBS"
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001198AC_SUBST([GBM_PC_REQ_PRIV])
1199AC_SUBST([GBM_PC_LIB_PRIV])
Benjamin Franzke42cdf402011-07-25 09:37:02 +02001200
1201dnl
Dan Nicholson53b37342009-02-25 17:45:34 -08001202dnl EGL configuration
1203dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001204EGL_CLIENT_APIS=""
1205
Dan Nicholson66f97862009-04-29 12:11:43 -07001206if test "x$enable_egl" = xyes; then
1207 SRC_DIRS="$SRC_DIRS egl"
Matt Turnerb6651ae2012-09-18 21:51:25 -07001208 EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
Marek Olšákad50abba2011-06-14 05:14:27 +02001209
Benjamin Franzke85fe9482011-08-09 14:23:18 +02001210 AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
1211
Chia-I Wu2eb7a2f2010-02-05 10:46:11 +08001212 if test "$enable_static" != yes; then
Chia-I Wud4c1ee02009-12-21 11:13:18 +08001213 # build egl_glx when libGL is built
Benjamin Franzke184bb092011-04-30 11:18:23 +02001214 PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
1215 [have_libudev=yes],[have_libudev=no])
Benjamin Franzkea7cd65f2011-05-31 11:14:46 +02001216 if test "$have_libudev" = yes; then
1217 DEFINES="$DEFINES -DHAVE_LIBUDEV"
1218 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001219
Chia-I Wu9e7a4142011-06-26 13:24:32 +09001220 if test "x$enable_dri" = xyes; then
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001221 HAVE_EGL_DRIVER_DRI2=1
Chia-I Wu39ae9652010-07-16 19:48:52 +08001222 fi
Kristian Høgsberg2168b872010-06-02 22:48:06 -04001223
Kristian Høgsberg42fa0092010-02-03 10:18:28 -05001224 fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001225fi
Dan Nicholson53b37342009-02-25 17:45:34 -08001226AC_SUBST([EGL_LIB_DEPS])
1227
1228dnl
Marek Olšák1251e1d2011-06-18 20:33:55 +02001229dnl EGL Gallium configuration
1230dnl
1231if test "x$enable_gallium_egl" = xyes; then
1232 if test "x$with_gallium_drivers" = x; then
1233 AC_MSG_ERROR([cannot enable egl_gallium without Gallium])
1234 fi
1235 if test "x$enable_egl" = xno; then
1236 AC_MSG_ERROR([cannot enable egl_gallium without EGL])
1237 fi
Chia-I Wu94ec5fd2011-06-27 09:19:02 +09001238 if test "x$have_libdrm" != xyes; then
1239 AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED])
1240 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001241
1242 GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS"
Chia-I Wub8f097f2011-06-20 12:01:39 +09001243 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static"
Marek Olšák1251e1d2011-06-18 20:33:55 +02001244 HAVE_ST_EGL="yes"
1245fi
1246
1247dnl
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001248dnl gbm Gallium configuration
1249dnl
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001250if test "x$enable_gallium_gbm" = xauto; then
Chia-I Wu95ef0692011-11-05 15:09:36 +08001251 case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in
1252 yesyesyes*drm*)
Benjamin Franzkeb18b2992011-07-02 13:45:14 +02001253 enable_gallium_gbm=yes ;;
1254 *)
1255 enable_gallium_gbm=no ;;
1256 esac
1257fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001258if test "x$enable_gallium_gbm" = xyes; then
1259 if test "x$with_gallium_drivers" = x; then
1260 AC_MSG_ERROR([cannot enable gbm_gallium without Gallium])
1261 fi
1262 if test "x$enable_gbm" = xno; then
1263 AC_MSG_ERROR([cannot enable gbm_gallium without gbm])
1264 fi
Chia-I Wu95ef0692011-11-05 15:09:36 +08001265 # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set.
1266 if test "x$enable_dri" = xno; then
1267 AC_MSG_ERROR([gbm_gallium requires --enable-dri to build])
1268 fi
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001269
1270 GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS"
1271 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm"
1272 HAVE_ST_GBM="yes"
Francisco Jerezb52a0f22012-04-20 16:31:23 +02001273 enable_gallium_loader=yes
Benjamin Franzke48d4a002011-05-26 15:11:50 +02001274fi
1275
1276dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001277dnl X.Org DDX configuration
1278dnl
1279if test "x$enable_xorg" = xyes; then
1280 PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0])
1281 PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED])
1282 PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED])
1283 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
1284 HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71",
1285 HAVE_XEXTPROTO_71="no")
1286 GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS"
1287 HAVE_ST_XORG=yes
1288fi
1289
1290dnl
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001291dnl XA configuration
1292dnl
1293if test "x$enable_xa" = xyes; then
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001294AC_PROG_AWK
1295AC_PROG_GREP
1296AC_CHECK_PROG(NM, nm, "nm")
1297if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then
1298AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.])
1299enable_xa=no
1300fi
1301fi
1302if test "x$enable_xa" = xyes; then
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001303 GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS"
1304 HAVE_ST_XA=yes
Thomas Hellstrom32b16412011-11-24 21:54:54 +01001305 AC_SUBST(AWK)
1306 AC_SUBST(GREP)
1307 AC_SUBST(NM)
Thomas Hellstrom424b1212011-07-04 10:21:35 +02001308fi
1309
1310dnl
Marek Olšák440d71d2011-06-14 05:38:58 +02001311dnl OpenVG configuration
1312dnl
1313VG_LIB_DEPS=""
1314
1315if test "x$enable_openvg" = xyes; then
1316 if test "x$enable_egl" = xno; then
1317 AC_MSG_ERROR([cannot enable OpenVG without EGL])
1318 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001319 if test "x$with_gallium_drivers" = x; then
Marek Olšák440d71d2011-06-14 05:38:58 +02001320 AC_MSG_ERROR([cannot enable OpenVG without Gallium])
1321 fi
Marek Olšák1251e1d2011-06-18 20:33:55 +02001322 if test "x$enable_gallium_egl" = xno; then
1323 AC_MSG_ERROR([cannot enable OpenVG without egl_gallium])
1324 fi
Marek Olšák440d71d2011-06-14 05:38:58 +02001325
1326 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
Matt Turnerb6651ae2012-09-18 21:51:25 -07001327 VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
Marek Olšák440d71d2011-06-14 05:38:58 +02001328 GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
1329 HAVE_ST_VEGA=yes
Dave Airlieec835352012-12-04 09:25:13 +10001330 VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
Matt Turner261719b2012-08-22 16:57:38 -07001331 AC_SUBST([VG_PC_LIB_PRIV])
Marek Olšák440d71d2011-06-14 05:38:58 +02001332fi
Matt Turnercdee0e82012-09-10 11:21:26 -07001333AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes)
Marek Olšák440d71d2011-06-14 05:38:58 +02001334
1335dnl
Christian Königc3b22302011-07-04 15:04:41 +02001336dnl Gallium G3DVL configuration
1337dnl
1338AC_ARG_ENABLE([gallium-g3dvl],
1339 [AS_HELP_STRING([--enable-gallium-g3dvl],
1340 [build gallium g3dvl @<:@default=disabled@:>@])],
1341 [enable_gallium_g3dvl="$enableval"],
1342 [enable_gallium_g3dvl=no])
1343if test "x$enable_gallium_g3dvl" = xyes; then
1344 if test "x$with_gallium_drivers" = x; then
1345 AC_MSG_ERROR([cannot enable G3DVL without Gallium])
1346 fi
1347
1348 if test "x$enable_xvmc" = xauto; then
Christian Königa8ae8cf2011-07-14 12:42:17 +02001349 PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no])
Christian Königc3b22302011-07-04 15:04:41 +02001350 fi
1351
1352 if test "x$enable_vdpau" = xauto; then
Christian König33bf4102011-07-14 13:57:23 +02001353 PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no])
Christian Königc3b22302011-07-04 15:04:41 +02001354 fi
Christian Königc3b22302011-07-04 15:04:41 +02001355fi
1356
Christian Königc3b22302011-07-04 15:04:41 +02001357if test "x$enable_xvmc" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001358 PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8])
Christian Königdcf8ee72012-02-15 17:30:58 +01001359 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc"
Christian Königc3b22302011-07-04 15:04:41 +02001360 HAVE_ST_XVMC="yes"
1361fi
1362
Christian Königc3b22302011-07-04 15:04:41 +02001363if test "x$enable_vdpau" = xyes; then
Christian König66480c02012-02-24 16:12:27 +01001364 PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8])
Christian Königc3b22302011-07-04 15:04:41 +02001365 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau"
1366 HAVE_ST_VDPAU="yes"
1367fi
1368
Christian Königc3b22302011-07-04 15:04:41 +02001369dnl
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001370dnl OpenCL configuration
1371dnl
1372
Tom Stellardc79e7662012-03-12 13:53:20 -04001373AC_ARG_WITH([libclc-path],
1374 [AS_HELP_STRING([--with-libclc-path],
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001375 [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
Tom Stellardc79e7662012-03-12 13:53:20 -04001376 [LIBCLC_PATH="$withval"],
1377 [LIBCLC_PATH=""])
1378
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001379if test "x$LIBCLC_PATH" != x; then
1380 AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
1381 Please review the updated build instructions for clover:
1382 http://dri.freedesktop.org/wiki/GalliumCompute])
1383fi
1384
1385
Tom Stellardea76f032012-06-15 16:52:16 -04001386AC_ARG_WITH([clang-libdir],
1387 [AS_HELP_STRING([--with-clang-libdir],
1388 [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
1389 [CLANG_LIBDIR="$withval"],
1390 [CLANG_LIBDIR=""])
1391
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001392LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
1393LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
1394AC_SUBST([LIBCLC_INCLUDEDIR])
1395AC_SUBST([LIBCLC_LIBEXECDIR])
Tom Stellardc79e7662012-03-12 13:53:20 -04001396
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001397if test "x$enable_opencl" = xyes; then
1398 if test "x$with_gallium_drivers" = x; then
1399 AC_MSG_ERROR([cannot enable OpenCL without Gallium])
1400 fi
Tom Stellard79d77b32012-04-20 16:56:46 +02001401
1402 if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then
1403 AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
1404 fi
1405
Johannes Obermayr959e83d2012-11-30 01:44:56 +01001406 if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
1407 AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
1408 fi
1409
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001410 GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
1411 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
Tom Stellard79d77b32012-04-20 16:56:46 +02001412 enable_gallium_loader=yes
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001413fi
1414
Matt Turner45270fb2012-09-13 10:45:01 -07001415if test "x$enable_gallium_gbm" = xyes || test "x$enable_opencl" = xyes; then
1416 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader"
1417fi
1418
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001419dnl
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001420dnl Gallium configuration
1421dnl
Marek Olšák58b6a192011-06-14 07:46:59 +02001422if test "x$with_gallium_drivers" != x; then
Jakob Bornecrantzbe38b322010-03-23 13:23:26 +00001423 SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01001424fi
Matt Turnerbfd7d6f2012-08-17 15:51:59 -07001425AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x)
Dan Nicholsondca1b792007-10-23 09:25:58 -07001426
Tom Stellarda75c6162012-01-06 17:38:37 -05001427AC_SUBST([LLVM_BINDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001428AC_SUBST([LLVM_CFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001429AC_SUBST([LLVM_CPPFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001430AC_SUBST([LLVM_CXXFLAGS])
Tom Stellardd4167802012-04-24 10:34:57 -04001431AC_SUBST([LLVM_LIBDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001432AC_SUBST([LLVM_LIBS])
1433AC_SUBST([LLVM_LDFLAGS])
Tom Stellarda75c6162012-01-06 17:38:37 -05001434AC_SUBST([LLVM_INCLUDEDIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001435AC_SUBST([LLVM_VERSION])
Tom Stellardea76f032012-06-15 16:52:16 -04001436AC_SUBST([CLANG_RESOURCE_DIR])
Dave Airlie81fe1982010-04-22 14:59:29 +10001437
Chia-I Wube5f34a2010-10-27 16:14:27 +08001438case "x$enable_opengl$enable_gles1$enable_gles2" in
1439x*yes*)
1440 EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
1441 ;;
1442esac
Chia-I Wube5f34a2010-10-27 16:14:27 +08001443
Chia-I Wu874ccd52010-05-04 22:43:05 +08001444AC_SUBST([VG_LIB_DEPS])
Chia-I Wu63ab2502010-05-05 15:38:02 +08001445AC_SUBST([EGL_CLIENT_APIS])
1446
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001447dnl
1448dnl EGL Platforms configuration
1449dnl
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001450AC_ARG_WITH([egl-platforms],
1451 [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@],
1452 [comma delimited native platforms libEGL supports, e.g.
Chia-I Wue7424d72010-09-19 16:54:39 +08001453 "x11,drm" @<:@default=auto@:>@])],
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001454 [with_egl_platforms="$withval"],
Eric Anholt28d92ef2012-02-05 07:54:38 +01001455 [if test "x$enable_egl" = xyes; then
1456 with_egl_platforms="x11"
1457 else
1458 with_egl_platforms=""
1459 fi])
Chia-I Wu49381d62010-01-11 01:23:01 +08001460
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001461EGL_PLATFORMS=""
Benjamin Franzke214fc6e2011-02-04 12:24:08 +01001462
Eric Anholt28d92ef2012-02-05 07:54:38 +01001463if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then
1464 AC_MSG_ERROR([cannot build egl state tracker without EGL library])
1465fi
1466
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001467# Do per-EGL platform setups and checks
Eric Anholt28d92ef2012-02-05 07:54:38 +01001468egl_platforms=`IFS=', '; echo $with_egl_platforms`
1469for plat in $egl_platforms; do
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001470 case "$plat" in
1471 fbdev|null)
1472 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat"
1473 ;;
1474
1475 wayland)
Ander Conselvan de Oliveira60a11e22012-11-22 15:34:49 +02001476 PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.0.2 wayland-server >= 1.0.2])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001477 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
Benjamin Franzke8b902052012-01-24 20:38:01 +01001478
Kristian Høgsberg426a23a2012-07-13 11:06:32 -04001479 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
1480 AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],,
1481 [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH])
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001482 ;;
1483
1484 x11)
Eric Anholtb4773842012-09-25 09:09:47 -07001485 PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 >= 1.8 xcb-xfixes])
Kristian Høgsbergb5c53242012-11-29 15:11:13 -05001486
1487 if test "x$enable_glx" = xyes; then
1488 HAVE_EGL_DRIVER_GLX=1
1489 fi
Kristian Høgsberg2c4f6ce2012-06-01 14:14:20 -04001490 ;;
1491
1492 drm)
1493 test "x$enable_gbm" = "xno" &&
1494 AC_MSG_ERROR([EGL platform drm needs gbm])
1495 ;;
1496
1497 android|gdi)
1498 ;;
1499
1500 *)
1501 AC_MSG_ERROR([EGL platform '$plat' does not exist])
1502 ;;
1503 esac
1504
Benjamin Franzke7ed18262011-07-02 13:46:42 +02001505 case "$plat$have_libudev" in
1506 waylandno|drmno)
1507 AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;;
1508 esac
Eric Anholt28d92ef2012-02-05 07:54:38 +01001509done
1510
Eric Anholt88612022012-02-05 10:46:13 +01001511# libEGL wants to default to the first platform specified in
1512# ./configure. parse that here.
1513if test "x$egl_platforms" != "x"; then
1514 FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'`
1515 EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS"
1516else
1517 EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM"
1518fi
1519
Eric Anholt28d92ef2012-02-05 07:54:38 +01001520EGL_PLATFORMS="$egl_platforms"
Eric Anholt88612022012-02-05 10:46:13 +01001521
1522AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1)
1523AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1)
1524AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1)
1525AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1)
1526AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1)
1527
1528AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
1529AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x")
1530
1531AC_SUBST([EGL_NATIVE_PLATFORM])
Chia-I Wuda39d5d2010-06-17 16:07:46 +08001532AC_SUBST([EGL_PLATFORMS])
Eric Anholt88612022012-02-05 10:46:13 +01001533AC_SUBST([EGL_CFLAGS])
Chia-I Wu49381d62010-01-11 01:23:01 +08001534
Chia-I Wu28c3e572010-01-23 20:18:43 +08001535AC_ARG_WITH([egl-driver-dir],
1536 [AS_HELP_STRING([--with-egl-driver-dir=DIR],
1537 [directory for EGL drivers [[default=${libdir}/egl]]])],
1538 [EGL_DRIVER_INSTALL_DIR="$withval"],
1539 [EGL_DRIVER_INSTALL_DIR='${libdir}/egl'])
1540AC_SUBST([EGL_DRIVER_INSTALL_DIR])
1541
Joel Bosveld8acca482009-03-06 08:46:08 +09001542AC_ARG_WITH([xorg-driver-dir],
1543 [AS_HELP_STRING([--with-xorg-driver-dir=DIR],
1544 [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])],
1545 [XORG_DRIVER_INSTALL_DIR="$withval"],
1546 [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"])
1547AC_SUBST([XORG_DRIVER_INSTALL_DIR])
1548
Tom Fogal7085dce2009-08-13 19:40:30 -06001549AC_ARG_WITH([max-width],
1550 [AS_HELP_STRING([--with-max-width=N],
1551 [Maximum framebuffer width (4096)])],
1552 [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}";
1553 AS_IF([test "${withval}" -gt "4096"],
1554 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1555)
1556AC_ARG_WITH([max-height],
1557 [AS_HELP_STRING([--with-max-height=N],
1558 [Maximum framebuffer height (4096)])],
1559 [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}";
1560 AS_IF([test "${withval}" -gt "4096"],
1561 [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])]
1562)
1563
Jakob Bornecrantz3ede3772009-02-13 00:57:47 +01001564dnl
Dave Airlie81fe1982010-04-22 14:59:29 +10001565dnl Gallium LLVM
1566dnl
1567AC_ARG_ENABLE([gallium-llvm],
1568 [AS_HELP_STRING([--enable-gallium-llvm],
Marek Olšáka86fc712011-04-21 13:27:55 +02001569 [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])],
Dave Airlie81fe1982010-04-22 14:59:29 +10001570 [enable_gallium_llvm="$enableval"],
1571 [enable_gallium_llvm=auto])
Tom Stellard7d87c712012-03-27 22:24:39 -04001572
1573AC_ARG_WITH([llvm-shared-libs],
1574 [AS_HELP_STRING([--with-llvm-shared-libs],
1575 [link with LLVM shared libraries @<:@default=disabled@:>@])],
Quentin Glidic1e857132013-01-25 15:02:04 +01001576 [],
Tom Stellard7d87c712012-03-27 22:24:39 -04001577 [with_llvm_shared_libs=no])
Quentin Glidic1e857132013-01-25 15:02:04 +01001578AS_IF([test x$enable_opencl = xyes],
1579 [
1580 AC_MSG_WARN([OpenCL required, forcing LLVM shared libraries])
1581 with_llvm_shared_libs=yes
1582 ])
Tom Stellard7d87c712012-03-27 22:24:39 -04001583
Tom Stellard17f6c912012-07-17 18:32:56 +00001584AC_ARG_WITH([llvm-prefix],
1585 [AS_HELP_STRING([--with-llvm-prefix],
1586 [Prefix for LLVM installations in non-standard locations])],
1587 [llvm_prefix="$withval"],
1588 [llvm_prefix=""])
1589
1590
Marek Olšák9b67a342012-11-27 23:38:01 +01001591# Call this inside ` ` to get the return value.
1592# $1 is the llvm-config command with arguments.
1593strip_unwanted_llvm_flags() {
Marek Olšák3d59cde2012-11-27 23:56:04 +01001594 # Use \> (marks the end of the word)
Marek Olšák9b67a342012-11-27 23:38:01 +01001595 echo `$1` | sed \
1596 -e 's/-DNDEBUG\>//g' \
Marek Olšák3d59cde2012-11-27 23:56:04 +01001597 -e 's/-pedantic\>//g' \
1598 -e 's/-Wcovered-switch-default\>//g' \
1599 -e 's/-O.\>//g' \
1600 -e 's/-g\>//g' \
Marek Olšákf9429e32012-11-28 00:28:18 +01001601 -e 's/-Wall\>//g' \
1602 -e 's/-fomit-frame-pointer\>//g'
Marek Olšák9b67a342012-11-27 23:38:01 +01001603}
1604
1605
Marek Olšák58b6a192011-06-14 07:46:59 +02001606if test "x$with_gallium_drivers" = x; then
1607 enable_gallium_llvm=no
1608fi
Marek Olšáka86fc712011-04-21 13:27:55 +02001609if test "x$enable_gallium_llvm" = xauto; then
1610 case "$host_cpu" in
1611 i*86|x86_64) enable_gallium_llvm=yes;;
1612 esac
1613fi
Dave Airlie81fe1982010-04-22 14:59:29 +10001614if test "x$enable_gallium_llvm" = xyes; then
Tom Stellard17f6c912012-07-17 18:32:56 +00001615 if test "x$llvm_prefix" != x; then
1616 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"])
1617 else
1618 AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no])
1619 fi
Marek Olšák99fba502011-07-23 15:57:51 +02001620
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001621 if test "x$LLVM_CONFIG" != xno; then
ojab2fe6c252012-01-05 14:18:34 +04001622 LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'`
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001623 LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'`
Tom Stellard08980472013-01-25 16:43:11 +01001624 LLVM_COMPONENTS="engine bitwriter"
1625 if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then
1626 LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
1627 fi
Johannes Obermayrc2958742013-04-09 17:38:42 +01001628
1629 if test "x$enable_debug" = xyes; then
1630 # Debug builds require OProfileJIT if LLVM was built with support for it
1631 if $LLVM_CONFIG --components | grep -q '\<oprofilejit\>'; then
1632 LLVM_COMPONENTS="${LLVM_COMPONENTS} oprofilejit"
1633 fi
Adam Sampson2506b032013-02-28 15:35:11 +00001634 fi
Tom Stellard00d80b32012-10-01 16:19:43 -04001635
Tom Stellard08980472013-01-25 16:43:11 +01001636 if test "x$enable_opencl" = xyes; then
1637 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation"
Niels Ole Salscheiderb336f512013-04-04 23:26:45 +02001638 # LLVM 3.3 >= 177971 requires IRReader
1639 if $LLVM_CONFIG --components | grep -q '\<irreader\>'; then
1640 LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader"
1641 fi
Tom Stellard08980472013-01-25 16:43:11 +01001642 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001643 LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
Tom Stellarda75c6162012-01-06 17:38:37 -05001644 LLVM_BINDIR=`$LLVM_CONFIG --bindir`
Marek Olšák9b67a342012-11-27 23:38:01 +01001645 LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"`
1646 LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient
1647 LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"`
Tom Stellarda75c6162012-01-06 17:38:37 -05001648 LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
Tom Stellardd4167802012-04-24 10:34:57 -04001649 LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
Tom Stellard80d290d2012-08-24 11:48:32 -07001650 DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT"
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001651 MESA_LLVM=1
Tom Stellardea76f032012-06-15 16:52:16 -04001652
1653 dnl Check for Clang interanl headers
1654 if test "x$enable_opencl" = xyes; then
1655 if test "x$CLANG_LIBDIR" = x; then
1656 CLANG_LIBDIR=${LLVM_LIBDIR}
1657 fi
1658 CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
1659 AC_CHECK_FILE("$CLANG_RESOURCE_DIR/include/stddef.h",,
1660 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.]))
1661 fi
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001662 else
Dave Airlie81fe1982010-04-22 14:59:29 +10001663 MESA_LLVM=0
Tom Stellard80d290d2012-08-24 11:48:32 -07001664 LLVM_VERSION_INT=0
Dave Airlie22e8ddc2010-04-25 07:48:48 +10001665 fi
1666else
1667 MESA_LLVM=0
Tom Stellard80d290d2012-08-24 11:48:32 -07001668 LLVM_VERSION_INT=0
Dave Airlie81fe1982010-04-22 14:59:29 +10001669fi
1670
Alexandre Demers3ea36952012-04-04 10:54:56 +02001671dnl Directory for XVMC libs
1672AC_ARG_WITH([xvmc-libdir],
1673 [AS_HELP_STRING([--with-xvmc-libdir=DIR],
1674 [directory for the XVMC libraries @<:@default=${libdir}@:>@])],
1675 [XVMC_LIB_INSTALL_DIR="$withval"],
1676 [XVMC_LIB_INSTALL_DIR='${libdir}'])
1677AC_SUBST([XVMC_LIB_INSTALL_DIR])
1678
Tom Stellard79d77b32012-04-20 16:56:46 +02001679dnl
1680dnl Gallium Tests
1681dnl
1682if test "x$enable_gallium_tests" = xyes; then
Andreas Bollcb4d5022012-11-27 19:18:25 +01001683 SRC_DIRS="$SRC_DIRS gallium/tests/trivial gallium/tests/unit"
Tom Stellard79d77b32012-04-20 16:56:46 +02001684 enable_gallium_loader=yes
1685fi
1686
Thomas Balling Sørensen32999972010-07-14 00:34:56 +02001687dnl Directory for VDPAU libs
1688AC_ARG_WITH([vdpau-libdir],
1689 [AS_HELP_STRING([--with-vdpau-libdir=DIR],
1690 [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])],
1691 [VDPAU_LIB_INSTALL_DIR="$withval"],
1692 [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau'])
1693AC_SUBST([VDPAU_LIB_INSTALL_DIR])
Younes Manton40cd0822010-03-05 23:11:05 -05001694
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001695dnl Directory for OpenCL libs
1696AC_ARG_WITH([opencl-libdir],
1697 [AS_HELP_STRING([--with-opencl-libdir=DIR],
Francisco Jerez4deefd92013-02-27 12:26:13 +01001698 [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])],
Francisco Jerezc6db1b32012-04-20 16:56:19 +02001699 [OPENCL_LIB_INSTALL_DIR="$withval"],
1700 [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl'])
1701AC_SUBST([OPENCL_LIB_INSTALL_DIR])
1702
Dave Airlie81fe1982010-04-22 14:59:29 +10001703dnl
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001704dnl Gallium helper functions
1705dnl
1706gallium_check_st() {
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001707 if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes ||
Christian Königc3b22302011-07-04 15:04:41 +02001708 test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes ||
Matt Turner900cc7c2012-09-07 11:12:11 -07001709 test "x$HAVE_ST_VDPAU" = xyes; then
Chia-I Wu81239342011-07-02 09:49:17 +09001710 if test "x$have_libdrm" != xyes; then
1711 AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED])
1712 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001713 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1"
1714 fi
1715 if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then
1716 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2"
Matt Turner07f2dee2013-03-05 10:25:55 -08001717 HAVE_COMMON_DRI=yes
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001718 fi
Chia-I Wud8e0e112010-06-29 14:04:27 +08001719 if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001720 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3"
1721 fi
Thomas Hellstrom9f2f5b32011-06-15 10:46:24 +02001722 if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then
1723 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4"
1724 fi
Christian Königc3b22302011-07-04 15:04:41 +02001725 if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then
1726 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5"
1727 fi
1728 if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then
1729 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6"
1730 fi
Jakob Bornecrantza82e37b2010-03-25 22:21:39 +01001731}
1732
Marek Olšákc17fb852011-06-14 04:03:17 +02001733gallium_require_llvm() {
1734 if test "x$MESA_LLVM" = x0; then
1735 case "$host_cpu" in
1736 i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);;
1737 esac
1738 fi
1739}
1740
Tom Stellard79d77b32012-04-20 16:56:46 +02001741gallium_require_drm_loader() {
1742 if test "x$enable_gallium_loader" = xyes; then
1743 PKG_CHECK_MODULES([LIBUDEV], [libudev], [],
Andreas Bollf416b382012-11-27 10:25:54 +01001744 AC_MSG_ERROR([Gallium drm loader requires libudev]))
Tom Stellard79d77b32012-04-20 16:56:46 +02001745 if test "x$have_libdrm" != xyes; then
1746 AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
1747 fi
1748 enable_gallium_drm_loader=yes
1749 fi
1750}
1751
Tom Stellard8d977852012-05-10 10:21:54 -04001752radeon_llvm_check() {
Vincent Lejeune1feb6b72012-10-31 21:02:29 +01001753 LLVM_REQUIRED_VERSION_MAJOR="3"
Tom Stellarda5a76782013-04-08 07:43:34 -07001754 LLVM_REQUIRED_VERSION_MINOR="3"
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001755 if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then
Tom Stellarda5a76782013-04-08 07:43:34 -07001756 AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required for r600g and radeonsi.])
Tom Stellard8d977852012-05-10 10:21:54 -04001757 fi
Johannes Obermayr05c143c2012-12-20 20:56:17 +01001758 if test true && $LLVM_CONFIG --targets-built | grep -qv '\<R600\>' ; then
1759 AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
1760 sources with the --enable-experimental-targets=R600
1761 configure flag])
Tom Stellard8d977852012-05-10 10:21:54 -04001762 fi
Christian Königce3aa0e2013-03-14 12:37:02 +01001763 LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader"
Christian König5b2855b2013-04-03 10:18:35 +02001764 NEED_RADEON_LLVM=yes
Tom Stellard9277b042013-04-04 13:02:51 -07001765 AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf],
1766 [AC_MSG_ERROR([radeonsi and r600g require libelf when using LLVM])])
Tom Stellard8d977852012-05-10 10:21:54 -04001767}
1768
Marek Olšák58b6a192011-06-14 07:46:59 +02001769dnl Gallium drivers
Marek Olšák02c8ee22011-06-27 08:02:31 +02001770dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block
Marek Olšák58b6a192011-06-14 07:46:59 +02001771if test "x$with_gallium_drivers" != x; then
Marek Olšák58b6a192011-06-14 07:46:59 +02001772 gallium_drivers=`IFS=', '; echo $with_gallium_drivers`
1773 for driver in $gallium_drivers; do
1774 case "x$driver" in
1775 xsvga)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001776 HAVE_GALLIUM_SVGA=yes
Marek Olšák02c8ee22011-06-27 08:02:31 +02001777 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe"
Thomas Hellstromd742a642011-09-29 21:41:21 +02001778 gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx"
Marek Olšák58b6a192011-06-14 07:46:59 +02001779 ;;
1780 xi915)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001781 HAVE_GALLIUM_I915=yes
Emil Velikovc2426bb2011-07-14 23:07:19 +01001782 PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED])
Marek Olšák02c8ee22011-06-27 08:02:31 +02001783 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe"
1784 if test "x$MESA_LLVM" = x1; then
1785 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1786 fi
1787 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw"
Marek Olšák58b6a192011-06-14 07:46:59 +02001788 gallium_check_st "i915/drm" "dri-i915" "xorg-i915"
1789 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001790 xr300)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001791 HAVE_GALLIUM_R300=yes
Jerome Glissec0c979e2012-01-30 17:22:13 -05001792 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Marek Olšák58b6a192011-06-14 07:46:59 +02001793 gallium_require_llvm "Gallium R300"
Marek Olšák02c8ee22011-06-27 08:02:31 +02001794 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
Marek Olšák4d6faf52013-01-13 22:58:08 +01001795 gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300"
Marek Olšák58b6a192011-06-14 07:46:59 +02001796 ;;
1797 xr600)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001798 HAVE_GALLIUM_R600=yes
Jerome Glissec0c979e2012-01-30 17:22:13 -05001799 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001800 gallium_require_drm_loader
Marek Olšák58b6a192011-06-14 07:46:59 +02001801 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600"
Adam Rak6a829a12011-11-30 22:20:41 +01001802 if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then
Tom Stellard8d977852012-05-10 10:21:54 -04001803 radeon_llvm_check
Tom Stellard91a160b2013-01-25 20:50:31 -05001804 R600_NEED_RADEON_GALLIUM=yes;
1805 LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo bitreader asmparser"
Adam Rak6a829a12011-11-30 22:20:41 +01001806 fi
1807 if test "x$enable_r600_llvm" = xyes; then
Tom Stellardced73ea2012-04-17 09:26:28 -04001808 USE_R600_LLVM_COMPILER=yes;
1809 fi
Tom Stellard08980472013-01-25 16:43:11 +01001810 if test "x$enable_opencl" = xyes; then
1811 LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser"
1812 fi
Matt Turner900cc7c2012-09-07 11:12:11 -07001813 gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600"
Marek Olšák58b6a192011-06-14 07:46:59 +02001814 ;;
Tom Stellarda75c6162012-01-06 17:38:37 -05001815 xradeonsi)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001816 HAVE_GALLIUM_RADEONSI=yes
Michel Dänzer24bc3822012-05-12 12:12:21 +02001817 PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
1818 gallium_require_drm_loader
Tom Stellarda75c6162012-01-06 17:38:37 -05001819 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi"
Tom Stellard8d977852012-05-10 10:21:54 -04001820 radeon_llvm_check
Christian König41625af2012-07-13 11:23:10 +02001821 gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" ""
Tom Stellarda75c6162012-01-06 17:38:37 -05001822 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001823 xnouveau)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001824 HAVE_GALLIUM_NOUVEAU=yes
Emil Velikovc2426bb2011-07-14 23:07:19 +01001825 PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED])
Tom Stellard79d77b32012-04-20 16:56:46 +02001826 gallium_require_drm_loader
Ben Skeggsa2fc42b2012-01-11 12:42:07 +01001827 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0"
Maarten Lankhorstdf8f8642011-10-18 14:24:30 +02001828 gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau"
Marek Olšák58b6a192011-06-14 07:46:59 +02001829 ;;
Rob Clark6173cc12012-10-27 11:07:34 -05001830 xfreedreno)
1831 HAVE_GALLIUM_FREEDRENO=yes
1832 PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED])
1833 gallium_require_drm_loader
1834 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno"
1835 gallium_check_st "freedreno/drm" "dri-freedreno" "" "" "" ""
1836 ;;
Marek Olšák58b6a192011-06-14 07:46:59 +02001837 xswrast)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001838 HAVE_GALLIUM_SOFTPIPE=yes
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001839 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe"
1840 if test "x$MESA_LLVM" = x1; then
Matt Turner2cbb94b2012-09-07 21:04:44 -07001841 HAVE_GALLIUM_LLVMPIPE=yes
Marek Olšákc6f59fc2011-07-26 01:05:13 +02001842 GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe"
1843 fi
1844
Marek Olšák58b6a192011-06-14 07:46:59 +02001845 if test "x$HAVE_ST_DRI" = xyes; then
1846 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast"
1847 fi
Christian Königc3b22302011-07-04 15:04:41 +02001848 if test "x$HAVE_ST_VDPAU" = xyes; then
1849 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe"
1850 fi
1851 if test "x$HAVE_ST_XVMC" = xyes; then
1852 GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe"
1853 fi
Eric Anholt48c99252011-10-14 14:33:00 -07001854 if test "x$HAVE_ST_VDPAU" = xyes ||
Matt Turner900cc7c2012-09-07 11:12:11 -07001855 test "x$HAVE_ST_XVMC" = xyes; then
Younes Mantonb97816d2011-07-14 12:22:20 -04001856 if test "x$HAVE_WINSYS_XLIB" != xyes; then
1857 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib"
1858 fi
1859 fi
Marek Olšák58b6a192011-06-14 07:46:59 +02001860 ;;
1861 *)
1862 AC_MSG_ERROR([Unknown Gallium driver: $driver])
1863 ;;
1864 esac
1865 done
Chia-I Wua1306f42010-01-22 15:51:51 +08001866fi
Tom Stellard69d639b2013-01-18 15:08:28 +00001867
1868dnl Set LLVM_LIBS - This is done after the driver configuration so
1869dnl that drivers can add additonal components to LLVM_COMPONENTS.
1870dnl Previously, gallium drivers were updating LLVM_LIBS directly
1871dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but
1872dnl this was causing the same libraries to be appear multiple times
1873dnl in LLVM_LIBS.
1874
Tom Stellard7a850c52013-01-25 12:46:55 -05001875if test "x$MESA_LLVM" != x0; then
Tom Stellardcf69a592013-01-18 16:26:12 +00001876
Tom Stellard7a850c52013-01-25 12:46:55 -05001877 LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`"
Tom Stellardcf69a592013-01-18 16:26:12 +00001878
Tom Stellard7a850c52013-01-25 12:46:55 -05001879 if test "x$with_llvm_shared_libs" = xyes; then
1880 dnl We can't use $LLVM_VERSION because it has 'svn' stripped out,
1881 LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version`
1882 AC_CHECK_FILE("$LLVM_LIBDIR/lib$LLVM_SO_NAME.so", llvm_have_one_so=yes,)
1883
1884 if test "x$llvm_have_one_so" = xyes; then
1885 dnl LLVM was built using auto*, so there is only one shared object.
1886 LLVM_LIBS="-l$LLVM_SO_NAME"
1887 else
1888 dnl If LLVM was built with CMake, there will be one shared object per
1889 dnl component.
1890 AC_CHECK_FILE("$LLVM_LIBDIR/libLLVMTarget.so",,
1891 AC_MSG_ERROR([Could not find llvm shared libraries:
Tom Stellardcf69a592013-01-18 16:26:12 +00001892 Please make sure you have built llvm with the --enable-shared option
1893 and that your llvm libraries are installed in $LLVM_LIBDIR
1894 If you have installed your llvm libraries to a different directory you
1895 can use the --with-llvm-prefix= configure flag to specify this directory.
1896 NOTE: Mesa is attempting to use llvm shared libraries because you have
1897 passed one of the following options to configure:
1898 --with-llvm-shared-libs
1899 --enable-opencl
1900 If you do not want to build with llvm shared libraries and instead want to
1901 use llvm static libraries then remove these options from your configure
1902 invocation and reconfigure.]))
1903
Tom Stellard7a850c52013-01-25 12:46:55 -05001904 dnl We don't need to update LLVM_LIBS in this case because the LLVM
1905 dnl install uses a shared object for each compoenent and we have
1906 dnl already added all of these objects to LLVM_LIBS.
1907 fi
Tom Stellardcf69a592013-01-18 16:26:12 +00001908 fi
Tom Stellard69d639b2013-01-18 15:08:28 +00001909fi
1910
Matt Turner2cbb94b2012-09-07 21:04:44 -07001911AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes)
1912AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes)
1913AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes)
1914AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes)
1915AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes)
1916AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes)
Rob Clark6173cc12012-10-27 11:07:34 -05001917AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes)
Matt Turner2cbb94b2012-09-07 21:04:44 -07001918AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes)
1919AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes)
Chia-I Wua1306f42010-01-22 15:51:51 +08001920
Francisco Jereze1364532012-04-25 22:16:00 +02001921if test "x$enable_gallium_loader" = xyes; then
1922 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
1923 GALLIUM_PIPE_LOADER_DEFINES="-DHAVE_PIPE_LOADER_SW"
Matt Turner53c62d32012-09-13 10:10:14 -07001924 GALLIUM_PIPE_LOADER_LIBS="\$(top_builddir)/src/gallium/auxiliary/pipe-loader/libpipe_loader.la"
1925 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 +02001926
1927 if test "x$HAVE_WINSYS_XLIB" = xyes; then
1928 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB"
Matt Turner53c62d32012-09-13 10:10:14 -07001929 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 +02001930 fi
1931
1932 if test "x$enable_gallium_drm_loader" = xyes; then
1933 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM"
Tom Stellard044de402012-07-17 18:36:06 +00001934 PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2],
1935 pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no)
1936 if test "x$pipe_loader_have_xcb" = xyes; then
1937 GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB"
1938 GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS"
1939 fi
Francisco Jereze1364532012-04-25 22:16:00 +02001940 fi
1941
1942 AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES])
1943 AC_SUBST([GALLIUM_PIPE_LOADER_LIBS])
1944fi
1945
Tom Stellard26ab7472012-03-03 20:02:05 -05001946dnl Tell Automake which drivers to build
1947for driver in $GALLIUM_DRIVERS_DIRS; do
1948 case "x$driver" in
1949 xgalahad)
1950 HAVE_GALAHAD_GALLIUM=yes;
1951 ;;
Tom Stellard3f3f10f2012-03-03 20:14:00 -05001952 xidentity)
1953 HAVE_IDENTITY_GALLIUM=yes;
1954 ;;
Tom Stellarddc382e52012-03-03 20:35:39 -05001955 xnoop)
1956 HAVE_NOOP_GALLIUM=yes;
1957 ;;
Tom Stellard26ab7472012-03-03 20:02:05 -05001958 *)
1959 GALLIUM_MAKE_DIRS="$GALLIUM_MAKE_DIRS $driver"
1960 ;;
1961 esac
1962done
1963
Matt Turner07f2dee2013-03-05 10:25:55 -08001964AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes)
1965AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes)
1966AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes)
1967AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes)
1968AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes)
1969AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes)
1970AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes)
1971
Tom Stellard26ab7472012-03-03 20:02:05 -05001972AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes)
Tom Stellard3f3f10f2012-03-03 20:14:00 -05001973AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes)
Tom Stellarddc382e52012-03-03 20:35:39 -05001974AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes)
Christian König5b2855b2013-04-03 10:18:35 +02001975AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes)
Tom Stellard91a160b2013-01-25 20:50:31 -05001976AM_CONDITIONAL(R600_NEED_RADEON_GALLIUM, test x$R600_NEED_RADEON_GALLIUM = xyes)
Tom Stellardced73ea2012-04-17 09:26:28 -04001977AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes)
Francisco Jereze1364532012-04-25 22:16:00 +02001978AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes)
1979AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes)
Tom Stellardd85e5122012-04-20 14:46:45 -04001980AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
Tom Stellard80d290d2012-08-24 11:48:32 -07001981AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1)
1982AM_CONDITIONAL(LLVM_NEEDS_FNORTTI, test $LLVM_VERSION_INT -ge 302)
1983
Tom Stellard26ab7472012-03-03 20:02:05 -05001984AC_SUBST([GALLIUM_MAKE_DIRS])
Tom Stellard9277b042013-04-04 13:02:51 -07001985AC_SUBST([ELF_LIB])
Tom Stellard26ab7472012-03-03 20:02:05 -05001986
Quentin Glidicc5e93962012-11-28 16:33:47 +01001987AM_CONDITIONAL(NEED_LIBPROGRAM, test "x$with_gallium_drivers" != x -o \
1988 "x$enable_xlib_glx" = xyes -o \
1989 "x$enable_osmesa" = xyes)
Eric Anholtf9d15622012-05-24 13:59:21 -07001990AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07001991
Eric Anholte4269492012-06-11 10:25:05 -07001992AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
1993AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
1994AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
Eric Anholtf9d15622012-05-24 13:59:21 -07001995
Matt Turnercc9f6092013-01-14 16:16:00 -08001996AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
1997
Matt Turner184b2f02012-09-05 17:06:16 -07001998AC_SUBST([VDPAU_MAJOR], 1)
1999AC_SUBST([VDPAU_MINOR], 0)
2000
Matt Turner0b132df2012-09-07 20:47:04 -07002001AC_SUBST([XVMC_MAJOR], 1)
2002AC_SUBST([XVMC_MINOR], 0)
2003
Matt Turnerd53901c2012-09-07 15:24:24 -07002004AC_SUBST([XA_MAJOR], 1)
2005AC_SUBST([XA_MINOR], 0)
2006AC_SUBST([XA_TINY], 0)
2007AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
2008
Dan Nicholsondca1b792007-10-23 09:25:58 -07002009dnl Restore LDFLAGS and CPPFLAGS
2010LDFLAGS="$_SAVE_LDFLAGS"
2011CPPFLAGS="$_SAVE_CPPFLAGS"
2012
Marcin Baczyńskiff2efdf2011-07-13 21:26:49 +02002013dnl Add user CFLAGS and CXXFLAGS
2014CFLAGS="$CFLAGS $USER_CFLAGS"
2015CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
2016
Dan Nicholsondca1b792007-10-23 09:25:58 -07002017dnl Substitute the config
Matt Turnerc8747402012-09-05 20:29:20 -07002018AC_CONFIG_FILES([Makefile
Matt Turner63c3a052012-09-24 14:30:21 -07002019 src/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002020 src/egl/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01002021 src/egl/drivers/Makefile
Eric Anholte5f89542012-02-06 12:12:53 +01002022 src/egl/drivers/dri2/Makefile
2023 src/egl/drivers/glx/Makefile
Eric Anholt88612022012-02-05 10:46:13 +01002024 src/egl/main/Makefile
2025 src/egl/main/egl.pc
Benjamin Franzke8b902052012-01-24 20:38:01 +01002026 src/egl/wayland/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002027 src/egl/wayland/wayland-drm/Makefile
Benjamin Franzke8b902052012-01-24 20:38:01 +01002028 src/egl/wayland/wayland-egl/Makefile
2029 src/egl/wayland/wayland-egl/wayland-egl.pc
Matt Turner383a70b2012-08-22 10:01:42 -07002030 src/gallium/Makefile
Tom Stellard80d290d2012-08-24 11:48:32 -07002031 src/gallium/auxiliary/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002032 src/gallium/auxiliary/pipe-loader/Makefile
2033 src/gallium/drivers/Makefile
Matt Turner5c6e1e92013-03-12 17:09:55 -07002034 src/gallium/drivers/freedreno/Makefile
Matt Turner7d5496a2012-08-29 10:31:29 -07002035 src/gallium/drivers/i915/Makefile
Matt Turner960cbd82012-08-29 12:04:45 -07002036 src/gallium/drivers/llvmpipe/Makefile
Matt Turner1cf66322012-08-29 12:33:57 -07002037 src/gallium/drivers/nouveau/Makefile
Matt Turner36066772012-08-29 14:02:13 -07002038 src/gallium/drivers/nv30/Makefile
Matt Turner2a283532012-08-29 14:10:28 -07002039 src/gallium/drivers/nv50/Makefile
Matt Turnerc35cddd2012-08-29 14:14:58 -07002040 src/gallium/drivers/nvc0/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002041 src/gallium/drivers/r300/Makefile
2042 src/gallium/drivers/r600/Makefile
Tom Stellard0dcb9ae2012-08-30 12:55:29 -04002043 src/gallium/drivers/radeon/Makefile
Matt Turnerda2d98f2012-08-29 14:29:08 -07002044 src/gallium/drivers/radeonsi/Makefile
Matt Turnerb51cdfa2012-08-29 11:42:45 -07002045 src/gallium/drivers/rbug/Makefile
Matt Turnerf781d4c2012-08-29 12:17:57 -07002046 src/gallium/drivers/softpipe/Makefile
Matt Turner0a421312012-08-29 12:29:47 -07002047 src/gallium/drivers/svga/Makefile
Tom Stellard047fe042012-08-24 11:46:32 -07002048 src/gallium/drivers/trace/Makefile
Matt Turner9b357582012-08-31 15:45:07 -07002049 src/gallium/state_trackers/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002050 src/gallium/state_trackers/clover/Makefile
Matt Turner2ff51cd2012-08-29 20:30:22 -07002051 src/gallium/state_trackers/dri/Makefile
Matt Turnerd9884812012-08-29 20:34:39 -07002052 src/gallium/state_trackers/dri/drm/Makefile
Matt Turnerf4b1f282012-08-29 20:46:02 -07002053 src/gallium/state_trackers/dri/sw/Makefile
Matt Turner8443efd2012-08-31 17:11:35 -07002054 src/gallium/state_trackers/egl/Makefile
Matt Turnerc0b90812012-09-04 11:41:22 -07002055 src/gallium/state_trackers/gbm/Makefile
Matt Turner083dcdf2012-09-04 11:51:36 -07002056 src/gallium/state_trackers/glx/Makefile
Brian Paul79eac7d2013-03-11 18:31:21 -06002057 src/gallium/state_trackers/osmesa/Makefile
Matt Turnerd2ca32e2012-09-04 13:13:51 -07002058 src/gallium/state_trackers/vdpau/Makefile
Matt Turner68c03112012-09-04 13:24:33 -07002059 src/gallium/state_trackers/vega/Makefile
Matt Turner2ad26032012-09-04 15:17:11 -07002060 src/gallium/state_trackers/xa/Makefile
Matt Turner405a9da2012-09-04 20:59:34 -07002061 src/gallium/state_trackers/xorg/Makefile
Matt Turner984562d2012-09-04 21:08:19 -07002062 src/gallium/state_trackers/xvmc/Makefile
Matt Turner9bf0d492012-08-23 15:55:53 -07002063 src/gallium/targets/Makefile
Matt Turner5c6e1e92013-03-12 17:09:55 -07002064 src/gallium/targets/dri-freedreno/Makefile
Matt Turner2cd5bf72012-09-04 21:26:39 -07002065 src/gallium/targets/dri-i915/Makefile
Matt Turner6ed9f9f2012-09-05 11:07:30 -07002066 src/gallium/targets/dri-nouveau/Makefile
Matt Turnerb570f1f2012-09-05 11:09:53 -07002067 src/gallium/targets/dri-r300/Makefile
Matt Turnerab07ae02012-09-05 11:12:29 -07002068 src/gallium/targets/dri-r600/Makefile
Matt Turnerdd657292012-09-05 11:14:51 -07002069 src/gallium/targets/dri-radeonsi/Makefile
Matt Turnerb3068d82012-09-05 11:17:33 -07002070 src/gallium/targets/dri-swrast/Makefile
Matt Turnerc14c8012012-09-05 11:19:11 -07002071 src/gallium/targets/dri-vmwgfx/Makefile
Matt Turnercdee0e82012-09-10 11:21:26 -07002072 src/gallium/targets/egl-static/Makefile
Matt Turner53c62d32012-09-13 10:10:14 -07002073 src/gallium/targets/gbm/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002074 src/gallium/targets/opencl/Makefile
Brian Paul79eac7d2013-03-11 18:31:21 -06002075 src/gallium/targets/osmesa/Makefile
Matt Turner45270fb2012-09-13 10:45:01 -07002076 src/gallium/targets/pipe-loader/Makefile
Matt Turner0470fb42012-09-05 15:19:30 -07002077 src/gallium/targets/libgl-xlib/Makefile
Matt Turnerd0df9e82012-09-05 15:55:49 -07002078 src/gallium/targets/vdpau-nouveau/Makefile
Matt Turner7e0d6ff2012-09-05 15:59:54 -07002079 src/gallium/targets/vdpau-r300/Makefile
Matt Turner98c05132012-09-05 16:12:49 -07002080 src/gallium/targets/vdpau-r600/Makefile
Matt Turnere3b21602012-09-05 16:28:35 -07002081 src/gallium/targets/vdpau-radeonsi/Makefile
Matt Turner7f244832012-09-05 16:52:41 -07002082 src/gallium/targets/vdpau-softpipe/Makefile
Matt Turnerd53901c2012-09-07 15:24:24 -07002083 src/gallium/targets/xa-vmwgfx/Makefile
2084 src/gallium/targets/xa-vmwgfx/xatracker.pc
Matt Turner1a434912012-09-06 16:56:06 -07002085 src/gallium/targets/xorg-i915/Makefile
Matt Turnerf984d122012-09-07 13:19:45 -07002086 src/gallium/targets/xorg-nouveau/Makefile
Matt Turnerff5ab732012-09-07 13:23:50 -07002087 src/gallium/targets/xorg-r600/Makefile
Matt Turnerf2bf0cd2012-09-07 13:25:59 -07002088 src/gallium/targets/xorg-radeonsi/Makefile
Matt Turnerb173b162012-09-07 13:50:43 -07002089 src/gallium/targets/xvmc-nouveau/Makefile
Matt Turnerc2371cc2012-09-07 13:53:51 -07002090 src/gallium/targets/xvmc-r300/Makefile
Matt Turner45bf6aa2012-09-07 13:56:04 -07002091 src/gallium/targets/xvmc-r600/Makefile
Matt Turneraf6a2e42012-09-07 14:03:27 -07002092 src/gallium/targets/xvmc-softpipe/Makefile
Andreas Boll59088a22012-11-26 19:58:12 +01002093 src/gallium/tests/trivial/Makefile
Andreas Bollcb4d5022012-11-27 19:18:25 +01002094 src/gallium/tests/unit/Makefile
Matt Turner9bf0d492012-08-23 15:55:53 -07002095 src/gallium/winsys/Makefile
Matt Turner5c6e1e92013-03-12 17:09:55 -07002096 src/gallium/winsys/freedreno/drm/Makefile
Matt Turner266d6392012-08-29 10:37:07 -07002097 src/gallium/winsys/i915/drm/Makefile
Matt Turner3bfe7c22012-08-29 10:53:46 -07002098 src/gallium/winsys/i915/sw/Makefile
Matt Turner77fc30b2012-08-29 14:39:48 -07002099 src/gallium/winsys/nouveau/drm/Makefile
Tom Stellard34a61502012-08-24 11:44:57 -07002100 src/gallium/winsys/radeon/drm/Makefile
Matt Turner2b5a1c02012-08-29 14:48:25 -07002101 src/gallium/winsys/svga/drm/Makefile
Matt Turnerb4beea62012-08-29 15:09:30 -07002102 src/gallium/winsys/sw/Makefile
Matt Turnera6b3cd12012-08-29 15:24:40 -07002103 src/gallium/winsys/sw/dri/Makefile
Matt Turner5c4ade52012-08-29 15:28:45 -07002104 src/gallium/winsys/sw/fbdev/Makefile
Matt Turner1c9fb3c2012-08-29 15:32:43 -07002105 src/gallium/winsys/sw/null/Makefile
Matt Turner1d0ef532012-08-29 15:44:25 -07002106 src/gallium/winsys/sw/wayland/Makefile
Matt Turner24c2fe92012-08-29 15:46:57 -07002107 src/gallium/winsys/sw/wrapper/Makefile
Matt Turner44653c02012-08-29 15:51:40 -07002108 src/gallium/winsys/sw/xlib/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002109 src/gbm/Makefile
2110 src/gbm/main/gbm.pc
Jon TURNEY68e04cc2012-06-28 23:15:48 +01002111 src/glsl/Makefile
Thierry Reding9948a332012-10-19 14:03:01 +02002112 src/glsl/builtin_compiler/Makefile
Eric Anholt8ffb0982012-02-05 06:10:56 +01002113 src/glx/Makefile
Ian Romanick2e8c8662012-05-23 15:23:22 -07002114 src/glx/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002115 src/gtest/Makefile
Matt Turner691c3042013-01-18 23:43:05 -08002116 src/mapi/Makefile
Matt Turnera6b8b702012-08-21 14:36:44 -07002117 src/mapi/es1api/Makefile
2118 src/mapi/es1api/glesv1_cm.pc
Matt Turner0f8110c2012-08-21 14:52:59 -07002119 src/mapi/es2api/Makefile
2120 src/mapi/es2api/glesv2.pc
Jon TURNEYb2a37e22012-06-29 18:09:37 +01002121 src/mapi/glapi/Makefile
Eric Anholt3a70f752012-06-11 12:59:21 -07002122 src/mapi/glapi/gen/Makefile
Ian Romanicka29ad2b2012-05-29 11:28:11 -07002123 src/mapi/glapi/tests/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002124 src/mapi/shared-glapi/Makefile
Ian Romanick45d3d0a2012-08-01 14:48:27 -07002125 src/mapi/shared-glapi/tests/Makefile
Matt Turner261719b2012-08-22 16:57:38 -07002126 src/mapi/vgapi/Makefile
2127 src/mapi/vgapi/vg.pc
Eric Anholt417c1a62012-06-12 12:10:58 -07002128 src/mesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002129 src/mesa/gl.pc
Eric Anholtd59149d2012-06-11 10:53:09 -07002130 src/mesa/drivers/Makefile
Matt Turner129213e2012-01-15 11:50:20 -05002131 src/mesa/drivers/dri/dri.pc
Matt Turner80aa7812012-01-26 19:31:12 -05002132 src/mesa/drivers/dri/common/Makefile
Carl Worthb587a752012-12-03 15:43:19 -08002133 src/mesa/drivers/dri/common/xmlpool/Makefile
Matt Turner3c87dfc2012-01-14 21:57:32 -05002134 src/mesa/drivers/dri/i915/Makefile
Eric Anholte3264802012-01-12 14:28:37 -08002135 src/mesa/drivers/dri/i965/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002136 src/mesa/drivers/dri/Makefile
Matt Turner3f964342012-01-15 10:20:30 -05002137 src/mesa/drivers/dri/nouveau/Makefile
Matt Turnerb38d7a02012-01-15 10:04:58 -05002138 src/mesa/drivers/dri/r200/Makefile
Matt Turnere0ee8182012-01-14 22:21:30 -05002139 src/mesa/drivers/dri/radeon/Makefile
Eric Anholt2d4b77c2012-06-12 11:38:19 -07002140 src/mesa/drivers/dri/swrast/Makefile
Laurent Carlier284325d2012-06-24 09:51:27 +02002141 src/mesa/drivers/osmesa/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002142 src/mesa/drivers/osmesa/osmesa.pc
Eric Anholtfa4cf4d2012-05-15 12:23:00 -07002143 src/mesa/drivers/x11/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002144 src/mesa/libdricore/Makefile
2145 src/mesa/main/tests/Makefile
Eric Anholt35fd61b2012-11-06 23:18:41 -08002146 src/mesa/main/tests/hash_table/Makefile
Eric Anholt90784412012-11-07 16:33:39 -08002147 src/mesa/program/Makefile
Matt Turner383a70b2012-08-22 10:01:42 -07002148 src/mesa/x86-64/Makefile
2149 src/mesa/x86/Makefile])
Dan Nicholsondca1b792007-10-23 09:25:58 -07002150
Marek Olšák618dbc82011-06-27 03:12:57 +02002151dnl Sort the dirs alphabetically
Marek Olšák3c799622011-09-27 16:51:05 +02002152GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2153GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
2154GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Tom Stellard26ab7472012-03-03 20:02:05 -05002155GALLIUM_MAKE_DIRS=`echo $GALLIUM_MAKE_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák3c799622011-09-27 16:51:05 +02002156GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
Marek Olšák618dbc82011-06-27 03:12:57 +02002157
Dan Nicholsone14ebbc2008-05-06 11:28:43 -07002158AC_OUTPUT
Dan Nicholsonaab38cf2007-12-11 08:21:51 -08002159
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002160dnl
2161dnl Output some configuration info for the user
2162dnl
2163echo ""
2164echo " prefix: $prefix"
2165echo " exec_prefix: $exec_prefix"
2166echo " libdir: $libdir"
Dan Nicholson11ac5b22008-07-03 09:17:44 -07002167echo " includedir: $includedir"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002168
Chia-I Wu815faa42010-10-29 12:34:44 +08002169dnl API info
2170echo ""
2171echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)"
Chia-I Wu815faa42010-10-29 12:34:44 +08002172echo " OpenVG: $enable_openvg"
2173
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002174dnl Driver info
2175echo ""
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002176if test "x$enable_osmesa" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002177 echo " OSMesa: lib$OSMESA_LIB"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002178else
Chia-I Wu815faa42010-10-29 12:34:44 +08002179 echo " OSMesa: no"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002180fi
2181
2182if test "x$enable_dri" != xno; then
Chia-I Wu815faa42010-10-29 12:34:44 +08002183 # cleanup the drivers var
2184 dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'`
2185 if test "x$DRI_DIRS" = x; then
2186 echo " DRI drivers: no"
2187 else
2188 echo " DRI drivers: $dri_dirs"
2189 fi
2190 echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR"
Dan Nicholson544ab202007-12-30 08:41:53 -08002191fi
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002192
2193case "x$enable_glx$enable_xlib_glx" in
2194xyesyes)
2195 echo " GLX: Xlib-based"
2196 ;;
2197xyesno)
2198 echo " GLX: DRI-based"
Chia-I Wu9e7a4142011-06-26 13:24:32 +09002199 ;;
2200*)
2201 echo " GLX: $enable_glx"
2202 ;;
2203esac
2204
Chia-I Wu815faa42010-10-29 12:34:44 +08002205dnl EGL
2206echo ""
2207echo " EGL: $enable_egl"
2208if test "$enable_egl" = yes; then
2209 echo " EGL platforms: $EGL_PLATFORMS"
Chia-I Wu12300502010-10-31 21:01:54 +08002210
2211 egl_drivers=""
Eric Anholt88612022012-02-05 10:46:13 +01002212 if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then
2213 egl_drivers="$egl_drivers builtin:egl_glx"
2214 fi
2215 if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then
2216 egl_drivers="$egl_drivers builtin:egl_dri2"
2217 fi
Chia-I Wu12300502010-10-31 21:01:54 +08002218
Marek Olšák1251e1d2011-06-18 20:33:55 +02002219 if test "x$HAVE_ST_EGL" = xyes; then
Chia-I Wu12300502010-10-31 21:01:54 +08002220 echo " EGL drivers: ${egl_drivers} egl_gallium"
2221 echo " EGL Gallium STs:$EGL_CLIENT_APIS"
Chia-I Wu815faa42010-10-29 12:34:44 +08002222 else
Chia-I Wu12300502010-10-31 21:01:54 +08002223 echo " EGL drivers: $egl_drivers"
Chia-I Wu815faa42010-10-29 12:34:44 +08002224 fi
Florent Thoumieb5095ab2008-07-28 14:44:43 +01002225fi
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002226
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002227echo ""
Eric Anholt1a8b1272010-05-21 12:17:24 -07002228if test "x$MESA_LLVM" = x1; then
Jakob Bornecrantzfe0fe672010-04-28 13:38:58 +01002229 echo " llvm: yes"
2230 echo " llvm-config: $LLVM_CONFIG"
2231 echo " llvm-version: $LLVM_VERSION"
2232else
2233 echo " llvm: no"
2234fi
2235
2236echo ""
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002237if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then
2238 echo " Gallium: yes"
2239 echo " Gallium dirs: $GALLIUM_DIRS"
Keith Whitwell51bff092010-03-11 14:43:00 +00002240 echo " Target dirs: $GALLIUM_TARGET_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002241 echo " Winsys dirs: $GALLIUM_WINSYS_DIRS"
Jakob Bornecrantzd67bd602009-02-20 11:03:18 +00002242 echo " Driver dirs: $GALLIUM_DRIVERS_DIRS"
Jakob Bornecrantz7e54d7d2009-02-11 02:38:21 +01002243 echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS"
2244else
2245 echo " Gallium: no"
2246fi
2247
Daniel Vetter8f15c312011-11-28 22:24:26 +01002248
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002249dnl Libraries
2250echo ""
2251echo " Shared libs: $enable_shared"
2252echo " Static libs: $enable_static"
Matt Turner53248e52012-08-17 11:25:14 -07002253echo " Shared-glapi: $enable_shared_glapi"
Dan Nicholson9cad8e32007-11-30 08:49:57 -08002254
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002255dnl Compiler options
2256# cleanup the CFLAGS/CXXFLAGS/DEFINES vars
Matt Turner3ed95dc2012-09-05 20:41:08 -07002257cflags=`echo $CFLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002258 $SED 's/^ *//;s/ */ /;s/ *$//'`
Matt Turner3ed95dc2012-09-05 20:41:08 -07002259cxxflags=`echo $CXXFLAGS | \
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002260 $SED 's/^ *//;s/ */ /;s/ *$//'`
Eric Anholte4269492012-06-11 10:25:05 -07002261defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'`
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002262echo ""
2263echo " CFLAGS: $cflags"
2264echo " CXXFLAGS: $cxxflags"
2265echo " Macros: $defines"
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002266echo ""
Marek Olšáka84a8da2012-11-27 22:32:50 +01002267if test "x$MESA_LLVM" = x1; then
2268 echo " LLVM_CFLAGS: $LLVM_CFLAGS"
2269 echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS"
2270 echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS"
2271 echo ""
2272fi
Kenneth Graunke3acc8262010-10-25 13:52:58 -07002273echo " PYTHON2: $PYTHON2"
Dan Nicholson16a07fb2007-12-12 09:12:15 -08002274
Dan Nicholsondca1b792007-10-23 09:25:58 -07002275echo ""
Dan Nicholsonb6459422008-03-24 10:01:50 -07002276echo " Run '${MAKE-make}' to build Mesa"
Dan Nicholsondca1b792007-10-23 09:25:58 -07002277echo ""