Matt Turner | 2f1ab63 | 2012-01-03 21:58:37 -0500 | [diff] [blame] | 1 | dnl Process this file with autoconf to create configure. |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2 | |
Matt Turner | 5172383 | 2011-12-23 19:21:04 -0500 | [diff] [blame] | 3 | AC_PREREQ([2.60]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 4 | |
Dan Nicholson | e97ab72 | 2008-07-01 08:55:42 -0700 | [diff] [blame] | 5 | dnl Tell the user about autoconf.html in the --help output |
| 6 | m4_divert_once([HELP_END], [ |
| 7 | See docs/autoconf.html for more details on the options for Mesa.]) |
| 8 | |
Emil Velikov | 488b3ed | 2013-07-25 23:45:45 +0100 | [diff] [blame] | 9 | m4_define(MESA_VERSION, m4_normalize(m4_include(VERSION))) |
| 10 | AC_INIT([Mesa], [MESA_VERSION], |
Dan Nicholson | f64d6fe | 2007-12-12 17:57:45 -0800 | [diff] [blame] | 11 | [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 12 | AC_CONFIG_AUX_DIR([bin]) |
Matt Turner | 7da1242 | 2012-09-18 20:21:47 -0700 | [diff] [blame] | 13 | AC_CONFIG_MACRO_DIR([m4]) |
Thierry Reding | 9948a33 | 2012-10-19 14:03:01 +0200 | [diff] [blame] | 14 | AC_CANONICAL_SYSTEM |
Eric Anholt | a4ff334 | 2012-06-11 12:59:48 -0700 | [diff] [blame] | 15 | AM_INIT_AUTOMAKE([foreign]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 16 | |
Eric Anholt | 7fa5c91 | 2012-01-12 14:56:56 -0800 | [diff] [blame] | 17 | # Support silent build rules, requires at least automake-1.11. Disable |
| 18 | # by either passing --disable-silent-rules to configure or passing V=1 |
| 19 | # to make |
Lauri Kasanen | 0a82828 | 2013-02-22 22:25:58 +0200 | [diff] [blame] | 20 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])], |
| 21 | [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])]) |
Eric Anholt | 7fa5c91 | 2012-01-12 14:56:56 -0800 | [diff] [blame] | 22 | |
Kenneth Graunke | 4a5d020 | 2012-05-30 21:54:21 -0700 | [diff] [blame] | 23 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
| 24 | |
Johannes Obermayr | 10a96f4 | 2012-09-02 01:35:47 +0200 | [diff] [blame] | 25 | dnl Set internal versions |
| 26 | OSMESA_VERSION=8 |
| 27 | AC_SUBST([OSMESA_VERSION]) |
| 28 | |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 29 | dnl Versions for external dependencies |
Emil Velikov | 5fe4796 | 2014-02-13 00:23:16 +0000 | [diff] [blame] | 30 | LIBDRM_REQUIRED=2.4.38 |
Marek Olšák | 49e2275 | 2014-07-29 23:25:42 +0200 | [diff] [blame] | 31 | LIBDRM_RADEON_REQUIRED=2.4.56 |
Kenneth Graunke | 77425ef | 2014-01-20 10:46:53 -0800 | [diff] [blame] | 32 | LIBDRM_INTEL_REQUIRED=2.4.52 |
Ben Skeggs | 2e47d01 | 2011-12-23 14:03:49 +1000 | [diff] [blame] | 33 | LIBDRM_NVVIEUX_REQUIRED=2.4.33 |
Maarten Lankhorst | 9ba7eac | 2012-12-02 12:07:35 +0100 | [diff] [blame] | 34 | LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41" |
Rob Clark | d48faad | 2014-06-18 10:24:04 -0400 | [diff] [blame] | 35 | LIBDRM_FREEDRENO_REQUIRED=2.4.55 |
Jesse Barnes | 1e39fc7 | 2011-05-05 13:09:16 -0700 | [diff] [blame] | 36 | DRI2PROTO_REQUIRED=2.6 |
Keith Packard | 2d94601 | 2013-11-04 18:15:51 -0800 | [diff] [blame] | 37 | DRI3PROTO_REQUIRED=1.0 |
| 38 | PRESENTPROTO_REQUIRED=1.0 |
| 39 | LIBUDEV_REQUIRED=151 |
Jesse Barnes | 1e39fc7 | 2011-05-05 13:09:16 -0700 | [diff] [blame] | 40 | GLPROTO_REQUIRED=1.4.14 |
Fabio Pedretti | 8a8dd86 | 2014-03-01 10:11:12 +0100 | [diff] [blame] | 41 | LIBOMXIL_BELLAGIO_REQUIRED=0.0 |
| 42 | VDPAU_REQUIRED=0.4.1 |
| 43 | WAYLAND_REQUIRED=1.2.0 |
Emil Velikov | da029f8 | 2014-07-11 23:17:48 +0100 | [diff] [blame] | 44 | XCB_REQUIRED=1.9.3 |
Fabio Pedretti | 8a8dd86 | 2014-03-01 10:11:12 +0100 | [diff] [blame] | 45 | XCBDRI2_REQUIRED=1.8 |
| 46 | XCBGLX_REQUIRED=1.8.1 |
| 47 | XSHMFENCE_REQUIRED=1.1 |
| 48 | XVMC_REQUIRED=1.0.6 |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 49 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 50 | dnl Check for progs |
| 51 | AC_PROG_CPP |
| 52 | AC_PROG_CC |
| 53 | AC_PROG_CXX |
Dylan Noblesmith | a3d5673 | 2012-04-02 15:35:38 +0000 | [diff] [blame] | 54 | AM_PROG_CC_C_O |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 55 | AM_PROG_AS |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 56 | AC_CHECK_PROGS([MAKE], [gmake make]) |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 57 | AC_CHECK_PROGS([PYTHON2], [python2 python]) |
Matt Turner | 3a343ef | 2012-01-11 01:05:56 -0500 | [diff] [blame] | 58 | AC_PROG_SED |
Matt Turner | fd827a8 | 2012-01-21 22:43:02 -0500 | [diff] [blame] | 59 | AC_PROG_MKDIR_P |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 60 | |
Michel Dänzer | 76b906c | 2014-08-29 10:27:43 +0900 | [diff] [blame] | 61 | AC_SYS_LARGEFILE |
| 62 | |
Emil Velikov | 957a28e | 2014-08-13 17:55:39 +0100 | [diff] [blame] | 63 | LT_PREREQ([2.2]) |
| 64 | LT_INIT([disable-static]) |
| 65 | |
Matt Turner | b68b852 | 2012-10-01 13:11:30 -0700 | [diff] [blame] | 66 | AX_PROG_BISON([], |
Matt Turner | 02b6da1 | 2013-01-29 11:22:06 -0800 | [diff] [blame] | 67 | AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"], |
Matt Turner | b68b852 | 2012-10-01 13:11:30 -0700 | [diff] [blame] | 68 | [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])])) |
Matt Turner | 2a71054 | 2012-10-01 13:28:51 -0700 | [diff] [blame] | 69 | AX_PROG_FLEX([], |
Matt Turner | 02b6da1 | 2013-01-29 11:22:06 -0800 | [diff] [blame] | 70 | AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-lex.c"], |
Matt Turner | 2a71054 | 2012-10-01 13:28:51 -0700 | [diff] [blame] | 71 | [AC_MSG_ERROR([flex not found - unable to compile glcpp-lex.l])])) |
Brian Paul | de1df26 | 2011-05-18 07:50:21 -0600 | [diff] [blame] | 72 | |
Kenneth Graunke | 2224fb6 | 2012-05-29 16:03:05 -0700 | [diff] [blame] | 73 | AC_CHECK_PROG(INDENT, indent, indent, cat) |
| 74 | if test "x$INDENT" != "xcat"; then |
Vinson Lee | 2f358fe | 2012-12-31 15:19:43 -0800 | [diff] [blame] | 75 | AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -TGLubyte -TGLbyte -TBool') |
Kenneth Graunke | 2224fb6 | 2012-05-29 16:03:05 -0700 | [diff] [blame] | 76 | fi |
| 77 | |
Dan Nicholson | bc302b2 | 2009-05-22 09:39:02 -0700 | [diff] [blame] | 78 | AC_PROG_INSTALL |
Dan Nicholson | bc302b2 | 2009-05-22 09:39:02 -0700 | [diff] [blame] | 79 | |
Dan Nicholson | bfb27b5 | 2008-06-30 09:40:30 -0700 | [diff] [blame] | 80 | dnl We need a POSIX shell for parts of the build. Assume we have one |
| 81 | dnl in most cases. |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 82 | case "$host_os" in |
| 83 | solaris*) |
| 84 | # Solaris /bin/sh is too old/non-POSIX compliant |
| 85 | AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh]) |
Dan Nicholson | bfb27b5 | 2008-06-30 09:40:30 -0700 | [diff] [blame] | 86 | SHELL="$POSIX_SHELL" |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 87 | ;; |
| 88 | esac |
| 89 | |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 90 | dnl clang is mostly GCC-compatible, but its version is much lower, |
| 91 | dnl so we have to check for it. |
| 92 | AC_MSG_CHECKING([if compiling with clang]) |
| 93 | |
| 94 | AC_COMPILE_IFELSE( |
| 95 | [AC_LANG_PROGRAM([], [[ |
| 96 | #ifndef __clang__ |
| 97 | not clang |
| 98 | #endif |
| 99 | ]])], |
Jeremy Huddleston | b728eef | 2011-05-05 14:08:57 -0700 | [diff] [blame] | 100 | [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no]) |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 101 | |
Jeremy Huddleston | b728eef | 2011-05-05 14:08:57 -0700 | [diff] [blame] | 102 | AC_MSG_RESULT([$acv_mesa_CLANG]) |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 103 | |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 104 | dnl If we're using GCC, make sure that it is at least version 3.3.0. Older |
| 105 | dnl versions are explictly not supported. |
Mike Frysinger | 73c9b4b | 2013-02-04 21:27:40 -0500 | [diff] [blame] | 106 | GEN_ASM_OFFSETS=no |
Jeremy Huddleston | b728eef | 2011-05-05 14:08:57 -0700 | [diff] [blame] | 107 | if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 108 | AC_MSG_CHECKING([whether gcc version is sufficient]) |
| 109 | major=0 |
| 110 | minor=0 |
| 111 | |
| 112 | GCC_VERSION=`$CC -dumpversion` |
| 113 | if test $? -eq 0; then |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 114 | GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` |
| 115 | GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 116 | fi |
| 117 | |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 118 | if test $GCC_VERSION_MAJOR -lt 3 -o $GCC_VERSION_MAJOR -eq 3 -a $GCC_VERSION_MINOR -lt 3 ; then |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 119 | AC_MSG_RESULT([no]) |
| 120 | AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.]) |
| 121 | else |
| 122 | AC_MSG_RESULT([yes]) |
| 123 | fi |
Mike Frysinger | 73c9b4b | 2013-02-04 21:27:40 -0500 | [diff] [blame] | 124 | |
| 125 | if test "x$cross_compiling" = xyes; then |
| 126 | GEN_ASM_OFFSETS=yes |
| 127 | fi |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 128 | fi |
Tom Stellard | f8ba0f5 | 2014-02-20 07:31:16 -0800 | [diff] [blame] | 129 | |
| 130 | dnl Check for compiler builtins |
| 131 | AX_GCC_BUILTIN([__builtin_bswap32]) |
Tom Stellard | a9f88e2 | 2014-02-19 14:17:33 -0800 | [diff] [blame] | 132 | AX_GCC_BUILTIN([__builtin_bswap64]) |
Tom Stellard | f8ba0f5 | 2014-02-20 07:31:16 -0800 | [diff] [blame] | 133 | |
Mike Frysinger | 73c9b4b | 2013-02-04 21:27:40 -0500 | [diff] [blame] | 134 | AM_CONDITIONAL([GEN_ASM_OFFSETS], test "x$GEN_ASM_OFFSETS" = xyes) |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 135 | |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 136 | dnl Make sure the pkg-config macros are defined |
Dan Nicholson | 356f311 | 2009-04-29 06:49:27 -0700 | [diff] [blame] | 137 | m4_ifndef([PKG_PROG_PKG_CONFIG], |
| 138 | [m4_fatal([Could not locate the pkg-config autoconf macros. |
| 139 | These are usually located in /usr/share/aclocal/pkg.m4. If your macros |
| 140 | are in a different location, try setting the environment variable |
| 141 | ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 142 | PKG_PROG_PKG_CONFIG() |
| 143 | |
| 144 | dnl LIB_DIR - library basename |
| 145 | LIB_DIR=`echo $libdir | $SED 's%.*/%%'` |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 146 | AC_SUBST([LIB_DIR]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 147 | |
Matt Turner | d12b07e | 2012-08-14 12:33:32 -0700 | [diff] [blame] | 148 | dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 149 | _SAVE_LDFLAGS="$LDFLAGS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 150 | _SAVE_CPPFLAGS="$CPPFLAGS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 151 | |
| 152 | dnl Compiler macros |
Matt Turner | 4bb9d16 | 2014-06-10 18:18:39 -0700 | [diff] [blame] | 153 | DEFINES="-DUSE_EXTERNAL_DXTN_LIB=1" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 154 | AC_SUBST([DEFINES]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 155 | case "$host_os" in |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 156 | linux*|*-gnu*|gnu*) |
Matt Turner | b133b84 | 2014-09-21 17:33:21 -0700 | [diff] [blame^] | 157 | DEFINES="$DEFINES -D_GNU_SOURCE" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 158 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 159 | solaris*) |
Matt Turner | b133b84 | 2014-09-21 17:33:21 -0700 | [diff] [blame^] | 160 | DEFINES="$DEFINES -DSVR4" |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 161 | ;; |
Brian Paul | 9798890 | 2010-02-18 12:46:12 -0700 | [diff] [blame] | 162 | cygwin*) |
Matt Turner | b133b84 | 2014-09-21 17:33:21 -0700 | [diff] [blame^] | 163 | DEFINES="$DEFINES -D_XOPEN_SOURCE=700" |
Brian Paul | 9798890 | 2010-02-18 12:46:12 -0700 | [diff] [blame] | 164 | ;; |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 165 | esac |
| 166 | |
| 167 | dnl Add flags for gcc and g++ |
| 168 | if test "x$GCC" = xyes; then |
Jon TURNEY | 7a641dd | 2014-06-02 17:40:38 +0100 | [diff] [blame] | 169 | CFLAGS="$CFLAGS -Wall -std=c99" |
Eric Anholt | b9aab8b | 2012-01-26 18:48:20 -0800 | [diff] [blame] | 170 | |
| 171 | # Enable -Werror=implicit-function-declaration and |
| 172 | # -Werror=missing-prototypes, if available, or otherwise, just |
| 173 | # -Wmissing-prototypes. This is particularly useful to avoid |
| 174 | # generating a loadable driver module that has undefined symbols. |
| 175 | save_CFLAGS="$CFLAGS" |
| 176 | AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes]) |
| 177 | CFLAGS="$CFLAGS -Werror=implicit-function-declaration" |
| 178 | CFLAGS="$CFLAGS -Werror=missing-prototypes" |
| 179 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], |
| 180 | AC_MSG_RESULT([yes]), |
| 181 | [CFLAGS="$save_CFLAGS -Wmissing-prototypes"; |
| 182 | AC_MSG_RESULT([no])]); |
Alan Coopersmith | adda7f3 | 2010-01-16 18:34:23 -0800 | [diff] [blame] | 183 | |
| 184 | # Enable -fvisibility=hidden if using a gcc that supports it |
| 185 | save_CFLAGS="$CFLAGS" |
Alan Coopersmith | f8107a4 | 2010-01-21 16:42:58 -0800 | [diff] [blame] | 186 | AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 187 | VISIBILITY_CFLAGS="-fvisibility=hidden" |
| 188 | CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" |
Alan Coopersmith | adda7f3 | 2010-01-16 18:34:23 -0800 | [diff] [blame] | 189 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 190 | [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); |
| 191 | |
| 192 | # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. |
| 193 | CFLAGS=$save_CFLAGS |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 194 | |
| 195 | # Work around aliasing bugs - developers should comment this out |
| 196 | CFLAGS="$CFLAGS -fno-strict-aliasing" |
José Fonseca | 1448bdf | 2011-10-14 18:28:55 +0100 | [diff] [blame] | 197 | |
| 198 | # gcc's builtin memcmp is slower than glibc's |
| 199 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052 |
| 200 | CFLAGS="$CFLAGS -fno-builtin-memcmp" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 201 | fi |
| 202 | if test "x$GXX" = xyes; then |
| 203 | CXXFLAGS="$CXXFLAGS -Wall" |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 204 | |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 205 | # Enable -fvisibility=hidden if using a gcc that supports it |
| 206 | save_CXXFLAGS="$CXXFLAGS" |
| 207 | AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 208 | VISIBILITY_CXXFLAGS="-fvisibility=hidden" |
| 209 | CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS" |
Jon TURNEY | 560f762 | 2011-04-26 11:49:01 +0100 | [diff] [blame] | 210 | AC_LANG_PUSH([C++]) |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 211 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 212 | [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]); |
Jon TURNEY | 560f762 | 2011-04-26 11:49:01 +0100 | [diff] [blame] | 213 | AC_LANG_POP([C++]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 214 | |
| 215 | # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed. |
| 216 | CXXFLAGS=$save_CXXFLAGS |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 217 | |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 218 | # Work around aliasing bugs - developers should comment this out |
| 219 | CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" |
José Fonseca | 1448bdf | 2011-10-14 18:28:55 +0100 | [diff] [blame] | 220 | |
| 221 | # gcc's builtin memcmp is slower than glibc's |
| 222 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052 |
| 223 | CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 224 | fi |
| 225 | |
Jon TURNEY | db78643 | 2011-04-26 11:56:02 +0100 | [diff] [blame] | 226 | dnl even if the compiler appears to support it, using visibility attributes isn't |
| 227 | dnl going to do anything useful currently on cygwin apart from emit lots of warnings |
| 228 | case "$host_os" in |
| 229 | cygwin*) |
| 230 | VISIBILITY_CFLAGS="" |
| 231 | VISIBILITY_CXXFLAGS="" |
| 232 | ;; |
| 233 | esac |
| 234 | |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 235 | AC_SUBST([VISIBILITY_CFLAGS]) |
| 236 | AC_SUBST([VISIBILITY_CXXFLAGS]) |
| 237 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 238 | dnl |
Lauri Kasanen | fcefdc9 | 2013-12-19 21:43:25 +0200 | [diff] [blame] | 239 | dnl Optional flags, check for compiler support |
| 240 | dnl |
| 241 | AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_SUPPORTED=1], [SSE41_SUPPORTED=0]) |
Emil Velikov | b3121bf | 2014-08-01 17:06:10 +0100 | [diff] [blame] | 242 | if test "x$SSE41_SUPPORTED" = x1; then |
| 243 | DEFINES="$DEFINES -DUSE_SSE41" |
| 244 | fi |
Lauri Kasanen | fcefdc9 | 2013-12-19 21:43:25 +0200 | [diff] [blame] | 245 | AM_CONDITIONAL([SSE41_SUPPORTED], [test x$SSE41_SUPPORTED = x1]) |
| 246 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 247 | dnl Can't have static and shared libraries, default to static if user |
| 248 | dnl explicitly requested. If both disabled, set to static since shared |
Matt Turner | 0c17823 | 2012-01-14 11:10:06 -0500 | [diff] [blame] | 249 | dnl was explicitly requested. |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 250 | case "x$enable_static$enable_shared" in |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 251 | xyesyes) |
| 252 | AC_MSG_WARN([Cannot build static and shared libraries, disabling shared]) |
| 253 | enable_shared=no |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 254 | ;; |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 255 | xnono) |
| 256 | AC_MSG_WARN([Cannot disable both static and shared libraries, enabling shared]) |
Emil Velikov | a6efbac | 2014-03-11 11:50:37 +0000 | [diff] [blame] | 257 | enable_shared=yes |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 258 | ;; |
| 259 | esac |
| 260 | |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 261 | AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes) |
| 262 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 263 | dnl |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 264 | dnl other compiler options |
| 265 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 266 | AC_ARG_ENABLE([debug], |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 267 | [AS_HELP_STRING([--enable-debug], |
| 268 | [use debug compiler flags and macros @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 269 | [enable_debug="$enableval"], |
| 270 | [enable_debug=no] |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 271 | ) |
| 272 | if test "x$enable_debug" = xyes; then |
| 273 | DEFINES="$DEFINES -DDEBUG" |
| 274 | if test "x$GCC" = xyes; then |
Ian Romanick | 66decc7 | 2014-07-14 11:22:20 -0700 | [diff] [blame] | 275 | if ! echo "$CFLAGS" | grep -q -e '-g'; then |
| 276 | CFLAGS="$CFLAGS -g" |
| 277 | fi |
| 278 | if ! echo "$CFLAGS" | grep -q -e '-O'; then |
| 279 | CFLAGS="$CFLAGS -O0" |
| 280 | fi |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 281 | fi |
| 282 | if test "x$GXX" = xyes; then |
Ian Romanick | 66decc7 | 2014-07-14 11:22:20 -0700 | [diff] [blame] | 283 | if ! echo "$CXXFLAGS" | grep -q -e '-g'; then |
| 284 | CXXFLAGS="$CXXFLAGS -g" |
| 285 | fi |
| 286 | if ! echo "$CXXFLAGS" | grep -q -e '-O'; then |
| 287 | CXXFLAGS="$CXXFLAGS -O0" |
| 288 | fi |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 289 | fi |
| 290 | fi |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 291 | |
| 292 | dnl |
Jon TURNEY | ff90a87 | 2014-05-11 14:38:52 +0100 | [diff] [blame] | 293 | dnl Check if linker supports -Bsymbolic |
| 294 | dnl |
| 295 | save_LDFLAGS=$LDFLAGS |
| 296 | LDFLAGS="$LDFLAGS -Wl,-Bsymbolic" |
| 297 | AC_MSG_CHECKING([if ld supports -Bsymbolic]) |
| 298 | AC_LINK_IFELSE( |
| 299 | [AC_LANG_SOURCE([int main() { return 0;}])], |
| 300 | [AC_MSG_RESULT([yes]) |
| 301 | BSYMBOLIC="-Wl,-Bsymbolic";], |
| 302 | [AC_MSG_RESULT([no]) |
| 303 | BSYMBOLIC="";]) |
| 304 | LDFLAGS=$save_LDFLAGS |
| 305 | |
| 306 | AC_SUBST([BSYMBOLIC]) |
| 307 | |
| 308 | dnl |
Emil Velikov | d681b22 | 2014-03-11 17:58:08 +0000 | [diff] [blame] | 309 | dnl Check if linker supports garbage collection |
| 310 | dnl |
| 311 | save_LDFLAGS=$LDFLAGS |
| 312 | LDFLAGS="$LDFLAGS -Wl,--gc-sections" |
| 313 | AC_MSG_CHECKING([whether ld supports --gc-sections]) |
| 314 | AC_LINK_IFELSE( |
| 315 | [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])], |
| 316 | [AC_MSG_RESULT([yes]) |
| 317 | GC_SECTIONS="-Wl,--gc-sections";], |
| 318 | [AC_MSG_RESULT([no]) |
| 319 | GC_SECTIONS="";]) |
| 320 | LDFLAGS=$save_LDFLAGS |
| 321 | |
| 322 | AC_SUBST([GC_SECTIONS]) |
| 323 | |
| 324 | dnl |
Emil Velikov | f57d092 | 2014-05-13 01:33:48 +0100 | [diff] [blame] | 325 | dnl OpenBSD does not have DT_NEEDED entries for libc by design |
| 326 | dnl so when these flags are passed to ld via libtool the checks will fail |
| 327 | dnl |
| 328 | case "$host_os" in |
Vinson Lee | 5dd927b | 2014-05-21 22:13:13 -0700 | [diff] [blame] | 329 | openbsd* | darwin* ) |
Emil Velikov | f57d092 | 2014-05-13 01:33:48 +0100 | [diff] [blame] | 330 | LD_NO_UNDEFINED="" ;; |
| 331 | *) |
| 332 | LD_NO_UNDEFINED="-Wl,--no-undefined" ;; |
| 333 | esac |
| 334 | |
| 335 | AC_SUBST([LD_NO_UNDEFINED]) |
| 336 | |
| 337 | dnl |
Jon TURNEY | ff90a87 | 2014-05-11 14:38:52 +0100 | [diff] [blame] | 338 | dnl Check if linker supports version scripts |
| 339 | dnl |
| 340 | AC_MSG_CHECKING([if the linker supports version-scripts]) |
| 341 | save_LDFLAGS=$LDFLAGS |
| 342 | LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" |
| 343 | cat > conftest.map <<EOF |
| 344 | VERSION_1 { |
| 345 | global: |
| 346 | main; |
| 347 | |
| 348 | local: |
| 349 | *; |
| 350 | }; |
| 351 | EOF |
| 352 | AC_LINK_IFELSE( |
| 353 | [AC_LANG_SOURCE([int main() { return 0;}])], |
| 354 | [have_ld_version_script=yes;AC_MSG_RESULT(yes)], |
| 355 | [have_ld_version_script=no; AC_MSG_RESULT(no)]) |
| 356 | LDFLAGS=$save_LDFLAGS |
| 357 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") |
| 358 | |
| 359 | dnl |
Jonathan Gray | 635477d | 2014-09-02 02:08:00 +1000 | [diff] [blame] | 360 | dnl Check if linker supports dynamic list files |
| 361 | dnl |
| 362 | AC_MSG_CHECKING([if the linker supports --dynamic-list]) |
| 363 | save_LDFLAGS=$LDFLAGS |
| 364 | LDFLAGS="$LDFLAGS -Wl,--dynamic-list=conftest.dyn" |
| 365 | cat > conftest.dyn <<EOF |
| 366 | { |
| 367 | radeon_drm_winsys_create; |
| 368 | }; |
| 369 | EOF |
| 370 | AC_LINK_IFELSE( |
| 371 | [AC_LANG_SOURCE([int main() { return 0;}])], |
| 372 | [have_ld_dynamic_list=yes;AC_MSG_RESULT(yes)], |
| 373 | [have_ld_dynamic_list=no; AC_MSG_RESULT(no)]) |
| 374 | LDFLAGS=$save_LDFLAGS |
| 375 | AM_CONDITIONAL(HAVE_LD_DYNAMIC_LIST, test "$have_ld_dynamic_list" = "yes") |
| 376 | |
| 377 | dnl |
Emil Velikov | 22c1335 | 2014-03-09 11:50:44 +0000 | [diff] [blame] | 378 | dnl compatibility symlinks |
| 379 | dnl |
| 380 | case "$host_os" in |
| 381 | linux* ) |
| 382 | HAVE_COMPAT_SYMLINKS=yes ;; |
| 383 | * ) |
| 384 | HAVE_COMPAT_SYMLINKS=no ;; |
| 385 | esac |
| 386 | |
| 387 | AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test "x$HAVE_COMPAT_SYMLINKS" = xyes) |
| 388 | |
| 389 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 390 | dnl library names |
| 391 | dnl |
Emil Velikov | a6efbac | 2014-03-11 11:50:37 +0000 | [diff] [blame] | 392 | case "$host_os" in |
| 393 | darwin* ) |
| 394 | LIB_EXT='dylib' ;; |
| 395 | cygwin* ) |
| 396 | LIB_EXT='dll' ;; |
| 397 | aix* ) |
| 398 | LIB_EXT='a' ;; |
| 399 | * ) |
| 400 | LIB_EXT='so' ;; |
| 401 | esac |
Emil Velikov | bba9c28 | 2014-03-08 19:48:04 +0000 | [diff] [blame] | 402 | |
| 403 | AC_SUBST([LIB_EXT]) |
| 404 | |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 405 | AC_ARG_WITH([gl-lib-name], |
| 406 | [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@], |
| 407 | [specify GL library name @<:@default=GL@:>@])], |
| 408 | [GL_LIB=$withval], |
| 409 | [GL_LIB=GL]) |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 410 | AC_ARG_WITH([osmesa-lib-name], |
| 411 | [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@], |
| 412 | [specify OSMesa library name @<:@default=OSMesa@:>@])], |
| 413 | [OSMESA_LIB=$withval], |
| 414 | [OSMESA_LIB=OSMesa]) |
| 415 | AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL]) |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 416 | AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa]) |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 417 | |
Marek Olšák | 848f7d3 | 2011-04-01 01:12:41 +0200 | [diff] [blame] | 418 | dnl |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 419 | dnl Mangled Mesa support |
| 420 | dnl |
| 421 | AC_ARG_ENABLE([mangling], |
| 422 | [AS_HELP_STRING([--enable-mangling], |
| 423 | [enable mangled symbols and library name @<:@default=disabled@:>@])], |
| 424 | [enable_mangling="${enableval}"], |
| 425 | [enable_mangling=no] |
| 426 | ) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 427 | if test "x${enable_mangling}" = "xyes" ; then |
| 428 | DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE" |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 429 | GL_LIB="Mangled${GL_LIB}" |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 430 | OSMESA_LIB="Mangled${OSMESA_LIB}" |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 431 | fi |
| 432 | AC_SUBST([GL_LIB]) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 433 | AC_SUBST([OSMESA_LIB]) |
| 434 | |
| 435 | dnl |
Marek Olšák | 848f7d3 | 2011-04-01 01:12:41 +0200 | [diff] [blame] | 436 | dnl potentially-infringing-but-nobody-knows-for-sure stuff |
| 437 | dnl |
| 438 | AC_ARG_ENABLE([texture-float], |
| 439 | [AS_HELP_STRING([--enable-texture-float], |
| 440 | [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])], |
| 441 | [enable_texture_float="$enableval"], |
| 442 | [enable_texture_float=no] |
| 443 | ) |
| 444 | if test "x$enable_texture_float" = xyes; then |
| 445 | AC_MSG_WARN([Floating-point textures enabled.]) |
| 446 | AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.]) |
| 447 | DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED" |
| 448 | fi |
| 449 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 450 | dnl |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 451 | dnl Arch/platform-specific settings |
| 452 | dnl |
| 453 | AC_ARG_ENABLE([asm], |
| 454 | [AS_HELP_STRING([--disable-asm], |
| 455 | [disable assembly usage @<:@default=enabled on supported plaforms@:>@])], |
| 456 | [enable_asm="$enableval"], |
| 457 | [enable_asm=yes] |
| 458 | ) |
| 459 | asm_arch="" |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 460 | AC_MSG_CHECKING([whether to enable assembly]) |
| 461 | test "x$enable_asm" = xno && AC_MSG_RESULT([no]) |
| 462 | # disable if cross compiling on x86/x86_64 since we must run gen_matypes |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 463 | if test "x$enable_asm" = xyes -a "x$cross_compiling" = xyes; then |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 464 | case "$host_cpu" in |
Jean-Sébastien Pédron | 148f0de | 2013-06-05 13:27:37 +0200 | [diff] [blame] | 465 | i?86 | x86_64 | amd64) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 466 | enable_asm=no |
| 467 | AC_MSG_RESULT([no, cross compiling]) |
| 468 | ;; |
| 469 | esac |
| 470 | fi |
| 471 | # check for supported arches |
| 472 | if test "x$enable_asm" = xyes; then |
| 473 | case "$host_cpu" in |
| 474 | i?86) |
| 475 | case "$host_os" in |
Emil Velikov | 395ce0b | 2014-08-13 18:05:56 +0100 | [diff] [blame] | 476 | linux* | *freebsd* | dragonfly* | *netbsd* | openbsd* | gnu*) |
Andreas Boll | 06fff29 | 2013-03-16 13:50:19 +0100 | [diff] [blame] | 477 | asm_arch=x86 |
| 478 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 479 | esac |
| 480 | ;; |
Jean-Sébastien Pédron | 148f0de | 2013-06-05 13:27:37 +0200 | [diff] [blame] | 481 | x86_64|amd64) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 482 | case "$host_os" in |
Jonathan Gray | 78fbb41 | 2013-06-26 17:11:57 +1000 | [diff] [blame] | 483 | linux* | *freebsd* | dragonfly* | *netbsd* | openbsd*) |
Emil Velikov | 395ce0b | 2014-08-13 18:05:56 +0100 | [diff] [blame] | 484 | asm_arch=x86_64 |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 485 | ;; |
| 486 | esac |
| 487 | ;; |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 488 | sparc*) |
| 489 | case "$host_os" in |
| 490 | linux*) |
| 491 | asm_arch=sparc |
| 492 | ;; |
| 493 | esac |
| 494 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 495 | esac |
| 496 | |
| 497 | case "$asm_arch" in |
| 498 | x86) |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 499 | DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 500 | AC_MSG_RESULT([yes, x86]) |
| 501 | ;; |
Jean-Sébastien Pédron | 148f0de | 2013-06-05 13:27:37 +0200 | [diff] [blame] | 502 | x86_64|amd64) |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 503 | DEFINES="$DEFINES -DUSE_X86_64_ASM" |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 504 | AC_MSG_RESULT([yes, x86_64]) |
| 505 | ;; |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 506 | sparc) |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 507 | DEFINES="$DEFINES -DUSE_SPARC_ASM" |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 508 | AC_MSG_RESULT([yes, sparc]) |
| 509 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 510 | *) |
| 511 | AC_MSG_RESULT([no, platform not supported]) |
| 512 | ;; |
| 513 | esac |
| 514 | fi |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 515 | |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 516 | dnl Check to see if dlopen is in default libraries (like Solaris, which |
| 517 | dnl has it in libc), or if libdl is needed to get it. |
Tapani Pälli | 57c57df | 2012-08-16 13:59:12 +0300 | [diff] [blame] | 518 | AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"], |
| 519 | [AC_CHECK_LIB([dl], [dlopen], |
| 520 | [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])]) |
Chia-I Wu | 08f4bc0 | 2010-07-16 20:09:29 +0800 | [diff] [blame] | 521 | AC_SUBST([DLOPEN_LIBS]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 522 | |
Jon TURNEY | ec8ebff | 2014-04-05 17:11:45 +0100 | [diff] [blame] | 523 | dnl Check if that library also has dladdr |
Jon TURNEY | a2e1dc0 | 2014-08-08 20:13:18 +0100 | [diff] [blame] | 524 | save_LIBS="$LIBS" |
| 525 | LIBS="$LIBS $DLOPEN_LIBS" |
| 526 | AC_CHECK_FUNCS([dladdr]) |
| 527 | LIBS="$save_LIBS" |
Jon TURNEY | ec8ebff | 2014-04-05 17:11:45 +0100 | [diff] [blame] | 528 | |
Vinson Lee | 990bd49 | 2013-01-26 22:50:05 -0800 | [diff] [blame] | 529 | case "$host_os" in |
Vinson Lee | c403a52 | 2013-02-19 00:52:40 -0800 | [diff] [blame] | 530 | darwin*|mingw*) |
Vinson Lee | 990bd49 | 2013-01-26 22:50:05 -0800 | [diff] [blame] | 531 | ;; |
| 532 | *) |
| 533 | AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=], |
| 534 | [AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt], |
Matt Turner | 180e60d | 2014-06-10 18:08:10 -0700 | [diff] [blame] | 535 | [AC_MSG_ERROR([Could not find clock_gettime])])]) |
Vinson Lee | 990bd49 | 2013-01-26 22:50:05 -0800 | [diff] [blame] | 536 | AC_SUBST([CLOCK_LIB]) |
| 537 | ;; |
| 538 | esac |
Dave Airlie | ec83535 | 2012-12-04 09:25:13 +1000 | [diff] [blame] | 539 | |
Dan Nicholson | 985e1cd | 2008-06-04 13:17:06 -0700 | [diff] [blame] | 540 | dnl See if posix_memalign is available |
| 541 | AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"]) |
| 542 | |
Matt Turner | 7da1242 | 2012-09-18 20:21:47 -0700 | [diff] [blame] | 543 | dnl Check for pthreads |
Vinson Lee | 82c577a | 2014-06-03 17:00:24 -0700 | [diff] [blame] | 544 | case "$host_os" in |
| 545 | mingw*) |
| 546 | ;; |
| 547 | *) |
| 548 | AX_PTHREAD |
| 549 | ;; |
| 550 | esac |
Matt Turner | dd4fde8 | 2012-09-27 15:49:52 -0700 | [diff] [blame] | 551 | dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS |
| 552 | dnl to -pthread, which causes problems if we need -lpthread to appear in |
| 553 | dnl pkgconfig files. |
| 554 | test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread" |
Matt Turner | 7da1242 | 2012-09-18 20:21:47 -0700 | [diff] [blame] | 555 | |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 556 | dnl SELinux awareness. |
| 557 | AC_ARG_ENABLE([selinux], |
| 558 | [AS_HELP_STRING([--enable-selinux], |
| 559 | [Build SELinux-aware Mesa @<:@default=disabled@:>@])], |
| 560 | [MESA_SELINUX="$enableval"], |
| 561 | [MESA_SELINUX=no]) |
| 562 | if test "x$enable_selinux" = "xyes"; then |
Kusanagi Kouichi | 6ba4392 | 2014-02-15 11:53:00 +0900 | [diff] [blame] | 563 | PKG_CHECK_MODULES([SELINUX], [libselinux], [], |
| 564 | [AC_CHECK_HEADER([selinux/selinux.h],[], |
| 565 | [AC_MSG_ERROR([SELinux headers not found])]) |
| 566 | AC_CHECK_LIB([selinux],[is_selinux_enabled],[], |
| 567 | [AC_MSG_ERROR([SELinux library not found])]) |
| 568 | SELINUX_LIBS="-lselinux"]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 569 | DEFINES="$DEFINES -DMESA_SELINUX" |
| 570 | fi |
Kusanagi Kouichi | 6ba4392 | 2014-02-15 11:53:00 +0900 | [diff] [blame] | 571 | AC_SUBST([SELINUX_CFLAGS]) |
Matt Turner | 9ed0007 | 2012-09-18 20:22:37 -0700 | [diff] [blame] | 572 | AC_SUBST([SELINUX_LIBS]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 573 | |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 574 | dnl Options for APIs |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 575 | AC_ARG_ENABLE([opengl], |
| 576 | [AS_HELP_STRING([--disable-opengl], |
| 577 | [disable support for standard OpenGL API @<:@default=no@:>@])], |
| 578 | [enable_opengl="$enableval"], |
| 579 | [enable_opengl=yes]) |
| 580 | AC_ARG_ENABLE([gles1], |
| 581 | [AS_HELP_STRING([--enable-gles1], |
| 582 | [enable support for OpenGL ES 1.x API @<:@default=no@:>@])], |
| 583 | [enable_gles1="$enableval"], |
| 584 | [enable_gles1=no]) |
| 585 | AC_ARG_ENABLE([gles2], |
| 586 | [AS_HELP_STRING([--enable-gles2], |
| 587 | [enable support for OpenGL ES 2.x API @<:@default=no@:>@])], |
| 588 | [enable_gles2="$enableval"], |
| 589 | [enable_gles2=no]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 590 | AC_ARG_ENABLE([openvg], |
| 591 | [AS_HELP_STRING([--enable-openvg], |
| 592 | [enable support for OpenVG API @<:@default=no@:>@])], |
| 593 | [enable_openvg="$enableval"], |
| 594 | [enable_openvg=no]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 595 | |
| 596 | AC_ARG_ENABLE([dri], |
| 597 | [AS_HELP_STRING([--enable-dri], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 598 | [enable DRI modules @<:@default=enabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 599 | [enable_dri="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 600 | [enable_dri=yes]) |
Emil Velikov | 23740ed | 2014-03-21 18:09:36 +0000 | [diff] [blame] | 601 | |
| 602 | case "$host_os" in |
| 603 | linux*) |
| 604 | dri3_default=yes |
| 605 | ;; |
| 606 | *) |
| 607 | dri3_default=no |
| 608 | ;; |
| 609 | esac |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 610 | AC_ARG_ENABLE([dri3], |
| 611 | [AS_HELP_STRING([--enable-dri3], |
Emil Velikov | 23740ed | 2014-03-21 18:09:36 +0000 | [diff] [blame] | 612 | [enable DRI3 @<:@default=auto@:>@])], |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 613 | [enable_dri3="$enableval"], |
Emil Velikov | 23740ed | 2014-03-21 18:09:36 +0000 | [diff] [blame] | 614 | [enable_dri3="$dri3_default"]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 615 | AC_ARG_ENABLE([glx], |
| 616 | [AS_HELP_STRING([--enable-glx], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 617 | [enable GLX library @<:@default=enabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 618 | [enable_glx="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 619 | [enable_glx=yes]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 620 | AC_ARG_ENABLE([osmesa], |
| 621 | [AS_HELP_STRING([--enable-osmesa], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 622 | [enable OSMesa library @<:@default=disabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 623 | [enable_osmesa="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 624 | [enable_osmesa=no]) |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 625 | AC_ARG_ENABLE([gallium-osmesa], |
| 626 | [AS_HELP_STRING([--enable-gallium-osmesa], |
| 627 | [enable Gallium implementation of the OSMesa library @<:@default=disabled@:>@])], |
| 628 | [enable_gallium_osmesa="$enableval"], |
| 629 | [enable_gallium_osmesa=no]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 630 | AC_ARG_ENABLE([egl], |
| 631 | [AS_HELP_STRING([--disable-egl], |
| 632 | [disable EGL library @<:@default=enabled@:>@])], |
| 633 | [enable_egl="$enableval"], |
| 634 | [enable_egl=yes]) |
| 635 | |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 636 | AC_ARG_ENABLE([xa], |
| 637 | [AS_HELP_STRING([--enable-xa], |
| 638 | [enable build of the XA X Acceleration API @<:@default=no@:>@])], |
| 639 | [enable_xa="$enableval"], |
| 640 | [enable_xa=no]) |
Benjamin Franzke | eddcecb | 2011-05-26 15:09:39 +0200 | [diff] [blame] | 641 | AC_ARG_ENABLE([gbm], |
| 642 | [AS_HELP_STRING([--enable-gbm], |
| 643 | [enable gbm library @<:@default=auto@:>@])], |
| 644 | [enable_gbm="$enableval"], |
| 645 | [enable_gbm=auto]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 646 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 647 | AC_ARG_ENABLE([xvmc], |
| 648 | [AS_HELP_STRING([--enable-xvmc], |
| 649 | [enable xvmc library @<:@default=auto@:>@])], |
| 650 | [enable_xvmc="$enableval"], |
Emil Velikov | c6e5801 | 2014-08-17 23:56:19 +0100 | [diff] [blame] | 651 | [enable_xvmc=auto]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 652 | AC_ARG_ENABLE([vdpau], |
| 653 | [AS_HELP_STRING([--enable-vdpau], |
| 654 | [enable vdpau library @<:@default=auto@:>@])], |
| 655 | [enable_vdpau="$enableval"], |
| 656 | [enable_vdpau=auto]) |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 657 | AC_ARG_ENABLE([omx], |
| 658 | [AS_HELP_STRING([--enable-omx], |
| 659 | [enable OpenMAX library @<:@default=no@:>@])], |
| 660 | [enable_omx="$enableval"], |
| 661 | [enable_omx=no]) |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 662 | AC_ARG_ENABLE([opencl], |
| 663 | [AS_HELP_STRING([--enable-opencl], |
Emil Velikov | 065b6ca | 2014-03-04 20:02:35 +0000 | [diff] [blame] | 664 | [enable OpenCL library @<:@default=no@:>@])], |
| 665 | [enable_opencl="$enableval"], |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 666 | [enable_opencl=no]) |
Tom Stellard | 07567c1 | 2013-09-18 00:36:55 -0700 | [diff] [blame] | 667 | AC_ARG_ENABLE([opencl_icd], |
| 668 | [AS_HELP_STRING([--enable-opencl-icd], |
| 669 | [Build an OpenCL ICD library to be loaded by an ICD implementation |
| 670 | @<:@default=no@:>@])], |
| 671 | [enable_opencl_icd="$enableval"], |
| 672 | [enable_opencl_icd=no]) |
Matt Turner | c09a4cb | 2013-03-09 17:35:12 -0800 | [diff] [blame] | 673 | AC_ARG_ENABLE([xlib-glx], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 674 | [AS_HELP_STRING([--enable-xlib-glx], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 675 | [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 676 | [enable_xlib_glx="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 677 | [enable_xlib_glx=no]) |
Matt Turner | c09a4cb | 2013-03-09 17:35:12 -0800 | [diff] [blame] | 678 | AC_ARG_ENABLE([gallium-egl], |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 679 | [AS_HELP_STRING([--enable-gallium-egl], |
| 680 | [enable optional EGL state tracker (not required |
| 681 | for EGL support in Gallium with OpenGL and OpenGL ES) |
| 682 | @<:@default=disable@:>@])], |
| 683 | [enable_gallium_egl="$enableval"], |
| 684 | [enable_gallium_egl=no]) |
Matt Turner | c09a4cb | 2013-03-09 17:35:12 -0800 | [diff] [blame] | 685 | AC_ARG_ENABLE([gallium-gbm], |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 686 | [AS_HELP_STRING([--enable-gallium-gbm], |
| 687 | [enable optional gbm state tracker (not required for |
| 688 | gbm support in Gallium) |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 689 | @<:@default=auto@:>@])], |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 690 | [enable_gallium_gbm="$enableval"], |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 691 | [enable_gallium_gbm=auto]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 692 | |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 693 | AC_ARG_ENABLE([r600-llvm-compiler], |
Homer Hsing | 4050756 | 2012-05-15 18:56:17 -0400 | [diff] [blame] | 694 | [AS_HELP_STRING([--enable-r600-llvm-compiler], |
| 695 | [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])], |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 696 | [enable_r600_llvm="$enableval"], |
| 697 | [enable_r600_llvm=no]) |
| 698 | |
Matt Turner | c09a4cb | 2013-03-09 17:35:12 -0800 | [diff] [blame] | 699 | AC_ARG_ENABLE([gallium-tests], |
Francisco Jerez | 66f7fd9 | 2012-04-25 22:16:26 +0200 | [diff] [blame] | 700 | [AS_HELP_STRING([--enable-gallium-tests], |
| 701 | [Enable optional Gallium tests) @<:@default=disable@:>@])], |
| 702 | [enable_gallium_tests="$enableval"], |
| 703 | [enable_gallium_tests=no]) |
| 704 | |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 705 | # Option for Gallium drivers |
Damien Lespiau | 164a04e | 2013-01-14 13:54:57 +0000 | [diff] [blame] | 706 | |
| 707 | # Keep this in sync with the --with-gallium-drivers help string default value |
Thomas Hellstrom | 87118d8 | 2012-01-12 12:10:53 +0100 | [diff] [blame] | 708 | GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 709 | |
| 710 | AC_ARG_WITH([gallium-drivers], |
| 711 | [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@], |
| 712 | [comma delimited Gallium drivers list, e.g. |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 713 | "i915,ilo,nouveau,r300,r600,radeonsi,freedreno,svga,swrast,vc4" |
Damien Lespiau | 164a04e | 2013-01-14 13:54:57 +0000 | [diff] [blame] | 714 | @<:@default=r300,r600,svga,swrast@:>@])], |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 715 | [with_gallium_drivers="$withval"], |
| 716 | [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"]) |
Chia-I Wu | 156e955 | 2010-10-30 14:26:01 +0800 | [diff] [blame] | 717 | |
Ian Romanick | db311b4 | 2011-06-22 11:35:27 -0700 | [diff] [blame] | 718 | # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it |
| 719 | # here so that the script doesn't choke on an unknown driver name later. |
| 720 | case "$with_gallium_drivers" in |
| 721 | yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;; |
| 722 | no) with_gallium_drivers='' ;; |
| 723 | esac |
| 724 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 725 | if test "x$enable_opengl" = xno -a \ |
| 726 | "x$enable_gles1" = xno -a \ |
| 727 | "x$enable_gles2" = xno -a \ |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 728 | "x$enable_openvg" = xno -a \ |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 729 | "x$enable_xa" = xno -a \ |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 730 | "x$enable_xvmc" = xno -a \ |
| 731 | "x$enable_vdpau" = xno -a \ |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 732 | "x$enable_omx" = xno -a \ |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 733 | "x$enable_opencl" = xno; then |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 734 | AC_MSG_ERROR([at least one API should be enabled]) |
| 735 | fi |
| 736 | |
Andreas Boll | 723b783 | 2013-02-01 13:39:42 +0100 | [diff] [blame] | 737 | # Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x |
| 738 | if test "x$enable_opengl" = xno -a \ |
| 739 | "x$enable_gles1" = xyes; then |
| 740 | AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported]) |
| 741 | fi |
| 742 | |
| 743 | if test "x$enable_opengl" = xno -a \ |
| 744 | "x$enable_gles2" = xyes; then |
| 745 | AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported]) |
| 746 | fi |
| 747 | |
Matt Turner | 691c304 | 2013-01-18 23:43:05 -0800 | [diff] [blame] | 748 | AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes) |
| 749 | AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes) |
| 750 | AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes) |
| 751 | AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \ |
| 752 | "x$enable_gles1" = xyes -o \ |
| 753 | "x$enable_gles2" = xyes) |
| 754 | |
Kenneth Graunke | 9d21b5d | 2012-01-04 23:49:18 -0800 | [diff] [blame] | 755 | if test "x$enable_glx" = xno; then |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 756 | AC_MSG_WARN([GLX disabled, disabling Xlib-GLX]) |
Kenneth Graunke | 9d21b5d | 2012-01-04 23:49:18 -0800 | [diff] [blame] | 757 | enable_xlib_glx=no |
| 758 | fi |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 759 | |
Emil Velikov | 1a568e0 | 2014-03-04 02:13:48 +0000 | [diff] [blame] | 760 | if test "x$enable_dri$enable_xlib_glx" = xyesyes; then |
| 761 | AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together]) |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 762 | fi |
| 763 | |
Michel Dänzer | 3b888f5 | 2013-01-31 11:47:55 +0100 | [diff] [blame] | 764 | if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then |
| 765 | AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL]) |
| 766 | fi |
| 767 | |
| 768 | # Disable GLX if OpenGL is not enabled |
| 769 | if test "x$enable_glx$enable_opengl" = xyesno; then |
| 770 | AC_MSG_WARN([OpenGL not enabled, disabling GLX]) |
| 771 | enable_glx=no |
| 772 | fi |
| 773 | |
Emil Velikov | 1a568e0 | 2014-03-04 02:13:48 +0000 | [diff] [blame] | 774 | # Disable GLX if DRI and Xlib-GLX are not enabled |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 775 | if test "x$enable_glx" = xyes -a \ |
Emil Velikov | 1a568e0 | 2014-03-04 02:13:48 +0000 | [diff] [blame] | 776 | "x$enable_dri" = xno -a \ |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 777 | "x$enable_xlib_glx" = xno; then |
Emil Velikov | 1a568e0 | 2014-03-04 02:13:48 +0000 | [diff] [blame] | 778 | AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX]) |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 779 | enable_glx=no |
| 780 | fi |
| 781 | |
Matt Turner | a9676ae | 2013-01-18 23:59:49 -0800 | [diff] [blame] | 782 | AM_CONDITIONAL(HAVE_DRI_GLX, test "x$enable_glx" = xyes -a \ |
Emil Velikov | 1a568e0 | 2014-03-04 02:13:48 +0000 | [diff] [blame] | 783 | "x$enable_dri" = xyes) |
Jon TURNEY | 45f9aae | 2014-05-12 10:17:06 +0100 | [diff] [blame] | 784 | |
| 785 | # Select which platform-dependent DRI code gets built |
| 786 | case "$host_os" in |
| 787 | darwin*) |
| 788 | dri_platform='apple' ;; |
| 789 | gnu*|mingw*|cygwin*) |
| 790 | dri_platform='none' ;; |
| 791 | *) |
| 792 | dri_platform='drm' ;; |
| 793 | esac |
| 794 | |
| 795 | AM_CONDITIONAL(HAVE_DRICOMMON, test "x$enable_dri" = xyes ) |
| 796 | AM_CONDITIONAL(HAVE_DRISW, test "x$enable_dri" = xyes ) |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 797 | AM_CONDITIONAL(HAVE_DRI2, test "x$enable_dri" = xyes -a "x$dri_platform" = xdrm ) |
| 798 | AM_CONDITIONAL(HAVE_DRI3, test "x$enable_dri3" = xyes -a "x$dri_platform" = xdrm ) |
| 799 | AM_CONDITIONAL(HAVE_APPLEDRI, test "x$enable_dri" = xyes -a "x$dri_platform" = xapple ) |
Matt Turner | 06ad64a | 2012-01-15 21:30:26 -0500 | [diff] [blame] | 800 | |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 801 | AC_ARG_ENABLE([shared-glapi], |
| 802 | [AS_HELP_STRING([--enable-shared-glapi], |
| 803 | [Enable shared glapi for OpenGL @<:@default=yes@:>@])], |
| 804 | [enable_shared_glapi="$enableval"], |
Emil Velikov | 0432aa0 | 2014-02-19 00:54:04 +0000 | [diff] [blame] | 805 | [enable_shared_glapi=yes]) |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 806 | |
Emil Velikov | 0432aa0 | 2014-02-19 00:54:04 +0000 | [diff] [blame] | 807 | case "x$enable_opengl$enable_gles1$enable_gles2" in |
| 808 | x*yes*yes*) |
| 809 | if test "x$enable_shared_glapi" = xno; then |
| 810 | AC_MSG_ERROR([shared GLAPI required when building two or more of |
| 811 | the following APIs - opengl, gles1 gles2]) |
| 812 | fi |
| 813 | ;; |
| 814 | esac |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 815 | |
Emil Velikov | 1bb23ab | 2014-02-27 18:03:15 +0000 | [diff] [blame] | 816 | # Building Xlib-GLX requires shared glapi to be disabled. |
| 817 | if test "x$enable_xlib_glx" = xyes; then |
| 818 | AC_MSG_NOTICE([Shared GLAPI should not used with Xlib-GLX, disabling]) |
| 819 | enable_shared_glapi=no |
| 820 | fi |
| 821 | |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 822 | AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes) |
| 823 | |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 824 | # Build the pipe-drivers as separate libraries/modules. |
| 825 | # Do not touch this unless you know what you are doing. |
| 826 | # XXX: Expose via configure option ? |
| 827 | enable_shared_pipe_drivers=no |
| 828 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 829 | dnl |
| 830 | dnl Driver specific build directories |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 831 | dnl |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 832 | GALLIUM_TARGET_DIRS="" |
Jakob Bornecrantz | c9f9867 | 2010-03-16 13:54:18 +0000 | [diff] [blame] | 833 | GALLIUM_WINSYS_DIRS="sw" |
Kai Wasserbäch | 0a22fb6 | 2011-11-29 22:36:02 +0100 | [diff] [blame] | 834 | GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 835 | GALLIUM_STATE_TRACKERS_DIRS="" |
| 836 | |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 837 | case "x$enable_glx$enable_xlib_glx" in |
| 838 | xyesyes) |
Jakob Bornecrantz | c9f9867 | 2010-03-16 13:54:18 +0000 | [diff] [blame] | 839 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 840 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib" |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 841 | GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS" |
Matt Turner | b3f1f66 | 2013-01-20 15:32:08 -0800 | [diff] [blame] | 842 | NEED_WINSYS_XLIB="yes" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 843 | ;; |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 844 | esac |
| 845 | |
| 846 | if test "x$enable_dri" = xyes; then |
Emil Velikov | 4ef9c3d | 2011-07-11 15:58:29 +0100 | [diff] [blame] | 847 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri" |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 848 | GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 849 | enable_gallium_loader="$enable_shared_pipe_drivers" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 850 | fi |
| 851 | |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 852 | if test "x$enable_gallium_osmesa" = xyes; then |
Emil Velikov | e8e1158 | 2014-03-12 00:36:21 +0000 | [diff] [blame] | 853 | if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then |
| 854 | AC_MSG_ERROR([gallium_osmesa requires the gallium swrast driver]) |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 855 | fi |
| 856 | if test "x$enable_osmesa" = xyes; then |
| 857 | AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations]) |
| 858 | fi |
Brian Paul | 79eac7d | 2013-03-11 18:31:21 -0600 | [diff] [blame] | 859 | GALLIUM_STATE_TRACKERS_DIRS="osmesa $GALLIUM_STATE_TRACKERS_DIRS" |
| 860 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS osmesa" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 861 | fi |
| 862 | |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 863 | AC_SUBST([MESA_LLVM]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 864 | |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 865 | # Check for libdrm |
| 866 | PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED], |
| 867 | [have_libdrm=yes], [have_libdrm=no]) |
Tapani Pälli | a057b83 | 2013-12-01 11:53:55 +0200 | [diff] [blame] | 868 | if test "x$have_libdrm" = xyes; then |
| 869 | DEFINES="$DEFINES -DHAVE_LIBDRM" |
| 870 | fi |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 871 | |
Jonathan Gray | 81799c8 | 2014-03-23 15:53:08 +1100 | [diff] [blame] | 872 | case "$host_os" in |
| 873 | linux*) |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 874 | need_pci_id=yes ;; |
Jonathan Gray | 81799c8 | 2014-03-23 15:53:08 +1100 | [diff] [blame] | 875 | *) |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 876 | need_pci_id=no ;; |
Jonathan Gray | 81799c8 | 2014-03-23 15:53:08 +1100 | [diff] [blame] | 877 | esac |
| 878 | |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 879 | PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED], |
| 880 | have_libudev=yes, have_libudev=no) |
| 881 | |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 882 | AC_ARG_ENABLE([sysfs], |
| 883 | [AS_HELP_STRING([--enable-sysfs], |
| 884 | [enable /sys PCI identification @<:@default=disabled@:>@])], |
| 885 | [have_sysfs="$enableval"], |
| 886 | [have_sysfs=no] |
| 887 | ) |
| 888 | |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 889 | if test "x$enable_dri" = xyes; then |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 890 | if test "$enable_static" = yes; then |
| 891 | AC_MSG_ERROR([Cannot use static libraries for DRI drivers]) |
| 892 | fi |
| 893 | |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 894 | # not a hard requirement as swrast does not depend on it |
| 895 | if test "x$have_libdrm" = xyes; then |
| 896 | DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 897 | fi |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 898 | fi |
| 899 | |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 900 | AC_ARG_ENABLE([driglx-direct], |
| 901 | [AS_HELP_STRING([--disable-driglx-direct], |
Andreas Boll | 5ecbc3a | 2012-11-10 17:58:49 +0100 | [diff] [blame] | 902 | [disable direct rendering in GLX and EGL for DRI \ |
nobled | e7d18ed | 2011-03-14 22:08:22 +0000 | [diff] [blame] | 903 | @<:@default=auto@:>@])], |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 904 | [driglx_direct="$enableval"], |
Jon TURNEY | bd526ec | 2014-05-09 13:54:09 +0100 | [diff] [blame] | 905 | [driglx_direct="yes"]) |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 906 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 907 | dnl |
| 908 | dnl libGL configuration per driver |
| 909 | dnl |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 910 | case "x$enable_glx$enable_xlib_glx" in |
| 911 | xyesyes) |
| 912 | # Xlib-based GLX |
Emil Velikov | da029f8 | 2014-07-11 23:17:48 +0100 | [diff] [blame] | 913 | dri_modules="x11 xext xcb" |
| 914 | PKG_CHECK_MODULES([XLIBGL], [$dri_modules]) |
| 915 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 916 | X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" |
| 917 | GL_LIB_DEPS="$XLIBGL_LIBS" |
Matt Turner | b6651ae | 2012-09-18 21:51:25 -0700 | [diff] [blame] | 918 | GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" |
| 919 | GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 920 | ;; |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 921 | xyesno) |
| 922 | # DRI-based GLX |
Jesse Barnes | f2f83d9 | 2010-01-11 17:28:10 -0500 | [diff] [blame] | 923 | PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 924 | |
| 925 | # find the DRI deps for libGL |
Emil Velikov | da029f8 | 2014-07-11 23:17:48 +0100 | [diff] [blame] | 926 | dri_modules="x11 xext xdamage xfixes x11-xcb xcb xcb-glx >= $XCBGLX_REQUIRED" |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 927 | |
Jon TURNEY | 45f9aae | 2014-05-12 10:17:06 +0100 | [diff] [blame] | 928 | if test x"$driglx_direct" = xyes; then |
| 929 | if test x"$dri_platform" = xdrm ; then |
Jon TURNEY | f647a72 | 2014-06-02 18:52:15 +0100 | [diff] [blame] | 930 | DEFINES="$DEFINES -DGLX_USE_DRM" |
Jon TURNEY | 45f9aae | 2014-05-12 10:17:06 +0100 | [diff] [blame] | 931 | if test "x$have_libdrm" != xyes; then |
| 932 | AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) |
| 933 | fi |
| 934 | |
| 935 | PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) |
| 936 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED" |
| 937 | if test x"$enable_dri3" = xyes; then |
| 938 | PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED]) |
| 939 | PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED]) |
| 940 | fi |
| 941 | |
| 942 | if test x"$enable_dri" = xyes; then |
| 943 | dri_modules="$dri_modules xcb-dri2 >= $XCBDRI2_REQUIRED" |
| 944 | fi |
| 945 | |
| 946 | if test x"$enable_dri3" = xyes; then |
Emil Velikov | da029f8 | 2014-07-11 23:17:48 +0100 | [diff] [blame] | 947 | PKG_CHECK_EXISTS([xcb >= $XCB_REQUIRED], [], AC_MSG_ERROR([DRI3 requires xcb >= $XCB_REQUIRED])) |
Jon TURNEY | 45f9aae | 2014-05-12 10:17:06 +0100 | [diff] [blame] | 948 | dri_modules="$dri_modules xcb-dri3 xcb-present xcb-sync xshmfence >= $XSHMFENCE_REQUIRED" |
| 949 | fi |
Jon TURNEY | 5a459a0 | 2014-05-12 10:47:07 +0100 | [diff] [blame] | 950 | fi |
| 951 | if test x"$dri_platform" = xapple ; then |
| 952 | DEFINES="$DEFINES -DGLX_USE_APPLEGL" |
| 953 | fi |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 954 | fi |
Jon TURNEY | 2b9dac3 | 2010-04-21 12:58:54 +0100 | [diff] [blame] | 955 | |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 956 | # add xf86vidmode if available |
| 957 | PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no) |
| 958 | if test "$HAVE_XF86VIDMODE" = yes ; then |
| 959 | dri_modules="$dri_modules xxf86vm" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 960 | fi |
| 961 | |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 962 | PKG_CHECK_MODULES([DRIGL], [$dri_modules]) |
| 963 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 964 | X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" |
| 965 | GL_LIB_DEPS="$DRIGL_LIBS" |
| 966 | |
Matt Turner | b6651ae | 2012-09-18 21:51:25 -0700 | [diff] [blame] | 967 | # need DRM libs, $PTHREAD_LIBS, etc. |
| 968 | GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" |
| 969 | GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS" |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 970 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 971 | esac |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 972 | |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 973 | have_pci_id=no |
Dave Airlie | faee376 | 2014-01-28 15:52:13 +1000 | [diff] [blame] | 974 | if test "$have_libudev" = yes; then |
| 975 | DEFINES="$DEFINES -DHAVE_LIBUDEV" |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 976 | have_pci_id=yes |
| 977 | fi |
| 978 | |
| 979 | if test "$have_sysfs" = yes; then |
| 980 | DEFINES="$DEFINES -DHAVE_SYSFS" |
| 981 | have_pci_id=yes |
Dave Airlie | faee376 | 2014-01-28 15:52:13 +1000 | [diff] [blame] | 982 | fi |
| 983 | |
Ian Romanick | 4becf67 | 2012-01-03 11:35:59 -0800 | [diff] [blame] | 984 | # This is outside the case (above) so that it is invoked even for non-GLX |
| 985 | # builds. |
Eric Anholt | 8ffb098 | 2012-02-05 06:10:56 +0100 | [diff] [blame] | 986 | AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes) |
Ian Romanick | 4becf67 | 2012-01-03 11:35:59 -0800 | [diff] [blame] | 987 | |
Matt Turner | b6651ae | 2012-09-18 21:51:25 -0700 | [diff] [blame] | 988 | GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" |
| 989 | GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS" |
| 990 | GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" |
| 991 | GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 992 | |
Robert Bragg | dda49c3 | 2012-09-19 16:12:08 +0100 | [diff] [blame] | 993 | AC_SUBST([X11_INCLUDES]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 994 | AC_SUBST([GL_LIB_DEPS]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 995 | AC_SUBST([GL_PC_REQ_PRIV]) |
| 996 | AC_SUBST([GL_PC_LIB_PRIV]) |
| 997 | AC_SUBST([GL_PC_CFLAGS]) |
| 998 | AC_SUBST([DRI_PC_REQ_PRIV]) |
Li Peng | c33c191 | 2010-07-30 12:26:15 +0800 | [diff] [blame] | 999 | AC_SUBST([GLESv1_CM_LIB_DEPS]) |
Kristian Høgsberg | 9e4f2da | 2010-05-04 14:13:11 -0400 | [diff] [blame] | 1000 | AC_SUBST([GLESv1_CM_PC_LIB_PRIV]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 1001 | AC_SUBST([GLESv2_LIB_DEPS]) |
Kristian Høgsberg | 9e4f2da | 2010-05-04 14:13:11 -0400 | [diff] [blame] | 1002 | AC_SUBST([GLESv2_PC_LIB_PRIV]) |
| 1003 | |
Jon TURNEY | 2b9dac3 | 2010-04-21 12:58:54 +0100 | [diff] [blame] | 1004 | AC_SUBST([HAVE_XF86VIDMODE]) |
| 1005 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1006 | dnl |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1007 | dnl More GLX setup |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1008 | dnl |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1009 | case "x$enable_glx$enable_xlib_glx" in |
| 1010 | xyesyes) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1011 | DEFINES="$DEFINES -DUSE_XSHM" |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1012 | ;; |
| 1013 | xyesno) |
| 1014 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" |
| 1015 | if test "x$driglx_direct" = xyes; then |
| 1016 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 1017 | fi |
| 1018 | ;; |
| 1019 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1020 | |
| 1021 | dnl |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 1022 | dnl TLS detection |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1023 | dnl |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 1024 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1025 | AC_ARG_ENABLE([glx-tls], |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1026 | [AS_HELP_STRING([--enable-glx-tls], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 1027 | [enable TLS support in GLX @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1028 | [GLX_USE_TLS="$enableval"], |
| 1029 | [GLX_USE_TLS=no]) |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 1030 | AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) |
| 1031 | |
Matt Turner | 814345f | 2012-09-18 22:09:26 -0700 | [diff] [blame] | 1032 | AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes], |
Matt Turner | b133b84 | 2014-09-21 17:33:21 -0700 | [diff] [blame^] | 1033 | [DEFINES="${DEFINES} -DGLX_USE_TLS"]) |
Tom Fogal | 4484297 | 2011-02-21 22:32:18 -0700 | [diff] [blame] | 1034 | |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 1035 | dnl |
| 1036 | dnl More DRI setup |
| 1037 | dnl |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1038 | dnl Directory for DRI drivers |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1039 | AC_ARG_WITH([dri-driverdir], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1040 | [AS_HELP_STRING([--with-dri-driverdir=DIR], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 1041 | [directory for the DRI drivers @<:@${libdir}/dri@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1042 | [DRI_DRIVER_INSTALL_DIR="$withval"], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 1043 | [DRI_DRIVER_INSTALL_DIR='${libdir}/dri']) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1044 | AC_SUBST([DRI_DRIVER_INSTALL_DIR]) |
Chow Loong Jin | 35506de | 2009-10-28 14:34:14 +0800 | [diff] [blame] | 1045 | dnl Extra search path for DRI drivers |
| 1046 | AC_ARG_WITH([dri-searchpath], |
| 1047 | [AS_HELP_STRING([--with-dri-searchpath=DIRS...], |
| 1048 | [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])], |
| 1049 | [DRI_DRIVER_SEARCH_DIR="$withval"], |
| 1050 | [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}']) |
| 1051 | AC_SUBST([DRI_DRIVER_SEARCH_DIR]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1052 | dnl Which drivers to build - default is chosen by platform |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1053 | AC_ARG_WITH([dri-drivers], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1054 | [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], |
Emil Velikov | 65e67b9 | 2014-02-03 20:54:08 +0000 | [diff] [blame] | 1055 | [comma delimited classic DRI drivers list, e.g. |
Michel Dänzer | cade071 | 2009-07-10 14:49:46 +0200 | [diff] [blame] | 1056 | "swrast,i965,radeon" @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1057 | [with_dri_drivers="$withval"], |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1058 | [with_dri_drivers=auto]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1059 | |
Emil Velikov | 9eae750 | 2014-02-18 00:57:24 +0000 | [diff] [blame] | 1060 | if test "x$with_dri_drivers" = xauto; then |
| 1061 | if test "x$enable_opengl" = xyes -a "x$enable_dri" = xyes; then |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1062 | with_dri_drivers="yes" |
Emil Velikov | 9eae750 | 2014-02-18 00:57:24 +0000 | [diff] [blame] | 1063 | else |
| 1064 | with_dri_drivers="no" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1065 | fi |
Emil Velikov | 9eae750 | 2014-02-18 00:57:24 +0000 | [diff] [blame] | 1066 | fi |
Emil Velikov | f42333b | 2014-02-24 22:57:59 +0000 | [diff] [blame] | 1067 | if test "x$with_dri_drivers" = xno; then |
| 1068 | with_dri_drivers='' |
| 1069 | fi |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1070 | |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1071 | dnl If $with_dri_drivers is yes, drivers will be added through |
| 1072 | dnl platform checks. Set DEFINES and LIB_DEPS |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1073 | if test "x$enable_dri" = xyes; then |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1074 | # Platform specific settings and drivers to build |
| 1075 | case "$host_os" in |
| 1076 | linux*) |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1077 | DEFINES="$DEFINES -DHAVE_ALIAS" |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 1078 | if test "x$enable_dri3" = xyes; then |
| 1079 | DEFINES="$DEFINES -DHAVE_DRI3" |
| 1080 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1081 | |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 1082 | if test "x$have_pci_id" != xyes; then |
| 1083 | AC_MSG_ERROR([libudev-dev or sysfs required for building DRI]) |
Eric Anholt | b959fd9 | 2014-01-30 10:19:44 -0800 | [diff] [blame] | 1084 | fi |
| 1085 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1086 | case "$host_cpu" in |
Emil Velikov | 35f6eed | 2014-02-03 21:05:19 +0000 | [diff] [blame] | 1087 | powerpc* | sparc*) |
| 1088 | # Build only the drivers for cards that exist on PowerPC/sparc |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1089 | if test "x$with_dri_drivers" = "xyes"; then |
| 1090 | with_dri_drivers="r200 radeon swrast" |
Dave Airlie | 2b0e75e | 2008-06-12 12:06:50 +1000 | [diff] [blame] | 1091 | fi |
| 1092 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1093 | esac |
| 1094 | ;; |
Fabio Pedretti | 4f4da81 | 2013-11-06 10:55:27 +0100 | [diff] [blame] | 1095 | *freebsd* | dragonfly* | *netbsd* | openbsd*) |
Brian Paul | 7f8434b | 2013-02-26 08:49:34 -0700 | [diff] [blame] | 1096 | DEFINES="$DEFINES -DHAVE_ALIAS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1097 | ;; |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 1098 | gnu*) |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1099 | DEFINES="$DEFINES -DHAVE_ALIAS" |
Emil Velikov | 23740ed | 2014-03-21 18:09:36 +0000 | [diff] [blame] | 1100 | ;; |
Jon TURNEY | c6e33ca | 2011-03-14 22:08:23 +0000 | [diff] [blame] | 1101 | cygwin*) |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1102 | if test "x$with_dri_drivers" = "xyes"; then |
| 1103 | with_dri_drivers="swrast" |
Jon TURNEY | c6e33ca | 2011-03-14 22:08:23 +0000 | [diff] [blame] | 1104 | fi |
| 1105 | ;; |
Jon TURNEY | ff90a87 | 2014-05-11 14:38:52 +0100 | [diff] [blame] | 1106 | darwin*) |
Matt Turner | 4bb9d16 | 2014-06-10 18:18:39 -0700 | [diff] [blame] | 1107 | DEFINES="$DEFINES -DGLX_ALIAS_UNSUPPORTED" |
Jon TURNEY | ff90a87 | 2014-05-11 14:38:52 +0100 | [diff] [blame] | 1108 | if test "x$with_dri_drivers" = "xyes"; then |
| 1109 | with_dri_drivers="swrast" |
| 1110 | fi |
| 1111 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1112 | esac |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 1113 | |
| 1114 | # default drivers |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1115 | if test "x$with_dri_drivers" = "xyes"; then |
| 1116 | with_dri_drivers="i915 i965 nouveau r200 radeon swrast" |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 1117 | fi |
| 1118 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1119 | # Check for expat |
Johannes Nixdorf | 476db98 | 2014-03-22 12:49:06 +0100 | [diff] [blame] | 1120 | PKG_CHECK_EXISTS([expat], [have_expat=yes], [have_expat=no]) |
Emil Velikov | 9eb3de1 | 2013-10-30 00:03:43 +0000 | [diff] [blame] | 1121 | if test "x$have_expat" = "xyes"; then |
| 1122 | PKG_CHECK_MODULES([EXPAT], [expat], [], |
| 1123 | AC_MSG_ERROR([Expat required for DRI.])) |
| 1124 | else |
| 1125 | # expat version 2.0 and earlier do not provide expat.pc |
| 1126 | EXPAT_LIBS=-lexpat |
| 1127 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1128 | |
Emil Velikov | 98204ea | 2014-06-16 14:21:13 +0100 | [diff] [blame] | 1129 | DRICOMMON_NEED_LIBDRM=no |
Matt Turner | 07f2dee | 2013-03-05 10:25:55 -0800 | [diff] [blame] | 1130 | # If we are building any DRI driver other than swrast. |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1131 | if test -n "$with_dri_drivers"; then |
| 1132 | if test "x$with_dri_drivers" != xswrast; then |
Eric Anholt | bdcee13 | 2013-09-27 16:57:11 -0700 | [diff] [blame] | 1133 | # ... libdrm is required |
| 1134 | if test "x$have_libdrm" != xyes; then |
| 1135 | AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED]) |
| 1136 | fi |
| 1137 | DRICOMMON_NEED_LIBDRM=yes |
Emil Velikov | 98204ea | 2014-06-16 14:21:13 +0100 | [diff] [blame] | 1138 | fi |
| 1139 | fi |
| 1140 | |
| 1141 | # If we're building any gallium DRI driver other than swrast |
| 1142 | if test -n "$with_gallium_drivers" -a "x$DRICOMMON_NEED_LIBDRM" = xno; then |
| 1143 | if test "x$with_gallium_drivers" != xswrast; then |
| 1144 | # ... build a libdrm aware dricommon |
| 1145 | DRICOMMON_NEED_LIBDRM=yes |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 1146 | fi |
| 1147 | fi |
| 1148 | |
Matt Turner | 2b3a8cb | 2012-01-13 14:30:36 -0500 | [diff] [blame] | 1149 | # put all the necessary libs together |
Emil Velikov | aec20d6 | 2013-10-29 21:14:41 +0000 | [diff] [blame] | 1150 | DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1151 | fi |
Eric Anholt | 1925a9a | 2013-06-26 13:04:51 -0700 | [diff] [blame] | 1152 | |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1153 | AC_SUBST([DRI_LIB_DEPS]) |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1154 | |
Emil Velikov | f42333b | 2014-02-24 22:57:59 +0000 | [diff] [blame] | 1155 | DRI_DIRS='' |
| 1156 | dnl Duplicates in DRI_DIRS are removed by sorting it at the end of this block |
| 1157 | if test -n "$with_dri_drivers"; then |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1158 | if test "x$enable_opengl" != xyes; then |
| 1159 | AC_MSG_ERROR([--with-dri-drivers requires OpenGL]) |
| 1160 | fi |
| 1161 | |
| 1162 | dri_drivers=`IFS=', '; echo $with_dri_drivers` |
| 1163 | for driver in $dri_drivers; do |
Eric Anholt | 9856d65 | 2014-03-04 14:43:16 -0800 | [diff] [blame] | 1164 | DRI_DIRS="$DRI_DIRS $driver" |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1165 | case "x$driver" in |
| 1166 | xi915) |
| 1167 | HAVE_I915_DRI=yes; |
| 1168 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
| 1169 | ;; |
| 1170 | xi965) |
| 1171 | HAVE_I965_DRI=yes; |
| 1172 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
| 1173 | ;; |
| 1174 | xnouveau) |
| 1175 | HAVE_NOUVEAU_DRI=yes; |
| 1176 | PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED]) |
| 1177 | ;; |
| 1178 | xradeon) |
| 1179 | HAVE_RADEON_DRI=yes; |
| 1180 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
| 1181 | ;; |
| 1182 | xr200) |
| 1183 | HAVE_R200_DRI=yes; |
| 1184 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
| 1185 | ;; |
| 1186 | xswrast) |
| 1187 | HAVE_SWRAST_DRI=yes; |
| 1188 | ;; |
| 1189 | *) |
| 1190 | AC_MSG_ERROR([classic DRI driver '$driver' does not exist]) |
| 1191 | ;; |
| 1192 | esac |
| 1193 | done |
Emil Velikov | f42333b | 2014-02-24 22:57:59 +0000 | [diff] [blame] | 1194 | DRI_DIRS=`echo $DRI_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1195 | fi |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 1196 | |
Eric Anholt | bdcee13 | 2013-09-27 16:57:11 -0700 | [diff] [blame] | 1197 | AM_CONDITIONAL(NEED_MEGADRIVER, test -n "$DRI_DIRS") |
Eric Anholt | 1925a9a | 2013-06-26 13:04:51 -0700 | [diff] [blame] | 1198 | AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \ |
| 1199 | "x$enable_osmesa" = xyes -o \ |
Eric Anholt | bdcee13 | 2013-09-27 16:57:11 -0700 | [diff] [blame] | 1200 | -n "$DRI_DIRS") |
Matt Turner | 349845f | 2012-01-15 11:39:48 -0500 | [diff] [blame] | 1201 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1202 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1203 | dnl OSMesa configuration |
| 1204 | dnl |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1205 | |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1206 | dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1207 | AC_ARG_WITH([osmesa-bits], |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1208 | [AS_HELP_STRING([--with-osmesa-bits=BITS], |
| 1209 | [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1210 | [osmesa_bits="$withval"], |
| 1211 | [osmesa_bits=8]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1212 | if test "x$osmesa_bits" != x8; then |
| 1213 | if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then |
| 1214 | AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver]) |
| 1215 | osmesa_bits=8 |
| 1216 | fi |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1217 | fi |
| 1218 | case "x$osmesa_bits" in |
| 1219 | x8) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 1220 | OSMESA_LIB="${OSMESA_LIB}" |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1221 | ;; |
| 1222 | x16|x32) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 1223 | OSMESA_LIB="${OSMESA_LIB}$osmesa_bits" |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1224 | DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31" |
| 1225 | ;; |
| 1226 | *) |
| 1227 | AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option]) |
| 1228 | ;; |
| 1229 | esac |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1230 | |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 1231 | if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 1232 | # only link libraries with osmesa if shared |
| 1233 | if test "$enable_static" = no; then |
| 1234 | OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS" |
| 1235 | else |
| 1236 | OSMESA_LIB_DEPS="" |
| 1237 | fi |
Matt Turner | b6651ae | 2012-09-18 21:51:25 -0700 | [diff] [blame] | 1238 | OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1239 | fi |
Laurent Carlier | 284325d | 2012-06-24 09:51:27 +0200 | [diff] [blame] | 1240 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1241 | AC_SUBST([OSMESA_LIB_DEPS]) |
Matt Turner | 7ef94c6 | 2012-01-31 21:34:42 -0500 | [diff] [blame] | 1242 | AC_SUBST([OSMESA_PC_REQ]) |
Dan Nicholson | 8be02fc | 2008-12-14 09:35:29 -0800 | [diff] [blame] | 1243 | AC_SUBST([OSMESA_PC_LIB_PRIV]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1244 | |
| 1245 | dnl |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1246 | dnl gbm configuration |
| 1247 | dnl |
| 1248 | if test "x$enable_gbm" = xauto; then |
| 1249 | case "$with_egl_platforms" in |
| 1250 | *drm*) |
| 1251 | enable_gbm=yes ;; |
| 1252 | *) |
| 1253 | enable_gbm=no ;; |
| 1254 | esac |
| 1255 | fi |
| 1256 | if test "x$enable_gbm" = xyes; then |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 1257 | if test "x$need_pci_id$have_pci_id" = xyesno; then |
| 1258 | AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED or sysfs]) |
Armin K | f0f202e | 2013-11-09 00:06:45 +0100 | [diff] [blame] | 1259 | fi |
Matt Turner | 027ce0c | 2012-01-24 11:34:42 -0500 | [diff] [blame] | 1260 | |
| 1261 | if test "x$enable_dri" = xyes; then |
| 1262 | GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri" |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 1263 | if test "x$enable_shared_glapi" = xno; then |
Matt Turner | 027ce0c | 2012-01-24 11:34:42 -0500 | [diff] [blame] | 1264 | AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi]) |
| 1265 | fi |
Emil Velikov | e477d12 | 2014-05-05 22:09:22 +0100 | [diff] [blame] | 1266 | else |
| 1267 | # Strictly speaking libgbm does not require --enable-dri, although |
| 1268 | # both of its backends do. Thus one can build libgbm without any |
| 1269 | # backends if --disable-dri is set. |
| 1270 | # To avoid unnecessary complexity of checking if at least one backend |
| 1271 | # is available when building, just mandate --enable-dri. |
| 1272 | AC_MSG_ERROR([gbm requires --enable-dri]) |
Matt Turner | 027ce0c | 2012-01-24 11:34:42 -0500 | [diff] [blame] | 1273 | fi |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1274 | fi |
Matt Turner | a9676ae | 2013-01-18 23:59:49 -0800 | [diff] [blame] | 1275 | AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes) |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 1276 | if test "x$need_pci_id$have_libudev" = xyesyes; then |
Jonathan Gray | 81799c8 | 2014-03-23 15:53:08 +1100 | [diff] [blame] | 1277 | GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED" |
| 1278 | else |
| 1279 | GBM_PC_REQ_PRIV="" |
| 1280 | fi |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1281 | GBM_PC_LIB_PRIV="$DLOPEN_LIBS" |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1282 | AC_SUBST([GBM_PC_REQ_PRIV]) |
| 1283 | AC_SUBST([GBM_PC_LIB_PRIV]) |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1284 | |
| 1285 | dnl |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1286 | dnl EGL configuration |
| 1287 | dnl |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1288 | EGL_CLIENT_APIS="" |
| 1289 | |
Dan Nicholson | 66f9786 | 2009-04-29 12:11:43 -0700 | [diff] [blame] | 1290 | if test "x$enable_egl" = xyes; then |
Matt Turner | b6651ae | 2012-09-18 21:51:25 -0700 | [diff] [blame] | 1291 | EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS" |
Marek Olšák | ad50abba | 2011-06-14 05:14:27 +0200 | [diff] [blame] | 1292 | |
Benjamin Franzke | 85fe948 | 2011-08-09 14:23:18 +0200 | [diff] [blame] | 1293 | AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"]) |
| 1294 | |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 1295 | if test "$enable_static" != yes; then |
| 1296 | if test "x$enable_dri" = xyes; then |
| 1297 | HAVE_EGL_DRIVER_DRI2=1 |
| 1298 | fi |
| 1299 | |
Kristian Høgsberg | 42fa009 | 2010-02-03 10:18:28 -0500 | [diff] [blame] | 1300 | fi |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1301 | fi |
Matt Turner | a9676ae | 2013-01-18 23:59:49 -0800 | [diff] [blame] | 1302 | AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes) |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1303 | AC_SUBST([EGL_LIB_DEPS]) |
| 1304 | |
| 1305 | dnl |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1306 | dnl EGL Gallium configuration |
| 1307 | dnl |
| 1308 | if test "x$enable_gallium_egl" = xyes; then |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 1309 | if test -z "$with_gallium_drivers"; then |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1310 | AC_MSG_ERROR([cannot enable egl_gallium without Gallium]) |
| 1311 | fi |
| 1312 | if test "x$enable_egl" = xno; then |
| 1313 | AC_MSG_ERROR([cannot enable egl_gallium without EGL]) |
| 1314 | fi |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 1315 | if test "x$have_libdrm" != xyes; then |
| 1316 | AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED]) |
| 1317 | fi |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1318 | |
| 1319 | GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS" |
Chia-I Wu | b8f097f | 2011-06-20 12:01:39 +0900 | [diff] [blame] | 1320 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1321 | # XXX: Uncomment once converted to use static/shared pipe-drivers |
| 1322 | # enable_gallium_loader=$enable_shared_pipe_drivers |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1323 | fi |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1324 | AM_CONDITIONAL(HAVE_GALLIUM_EGL, test "x$enable_gallium_egl" = xyes) |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1325 | |
| 1326 | dnl |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1327 | dnl gbm Gallium configuration |
| 1328 | dnl |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 1329 | if test "x$enable_gallium_gbm" = xauto; then |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1330 | case "$enable_gbm$enable_gallium_egl$enable_dri$with_egl_platforms" in |
Chia-I Wu | 95ef069 | 2011-11-05 15:09:36 +0800 | [diff] [blame] | 1331 | yesyesyes*drm*) |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 1332 | enable_gallium_gbm=yes ;; |
| 1333 | *) |
| 1334 | enable_gallium_gbm=no ;; |
| 1335 | esac |
| 1336 | fi |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1337 | if test "x$enable_gallium_gbm" = xyes; then |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 1338 | if test -z "$with_gallium_drivers"; then |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1339 | AC_MSG_ERROR([cannot enable gbm_gallium without Gallium]) |
| 1340 | fi |
| 1341 | if test "x$enable_gbm" = xno; then |
| 1342 | AC_MSG_ERROR([cannot enable gbm_gallium without gbm]) |
| 1343 | fi |
| 1344 | |
Emil Velikov | 1d1ec76 | 2014-07-24 23:05:55 +0100 | [diff] [blame] | 1345 | if test "x$enable_gallium_egl" != xyes; then |
| 1346 | AC_MSG_ERROR([gbm_gallium is only used by egl_gallium]) |
| 1347 | fi |
| 1348 | |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1349 | GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS" |
| 1350 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1351 | enable_gallium_loader=$enable_shared_pipe_drivers |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1352 | fi |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1353 | AM_CONDITIONAL(HAVE_GALLIUM_GBM, test "x$enable_gallium_gbm" = xyes) |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1354 | |
| 1355 | dnl |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1356 | dnl XA configuration |
| 1357 | dnl |
| 1358 | if test "x$enable_xa" = xyes; then |
Emil Velikov | e283e96 | 2014-02-24 22:58:10 +0000 | [diff] [blame] | 1359 | if test "x$with_gallium_drivers" = xswrast; then |
| 1360 | AC_MSG_ERROR([ |
| 1361 | Building xa requires at least one non swrast gallium driver. |
Matt Turner | 180e60d | 2014-06-10 18:08:10 -0700 | [diff] [blame] | 1362 | If you are looking to use libxatracker.so with the VMware driver, |
Emil Velikov | e283e96 | 2014-02-24 22:58:10 +0000 | [diff] [blame] | 1363 | make sure to include svga in the gallium drivers list, apart from |
| 1364 | enabling XA. |
| 1365 | Example: ./configure --enable-xa --with-gallium-drivers=svga...]) |
| 1366 | fi |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1367 | GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1368 | enable_gallium_loader=$enable_shared_pipe_drivers |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1369 | fi |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1370 | AM_CONDITIONAL(HAVE_ST_XA, test "x$enable_xa" = xyes) |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1371 | |
| 1372 | dnl |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1373 | dnl OpenVG configuration |
| 1374 | dnl |
| 1375 | VG_LIB_DEPS="" |
| 1376 | |
| 1377 | if test "x$enable_openvg" = xyes; then |
| 1378 | if test "x$enable_egl" = xno; then |
| 1379 | AC_MSG_ERROR([cannot enable OpenVG without EGL]) |
| 1380 | fi |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 1381 | if test -z "$with_gallium_drivers"; then |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1382 | AC_MSG_ERROR([cannot enable OpenVG without Gallium]) |
| 1383 | fi |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1384 | if test "x$enable_gallium_egl" = xno; then |
| 1385 | AC_MSG_ERROR([cannot enable OpenVG without egl_gallium]) |
| 1386 | fi |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1387 | |
| 1388 | EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)' |
Matt Turner | b6651ae | 2012-09-18 21:51:25 -0700 | [diff] [blame] | 1389 | VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS" |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1390 | GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS" |
Dave Airlie | ec83535 | 2012-12-04 09:25:13 +1000 | [diff] [blame] | 1391 | VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS" |
Matt Turner | 261719b | 2012-08-22 16:57:38 -0700 | [diff] [blame] | 1392 | AC_SUBST([VG_PC_LIB_PRIV]) |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1393 | fi |
Matt Turner | cdee0e8 | 2012-09-10 11:21:26 -0700 | [diff] [blame] | 1394 | AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes) |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1395 | |
| 1396 | dnl |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1397 | dnl Gallium G3DVL configuration |
| 1398 | dnl |
Emil Velikov | 816d392 | 2014-06-11 22:15:58 +0100 | [diff] [blame] | 1399 | if test -n "$with_gallium_drivers" -a "x$with_gallium_drivers" != xswrast; then |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1400 | if test "x$enable_xvmc" = xauto; then |
Christian König | a8ae8cf | 2011-07-14 12:42:17 +0200 | [diff] [blame] | 1401 | PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1402 | fi |
| 1403 | |
| 1404 | if test "x$enable_vdpau" = xauto; then |
Christian König | 33bf410 | 2011-07-14 13:57:23 +0200 | [diff] [blame] | 1405 | PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1406 | fi |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1407 | |
| 1408 | if test "x$enable_omx" = xauto; then |
| 1409 | PKG_CHECK_EXISTS([libomxil-bellagio], [enable_omx=yes], [enable_omx=no]) |
| 1410 | fi |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1411 | fi |
| 1412 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1413 | if test "x$enable_xvmc" = xyes; then |
Emil Velikov | 0b76c51 | 2014-07-12 00:09:57 +0100 | [diff] [blame] | 1414 | PKG_CHECK_MODULES([XVMC], [xvmc >= $XVMC_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) |
Christian König | dcf8ee7 | 2012-02-15 17:30:58 +0100 | [diff] [blame] | 1415 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1416 | enable_gallium_loader=$enable_shared_pipe_drivers |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1417 | fi |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1418 | AM_CONDITIONAL(HAVE_ST_XVMC, test "x$enable_xvmc" = xyes) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1419 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1420 | if test "x$enable_vdpau" = xyes; then |
Emil Velikov | 0b76c51 | 2014-07-12 00:09:57 +0100 | [diff] [blame] | 1421 | PKG_CHECK_MODULES([VDPAU], [vdpau >= $VDPAU_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED], |
| 1422 | [VDPAU_LIBS="`$PKG_CONFIG --libs x11-xcb xcb xcb-dri2`"]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1423 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1424 | enable_gallium_loader=$enable_shared_pipe_drivers |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1425 | fi |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1426 | AM_CONDITIONAL(HAVE_ST_VDPAU, test "x$enable_vdpau" = xyes) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1427 | |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1428 | if test "x$enable_omx" = xyes; then |
Emil Velikov | 0b76c51 | 2014-07-12 00:09:57 +0100 | [diff] [blame] | 1429 | PKG_CHECK_MODULES([OMX], [libomxil-bellagio >= $LIBOMXIL_BELLAGIO_REQUIRED x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED]) |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1430 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS omx" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1431 | enable_gallium_loader=$enable_shared_pipe_drivers |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1432 | fi |
| 1433 | AM_CONDITIONAL(HAVE_ST_OMX, test "x$enable_omx" = xyes) |
| 1434 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1435 | dnl |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1436 | dnl OpenCL configuration |
| 1437 | dnl |
| 1438 | |
Tom Stellard | c79e766 | 2012-03-12 13:53:20 -0400 | [diff] [blame] | 1439 | AC_ARG_WITH([libclc-path], |
| 1440 | [AS_HELP_STRING([--with-libclc-path], |
Johannes Obermayr | 959e83d | 2012-11-30 01:44:56 +0100 | [diff] [blame] | 1441 | [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])], |
Tom Stellard | c79e766 | 2012-03-12 13:53:20 -0400 | [diff] [blame] | 1442 | [LIBCLC_PATH="$withval"], |
Emil Velikov | 2e830bb | 2014-02-24 22:58:07 +0000 | [diff] [blame] | 1443 | [LIBCLC_PATH='']) |
Tom Stellard | c79e766 | 2012-03-12 13:53:20 -0400 | [diff] [blame] | 1444 | |
Emil Velikov | f41102b | 2014-02-04 17:32:03 +0000 | [diff] [blame] | 1445 | if test -n "$LIBCLC_PATH"; then |
Johannes Obermayr | 959e83d | 2012-11-30 01:44:56 +0100 | [diff] [blame] | 1446 | AC_MSG_ERROR([The --with-libclc-path option has been deprecated. |
| 1447 | Please review the updated build instructions for clover: |
| 1448 | http://dri.freedesktop.org/wiki/GalliumCompute]) |
| 1449 | fi |
| 1450 | |
| 1451 | |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1452 | AC_ARG_WITH([clang-libdir], |
| 1453 | [AS_HELP_STRING([--with-clang-libdir], |
| 1454 | [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])], |
| 1455 | [CLANG_LIBDIR="$withval"], |
Emil Velikov | 2e830bb | 2014-02-24 22:58:07 +0000 | [diff] [blame] | 1456 | [CLANG_LIBDIR='']) |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1457 | |
Tom Stellard | a64d3dd | 2013-09-05 16:26:17 -0700 | [diff] [blame] | 1458 | PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no]) |
Tom Stellard | c79e766 | 2012-03-12 13:53:20 -0400 | [diff] [blame] | 1459 | |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1460 | if test "x$enable_opencl" = xyes; then |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 1461 | if test -z "$with_gallium_drivers"; then |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1462 | AC_MSG_ERROR([cannot enable OpenCL without Gallium]) |
| 1463 | fi |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1464 | |
Francisco Jerez | 7baad4b | 2013-09-28 17:26:50 -0700 | [diff] [blame] | 1465 | if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 7; then |
| 1466 | AC_MSG_ERROR([gcc >= 4.7 is required to build clover]) |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1467 | fi |
| 1468 | |
Tom Stellard | a64d3dd | 2013-09-05 16:26:17 -0700 | [diff] [blame] | 1469 | if test "x$have_libclc" = xno; then |
| 1470 | AC_MSG_ERROR([pkg-config cannot find libclc.pc which is required to build clover. |
| 1471 | Make sure the directory containing libclc.pc is specified in your |
| 1472 | PKG_CONFIG_PATH environment variable. |
| 1473 | By default libclc.pc is installed to /usr/local/share/pkgconfig/]) |
| 1474 | else |
Emil Velikov | 0828ad4 | 2013-09-28 03:20:14 +0100 | [diff] [blame] | 1475 | LIBCLC_INCLUDEDIR=`$PKG_CONFIG --variable=includedir libclc` |
| 1476 | LIBCLC_LIBEXECDIR=`$PKG_CONFIG --variable=libexecdir libclc` |
Tom Stellard | a64d3dd | 2013-09-05 16:26:17 -0700 | [diff] [blame] | 1477 | AC_SUBST([LIBCLC_INCLUDEDIR]) |
| 1478 | AC_SUBST([LIBCLC_LIBEXECDIR]) |
Johannes Obermayr | 959e83d | 2012-11-30 01:44:56 +0100 | [diff] [blame] | 1479 | fi |
| 1480 | |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1481 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover" |
| 1482 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl" |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1483 | # XXX: Use $enable_shared_pipe_drivers once converted to use static/shared pipe-drivers |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1484 | enable_gallium_loader=yes |
Tom Stellard | 07567c1 | 2013-09-18 00:36:55 -0700 | [diff] [blame] | 1485 | |
| 1486 | if test "x$enable_opencl_icd" = xyes; then |
| 1487 | OPENCL_LIBNAME="MesaOpenCL" |
| 1488 | else |
| 1489 | OPENCL_LIBNAME="OpenCL" |
| 1490 | fi |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1491 | fi |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1492 | AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes) |
Tom Stellard | 07567c1 | 2013-09-18 00:36:55 -0700 | [diff] [blame] | 1493 | AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes) |
| 1494 | AC_SUBST([OPENCL_LIBNAME]) |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1495 | |
| 1496 | dnl |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1497 | dnl Gallium configuration |
| 1498 | dnl |
Matt Turner | a9676ae | 2013-01-18 23:59:49 -0800 | [diff] [blame] | 1499 | AM_CONDITIONAL(HAVE_GALLIUM, test -n "$with_gallium_drivers") |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1500 | |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1501 | AC_SUBST([LLVM_BINDIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1502 | AC_SUBST([LLVM_CFLAGS]) |
Tom Stellard | d416780 | 2012-04-24 10:34:57 -0400 | [diff] [blame] | 1503 | AC_SUBST([LLVM_CPPFLAGS]) |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1504 | AC_SUBST([LLVM_CXXFLAGS]) |
Tom Stellard | d416780 | 2012-04-24 10:34:57 -0400 | [diff] [blame] | 1505 | AC_SUBST([LLVM_LIBDIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1506 | AC_SUBST([LLVM_LIBS]) |
| 1507 | AC_SUBST([LLVM_LDFLAGS]) |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1508 | AC_SUBST([LLVM_INCLUDEDIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1509 | AC_SUBST([LLVM_VERSION]) |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1510 | AC_SUBST([CLANG_RESOURCE_DIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1511 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1512 | case "x$enable_opengl$enable_gles1$enable_gles2" in |
| 1513 | x*yes*) |
| 1514 | EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)' |
| 1515 | ;; |
| 1516 | esac |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1517 | |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 1518 | AC_SUBST([VG_LIB_DEPS]) |
Chia-I Wu | 63ab250 | 2010-05-05 15:38:02 +0800 | [diff] [blame] | 1519 | AC_SUBST([EGL_CLIENT_APIS]) |
| 1520 | |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1521 | dnl |
| 1522 | dnl EGL Platforms configuration |
| 1523 | dnl |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1524 | AC_ARG_WITH([egl-platforms], |
| 1525 | [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@], |
| 1526 | [comma delimited native platforms libEGL supports, e.g. |
Chia-I Wu | e7424d7 | 2010-09-19 16:54:39 +0800 | [diff] [blame] | 1527 | "x11,drm" @<:@default=auto@:>@])], |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1528 | [with_egl_platforms="$withval"], |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1529 | [if test "x$enable_egl" = xyes; then |
| 1530 | with_egl_platforms="x11" |
| 1531 | else |
| 1532 | with_egl_platforms="" |
| 1533 | fi]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1534 | |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1535 | if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then |
| 1536 | AC_MSG_ERROR([cannot build egl state tracker without EGL library]) |
| 1537 | fi |
| 1538 | |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1539 | # Do per-EGL platform setups and checks |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1540 | egl_platforms=`IFS=', '; echo $with_egl_platforms` |
| 1541 | for plat in $egl_platforms; do |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1542 | case "$plat" in |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1543 | wayland) |
Fabio Pedretti | 8a8dd86 | 2014-03-01 10:11:12 +0100 | [diff] [blame] | 1544 | PKG_CHECK_MODULES([WAYLAND], [wayland-client >= $WAYLAND_REQUIRED wayland-server >= $WAYLAND_REQUIRED]) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1545 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland" |
Benjamin Franzke | 8b90205 | 2012-01-24 20:38:01 +0100 | [diff] [blame] | 1546 | |
Kristian Høgsberg | 426a23a | 2012-07-13 11:06:32 -0400 | [diff] [blame] | 1547 | WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` |
| 1548 | AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, |
| 1549 | [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1550 | ;; |
| 1551 | |
| 1552 | x11) |
Emil Velikov | 17798bf | 2014-07-12 00:05:56 +0100 | [diff] [blame] | 1553 | PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb xcb-dri2 >= $XCBDRI2_REQUIRED xcb-xfixes]) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1554 | ;; |
| 1555 | |
| 1556 | drm) |
| 1557 | test "x$enable_gbm" = "xno" && |
| 1558 | AC_MSG_ERROR([EGL platform drm needs gbm]) |
Tapani Pälli | a057b83 | 2013-12-01 11:53:55 +0200 | [diff] [blame] | 1559 | test "x$have_libdrm" != xyes && |
| 1560 | AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED]) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1561 | ;; |
| 1562 | |
Matt Turner | b3f1f66 | 2013-01-20 15:32:08 -0800 | [diff] [blame] | 1563 | android|fbdev|gdi|null) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1564 | ;; |
| 1565 | |
| 1566 | *) |
| 1567 | AC_MSG_ERROR([EGL platform '$plat' does not exist]) |
| 1568 | ;; |
| 1569 | esac |
| 1570 | |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 1571 | case "$plat$need_pci_id$have_pci_id" in |
Jonathan Gray | 81799c8 | 2014-03-23 15:53:08 +1100 | [diff] [blame] | 1572 | waylandyesno|drmyesno) |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 1573 | AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED or sysfs]) ;; |
Benjamin Franzke | 7ed1826 | 2011-07-02 13:46:42 +0200 | [diff] [blame] | 1574 | esac |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1575 | done |
| 1576 | |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1577 | # libEGL wants to default to the first platform specified in |
| 1578 | # ./configure. parse that here. |
| 1579 | if test "x$egl_platforms" != "x"; then |
| 1580 | FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'` |
| 1581 | EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS" |
| 1582 | else |
| 1583 | EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM" |
| 1584 | fi |
| 1585 | |
Emil Velikov | 3dc174e | 2014-03-12 02:37:55 +0000 | [diff] [blame] | 1586 | if echo "$egl_platforms" | grep -q 'x11'; then |
Emil Velikov | 61973ff | 2014-02-22 16:47:21 +0000 | [diff] [blame] | 1587 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" |
Matt Turner | b3f1f66 | 2013-01-20 15:32:08 -0800 | [diff] [blame] | 1588 | NEED_WINSYS_XLIB=yes |
| 1589 | fi |
Emil Velikov | 3dc174e | 2014-03-12 02:37:55 +0000 | [diff] [blame] | 1590 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11') |
| 1591 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland') |
| 1592 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm') |
| 1593 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep -q 'fbdev') |
| 1594 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null') |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1595 | |
| 1596 | AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x") |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1597 | |
| 1598 | AC_SUBST([EGL_NATIVE_PLATFORM]) |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1599 | AC_SUBST([EGL_CFLAGS]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1600 | |
Ross Burton | 1a7275d | 2013-06-27 12:35:07 +0100 | [diff] [blame] | 1601 | # If we don't have the X11 platform, set this define so we don't try to include |
| 1602 | # the X11 headers. |
| 1603 | if ! echo "$egl_platforms" | grep -q 'x11'; then |
| 1604 | DEFINES="$DEFINES -DMESA_EGL_NO_X11_HEADERS" |
| 1605 | GL_PC_CFLAGS="$GL_PC_CFLAGS -DMESA_EGL_NO_X11_HEADERS" |
| 1606 | fi |
| 1607 | |
Chia-I Wu | 28c3e57 | 2010-01-23 20:18:43 +0800 | [diff] [blame] | 1608 | AC_ARG_WITH([egl-driver-dir], |
| 1609 | [AS_HELP_STRING([--with-egl-driver-dir=DIR], |
Alexandre Demers | 11a879f | 2014-06-30 17:05:21 -0400 | [diff] [blame] | 1610 | [directory for EGL drivers @<:@default=${libdir}/egl@:>@])], |
Chia-I Wu | 28c3e57 | 2010-01-23 20:18:43 +0800 | [diff] [blame] | 1611 | [EGL_DRIVER_INSTALL_DIR="$withval"], |
| 1612 | [EGL_DRIVER_INSTALL_DIR='${libdir}/egl']) |
| 1613 | AC_SUBST([EGL_DRIVER_INSTALL_DIR]) |
| 1614 | |
Tom Fogal | 7085dce | 2009-08-13 19:40:30 -0600 | [diff] [blame] | 1615 | AC_ARG_WITH([max-width], |
| 1616 | [AS_HELP_STRING([--with-max-width=N], |
| 1617 | [Maximum framebuffer width (4096)])], |
| 1618 | [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}"; |
| 1619 | AS_IF([test "${withval}" -gt "4096"], |
| 1620 | [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])] |
| 1621 | ) |
| 1622 | AC_ARG_WITH([max-height], |
| 1623 | [AS_HELP_STRING([--with-max-height=N], |
| 1624 | [Maximum framebuffer height (4096)])], |
| 1625 | [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}"; |
| 1626 | AS_IF([test "${withval}" -gt "4096"], |
| 1627 | [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])] |
| 1628 | ) |
| 1629 | |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1630 | dnl |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1631 | dnl Gallium LLVM |
| 1632 | dnl |
| 1633 | AC_ARG_ENABLE([gallium-llvm], |
| 1634 | [AS_HELP_STRING([--enable-gallium-llvm], |
Marek Olšák | a86fc71 | 2011-04-21 13:27:55 +0200 | [diff] [blame] | 1635 | [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])], |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1636 | [enable_gallium_llvm="$enableval"], |
| 1637 | [enable_gallium_llvm=auto]) |
Tom Stellard | 7d87c71 | 2012-03-27 22:24:39 -0400 | [diff] [blame] | 1638 | |
Tom Stellard | a4c7342 | 2014-02-04 11:54:38 -0500 | [diff] [blame] | 1639 | AC_ARG_ENABLE([llvm-shared-libs], |
| 1640 | [AS_HELP_STRING([--enable-llvm-shared-libs], |
| 1641 | [link with LLVM shared libraries @<:@default=enabled@:>@])], |
Emil Velikov | 065b6ca | 2014-03-04 20:02:35 +0000 | [diff] [blame] | 1642 | [enable_llvm_shared_libs="$enableval"], |
| 1643 | [enable_llvm_shared_libs=yes]) |
Tom Stellard | 7d87c71 | 2012-03-27 22:24:39 -0400 | [diff] [blame] | 1644 | |
Tom Stellard | 17f6c91 | 2012-07-17 18:32:56 +0000 | [diff] [blame] | 1645 | AC_ARG_WITH([llvm-prefix], |
| 1646 | [AS_HELP_STRING([--with-llvm-prefix], |
| 1647 | [Prefix for LLVM installations in non-standard locations])], |
| 1648 | [llvm_prefix="$withval"], |
Emil Velikov | 2e830bb | 2014-02-24 22:58:07 +0000 | [diff] [blame] | 1649 | [llvm_prefix='']) |
Tom Stellard | 17f6c91 | 2012-07-17 18:32:56 +0000 | [diff] [blame] | 1650 | |
| 1651 | |
Marek Olšák | 9b67a34 | 2012-11-27 23:38:01 +0100 | [diff] [blame] | 1652 | # Call this inside ` ` to get the return value. |
| 1653 | # $1 is the llvm-config command with arguments. |
| 1654 | strip_unwanted_llvm_flags() { |
Marek Olšák | 3d59cde | 2012-11-27 23:56:04 +0100 | [diff] [blame] | 1655 | # Use \> (marks the end of the word) |
Marek Olšák | 9b67a34 | 2012-11-27 23:38:01 +0100 | [diff] [blame] | 1656 | echo `$1` | sed \ |
| 1657 | -e 's/-DNDEBUG\>//g' \ |
Jonathan Gray | c68073e | 2014-09-06 01:44:41 +1000 | [diff] [blame] | 1658 | -e 's/-D_GNU_SOURCE\>//g' \ |
Marek Olšák | 3d59cde | 2012-11-27 23:56:04 +0100 | [diff] [blame] | 1659 | -e 's/-pedantic\>//g' \ |
| 1660 | -e 's/-Wcovered-switch-default\>//g' \ |
| 1661 | -e 's/-O.\>//g' \ |
| 1662 | -e 's/-g\>//g' \ |
Marek Olšák | f9429e3 | 2012-11-28 00:28:18 +0100 | [diff] [blame] | 1663 | -e 's/-Wall\>//g' \ |
Bruno Jiménez | 089d066 | 2014-03-02 22:39:01 +0100 | [diff] [blame] | 1664 | -e 's/-Wcast-qual\>//g' \ |
| 1665 | -e 's/-Woverloaded-virtual\>//g' \ |
Markus Trippelsdorf | 78fcc31 | 2013-12-13 10:59:42 +0100 | [diff] [blame] | 1666 | -e 's/-fcolor-diagnostics\>//g' \ |
Bruno Jiménez | 089d066 | 2014-03-02 22:39:01 +0100 | [diff] [blame] | 1667 | -e 's/-fdata-sections\>//g' \ |
| 1668 | -e 's/-ffunction-sections\>//g' \ |
| 1669 | -e 's/-fno-exceptions\>//g' \ |
| 1670 | -e 's/-fomit-frame-pointer\>//g' \ |
| 1671 | -e 's/-fvisibility-inlines-hidden\>//g' \ |
Vinson Lee | 8479edf | 2014-05-09 18:21:59 -0700 | [diff] [blame] | 1672 | -e 's/-fPIC\>//g' \ |
| 1673 | -e 's/-fstack-protector-strong\>//g' |
Marek Olšák | 9b67a34 | 2012-11-27 23:38:01 +0100 | [diff] [blame] | 1674 | } |
| 1675 | |
| 1676 | |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 1677 | if test -z "$with_gallium_drivers"; then |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1678 | enable_gallium_llvm=no |
| 1679 | fi |
Marek Olšák | a86fc71 | 2011-04-21 13:27:55 +0200 | [diff] [blame] | 1680 | if test "x$enable_gallium_llvm" = xauto; then |
| 1681 | case "$host_cpu" in |
Jean-Sébastien Pédron | 148f0de | 2013-06-05 13:27:37 +0200 | [diff] [blame] | 1682 | i*86|x86_64|amd64) enable_gallium_llvm=yes;; |
Marek Olšák | a86fc71 | 2011-04-21 13:27:55 +0200 | [diff] [blame] | 1683 | esac |
| 1684 | fi |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1685 | if test "x$enable_gallium_llvm" = xyes; then |
Emil Velikov | f41102b | 2014-02-04 17:32:03 +0000 | [diff] [blame] | 1686 | if test -n "$llvm_prefix"; then |
Michał Górny | 5ea2376 | 2013-12-28 15:22:09 +0100 | [diff] [blame] | 1687 | AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"]) |
Tom Stellard | 17f6c91 | 2012-07-17 18:32:56 +0000 | [diff] [blame] | 1688 | else |
Michał Górny | 5ea2376 | 2013-12-28 15:22:09 +0100 | [diff] [blame] | 1689 | AC_PATH_TOOL([LLVM_CONFIG], [llvm-config], [no]) |
Tom Stellard | 17f6c91 | 2012-07-17 18:32:56 +0000 | [diff] [blame] | 1690 | fi |
Marek Olšák | 99fba50 | 2011-07-23 15:57:51 +0200 | [diff] [blame] | 1691 | |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1692 | if test "x$LLVM_CONFIG" != xno; then |
Jonathan Gray | cdb3535 | 2014-09-10 16:11:25 +1000 | [diff] [blame] | 1693 | LLVM_VERSION=`$LLVM_CONFIG --version | egrep -o '^[[0-9.]]+'` |
Klemens Baum | 45574ab | 2013-06-27 23:13:37 +0200 | [diff] [blame] | 1694 | LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` |
| 1695 | LLVM_BINDIR=`$LLVM_CONFIG --bindir` |
| 1696 | LLVM_CPPFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cppflags"` |
| 1697 | LLVM_CFLAGS=$LLVM_CPPFLAGS # CPPFLAGS seem to be sufficient |
| 1698 | LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"` |
| 1699 | LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` |
| 1700 | LLVM_LIBDIR=`$LLVM_CONFIG --libdir` |
| 1701 | |
| 1702 | AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR], |
| 1703 | [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"]) |
| 1704 | AC_COMPUTE_INT([LLVM_VERSION_MINOR], [LLVM_VERSION_MINOR], |
| 1705 | [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"]) |
| 1706 | |
Tom Stellard | c5d0008 | 2014-05-09 04:23:50 -0400 | [diff] [blame] | 1707 | dnl In LLVM 3.4.1 patch level was defined in config.h and not |
| 1708 | dnl llvm-config.h |
| 1709 | AC_COMPUTE_INT([LLVM_VERSION_PATCH], [LLVM_VERSION_PATCH], |
| 1710 | [#include "${LLVM_INCLUDEDIR}/llvm/Config/config.h"], |
| 1711 | LLVM_VERSION_PATCH=0) dnl Default if LLVM_VERSION_PATCH not found |
| 1712 | |
Emil Velikov | f41102b | 2014-02-04 17:32:03 +0000 | [diff] [blame] | 1713 | if test -n "${LLVM_VERSION_MAJOR}"; then |
Klemens Baum | 45574ab | 2013-06-27 23:13:37 +0200 | [diff] [blame] | 1714 | LLVM_VERSION_INT="${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" |
| 1715 | else |
| 1716 | LLVM_VERSION_INT=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/\10\2/g'` |
| 1717 | fi |
| 1718 | |
José Fonseca | ecef2da | 2014-05-12 16:30:51 +0100 | [diff] [blame] | 1719 | LLVM_REQUIRED_VERSION_MAJOR="3" |
| 1720 | LLVM_REQUIRED_VERSION_MINOR="1" |
| 1721 | if test "$LLVM_VERSION_INT" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}"; then |
| 1722 | AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required]) |
| 1723 | fi |
| 1724 | |
Tom Stellard | 0898047 | 2013-01-25 16:43:11 +0100 | [diff] [blame] | 1725 | LLVM_COMPONENTS="engine bitwriter" |
Jonathan Gray | f96c07a | 2013-06-20 20:14:33 +1000 | [diff] [blame] | 1726 | if $LLVM_CONFIG --components | grep -qw 'mcjit'; then |
Tom Stellard | 0898047 | 2013-01-25 16:43:11 +0100 | [diff] [blame] | 1727 | LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit" |
| 1728 | fi |
Johannes Obermayr | c295874 | 2013-04-09 17:38:42 +0100 | [diff] [blame] | 1729 | |
Tom Stellard | 0898047 | 2013-01-25 16:43:11 +0100 | [diff] [blame] | 1730 | if test "x$enable_opencl" = xyes; then |
| 1731 | LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation" |
Niels Ole Salscheider | b336f51 | 2013-04-04 23:26:45 +0200 | [diff] [blame] | 1732 | # LLVM 3.3 >= 177971 requires IRReader |
Jonathan Gray | f96c07a | 2013-06-20 20:14:33 +1000 | [diff] [blame] | 1733 | if $LLVM_CONFIG --components | grep -qw 'irreader'; then |
Niels Ole Salscheider | b336f51 | 2013-04-04 23:26:45 +0200 | [diff] [blame] | 1734 | LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader" |
| 1735 | fi |
Niels Ole Salscheider | 5394ee8 | 2013-08-07 17:48:48 +0200 | [diff] [blame] | 1736 | # LLVM 3.4 requires Option |
| 1737 | if $LLVM_CONFIG --components | grep -qw 'option'; then |
| 1738 | LLVM_COMPONENTS="${LLVM_COMPONENTS} option" |
| 1739 | fi |
Kai Wasserbäch | 97aa256 | 2014-05-19 17:02:49 +0200 | [diff] [blame] | 1740 | # Current OpenCL/Clover and LLVM 3.5 require ObjCARCOpts and ProfileData |
| 1741 | if $LLVM_CONFIG --components | grep -qw 'objcarcopts'; then |
| 1742 | LLVM_COMPONENTS="${LLVM_COMPONENTS} objcarcopts" |
| 1743 | fi |
| 1744 | if $LLVM_CONFIG --components | grep -qw 'profiledata'; then |
| 1745 | LLVM_COMPONENTS="${LLVM_COMPONENTS} profiledata" |
| 1746 | fi |
Tom Stellard | 0898047 | 2013-01-25 16:43:11 +0100 | [diff] [blame] | 1747 | fi |
Tom Stellard | c5d0008 | 2014-05-09 04:23:50 -0400 | [diff] [blame] | 1748 | DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DLLVM_VERSION_PATCH=$LLVM_VERSION_PATCH" |
Klemens Baum | 45574ab | 2013-06-27 23:13:37 +0200 | [diff] [blame] | 1749 | MESA_LLVM=1 |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1750 | |
Klemens Baum | 45574ab | 2013-06-27 23:13:37 +0200 | [diff] [blame] | 1751 | dnl Check for Clang internal headers |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1752 | if test "x$enable_opencl" = xyes; then |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 1753 | if test -z "$CLANG_LIBDIR"; then |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1754 | CLANG_LIBDIR=${LLVM_LIBDIR} |
| 1755 | fi |
| 1756 | CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} |
Jonathan Liu | af16f73 | 2013-06-04 23:04:44 +1000 | [diff] [blame] | 1757 | AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"], |
| 1758 | [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])]) |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1759 | fi |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1760 | else |
Klemens Baum | 45574ab | 2013-06-27 23:13:37 +0200 | [diff] [blame] | 1761 | MESA_LLVM=0 |
| 1762 | LLVM_VERSION_INT=0 |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1763 | fi |
| 1764 | else |
| 1765 | MESA_LLVM=0 |
Tom Stellard | 80d290d | 2012-08-24 11:48:32 -0700 | [diff] [blame] | 1766 | LLVM_VERSION_INT=0 |
Michel Dänzer | 2d399bb | 2014-06-10 11:25:04 +0900 | [diff] [blame] | 1767 | |
| 1768 | if test "x$enable_opencl" = xyes; then |
| 1769 | AC_MSG_ERROR([cannot enable OpenCL without LLVM]) |
| 1770 | fi |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1771 | fi |
| 1772 | |
Alexandre Demers | 3ea3695 | 2012-04-04 10:54:56 +0200 | [diff] [blame] | 1773 | dnl Directory for XVMC libs |
| 1774 | AC_ARG_WITH([xvmc-libdir], |
| 1775 | [AS_HELP_STRING([--with-xvmc-libdir=DIR], |
| 1776 | [directory for the XVMC libraries @<:@default=${libdir}@:>@])], |
| 1777 | [XVMC_LIB_INSTALL_DIR="$withval"], |
| 1778 | [XVMC_LIB_INSTALL_DIR='${libdir}']) |
| 1779 | AC_SUBST([XVMC_LIB_INSTALL_DIR]) |
| 1780 | |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1781 | dnl |
| 1782 | dnl Gallium Tests |
| 1783 | dnl |
| 1784 | if test "x$enable_gallium_tests" = xyes; then |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 1785 | # XXX: Use $enable_shared_pipe_drivers once converted to use static/shared pipe-drivers |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1786 | enable_gallium_loader=yes |
| 1787 | fi |
Matt Turner | a9676ae | 2013-01-18 23:59:49 -0800 | [diff] [blame] | 1788 | AM_CONDITIONAL(HAVE_GALLIUM_TESTS, test "x$enable_gallium_tests" = xyes) |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1789 | |
Matt Turner | 2f7a37d | 2013-01-20 12:54:31 -0800 | [diff] [blame] | 1790 | if test "x$enable_gallium_loader" = xyes; then |
| 1791 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS pipe-loader" |
| 1792 | fi |
| 1793 | |
Thomas Balling Sørensen | 3299997 | 2010-07-14 00:34:56 +0200 | [diff] [blame] | 1794 | dnl Directory for VDPAU libs |
| 1795 | AC_ARG_WITH([vdpau-libdir], |
| 1796 | [AS_HELP_STRING([--with-vdpau-libdir=DIR], |
| 1797 | [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])], |
| 1798 | [VDPAU_LIB_INSTALL_DIR="$withval"], |
| 1799 | [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau']) |
| 1800 | AC_SUBST([VDPAU_LIB_INSTALL_DIR]) |
Younes Manton | 40cd082 | 2010-03-05 23:11:05 -0500 | [diff] [blame] | 1801 | |
Emil Velikov | 254aafb | 2014-03-03 02:21:53 +0000 | [diff] [blame] | 1802 | OMX_LIB_INSTALL_DIR_DEFAULT='' |
| 1803 | if test "x$enable_omx" = xyes; then |
| 1804 | OMX_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio` |
| 1805 | fi |
| 1806 | |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1807 | AC_ARG_WITH([omx-libdir], |
| 1808 | [AS_HELP_STRING([--with-omx-libdir=DIR], |
| 1809 | [directory for the OMX libraries])], |
| 1810 | [OMX_LIB_INSTALL_DIR="$withval"], |
Emil Velikov | 254aafb | 2014-03-03 02:21:53 +0000 | [diff] [blame] | 1811 | [OMX_LIB_INSTALL_DIR="$OMX_LIB_INSTALL_DIR_DEFAULT"]) |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1812 | AC_SUBST([OMX_LIB_INSTALL_DIR]) |
| 1813 | |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1814 | dnl Directory for OpenCL libs |
| 1815 | AC_ARG_WITH([opencl-libdir], |
| 1816 | [AS_HELP_STRING([--with-opencl-libdir=DIR], |
Francisco Jerez | 4deefd9 | 2013-02-27 12:26:13 +0100 | [diff] [blame] | 1817 | [directory for auxiliary libraries used by the OpenCL implementation @<:@default=${libdir}/opencl@:>@])], |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1818 | [OPENCL_LIB_INSTALL_DIR="$withval"], |
| 1819 | [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl']) |
| 1820 | AC_SUBST([OPENCL_LIB_INSTALL_DIR]) |
| 1821 | |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1822 | dnl |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1823 | dnl Gallium helper functions |
| 1824 | dnl |
| 1825 | gallium_check_st() { |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1826 | if test "x$have_libdrm" != xyes; then |
| 1827 | AC_MSG_ERROR([$1 requires libdrm >= $LIBDRM_REQUIRED]) |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1828 | fi |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1829 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $2" |
| 1830 | |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 1831 | if test "x$enable_dri" = xyes -a -n "$3"; then |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1832 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3" |
| 1833 | fi |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 1834 | if test "x$enable_xa" = xyes -a -n "$4"; then |
Thomas Hellstrom | 9f2f5b3 | 2011-06-15 10:46:24 +0200 | [diff] [blame] | 1835 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4" |
| 1836 | fi |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 1837 | if test "x$enable_xvmc" = xyes -a -n "$5"; then |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1838 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5" |
| 1839 | fi |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 1840 | if test "x$enable_vdpau" = xyes -a -n "$6"; then |
Christian König | 79aa29d | 2014-02-11 16:55:30 +0100 | [diff] [blame] | 1841 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6" |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 1842 | fi |
Matt Turner | 585e250 | 2014-09-21 13:22:28 -0700 | [diff] [blame] | 1843 | if test "x$enable_omx" = xyes -a "x$7" != x; then |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1844 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7" |
| 1845 | fi |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1846 | } |
| 1847 | |
Marek Olšák | c17fb85 | 2011-06-14 04:03:17 +0200 | [diff] [blame] | 1848 | gallium_require_llvm() { |
| 1849 | if test "x$MESA_LLVM" = x0; then |
Maarten Lankhorst | 4c16e6a | 2014-08-11 13:16:05 +0200 | [diff] [blame] | 1850 | case "$host" in *gnux32) return;; esac |
Marek Olšák | c17fb85 | 2011-06-14 04:03:17 +0200 | [diff] [blame] | 1851 | case "$host_cpu" in |
Jean-Sébastien Pédron | 148f0de | 2013-06-05 13:27:37 +0200 | [diff] [blame] | 1852 | i*86|x86_64|amd64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);; |
Marek Olšák | c17fb85 | 2011-06-14 04:03:17 +0200 | [diff] [blame] | 1853 | esac |
| 1854 | fi |
| 1855 | } |
| 1856 | |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1857 | gallium_require_drm_loader() { |
| 1858 | if test "x$enable_gallium_loader" = xyes; then |
Gary Wong | 85b6f36 | 2014-05-21 21:07:42 -0600 | [diff] [blame] | 1859 | if test "x$need_pci_id$have_pci_id" = xyesno; then |
| 1860 | AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED or sysfs]) |
Emil Velikov | 118c36a | 2014-01-29 17:19:46 +0000 | [diff] [blame] | 1861 | fi |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1862 | if test "x$have_libdrm" != xyes; then |
| 1863 | AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED]) |
| 1864 | fi |
| 1865 | enable_gallium_drm_loader=yes |
| 1866 | fi |
| 1867 | } |
| 1868 | |
Marek Olšák | cc71df5 | 2014-04-24 13:40:56 +0200 | [diff] [blame] | 1869 | require_egl_drm() { |
| 1870 | case "$with_egl_platforms" in |
| 1871 | *drm*) |
| 1872 | ;; |
| 1873 | *) |
| 1874 | AC_MSG_ERROR([--with-egl-platforms=drm is required to build the $1 driver.]) |
| 1875 | ;; |
| 1876 | esac |
| 1877 | if test "x$enable_gbm" != xyes; then |
| 1878 | AC_MSG_ERROR([--enable-gbm is required to build the $1 driver.]) |
| 1879 | fi |
| 1880 | } |
| 1881 | |
Tom Stellard | 8d97785 | 2012-05-10 10:21:54 -0400 | [diff] [blame] | 1882 | radeon_llvm_check() { |
Emil Velikov | 929f833 | 2014-02-07 22:13:44 +0000 | [diff] [blame] | 1883 | if test "x$enable_gallium_llvm" != "xyes"; then |
| 1884 | AC_MSG_ERROR([--enable-gallium-llvm is required when building $1]) |
| 1885 | fi |
Vincent Lejeune | 1feb6b7 | 2012-10-31 21:02:29 +0100 | [diff] [blame] | 1886 | LLVM_REQUIRED_VERSION_MAJOR="3" |
Marek Olšák | 4ad6824 | 2014-07-08 02:41:13 +0200 | [diff] [blame] | 1887 | LLVM_REQUIRED_VERSION_MINOR="4" |
| 1888 | LLVM_REQUIRED_VERSION_PATCH="2" |
| 1889 | if test "${LLVM_VERSION_INT}${LLVM_VERSION_PATCH}" -lt "${LLVM_REQUIRED_VERSION_MAJOR}0${LLVM_REQUIRED_VERSION_MINOR}${LLVM_REQUIRED_VERSION_PATCH}"; then |
Vinson Lee | f6fc807 | 2014-07-18 12:12:37 -0700 | [diff] [blame] | 1890 | AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR.$LLVM_REQUIRED_VERSION_PATCH or newer is required for $1]) |
Tom Stellard | 8d97785 | 2012-05-10 10:21:54 -0400 | [diff] [blame] | 1891 | fi |
Jonathan Gray | f96c07a | 2013-06-20 20:14:33 +1000 | [diff] [blame] | 1892 | if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then |
Johannes Obermayr | 05c143c | 2012-12-20 20:56:17 +0100 | [diff] [blame] | 1893 | AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM |
| 1894 | sources with the --enable-experimental-targets=R600 |
| 1895 | configure flag]) |
Tom Stellard | 8d97785 | 2012-05-10 10:21:54 -0400 | [diff] [blame] | 1896 | fi |
Andreas Hartmetz | f43f07d | 2013-05-28 23:59:41 +0200 | [diff] [blame] | 1897 | LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo" |
Christian König | 5b2855b | 2013-04-03 10:18:35 +0200 | [diff] [blame] | 1898 | NEED_RADEON_LLVM=yes |
Tom Stellard | 9277b04 | 2013-04-04 13:02:51 -0700 | [diff] [blame] | 1899 | AC_CHECK_LIB([elf], [elf_memory], [ELF_LIB=-lelf], |
Emil Velikov | 929f833 | 2014-02-07 22:13:44 +0000 | [diff] [blame] | 1900 | [AC_MSG_ERROR([$1 requires libelf when using LLVM])]) |
Tom Stellard | 8d97785 | 2012-05-10 10:21:54 -0400 | [diff] [blame] | 1901 | } |
| 1902 | |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1903 | dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block |
Emil Velikov | f41102b | 2014-02-04 17:32:03 +0000 | [diff] [blame] | 1904 | if test -n "$with_gallium_drivers"; then |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1905 | gallium_drivers=`IFS=', '; echo $with_gallium_drivers` |
| 1906 | for driver in $gallium_drivers; do |
| 1907 | case "x$driver" in |
| 1908 | xsvga) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1909 | HAVE_GALLIUM_SVGA=yes |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1910 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe" |
Emil Velikov | 4687b0a | 2014-02-24 22:58:13 +0000 | [diff] [blame] | 1911 | gallium_require_drm_loader |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1912 | gallium_check_st "svga" "svga/drm" "dri/vmwgfx" "xa/vmwgfx" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1913 | ;; |
| 1914 | xi915) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1915 | HAVE_GALLIUM_I915=yes |
Emil Velikov | c2426bb | 2011-07-14 23:07:19 +0100 | [diff] [blame] | 1916 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
Emil Velikov | 4687b0a | 2014-02-24 22:58:13 +0000 | [diff] [blame] | 1917 | gallium_require_drm_loader |
Emil Velikov | 6984e8d | 2014-06-19 00:28:49 +0100 | [diff] [blame] | 1918 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1919 | gallium_check_st "Gallium i915" "i915/drm" "dri/i915" "xa/i915" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1920 | ;; |
Chia-I Wu | 5816a47 | 2012-12-13 06:01:23 +0800 | [diff] [blame] | 1921 | xilo) |
| 1922 | HAVE_GALLIUM_ILO=yes |
| 1923 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
| 1924 | gallium_require_drm_loader |
| 1925 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS ilo" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1926 | gallium_check_st "Gallium i965/ilo" "intel/drm" "dri/ilo" "xa/ilo" |
Chia-I Wu | 5816a47 | 2012-12-13 06:01:23 +0800 | [diff] [blame] | 1927 | ;; |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1928 | xr300) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1929 | HAVE_GALLIUM_R300=yes |
Jerome Glisse | c0c979e | 2012-01-30 17:22:13 -0500 | [diff] [blame] | 1930 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
Emil Velikov | 4687b0a | 2014-02-24 22:58:13 +0000 | [diff] [blame] | 1931 | gallium_require_drm_loader |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1932 | gallium_require_llvm "Gallium R300" |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1933 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1934 | gallium_check_st "Gallium R300" "radeon/drm" "dri/r300" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1935 | ;; |
| 1936 | xr600) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1937 | HAVE_GALLIUM_R600=yes |
Jerome Glisse | c0c979e | 2012-01-30 17:22:13 -0500 | [diff] [blame] | 1938 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1939 | gallium_require_drm_loader |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1940 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600" |
Adam Rak | 6a829a1 | 2011-11-30 22:20:41 +0100 | [diff] [blame] | 1941 | if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then |
Emil Velikov | 929f833 | 2014-02-07 22:13:44 +0000 | [diff] [blame] | 1942 | radeon_llvm_check "r600g" |
Andreas Hartmetz | f43f07d | 2013-05-28 23:59:41 +0200 | [diff] [blame] | 1943 | LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser" |
Adam Rak | 6a829a1 | 2011-11-30 22:20:41 +0100 | [diff] [blame] | 1944 | fi |
| 1945 | if test "x$enable_r600_llvm" = xyes; then |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 1946 | USE_R600_LLVM_COMPILER=yes; |
| 1947 | fi |
Tom Stellard | 0898047 | 2013-01-25 16:43:11 +0100 | [diff] [blame] | 1948 | if test "x$enable_opencl" = xyes; then |
| 1949 | LLVM_COMPONENTS="${LLVM_COMPONENTS} bitreader asmparser" |
| 1950 | fi |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1951 | gallium_check_st "Gallium R600" "radeon/drm" "dri/r600" "" "xvmc/r600" "vdpau/r600" "omx/r600" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1952 | ;; |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1953 | xradeonsi) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1954 | HAVE_GALLIUM_RADEONSI=yes |
Michel Dänzer | 24bc382 | 2012-05-12 12:12:21 +0200 | [diff] [blame] | 1955 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
| 1956 | gallium_require_drm_loader |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1957 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi" |
Emil Velikov | 929f833 | 2014-02-07 22:13:44 +0000 | [diff] [blame] | 1958 | radeon_llvm_check "radeonsi" |
Marek Olšák | cc71df5 | 2014-04-24 13:40:56 +0200 | [diff] [blame] | 1959 | require_egl_drm "radeonsi" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1960 | gallium_check_st "radeonsi" "radeon/drm" "dri/radeonsi" "" "" "vdpau/radeonsi" "omx/radeonsi" |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1961 | ;; |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1962 | xnouveau) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1963 | HAVE_GALLIUM_NOUVEAU=yes |
Emil Velikov | c2426bb | 2011-07-14 23:07:19 +0100 | [diff] [blame] | 1964 | PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED]) |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1965 | gallium_require_drm_loader |
Johannes Obermayr | 5eb7ff1 | 2013-08-20 20:14:00 +0200 | [diff] [blame] | 1966 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1967 | gallium_check_st "nouveau" "nouveau/drm" "dri/nouveau" "xa/nouveau" "xvmc/nouveau" "vdpau/nouveau" "omx/nouveau" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1968 | ;; |
Rob Clark | 6173cc1 | 2012-10-27 11:07:34 -0500 | [diff] [blame] | 1969 | xfreedreno) |
| 1970 | HAVE_GALLIUM_FREEDRENO=yes |
| 1971 | PKG_CHECK_MODULES([FREEDRENO], [libdrm_freedreno >= $LIBDRM_FREEDRENO_REQUIRED]) |
| 1972 | gallium_require_drm_loader |
| 1973 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS freedreno" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1974 | gallium_check_st "freedreno" "freedreno/drm" "dri/freedreno" "xa/freedreno" "" "" |
Rob Clark | 6173cc1 | 2012-10-27 11:07:34 -0500 | [diff] [blame] | 1975 | ;; |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1976 | xswrast) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1977 | HAVE_GALLIUM_SOFTPIPE=yes |
Marek Olšák | c6f59fc | 2011-07-26 01:05:13 +0200 | [diff] [blame] | 1978 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe" |
| 1979 | if test "x$MESA_LLVM" = x1; then |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 1980 | HAVE_GALLIUM_LLVMPIPE=yes |
Marek Olšák | c6f59fc | 2011-07-26 01:05:13 +0200 | [diff] [blame] | 1981 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe" |
| 1982 | fi |
| 1983 | |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 1984 | if test "x$enable_dri" = xyes; then |
Emil Velikov | 0bdc3e1 | 2014-06-21 12:50:10 +0100 | [diff] [blame] | 1985 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri/swrast" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1986 | fi |
Giovanni Campagna | 3b176c4 | 2014-07-23 19:37:31 +0100 | [diff] [blame] | 1987 | |
| 1988 | if test "x$have_libdrm" = xyes; then |
Emil Velikov | 6dcd5ae | 2014-09-05 14:06:23 +0100 | [diff] [blame] | 1989 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/kms-dri" |
Giovanni Campagna | 3b176c4 | 2014-07-23 19:37:31 +0100 | [diff] [blame] | 1990 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri/kms-swrast" |
| 1991 | fi |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1992 | ;; |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 1993 | xvc4) |
| 1994 | HAVE_GALLIUM_VC4=yes |
| 1995 | gallium_require_drm_loader |
| 1996 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS vc4" |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 1997 | gallium_check_st "vc4" "vc4/drm" "dri-vc4" "" "" "" |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 1998 | |
| 1999 | case "$host_cpu" in |
| 2000 | i?86 | x86_64 | amd64) |
| 2001 | USE_VC4_SIMULATOR=yes |
| 2002 | ;; |
| 2003 | esac |
| 2004 | ;; |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 2005 | *) |
| 2006 | AC_MSG_ERROR([Unknown Gallium driver: $driver]) |
| 2007 | ;; |
| 2008 | esac |
| 2009 | done |
Chia-I Wu | a1306f4 | 2010-01-22 15:51:51 +0800 | [diff] [blame] | 2010 | fi |
Tom Stellard | 69d639b | 2013-01-18 15:08:28 +0000 | [diff] [blame] | 2011 | |
| 2012 | dnl Set LLVM_LIBS - This is done after the driver configuration so |
| 2013 | dnl that drivers can add additonal components to LLVM_COMPONENTS. |
| 2014 | dnl Previously, gallium drivers were updating LLVM_LIBS directly |
| 2015 | dnl by calling llvm-config --libs ${DRIVER_LLVM_COMPONENTS}, but |
| 2016 | dnl this was causing the same libraries to be appear multiple times |
| 2017 | dnl in LLVM_LIBS. |
| 2018 | |
Tom Stellard | 7a850c5 | 2013-01-25 12:46:55 -0500 | [diff] [blame] | 2019 | if test "x$MESA_LLVM" != x0; then |
Tom Stellard | cf69a59 | 2013-01-18 16:26:12 +0000 | [diff] [blame] | 2020 | |
Tom Stellard | 7a850c5 | 2013-01-25 12:46:55 -0500 | [diff] [blame] | 2021 | LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`" |
Tom Stellard | cf69a59 | 2013-01-18 16:26:12 +0000 | [diff] [blame] | 2022 | |
Emil Velikov | 065b6ca | 2014-03-04 20:02:35 +0000 | [diff] [blame] | 2023 | if test "x$enable_llvm_shared_libs" = xyes; then |
Tom Stellard | 7a850c5 | 2013-01-25 12:46:55 -0500 | [diff] [blame] | 2024 | dnl We can't use $LLVM_VERSION because it has 'svn' stripped out, |
| 2025 | LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version` |
Jonathan Liu | af16f73 | 2013-06-04 23:04:44 +1000 | [diff] [blame] | 2026 | AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes]) |
Tom Stellard | 7a850c5 | 2013-01-25 12:46:55 -0500 | [diff] [blame] | 2027 | |
| 2028 | if test "x$llvm_have_one_so" = xyes; then |
| 2029 | dnl LLVM was built using auto*, so there is only one shared object. |
| 2030 | LLVM_LIBS="-l$LLVM_SO_NAME" |
| 2031 | else |
| 2032 | dnl If LLVM was built with CMake, there will be one shared object per |
| 2033 | dnl component. |
Jonathan Liu | af16f73 | 2013-06-04 23:04:44 +1000 | [diff] [blame] | 2034 | AS_IF([test ! -f "$LLVM_LIBDIR/libLLVMTarget.so"], |
| 2035 | [AC_MSG_ERROR([Could not find llvm shared libraries: |
Tom Stellard | cf69a59 | 2013-01-18 16:26:12 +0000 | [diff] [blame] | 2036 | Please make sure you have built llvm with the --enable-shared option |
| 2037 | and that your llvm libraries are installed in $LLVM_LIBDIR |
| 2038 | If you have installed your llvm libraries to a different directory you |
| 2039 | can use the --with-llvm-prefix= configure flag to specify this directory. |
Emil Velikov | 065b6ca | 2014-03-04 20:02:35 +0000 | [diff] [blame] | 2040 | NOTE: Mesa is attempting to use llvm shared libraries by default. |
Tom Stellard | cf69a59 | 2013-01-18 16:26:12 +0000 | [diff] [blame] | 2041 | If you do not want to build with llvm shared libraries and instead want to |
Emil Velikov | 065b6ca | 2014-03-04 20:02:35 +0000 | [diff] [blame] | 2042 | use llvm static libraries then add --disable-llvm-shared-libs to your configure |
| 2043 | invocation and rebuild.])]) |
Tom Stellard | cf69a59 | 2013-01-18 16:26:12 +0000 | [diff] [blame] | 2044 | |
Tom Stellard | 7a850c5 | 2013-01-25 12:46:55 -0500 | [diff] [blame] | 2045 | dnl We don't need to update LLVM_LIBS in this case because the LLVM |
| 2046 | dnl install uses a shared object for each compoenent and we have |
| 2047 | dnl already added all of these objects to LLVM_LIBS. |
| 2048 | fi |
Emil Velikov | 065b6ca | 2014-03-04 20:02:35 +0000 | [diff] [blame] | 2049 | else |
| 2050 | AC_MSG_WARN([Building mesa with staticly linked LLVM may cause compilation issues]) |
Tom Stellard | cf69a59 | 2013-01-18 16:26:12 +0000 | [diff] [blame] | 2051 | fi |
Tom Stellard | 69d639b | 2013-01-18 15:08:28 +0000 | [diff] [blame] | 2052 | fi |
| 2053 | |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 2054 | AM_CONDITIONAL(HAVE_GALLIUM_SVGA, test "x$HAVE_GALLIUM_SVGA" = xyes) |
| 2055 | AM_CONDITIONAL(HAVE_GALLIUM_I915, test "x$HAVE_GALLIUM_I915" = xyes) |
Chia-I Wu | 5816a47 | 2012-12-13 06:01:23 +0800 | [diff] [blame] | 2056 | AM_CONDITIONAL(HAVE_GALLIUM_ILO, test "x$HAVE_GALLIUM_ILO" = xyes) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 2057 | AM_CONDITIONAL(HAVE_GALLIUM_R300, test "x$HAVE_GALLIUM_R300" = xyes) |
| 2058 | AM_CONDITIONAL(HAVE_GALLIUM_R600, test "x$HAVE_GALLIUM_R600" = xyes) |
| 2059 | AM_CONDITIONAL(HAVE_GALLIUM_RADEONSI, test "x$HAVE_GALLIUM_RADEONSI" = xyes) |
Emil Velikov | d812c74 | 2014-05-10 14:35:08 +0100 | [diff] [blame] | 2060 | AM_CONDITIONAL(HAVE_GALLIUM_RADEON_COMMON, test "x$HAVE_GALLIUM_R600" = xyes -o \ |
| 2061 | "x$HAVE_GALLIUM_RADEONSI" = xyes) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 2062 | AM_CONDITIONAL(HAVE_GALLIUM_NOUVEAU, test "x$HAVE_GALLIUM_NOUVEAU" = xyes) |
Rob Clark | 6173cc1 | 2012-10-27 11:07:34 -0500 | [diff] [blame] | 2063 | AM_CONDITIONAL(HAVE_GALLIUM_FREEDRENO, test "x$HAVE_GALLIUM_FREEDRENO" = xyes) |
Matt Turner | 2cbb94b | 2012-09-07 21:04:44 -0700 | [diff] [blame] | 2064 | AM_CONDITIONAL(HAVE_GALLIUM_SOFTPIPE, test "x$HAVE_GALLIUM_SOFTPIPE" = xyes) |
| 2065 | AM_CONDITIONAL(HAVE_GALLIUM_LLVMPIPE, test "x$HAVE_GALLIUM_LLVMPIPE" = xyes) |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 2066 | AM_CONDITIONAL(HAVE_GALLIUM_VC4, test "x$HAVE_GALLIUM_VC4" = xyes) |
Chia-I Wu | a1306f4 | 2010-01-22 15:51:51 +0800 | [diff] [blame] | 2067 | |
Emil Velikov | 44ec468 | 2014-09-08 23:52:46 +0100 | [diff] [blame] | 2068 | AM_CONDITIONAL(HAVE_GALLIUM_STATIC_TARGETS, test "x$enable_shared_pipe_drivers" = xno) |
Emil Velikov | 949beb0 | 2014-05-16 15:09:26 +0100 | [diff] [blame] | 2069 | |
Rob Clark | a122c75 | 2014-02-10 09:39:23 -0500 | [diff] [blame] | 2070 | # NOTE: anything using xcb or other client side libs ends up in separate |
| 2071 | # _CLIENT variables. The pipe loader is built in two variants, |
| 2072 | # one that is standalone and does not link any x client libs (for |
| 2073 | # use by XA tracker in particular, but could be used in any case |
| 2074 | # where communication with xserver is not desired). |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2075 | if test "x$enable_gallium_loader" = xyes; then |
| 2076 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null" |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2077 | |
Emil Velikov | 6c44d43 | 2014-04-01 17:42:41 +0100 | [diff] [blame] | 2078 | if test "x$NEED_WINSYS_XLIB" = xyes; then |
Emil Velikov | 3445e8b | 2014-02-22 16:44:14 +0000 | [diff] [blame] | 2079 | GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB" |
| 2080 | fi |
| 2081 | |
Emil Velikov | 5c6a144 | 2014-04-01 17:42:40 +0100 | [diff] [blame] | 2082 | if test "x$enable_dri" = xyes; then |
| 2083 | GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI" |
| 2084 | fi |
| 2085 | |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2086 | if test "x$enable_gallium_drm_loader" = xyes; then |
| 2087 | GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM" |
Tom Stellard | 044de40 | 2012-07-17 18:36:06 +0000 | [diff] [blame] | 2088 | PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2], |
| 2089 | pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no) |
| 2090 | if test "x$pipe_loader_have_xcb" = xyes; then |
Rob Clark | a122c75 | 2014-02-10 09:39:23 -0500 | [diff] [blame] | 2091 | GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES -DHAVE_PIPE_LOADER_XCB" |
| 2092 | GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS" |
Tom Stellard | 044de40 | 2012-07-17 18:36:06 +0000 | [diff] [blame] | 2093 | fi |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2094 | fi |
| 2095 | |
Rob Clark | a122c75 | 2014-02-10 09:39:23 -0500 | [diff] [blame] | 2096 | GALLIUM_PIPE_LOADER_CLIENT_DEFINES="$GALLIUM_PIPE_LOADER_CLIENT_DEFINES $GALLIUM_PIPE_LOADER_DEFINES" |
| 2097 | GALLIUM_PIPE_LOADER_CLIENT_LIBS="$GALLIUM_PIPE_LOADER_CLIENT_LIBS $GALLIUM_PIPE_LOADER_LIBS" |
| 2098 | |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2099 | AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES]) |
| 2100 | AC_SUBST([GALLIUM_PIPE_LOADER_LIBS]) |
Rob Clark | a122c75 | 2014-02-10 09:39:23 -0500 | [diff] [blame] | 2101 | AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES]) |
| 2102 | AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS]) |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2103 | fi |
| 2104 | |
Matt Turner | 07f2dee | 2013-03-05 10:25:55 -0800 | [diff] [blame] | 2105 | AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes) |
| 2106 | AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes) |
| 2107 | AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes) |
| 2108 | AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes) |
| 2109 | AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes) |
| 2110 | AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes) |
Matt Turner | 07f2dee | 2013-03-05 10:25:55 -0800 | [diff] [blame] | 2111 | |
Emil Velikov | 0d0313c | 2014-09-05 14:06:21 +0100 | [diff] [blame] | 2112 | AM_CONDITIONAL(NEED_RADEON_DRM_WINSYS, test "x$HAVE_GALLIUM_R300" = xyes -o \ |
Matt Turner | b3f1f66 | 2013-01-20 15:32:08 -0800 | [diff] [blame] | 2113 | "x$HAVE_GALLIUM_R600" = xyes -o \ |
| 2114 | "x$HAVE_GALLIUM_RADEONSI" = xyes) |
Matt Turner | b3f1f66 | 2013-01-20 15:32:08 -0800 | [diff] [blame] | 2115 | AM_CONDITIONAL(NEED_WINSYS_XLIB, test "x$NEED_WINSYS_XLIB" = xyes) |
Christian König | 5b2855b | 2013-04-03 10:18:35 +0200 | [diff] [blame] | 2116 | AM_CONDITIONAL(NEED_RADEON_LLVM, test x$NEED_RADEON_LLVM = xyes) |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 2117 | AM_CONDITIONAL(USE_R600_LLVM_COMPILER, test x$USE_R600_LLVM_COMPILER = xyes) |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 2118 | AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes) |
| 2119 | AM_CONDITIONAL(HAVE_DRM_LOADER_GALLIUM, test x$enable_gallium_drm_loader = xyes) |
Tom Stellard | d85e512 | 2012-04-20 14:46:45 -0400 | [diff] [blame] | 2120 | AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes) |
Tom Stellard | 80d290d | 2012-08-24 11:48:32 -0700 | [diff] [blame] | 2121 | AM_CONDITIONAL(HAVE_MESA_LLVM, test x$MESA_LLVM = x1) |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 2122 | AM_CONDITIONAL(USE_VC4_SIMULATOR, test x$USE_VC4_SIMULATOR = xyes) |
| 2123 | if test "x$USE_VC4_SIMULATOR" = xyes -a "x$HAVE_GALLIUM_ILO" = xyes; then |
| 2124 | AC_MSG_ERROR([VC4 simulator on x86 replaces i965 driver build, so ilo must be disabled.]) |
| 2125 | fi |
Tom Stellard | 80d290d | 2012-08-24 11:48:32 -0700 | [diff] [blame] | 2126 | |
Tom Stellard | 9277b04 | 2013-04-04 13:02:51 -0700 | [diff] [blame] | 2127 | AC_SUBST([ELF_LIB]) |
Tom Stellard | 26ab747 | 2012-03-03 20:02:05 -0500 | [diff] [blame] | 2128 | |
Eric Anholt | bdcee13 | 2013-09-27 16:57:11 -0700 | [diff] [blame] | 2129 | AM_CONDITIONAL(DRICOMMON_NEED_LIBDRM, test "x$DRICOMMON_NEED_LIBDRM" = xyes) |
Emil Velikov | 26d380d | 2014-01-19 03:09:03 +0000 | [diff] [blame] | 2130 | AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes) |
Matt Turner | 13a7010 | 2013-01-19 00:35:43 -0800 | [diff] [blame] | 2131 | AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes) |
| 2132 | AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes) |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 2133 | AM_CONDITIONAL(HAVE_GALLIUM_OSMESA, test "x$enable_gallium_osmesa" = xyes) |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 2134 | |
Matt Turner | d8abd67 | 2013-11-05 13:53:45 -0800 | [diff] [blame] | 2135 | AM_CONDITIONAL(HAVE_X86_ASM, test "x$asm_arch" = xx86 -o "x$asm_arch" = xx86_64) |
Matt Turner | 957c757 | 2013-11-05 11:20:12 -0800 | [diff] [blame] | 2136 | AM_CONDITIONAL(HAVE_X86_64_ASM, test "x$asm_arch" = xx86_64) |
| 2137 | AM_CONDITIONAL(HAVE_SPARC_ASM, test "x$asm_arch" = xsparc) |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 2138 | |
Matt Turner | 184b2f0 | 2012-09-05 17:06:16 -0700 | [diff] [blame] | 2139 | AC_SUBST([VDPAU_MAJOR], 1) |
| 2140 | AC_SUBST([VDPAU_MINOR], 0) |
| 2141 | |
Matt Turner | 0b132df | 2012-09-07 20:47:04 -0700 | [diff] [blame] | 2142 | AC_SUBST([XVMC_MAJOR], 1) |
| 2143 | AC_SUBST([XVMC_MINOR], 0) |
| 2144 | |
Emil Velikov | 56f5316 | 2014-04-07 13:17:01 +0100 | [diff] [blame] | 2145 | XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h" |
| 2146 | XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MAJOR //'` |
| 2147 | XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MINOR //'` |
| 2148 | XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_PATCH //'` |
| 2149 | |
| 2150 | AC_SUBST([XA_MAJOR], $XA_MAJOR) |
| 2151 | AC_SUBST([XA_MINOR], $XA_MINOR) |
| 2152 | AC_SUBST([XA_TINY], $XA_TINY) |
Matt Turner | d53901c | 2012-09-07 15:24:24 -0700 | [diff] [blame] | 2153 | AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY") |
| 2154 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2155 | dnl Restore LDFLAGS and CPPFLAGS |
| 2156 | LDFLAGS="$_SAVE_LDFLAGS" |
| 2157 | CPPFLAGS="$_SAVE_CPPFLAGS" |
| 2158 | |
Johannes Obermayr | 6016dab | 2013-09-12 00:32:40 +0200 | [diff] [blame] | 2159 | dnl Suppress clang's warnings about unused CFLAGS and CXXFLAGS |
| 2160 | if test "x$acv_mesa_CLANG" = xyes; then |
| 2161 | CFLAGS="$CFLAGS -Qunused-arguments" |
| 2162 | CXXFLAGS="$CXXFLAGS -Qunused-arguments" |
| 2163 | fi |
| 2164 | |
Marcin Baczyński | ff2efdf | 2011-07-13 21:26:49 +0200 | [diff] [blame] | 2165 | dnl Add user CFLAGS and CXXFLAGS |
| 2166 | CFLAGS="$CFLAGS $USER_CFLAGS" |
| 2167 | CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" |
| 2168 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2169 | dnl Substitute the config |
Matt Turner | c874740 | 2012-09-05 20:29:20 -0700 | [diff] [blame] | 2170 | AC_CONFIG_FILES([Makefile |
Matt Turner | 63c3a05 | 2012-09-24 14:30:21 -0700 | [diff] [blame] | 2171 | src/Makefile |
Eric Anholt | e5f8954 | 2012-02-06 12:12:53 +0100 | [diff] [blame] | 2172 | src/egl/drivers/dri2/Makefile |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 2173 | src/egl/main/Makefile |
| 2174 | src/egl/main/egl.pc |
Benjamin Franzke | 8b90205 | 2012-01-24 20:38:01 +0100 | [diff] [blame] | 2175 | src/egl/wayland/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2176 | src/egl/wayland/wayland-drm/Makefile |
Benjamin Franzke | 8b90205 | 2012-01-24 20:38:01 +0100 | [diff] [blame] | 2177 | src/egl/wayland/wayland-egl/Makefile |
| 2178 | src/egl/wayland/wayland-egl/wayland-egl.pc |
Emil Velikov | fd7da27 | 2014-08-13 00:00:50 +0100 | [diff] [blame] | 2179 | src/gallium/Makefile |
Tom Stellard | 80d290d | 2012-08-24 11:48:32 -0700 | [diff] [blame] | 2180 | src/gallium/auxiliary/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2181 | src/gallium/auxiliary/pipe-loader/Makefile |
Matt Turner | 5c6e1e9 | 2013-03-12 17:09:55 -0700 | [diff] [blame] | 2182 | src/gallium/drivers/freedreno/Makefile |
Emil Velikov | 1918c37 | 2013-06-05 23:42:16 +0100 | [diff] [blame] | 2183 | src/gallium/drivers/galahad/Makefile |
Matt Turner | 7d5496a | 2012-08-29 10:31:29 -0700 | [diff] [blame] | 2184 | src/gallium/drivers/i915/Makefile |
Emil Velikov | d7c66ff | 2013-06-05 23:28:11 +0100 | [diff] [blame] | 2185 | src/gallium/drivers/identity/Makefile |
Chia-I Wu | 5816a47 | 2012-12-13 06:01:23 +0800 | [diff] [blame] | 2186 | src/gallium/drivers/ilo/Makefile |
Matt Turner | 960cbd8 | 2012-08-29 12:04:45 -0700 | [diff] [blame] | 2187 | src/gallium/drivers/llvmpipe/Makefile |
Emil Velikov | 38d80c0 | 2013-06-05 23:33:38 +0100 | [diff] [blame] | 2188 | src/gallium/drivers/noop/Makefile |
Matt Turner | 1cf6632 | 2012-08-29 12:33:57 -0700 | [diff] [blame] | 2189 | src/gallium/drivers/nouveau/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2190 | src/gallium/drivers/r300/Makefile |
| 2191 | src/gallium/drivers/r600/Makefile |
Tom Stellard | 0dcb9ae | 2012-08-30 12:55:29 -0400 | [diff] [blame] | 2192 | src/gallium/drivers/radeon/Makefile |
Matt Turner | da2d98f | 2012-08-29 14:29:08 -0700 | [diff] [blame] | 2193 | src/gallium/drivers/radeonsi/Makefile |
Matt Turner | b51cdfa | 2012-08-29 11:42:45 -0700 | [diff] [blame] | 2194 | src/gallium/drivers/rbug/Makefile |
Matt Turner | f781d4c | 2012-08-29 12:17:57 -0700 | [diff] [blame] | 2195 | src/gallium/drivers/softpipe/Makefile |
Matt Turner | 0a42131 | 2012-08-29 12:29:47 -0700 | [diff] [blame] | 2196 | src/gallium/drivers/svga/Makefile |
Tom Stellard | 047fe04 | 2012-08-24 11:46:32 -0700 | [diff] [blame] | 2197 | src/gallium/drivers/trace/Makefile |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 2198 | src/gallium/drivers/vc4/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2199 | src/gallium/state_trackers/clover/Makefile |
Matt Turner | 2ff51cd | 2012-08-29 20:30:22 -0700 | [diff] [blame] | 2200 | src/gallium/state_trackers/dri/Makefile |
Matt Turner | 8443efd | 2012-08-31 17:11:35 -0700 | [diff] [blame] | 2201 | src/gallium/state_trackers/egl/Makefile |
Matt Turner | c0b9081 | 2012-09-04 11:41:22 -0700 | [diff] [blame] | 2202 | src/gallium/state_trackers/gbm/Makefile |
Emil Velikov | 921fdf1 | 2013-09-22 16:14:06 +0100 | [diff] [blame] | 2203 | src/gallium/state_trackers/glx/xlib/Makefile |
Christian König | 15e39ca | 2013-08-05 11:41:27 -0600 | [diff] [blame] | 2204 | src/gallium/state_trackers/omx/Makefile |
Christian König | 79aa29d | 2014-02-11 16:55:30 +0100 | [diff] [blame] | 2205 | src/gallium/state_trackers/osmesa/Makefile |
Matt Turner | d2ca32e | 2012-09-04 13:13:51 -0700 | [diff] [blame] | 2206 | src/gallium/state_trackers/vdpau/Makefile |
Matt Turner | 68c0311 | 2012-09-04 13:24:33 -0700 | [diff] [blame] | 2207 | src/gallium/state_trackers/vega/Makefile |
Matt Turner | 2ad2603 | 2012-09-04 15:17:11 -0700 | [diff] [blame] | 2208 | src/gallium/state_trackers/xa/Makefile |
Matt Turner | 984562d | 2012-09-04 21:08:19 -0700 | [diff] [blame] | 2209 | src/gallium/state_trackers/xvmc/Makefile |
Emil Velikov | 6eabddd | 2014-06-16 14:23:50 +0100 | [diff] [blame] | 2210 | src/gallium/targets/dri/Makefile |
Matt Turner | cdee0e8 | 2012-09-10 11:21:26 -0700 | [diff] [blame] | 2211 | src/gallium/targets/egl-static/Makefile |
Matt Turner | 53c62d3 | 2012-09-13 10:10:14 -0700 | [diff] [blame] | 2212 | src/gallium/targets/gbm/Makefile |
Matt Turner | 026d1fe | 2014-06-10 18:11:56 -0700 | [diff] [blame] | 2213 | src/gallium/targets/libgl-xlib/Makefile |
Emil Velikov | b1f4a96 | 2014-06-12 16:33:58 +0100 | [diff] [blame] | 2214 | src/gallium/targets/omx/Makefile |
Matt Turner | 026d1fe | 2014-06-10 18:11:56 -0700 | [diff] [blame] | 2215 | src/gallium/targets/opencl/Makefile |
Brian Paul | 79eac7d | 2013-03-11 18:31:21 -0600 | [diff] [blame] | 2216 | src/gallium/targets/osmesa/Makefile |
Jon Severinsson | c811190 | 2013-08-23 11:18:59 +0200 | [diff] [blame] | 2217 | src/gallium/targets/osmesa/osmesa.pc |
Matt Turner | 45270fb | 2012-09-13 10:45:01 -0700 | [diff] [blame] | 2218 | src/gallium/targets/pipe-loader/Makefile |
Emil Velikov | 9df2c49 | 2014-06-12 15:41:29 +0100 | [diff] [blame] | 2219 | src/gallium/targets/vdpau/Makefile |
Matt Turner | 026d1fe | 2014-06-10 18:11:56 -0700 | [diff] [blame] | 2220 | src/gallium/targets/xa/Makefile |
| 2221 | src/gallium/targets/xa/xatracker.pc |
Emil Velikov | dc01ca4 | 2014-06-12 15:54:15 +0100 | [diff] [blame] | 2222 | src/gallium/targets/xvmc/Makefile |
Andreas Boll | 59088a2 | 2012-11-26 19:58:12 +0100 | [diff] [blame] | 2223 | src/gallium/tests/trivial/Makefile |
Andreas Boll | cb4d502 | 2012-11-27 19:18:25 +0100 | [diff] [blame] | 2224 | src/gallium/tests/unit/Makefile |
Matt Turner | 5c6e1e9 | 2013-03-12 17:09:55 -0700 | [diff] [blame] | 2225 | src/gallium/winsys/freedreno/drm/Makefile |
Matt Turner | 266d639 | 2012-08-29 10:37:07 -0700 | [diff] [blame] | 2226 | src/gallium/winsys/i915/drm/Makefile |
Chia-I Wu | 5816a47 | 2012-12-13 06:01:23 +0800 | [diff] [blame] | 2227 | src/gallium/winsys/intel/drm/Makefile |
Matt Turner | 77fc30b | 2012-08-29 14:39:48 -0700 | [diff] [blame] | 2228 | src/gallium/winsys/nouveau/drm/Makefile |
Tom Stellard | 34a6150 | 2012-08-24 11:44:57 -0700 | [diff] [blame] | 2229 | src/gallium/winsys/radeon/drm/Makefile |
Matt Turner | 2b5a1c0 | 2012-08-29 14:48:25 -0700 | [diff] [blame] | 2230 | src/gallium/winsys/svga/drm/Makefile |
Matt Turner | a6b3cd1 | 2012-08-29 15:24:40 -0700 | [diff] [blame] | 2231 | src/gallium/winsys/sw/dri/Makefile |
Matt Turner | 5c4ade5 | 2012-08-29 15:28:45 -0700 | [diff] [blame] | 2232 | src/gallium/winsys/sw/fbdev/Makefile |
Giovanni Campagna | 3b176c4 | 2014-07-23 19:37:31 +0100 | [diff] [blame] | 2233 | src/gallium/winsys/sw/kms-dri/Makefile |
Matt Turner | 1c9fb3c | 2012-08-29 15:32:43 -0700 | [diff] [blame] | 2234 | src/gallium/winsys/sw/null/Makefile |
Matt Turner | 1d0ef53 | 2012-08-29 15:44:25 -0700 | [diff] [blame] | 2235 | src/gallium/winsys/sw/wayland/Makefile |
Matt Turner | 24c2fe9 | 2012-08-29 15:46:57 -0700 | [diff] [blame] | 2236 | src/gallium/winsys/sw/wrapper/Makefile |
Matt Turner | 44653c0 | 2012-08-29 15:51:40 -0700 | [diff] [blame] | 2237 | src/gallium/winsys/sw/xlib/Makefile |
Eric Anholt | 1850d0a | 2014-06-19 08:19:38 +0100 | [diff] [blame] | 2238 | src/gallium/winsys/vc4/drm/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2239 | src/gbm/Makefile |
| 2240 | src/gbm/main/gbm.pc |
Jon TURNEY | 68e04cc | 2012-06-28 23:15:48 +0100 | [diff] [blame] | 2241 | src/glsl/Makefile |
Eric Anholt | 8ffb098 | 2012-02-05 06:10:56 +0100 | [diff] [blame] | 2242 | src/glx/Makefile |
Jon TURNEY | 5a459a0 | 2014-05-12 10:47:07 +0100 | [diff] [blame] | 2243 | src/glx/apple/Makefile |
Ian Romanick | 2e8c866 | 2012-05-23 15:23:22 -0700 | [diff] [blame] | 2244 | src/glx/tests/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2245 | src/gtest/Makefile |
Emil Velikov | 8c2e7fd | 2014-01-10 23:36:16 +0000 | [diff] [blame] | 2246 | src/loader/Makefile |
Matt Turner | 691c304 | 2013-01-18 23:43:05 -0800 | [diff] [blame] | 2247 | src/mapi/Makefile |
Matt Turner | a6b8b70 | 2012-08-21 14:36:44 -0700 | [diff] [blame] | 2248 | src/mapi/es1api/glesv1_cm.pc |
Matt Turner | 0f8110c | 2012-08-21 14:52:59 -0700 | [diff] [blame] | 2249 | src/mapi/es2api/glesv2.pc |
Eric Anholt | 3a70f75 | 2012-06-11 12:59:21 -0700 | [diff] [blame] | 2250 | src/mapi/glapi/gen/Makefile |
Matt Turner | 261719b | 2012-08-22 16:57:38 -0700 | [diff] [blame] | 2251 | src/mapi/vgapi/Makefile |
| 2252 | src/mapi/vgapi/vg.pc |
Eric Anholt | 417c1a6 | 2012-06-12 12:10:58 -0700 | [diff] [blame] | 2253 | src/mesa/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2254 | src/mesa/gl.pc |
Matt Turner | 129213e | 2012-01-15 11:50:20 -0500 | [diff] [blame] | 2255 | src/mesa/drivers/dri/dri.pc |
Matt Turner | 80aa781 | 2012-01-26 19:31:12 -0500 | [diff] [blame] | 2256 | src/mesa/drivers/dri/common/Makefile |
Carl Worth | b587a75 | 2012-12-03 15:43:19 -0800 | [diff] [blame] | 2257 | src/mesa/drivers/dri/common/xmlpool/Makefile |
Matt Turner | 3c87dfc | 2012-01-14 21:57:32 -0500 | [diff] [blame] | 2258 | src/mesa/drivers/dri/i915/Makefile |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 2259 | src/mesa/drivers/dri/i965/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2260 | src/mesa/drivers/dri/Makefile |
Matt Turner | 3f96434 | 2012-01-15 10:20:30 -0500 | [diff] [blame] | 2261 | src/mesa/drivers/dri/nouveau/Makefile |
Matt Turner | b38d7a0 | 2012-01-15 10:04:58 -0500 | [diff] [blame] | 2262 | src/mesa/drivers/dri/r200/Makefile |
Matt Turner | e0ee818 | 2012-01-14 22:21:30 -0500 | [diff] [blame] | 2263 | src/mesa/drivers/dri/radeon/Makefile |
Eric Anholt | 2d4b77c | 2012-06-12 11:38:19 -0700 | [diff] [blame] | 2264 | src/mesa/drivers/dri/swrast/Makefile |
Laurent Carlier | 284325d | 2012-06-24 09:51:27 +0200 | [diff] [blame] | 2265 | src/mesa/drivers/osmesa/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2266 | src/mesa/drivers/osmesa/osmesa.pc |
Eric Anholt | fa4cf4d | 2012-05-15 12:23:00 -0700 | [diff] [blame] | 2267 | src/mesa/drivers/x11/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 2268 | src/mesa/main/tests/Makefile |
Kenneth Graunke | 1e0da62 | 2014-02-24 23:39:14 -0800 | [diff] [blame] | 2269 | src/util/Makefile |
Kenneth Graunke | 72e55bb | 2014-02-25 01:08:45 -0800 | [diff] [blame] | 2270 | src/util/tests/hash_table/Makefile]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2271 | |
Marek Olšák | 618dbc8 | 2011-06-27 03:12:57 +0200 | [diff] [blame] | 2272 | dnl Sort the dirs alphabetically |
Marek Olšák | 3c79962 | 2011-09-27 16:51:05 +0200 | [diff] [blame] | 2273 | GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
| 2274 | GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
| 2275 | GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
| 2276 | GALLIUM_STATE_TRACKERS_DIRS=`echo $GALLIUM_STATE_TRACKERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
Marek Olšák | 618dbc8 | 2011-06-27 03:12:57 +0200 | [diff] [blame] | 2277 | |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 2278 | AC_OUTPUT |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 2279 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2280 | dnl |
| 2281 | dnl Output some configuration info for the user |
| 2282 | dnl |
| 2283 | echo "" |
| 2284 | echo " prefix: $prefix" |
| 2285 | echo " exec_prefix: $exec_prefix" |
| 2286 | echo " libdir: $libdir" |
Dan Nicholson | 11ac5b2 | 2008-07-03 09:17:44 -0700 | [diff] [blame] | 2287 | echo " includedir: $includedir" |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2288 | |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2289 | dnl API info |
| 2290 | echo "" |
| 2291 | echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2292 | echo " OpenVG: $enable_openvg" |
| 2293 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2294 | dnl Driver info |
| 2295 | echo "" |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 2296 | case "x$enable_osmesa$enable_gallium_osmesa" in |
| 2297 | xnoyes) |
| 2298 | echo " OSMesa: lib$OSMESA_LIB (Gallium)" |
| 2299 | ;; |
| 2300 | xyesno) |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2301 | echo " OSMesa: lib$OSMESA_LIB" |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 2302 | ;; |
| 2303 | xnono) |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2304 | echo " OSMesa: no" |
Matt Turner | 2f142d5 | 2013-08-20 14:16:17 -0700 | [diff] [blame] | 2305 | ;; |
| 2306 | esac |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2307 | |
Jon TURNEY | 45f9aae | 2014-05-12 10:17:06 +0100 | [diff] [blame] | 2308 | echo "" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2309 | if test "x$enable_dri" != xno; then |
Jon TURNEY | 45f9aae | 2014-05-12 10:17:06 +0100 | [diff] [blame] | 2310 | echo " DRI platform: $dri_platform" |
Emil Velikov | 8015ffe | 2014-02-11 14:47:37 +0000 | [diff] [blame] | 2311 | if test -z "$DRI_DIRS"; then |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2312 | echo " DRI drivers: no" |
| 2313 | else |
Emil Velikov | ee55500 | 2014-02-04 17:26:38 +0000 | [diff] [blame] | 2314 | echo " DRI drivers: $DRI_DIRS" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2315 | fi |
| 2316 | echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 2317 | fi |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2318 | |
| 2319 | case "x$enable_glx$enable_xlib_glx" in |
| 2320 | xyesyes) |
| 2321 | echo " GLX: Xlib-based" |
| 2322 | ;; |
| 2323 | xyesno) |
| 2324 | echo " GLX: DRI-based" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2325 | ;; |
| 2326 | *) |
| 2327 | echo " GLX: $enable_glx" |
| 2328 | ;; |
| 2329 | esac |
| 2330 | |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2331 | dnl EGL |
| 2332 | echo "" |
| 2333 | echo " EGL: $enable_egl" |
| 2334 | if test "$enable_egl" = yes; then |
Matt Turner | 3647efa | 2013-03-09 17:26:43 -0800 | [diff] [blame] | 2335 | echo " EGL platforms: $egl_platforms" |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2336 | |
| 2337 | egl_drivers="" |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 2338 | if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then |
| 2339 | egl_drivers="$egl_drivers builtin:egl_dri2" |
| 2340 | fi |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2341 | |
Matt Turner | 69b69b1 | 2013-01-19 11:23:51 -0800 | [diff] [blame] | 2342 | if test "x$enable_gallium_egl" = xyes; then |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2343 | echo " EGL drivers: ${egl_drivers} egl_gallium" |
| 2344 | echo " EGL Gallium STs:$EGL_CLIENT_APIS" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2345 | else |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2346 | echo " EGL drivers: $egl_drivers" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2347 | fi |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 2348 | fi |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2349 | |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2350 | echo "" |
Eric Anholt | 1a8b127 | 2010-05-21 12:17:24 -0700 | [diff] [blame] | 2351 | if test "x$MESA_LLVM" = x1; then |
Jakob Bornecrantz | fe0fe67 | 2010-04-28 13:38:58 +0100 | [diff] [blame] | 2352 | echo " llvm: yes" |
| 2353 | echo " llvm-config: $LLVM_CONFIG" |
| 2354 | echo " llvm-version: $LLVM_VERSION" |
| 2355 | else |
| 2356 | echo " llvm: no" |
| 2357 | fi |
| 2358 | |
| 2359 | echo "" |
Matt Turner | a9676ae | 2013-01-18 23:59:49 -0800 | [diff] [blame] | 2360 | if test -n "$with_gallium_drivers"; then |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2361 | echo " Gallium: yes" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 2362 | echo " Target dirs: $GALLIUM_TARGET_DIRS" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2363 | echo " Winsys dirs: $GALLIUM_WINSYS_DIRS" |
Jakob Bornecrantz | d67bd60 | 2009-02-20 11:03:18 +0000 | [diff] [blame] | 2364 | echo " Driver dirs: $GALLIUM_DRIVERS_DIRS" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2365 | echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS" |
| 2366 | else |
| 2367 | echo " Gallium: no" |
| 2368 | fi |
| 2369 | |
Daniel Vetter | 8f15c31 | 2011-11-28 22:24:26 +0100 | [diff] [blame] | 2370 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2371 | dnl Libraries |
| 2372 | echo "" |
| 2373 | echo " Shared libs: $enable_shared" |
| 2374 | echo " Static libs: $enable_static" |
Matt Turner | 53248e5 | 2012-08-17 11:25:14 -0700 | [diff] [blame] | 2375 | echo " Shared-glapi: $enable_shared_glapi" |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2376 | |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2377 | dnl Compiler options |
| 2378 | # cleanup the CFLAGS/CXXFLAGS/DEFINES vars |
Matt Turner | 3ed95dc | 2012-09-05 20:41:08 -0700 | [diff] [blame] | 2379 | cflags=`echo $CFLAGS | \ |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2380 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
Matt Turner | 3ed95dc | 2012-09-05 20:41:08 -0700 | [diff] [blame] | 2381 | cxxflags=`echo $CXXFLAGS | \ |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2382 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 2383 | defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'` |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2384 | echo "" |
| 2385 | echo " CFLAGS: $cflags" |
| 2386 | echo " CXXFLAGS: $cxxflags" |
| 2387 | echo " Macros: $defines" |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 2388 | echo "" |
Marek Olšák | a84a8da | 2012-11-27 22:32:50 +0100 | [diff] [blame] | 2389 | if test "x$MESA_LLVM" = x1; then |
| 2390 | echo " LLVM_CFLAGS: $LLVM_CFLAGS" |
| 2391 | echo " LLVM_CXXFLAGS: $LLVM_CXXFLAGS" |
| 2392 | echo " LLVM_CPPFLAGS: $LLVM_CPPFLAGS" |
| 2393 | echo "" |
| 2394 | fi |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 2395 | echo " PYTHON2: $PYTHON2" |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2396 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2397 | echo "" |
Dan Nicholson | b645942 | 2008-03-24 10:01:50 -0700 | [diff] [blame] | 2398 | echo " Run '${MAKE-make}' to build Mesa" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2399 | echo "" |