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 | |
Andreas Boll | 3678f89 | 2012-08-31 16:43:56 +0200 | [diff] [blame] | 9 | AC_INIT([Mesa], [9.0.0], |
Dan Nicholson | f64d6fe | 2007-12-12 17:57:45 -0800 | [diff] [blame] | 10 | [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 11 | AC_CONFIG_AUX_DIR([bin]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 12 | AC_CANONICAL_HOST |
Eric Anholt | a4ff334 | 2012-06-11 12:59:48 -0700 | [diff] [blame] | 13 | AM_INIT_AUTOMAKE([foreign]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 14 | |
Colin Walters | 0d736b2 | 2012-01-14 09:16:20 -0500 | [diff] [blame] | 15 | dnl http://people.gnome.org/~walters/docs/build-api.txt |
| 16 | dnl We don't support srcdir != builddir. |
| 17 | echo \#buildapi-variable-no-builddir >/dev/null |
| 18 | |
Eric Anholt | 7fa5c91 | 2012-01-12 14:56:56 -0800 | [diff] [blame] | 19 | # Support silent build rules, requires at least automake-1.11. Disable |
| 20 | # by either passing --disable-silent-rules to configure or passing V=1 |
| 21 | # to make |
| 22 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 23 | |
Kenneth Graunke | 4a5d020 | 2012-05-30 21:54:21 -0700 | [diff] [blame] | 24 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) |
| 25 | |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 26 | LT_PREREQ([2.2]) |
| 27 | LT_INIT([disable-static]) |
| 28 | |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 29 | dnl Versions for external dependencies |
Chris Wilson | faf1dda | 2011-03-01 18:39:15 +0000 | [diff] [blame] | 30 | LIBDRM_REQUIRED=2.4.24 |
Marek Olšák | 1ff5f08 | 2012-08-27 00:22:31 +0200 | [diff] [blame] | 31 | LIBDRM_RADEON_REQUIRED=2.4.39 |
Eric Anholt | f015901 | 2012-07-18 10:18:26 -0700 | [diff] [blame] | 32 | LIBDRM_INTEL_REQUIRED=2.4.38 |
Ben Skeggs | 2e47d01 | 2011-12-23 14:03:49 +1000 | [diff] [blame] | 33 | LIBDRM_NVVIEUX_REQUIRED=2.4.33 |
Christoph Bumiller | 6d1cdec | 2012-04-06 15:41:55 +0200 | [diff] [blame] | 34 | LIBDRM_NOUVEAU_REQUIRED=2.4.33 |
Jesse Barnes | 1e39fc7 | 2011-05-05 13:09:16 -0700 | [diff] [blame] | 35 | DRI2PROTO_REQUIRED=2.6 |
| 36 | GLPROTO_REQUIRED=1.4.14 |
Chris Wilson | faf1dda | 2011-03-01 18:39:15 +0000 | [diff] [blame] | 37 | LIBDRM_XORG_REQUIRED=2.4.24 |
Jakob Bornecrantz | 683a099 | 2010-03-11 19:23:15 +0000 | [diff] [blame] | 38 | LIBKMS_XORG_REQUIRED=1.0.0 |
Dan Nicholson | cc77e8f | 2008-05-05 14:38:22 -0700 | [diff] [blame] | 39 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 40 | dnl Check for progs |
| 41 | AC_PROG_CPP |
| 42 | AC_PROG_CC |
| 43 | AC_PROG_CXX |
Dylan Noblesmith | a3d5673 | 2012-04-02 15:35:38 +0000 | [diff] [blame] | 44 | AM_PROG_CC_C_O |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 45 | AM_PROG_AS |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 46 | AC_CHECK_PROGS([MAKE], [gmake make]) |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 47 | AC_CHECK_PROGS([PYTHON2], [python2 python]) |
Matt Turner | 3a343ef | 2012-01-11 01:05:56 -0500 | [diff] [blame] | 48 | AC_PROG_SED |
Matt Turner | fd827a8 | 2012-01-21 22:43:02 -0500 | [diff] [blame] | 49 | AC_PROG_MKDIR_P |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 50 | AC_PATH_PROG([MKDEP], [makedepend]) |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 51 | |
Luca Barbieri | f762f7b | 2010-09-24 10:10:09 +0200 | [diff] [blame] | 52 | if test "x$MKDEP" = "x"; then |
| 53 | AC_MSG_ERROR([makedepend is required to build Mesa]) |
| 54 | fi |
| 55 | |
Matt Turner | dfb6142 | 2012-01-13 14:31:39 -0500 | [diff] [blame] | 56 | AC_PROG_YACC |
| 57 | AC_PATH_PROG([YACC_INST], $YACC) |
Matt Turner | ba4a36d | 2012-08-22 15:08:01 -0700 | [diff] [blame] | 58 | if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"; then |
Matt Turner | dfb6142 | 2012-01-13 14:31:39 -0500 | [diff] [blame] | 59 | if test -z "$YACC_INST"; then |
| 60 | AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y]) |
| 61 | fi |
| 62 | fi |
| 63 | AC_PROG_LEX |
Brian Paul | de1df26 | 2011-05-18 07:50:21 -0600 | [diff] [blame] | 64 | |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 65 | AC_PATH_PROG([PERL], [perl]) |
| 66 | |
Kenneth Graunke | 2224fb6 | 2012-05-29 16:03:05 -0700 | [diff] [blame] | 67 | AC_CHECK_PROG(INDENT, indent, indent, cat) |
| 68 | if test "x$INDENT" != "xcat"; then |
| 69 | AC_SUBST(INDENT_FLAGS, '-i4 -nut -br -brs -npcs -ce -T GLubyte -T GLbyte -T Bool') |
| 70 | fi |
| 71 | |
Dan Nicholson | bc302b2 | 2009-05-22 09:39:02 -0700 | [diff] [blame] | 72 | dnl Our fallback install-sh is a symlink to minstall. Use the existing |
| 73 | dnl configuration in that case. |
| 74 | AC_PROG_INSTALL |
| 75 | test "x$INSTALL" = "x$ac_install_sh" && INSTALL='$(MINSTALL)' |
| 76 | |
Dan Nicholson | bfb27b5 | 2008-06-30 09:40:30 -0700 | [diff] [blame] | 77 | dnl We need a POSIX shell for parts of the build. Assume we have one |
| 78 | dnl in most cases. |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 79 | case "$host_os" in |
| 80 | solaris*) |
| 81 | # Solaris /bin/sh is too old/non-POSIX compliant |
| 82 | AC_PATH_PROGS(POSIX_SHELL, [ksh93 ksh sh]) |
Dan Nicholson | bfb27b5 | 2008-06-30 09:40:30 -0700 | [diff] [blame] | 83 | SHELL="$POSIX_SHELL" |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 84 | ;; |
| 85 | esac |
| 86 | |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 87 | dnl clang is mostly GCC-compatible, but its version is much lower, |
| 88 | dnl so we have to check for it. |
| 89 | AC_MSG_CHECKING([if compiling with clang]) |
| 90 | |
| 91 | AC_COMPILE_IFELSE( |
| 92 | [AC_LANG_PROGRAM([], [[ |
| 93 | #ifndef __clang__ |
| 94 | not clang |
| 95 | #endif |
| 96 | ]])], |
Jeremy Huddleston | b728eef | 2011-05-05 14:08:57 -0700 | [diff] [blame] | 97 | [acv_mesa_CLANG=yes], [acv_mesa_CLANG=no]) |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 98 | |
Jeremy Huddleston | b728eef | 2011-05-05 14:08:57 -0700 | [diff] [blame] | 99 | AC_MSG_RESULT([$acv_mesa_CLANG]) |
nobled | 2a50187 | 2010-08-29 20:03:37 -0400 | [diff] [blame] | 100 | |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 101 | dnl If we're using GCC, make sure that it is at least version 3.3.0. Older |
| 102 | dnl versions are explictly not supported. |
Jeremy Huddleston | b728eef | 2011-05-05 14:08:57 -0700 | [diff] [blame] | 103 | if test "x$GCC" = xyes -a "x$acv_mesa_CLANG" = xno; then |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 104 | AC_MSG_CHECKING([whether gcc version is sufficient]) |
| 105 | major=0 |
| 106 | minor=0 |
| 107 | |
| 108 | GCC_VERSION=`$CC -dumpversion` |
| 109 | if test $? -eq 0; then |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 110 | GCC_VERSION_MAJOR=`echo $GCC_VERSION | cut -d. -f1` |
| 111 | GCC_VERSION_MINOR=`echo $GCC_VERSION | cut -d. -f2` |
Ian Romanick | 9aa3aa7 | 2010-03-03 15:59:37 -0800 | [diff] [blame] | 112 | fi |
| 113 | |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 114 | 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] | 115 | AC_MSG_RESULT([no]) |
| 116 | AC_MSG_ERROR([If using GCC, version 3.3.0 or later is required.]) |
| 117 | else |
| 118 | AC_MSG_RESULT([yes]) |
| 119 | fi |
| 120 | fi |
| 121 | |
| 122 | |
Dan Nicholson | db7fc63 | 2008-03-07 11:48:09 -0800 | [diff] [blame] | 123 | MKDEP_OPTIONS=-fdepend |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 124 | dnl Ask gcc where it's keeping its secret headers |
| 125 | if test "x$GCC" = xyes; then |
Dan Nicholson | a3d223f | 2009-01-30 10:52:09 -0800 | [diff] [blame] | 126 | for dir in include include-fixed; do |
| 127 | GCC_INCLUDES=`$CC -print-file-name=$dir` |
| 128 | if test "x$GCC_INCLUDES" != x && \ |
| 129 | test "$GCC_INCLUDES" != "$dir" && \ |
| 130 | test -d "$GCC_INCLUDES"; then |
| 131 | MKDEP_OPTIONS="$MKDEP_OPTIONS -I$GCC_INCLUDES" |
| 132 | fi |
| 133 | done |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 134 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 135 | AC_SUBST([MKDEP_OPTIONS]) |
Kristian Høgsberg | bcecea6 | 2008-02-25 18:50:26 -0500 | [diff] [blame] | 136 | |
Dan Nicholson | 41b0070 | 2007-12-12 08:48:30 -0800 | [diff] [blame] | 137 | dnl Make sure the pkg-config macros are defined |
Dan Nicholson | 356f311 | 2009-04-29 06:49:27 -0700 | [diff] [blame] | 138 | m4_ifndef([PKG_PROG_PKG_CONFIG], |
| 139 | [m4_fatal([Could not locate the pkg-config autoconf macros. |
| 140 | These are usually located in /usr/share/aclocal/pkg.m4. If your macros |
| 141 | are in a different location, try setting the environment variable |
| 142 | ACLOCAL="aclocal -I/other/macro/dir" before running autoreconf.])]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 143 | PKG_PROG_PKG_CONFIG() |
| 144 | |
| 145 | dnl LIB_DIR - library basename |
| 146 | LIB_DIR=`echo $libdir | $SED 's%.*/%%'` |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 147 | AC_SUBST([LIB_DIR]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 148 | |
Matt Turner | d12b07e | 2012-08-14 12:33:32 -0700 | [diff] [blame] | 149 | 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] | 150 | _SAVE_LDFLAGS="$LDFLAGS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 151 | _SAVE_CPPFLAGS="$CPPFLAGS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 152 | |
| 153 | dnl Compiler macros |
| 154 | DEFINES="" |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 155 | AC_SUBST([DEFINES]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 156 | case "$host_os" in |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 157 | linux*|*-gnu*|gnu*) |
Dan Nicholson | 29f603a | 2009-01-12 11:10:31 -0800 | [diff] [blame] | 158 | DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 159 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 160 | solaris*) |
| 161 | DEFINES="$DEFINES -DPTHREADS -DSVR4" |
| 162 | ;; |
Brian Paul | 9798890 | 2010-02-18 12:46:12 -0700 | [diff] [blame] | 163 | cygwin*) |
| 164 | DEFINES="$DEFINES -DPTHREADS" |
| 165 | ;; |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 166 | esac |
| 167 | |
| 168 | dnl Add flags for gcc and g++ |
| 169 | if test "x$GCC" = xyes; then |
Eric Anholt | b9aab8b | 2012-01-26 18:48:20 -0800 | [diff] [blame] | 170 | CFLAGS="$CFLAGS -Wall -std=c99" |
| 171 | |
| 172 | # Enable -Werror=implicit-function-declaration and |
| 173 | # -Werror=missing-prototypes, if available, or otherwise, just |
| 174 | # -Wmissing-prototypes. This is particularly useful to avoid |
| 175 | # generating a loadable driver module that has undefined symbols. |
| 176 | save_CFLAGS="$CFLAGS" |
| 177 | AC_MSG_CHECKING([whether $CC supports -Werror=missing-prototypes]) |
| 178 | CFLAGS="$CFLAGS -Werror=implicit-function-declaration" |
| 179 | CFLAGS="$CFLAGS -Werror=missing-prototypes" |
| 180 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], |
| 181 | AC_MSG_RESULT([yes]), |
| 182 | [CFLAGS="$save_CFLAGS -Wmissing-prototypes"; |
| 183 | AC_MSG_RESULT([no])]); |
Alan Coopersmith | adda7f3 | 2010-01-16 18:34:23 -0800 | [diff] [blame] | 184 | |
| 185 | # Enable -fvisibility=hidden if using a gcc that supports it |
| 186 | save_CFLAGS="$CFLAGS" |
Alan Coopersmith | f8107a4 | 2010-01-21 16:42:58 -0800 | [diff] [blame] | 187 | AC_MSG_CHECKING([whether $CC supports -fvisibility=hidden]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 188 | VISIBILITY_CFLAGS="-fvisibility=hidden" |
| 189 | CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" |
Alan Coopersmith | adda7f3 | 2010-01-16 18:34:23 -0800 | [diff] [blame] | 190 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 191 | [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]); |
| 192 | |
| 193 | # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed. |
| 194 | CFLAGS=$save_CFLAGS |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 195 | |
| 196 | # Work around aliasing bugs - developers should comment this out |
| 197 | CFLAGS="$CFLAGS -fno-strict-aliasing" |
José Fonseca | 1448bdf | 2011-10-14 18:28:55 +0100 | [diff] [blame] | 198 | |
| 199 | # gcc's builtin memcmp is slower than glibc's |
| 200 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052 |
| 201 | CFLAGS="$CFLAGS -fno-builtin-memcmp" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 202 | fi |
| 203 | if test "x$GXX" = xyes; then |
| 204 | CXXFLAGS="$CXXFLAGS -Wall" |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 205 | |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 206 | # Enable -fvisibility=hidden if using a gcc that supports it |
| 207 | save_CXXFLAGS="$CXXFLAGS" |
| 208 | AC_MSG_CHECKING([whether $CXX supports -fvisibility=hidden]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 209 | VISIBILITY_CXXFLAGS="-fvisibility=hidden" |
| 210 | CXXFLAGS="$CXXFLAGS $VISIBILITY_CXXFLAGS" |
Jon TURNEY | 560f762 | 2011-04-26 11:49:01 +0100 | [diff] [blame] | 211 | AC_LANG_PUSH([C++]) |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 212 | AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]), |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 213 | [VISIBILITY_CXXFLAGS="" ; AC_MSG_RESULT([no])]); |
Jon TURNEY | 560f762 | 2011-04-26 11:49:01 +0100 | [diff] [blame] | 214 | AC_LANG_POP([C++]) |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 215 | |
| 216 | # Restore CXXFLAGS; VISIBILITY_CXXFLAGS are added to it where needed. |
| 217 | CXXFLAGS=$save_CXXFLAGS |
Kristian Høgsberg | 7b34fcc | 2010-09-08 20:34:07 -0400 | [diff] [blame] | 218 | |
Dan Nicholson | 0c275b6 | 2008-01-15 22:52:25 -0800 | [diff] [blame] | 219 | # Work around aliasing bugs - developers should comment this out |
| 220 | CXXFLAGS="$CXXFLAGS -fno-strict-aliasing" |
José Fonseca | 1448bdf | 2011-10-14 18:28:55 +0100 | [diff] [blame] | 221 | |
| 222 | # gcc's builtin memcmp is slower than glibc's |
| 223 | # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43052 |
| 224 | CXXFLAGS="$CXXFLAGS -fno-builtin-memcmp" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 225 | fi |
| 226 | |
Jon TURNEY | db78643 | 2011-04-26 11:56:02 +0100 | [diff] [blame] | 227 | dnl even if the compiler appears to support it, using visibility attributes isn't |
| 228 | dnl going to do anything useful currently on cygwin apart from emit lots of warnings |
| 229 | case "$host_os" in |
| 230 | cygwin*) |
| 231 | VISIBILITY_CFLAGS="" |
| 232 | VISIBILITY_CXXFLAGS="" |
| 233 | ;; |
| 234 | esac |
| 235 | |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 236 | AC_SUBST([VISIBILITY_CFLAGS]) |
| 237 | AC_SUBST([VISIBILITY_CXXFLAGS]) |
| 238 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 239 | dnl |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 240 | dnl Hacks to enable 32 or 64 bit build |
| 241 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 242 | AC_ARG_ENABLE([32-bit], |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 243 | [AS_HELP_STRING([--enable-32-bit], |
| 244 | [build 32-bit libraries @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 245 | [enable_32bit="$enableval"], |
| 246 | [enable_32bit=auto] |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 247 | ) |
| 248 | if test "x$enable_32bit" = xyes; then |
| 249 | if test "x$GCC" = xyes; then |
| 250 | CFLAGS="$CFLAGS -m32" |
Tapani Pälli | a9cfd95 | 2012-05-31 09:32:45 +0300 | [diff] [blame] | 251 | CCASFLAGS="$CCASFLAGS -m32" |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 252 | fi |
| 253 | if test "x$GXX" = xyes; then |
| 254 | CXXFLAGS="$CXXFLAGS -m32" |
| 255 | fi |
| 256 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 257 | AC_ARG_ENABLE([64-bit], |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 258 | [AS_HELP_STRING([--enable-64-bit], |
| 259 | [build 64-bit libraries @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 260 | [enable_64bit="$enableval"], |
| 261 | [enable_64bit=auto] |
Dan Nicholson | ab57cba | 2007-12-26 11:12:29 -0600 | [diff] [blame] | 262 | ) |
| 263 | if test "x$enable_64bit" = xyes; then |
| 264 | if test "x$GCC" = xyes; then |
| 265 | CFLAGS="$CFLAGS -m64" |
| 266 | fi |
| 267 | if test "x$GXX" = xyes; then |
| 268 | CXXFLAGS="$CXXFLAGS -m64" |
| 269 | fi |
| 270 | fi |
| 271 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 272 | dnl Can't have static and shared libraries, default to static if user |
| 273 | dnl explicitly requested. If both disabled, set to static since shared |
Matt Turner | 0c17823 | 2012-01-14 11:10:06 -0500 | [diff] [blame] | 274 | dnl was explicitly requested. |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 275 | case "x$enable_static$enable_shared" in |
| 276 | xyesyes ) |
Matt Turner | 14819eb | 2012-08-01 08:32:49 -0700 | [diff] [blame] | 277 | AC_MSG_WARN([Cannot build static and shared libraries, disabling shared]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 278 | enable_shared=no |
| 279 | ;; |
| 280 | xnono ) |
Matt Turner | 14819eb | 2012-08-01 08:32:49 -0700 | [diff] [blame] | 281 | AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 282 | enable_static=yes |
| 283 | ;; |
| 284 | esac |
| 285 | |
Matt Turner | df4dccc | 2012-08-22 11:51:31 -0700 | [diff] [blame] | 286 | AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes) |
| 287 | |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 288 | dnl |
| 289 | dnl mklib options |
| 290 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 291 | AC_ARG_VAR([MKLIB_OPTIONS],[Options for the Mesa library script, mklib]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 292 | if test "$enable_static" = yes; then |
| 293 | MKLIB_OPTIONS="$MKLIB_OPTIONS -static" |
| 294 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 295 | AC_SUBST([MKLIB_OPTIONS]) |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 296 | |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 297 | dnl |
| 298 | dnl other compiler options |
| 299 | dnl |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 300 | AC_ARG_ENABLE([debug], |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 301 | [AS_HELP_STRING([--enable-debug], |
| 302 | [use debug compiler flags and macros @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 303 | [enable_debug="$enableval"], |
| 304 | [enable_debug=no] |
Dan Nicholson | 23656c4 | 2007-12-12 09:02:31 -0800 | [diff] [blame] | 305 | ) |
| 306 | if test "x$enable_debug" = xyes; then |
| 307 | DEFINES="$DEFINES -DDEBUG" |
| 308 | if test "x$GCC" = xyes; then |
| 309 | CFLAGS="$CFLAGS -g" |
| 310 | fi |
| 311 | if test "x$GXX" = xyes; then |
| 312 | CXXFLAGS="$CXXFLAGS -g" |
| 313 | fi |
| 314 | fi |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 315 | |
| 316 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 317 | dnl library names |
| 318 | dnl |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 319 | LIB_PREFIX_GLOB='lib' |
| 320 | LIB_VERSION_SEPARATOR='.' |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 321 | if test "$enable_static" = yes; then |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 322 | LIB_EXTENSION='a' |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 323 | else |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 324 | case "$host_os" in |
| 325 | darwin* ) |
| 326 | LIB_EXTENSION='dylib' ;; |
Jon TURNEY | 7eed6ab | 2009-06-08 16:02:18 +0100 | [diff] [blame] | 327 | cygwin* ) |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 328 | dnl prefix can be 'cyg' or 'lib' |
| 329 | LIB_PREFIX_GLOB='???' |
| 330 | LIB_VERSION_SEPARATOR='-' |
| 331 | LIB_EXTENSION='dll' ;; |
Tom Fogal | 9282edf | 2009-10-13 10:55:33 -0700 | [diff] [blame] | 332 | aix* ) |
| 333 | LIB_EXTENSION='a' ;; |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 334 | * ) |
| 335 | LIB_EXTENSION='so' ;; |
| 336 | esac |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 337 | fi |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 338 | AC_ARG_WITH([gl-lib-name], |
| 339 | [AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@], |
| 340 | [specify GL library name @<:@default=GL@:>@])], |
| 341 | [GL_LIB=$withval], |
| 342 | [GL_LIB=GL]) |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 343 | AC_ARG_WITH([osmesa-lib-name], |
| 344 | [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@], |
| 345 | [specify OSMesa library name @<:@default=OSMesa@:>@])], |
| 346 | [OSMESA_LIB=$withval], |
| 347 | [OSMESA_LIB=OSMesa]) |
| 348 | AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL]) |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 349 | AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa]) |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 350 | |
Marek Olšák | 848f7d3 | 2011-04-01 01:12:41 +0200 | [diff] [blame] | 351 | dnl |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 352 | dnl Mangled Mesa support |
| 353 | dnl |
| 354 | AC_ARG_ENABLE([mangling], |
| 355 | [AS_HELP_STRING([--enable-mangling], |
| 356 | [enable mangled symbols and library name @<:@default=disabled@:>@])], |
| 357 | [enable_mangling="${enableval}"], |
| 358 | [enable_mangling=no] |
| 359 | ) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 360 | if test "x${enable_mangling}" = "xyes" ; then |
| 361 | DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE" |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 362 | GL_LIB="Mangled${GL_LIB}" |
Brad King | f3cdcb8 | 2012-06-05 13:59:58 -0400 | [diff] [blame] | 363 | OSMESA_LIB="Mangled${OSMESA_LIB}" |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 364 | fi |
| 365 | AC_SUBST([GL_LIB]) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 366 | AC_SUBST([OSMESA_LIB]) |
| 367 | |
| 368 | dnl |
Marek Olšák | 848f7d3 | 2011-04-01 01:12:41 +0200 | [diff] [blame] | 369 | dnl potentially-infringing-but-nobody-knows-for-sure stuff |
| 370 | dnl |
| 371 | AC_ARG_ENABLE([texture-float], |
| 372 | [AS_HELP_STRING([--enable-texture-float], |
| 373 | [enable floating-point textures and renderbuffers @<:@default=disabled@:>@])], |
| 374 | [enable_texture_float="$enableval"], |
| 375 | [enable_texture_float=no] |
| 376 | ) |
| 377 | if test "x$enable_texture_float" = xyes; then |
| 378 | AC_MSG_WARN([Floating-point textures enabled.]) |
| 379 | AC_MSG_WARN([Please consult docs/patents.txt with your lawyer before building Mesa.]) |
| 380 | DEFINES="$DEFINES -DTEXTURE_FLOAT_ENABLED" |
| 381 | fi |
| 382 | |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 383 | GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION} |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 384 | OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION} |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 385 | EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION} |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 386 | GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION} |
| 387 | GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION} |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 388 | VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION} |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 389 | GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION} |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 390 | |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 391 | GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
Jon TURNEY | c55a8a7 | 2010-07-24 12:05:34 +0100 | [diff] [blame] | 392 | EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 393 | EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 394 | GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 395 | GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
| 396 | VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 397 | GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*' |
Dan Nicholson | 8217f24 | 2009-02-11 15:16:00 -0800 | [diff] [blame] | 398 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 399 | AC_SUBST([GL_LIB_NAME]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 400 | AC_SUBST([OSMESA_LIB_NAME]) |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 401 | AC_SUBST([EGL_LIB_NAME]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 402 | AC_SUBST([GLESv1_CM_LIB_NAME]) |
| 403 | AC_SUBST([GLESv2_LIB_NAME]) |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 404 | AC_SUBST([VG_LIB_NAME]) |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 405 | AC_SUBST([GLAPI_LIB_NAME]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 406 | |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 407 | AC_SUBST([GL_LIB_GLOB]) |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 408 | AC_SUBST([EGL_LIB_GLOB]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 409 | AC_SUBST([GLESv1_CM_LIB_GLOB]) |
| 410 | AC_SUBST([GLESv2_LIB_GLOB]) |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 411 | AC_SUBST([VG_LIB_GLOB]) |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 412 | AC_SUBST([GLAPI_LIB_GLOB]) |
Siddhartha Chaudhuri | 1a46c8a | 2009-02-09 07:58:38 -0700 | [diff] [blame] | 413 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 414 | dnl |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 415 | dnl Arch/platform-specific settings |
| 416 | dnl |
| 417 | AC_ARG_ENABLE([asm], |
| 418 | [AS_HELP_STRING([--disable-asm], |
| 419 | [disable assembly usage @<:@default=enabled on supported plaforms@:>@])], |
| 420 | [enable_asm="$enableval"], |
| 421 | [enable_asm=yes] |
| 422 | ) |
| 423 | asm_arch="" |
Eric Anholt | 7d7fe1b | 2012-05-16 09:09:18 -0700 | [diff] [blame] | 424 | MESA_ASM_FILES="" |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 425 | AC_MSG_CHECKING([whether to enable assembly]) |
| 426 | test "x$enable_asm" = xno && AC_MSG_RESULT([no]) |
| 427 | # disable if cross compiling on x86/x86_64 since we must run gen_matypes |
| 428 | if test "x$enable_asm" = xyes && test "x$cross_compiling" = xyes; then |
| 429 | case "$host_cpu" in |
| 430 | i?86 | x86_64) |
| 431 | enable_asm=no |
| 432 | AC_MSG_RESULT([no, cross compiling]) |
| 433 | ;; |
| 434 | esac |
| 435 | fi |
| 436 | # check for supported arches |
| 437 | if test "x$enable_asm" = xyes; then |
| 438 | case "$host_cpu" in |
| 439 | i?86) |
| 440 | case "$host_os" in |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 441 | linux* | *freebsd* | dragonfly* | *netbsd*) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 442 | test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86 |
| 443 | ;; |
| 444 | esac |
| 445 | ;; |
| 446 | x86_64) |
| 447 | case "$host_os" in |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 448 | linux* | *freebsd* | dragonfly* | *netbsd*) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 449 | test "x$enable_32bit" = xyes && asm_arch=x86 || asm_arch=x86_64 |
| 450 | ;; |
| 451 | esac |
| 452 | ;; |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 453 | sparc*) |
| 454 | case "$host_os" in |
| 455 | linux*) |
| 456 | asm_arch=sparc |
| 457 | ;; |
| 458 | esac |
| 459 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 460 | esac |
| 461 | |
| 462 | case "$asm_arch" in |
| 463 | x86) |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 464 | DEFINES="$DEFINES -DUSE_X86_ASM -DUSE_MMX_ASM -DUSE_3DNOW_ASM -DUSE_SSE_ASM" |
Eric Anholt | 7d7fe1b | 2012-05-16 09:09:18 -0700 | [diff] [blame] | 465 | MESA_ASM_FILES='$(X86_FILES)' |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 466 | AC_MSG_RESULT([yes, x86]) |
| 467 | ;; |
| 468 | x86_64) |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 469 | DEFINES="$DEFINES -DUSE_X86_64_ASM" |
Eric Anholt | 7d7fe1b | 2012-05-16 09:09:18 -0700 | [diff] [blame] | 470 | MESA_ASM_FILES='$(X86_64_FILES)' |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 471 | AC_MSG_RESULT([yes, x86_64]) |
| 472 | ;; |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 473 | sparc) |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 474 | DEFINES="$DEFINES -DUSE_SPARC_ASM" |
Eric Anholt | 7d7fe1b | 2012-05-16 09:09:18 -0700 | [diff] [blame] | 475 | MESA_ASM_FILES='$(SPARC_FILES)' |
David S. Miller | 857ac1e | 2009-02-26 05:35:15 -0800 | [diff] [blame] | 476 | AC_MSG_RESULT([yes, sparc]) |
| 477 | ;; |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 478 | *) |
| 479 | AC_MSG_RESULT([no, platform not supported]) |
| 480 | ;; |
| 481 | esac |
| 482 | fi |
Eric Anholt | 7d7fe1b | 2012-05-16 09:09:18 -0700 | [diff] [blame] | 483 | AC_SUBST([MESA_ASM_FILES]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 484 | |
| 485 | dnl PIC code macro |
| 486 | MESA_PIC_FLAGS |
| 487 | |
| 488 | dnl Check to see if dlopen is in default libraries (like Solaris, which |
| 489 | 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] | 490 | AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"], |
| 491 | [AC_CHECK_LIB([dl], [dlopen], |
| 492 | [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])]) |
Chia-I Wu | 08f4bc0 | 2010-07-16 20:09:29 +0800 | [diff] [blame] | 493 | AC_SUBST([DLOPEN_LIBS]) |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 494 | |
Dan Nicholson | 985e1cd | 2008-06-04 13:17:06 -0700 | [diff] [blame] | 495 | dnl See if posix_memalign is available |
| 496 | AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"]) |
| 497 | |
Dan Nicholson | 871125a | 2008-06-04 13:00:35 -0700 | [diff] [blame] | 498 | dnl SELinux awareness. |
| 499 | AC_ARG_ENABLE([selinux], |
| 500 | [AS_HELP_STRING([--enable-selinux], |
| 501 | [Build SELinux-aware Mesa @<:@default=disabled@:>@])], |
| 502 | [MESA_SELINUX="$enableval"], |
| 503 | [MESA_SELINUX=no]) |
| 504 | if test "x$enable_selinux" = "xyes"; then |
| 505 | AC_CHECK_HEADER([selinux/selinux.h],[], |
| 506 | [AC_MSG_ERROR([SELinux headers not found])]) |
| 507 | AC_CHECK_LIB([selinux],[is_selinux_enabled],[], |
| 508 | [AC_MSG_ERROR([SELinux library not found])]) |
| 509 | SELINUX_LIBS="-lselinux" |
| 510 | DEFINES="$DEFINES -DMESA_SELINUX" |
| 511 | fi |
| 512 | |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 513 | dnl Options for APIs |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 514 | AC_ARG_ENABLE([opengl], |
| 515 | [AS_HELP_STRING([--disable-opengl], |
| 516 | [disable support for standard OpenGL API @<:@default=no@:>@])], |
| 517 | [enable_opengl="$enableval"], |
| 518 | [enable_opengl=yes]) |
| 519 | AC_ARG_ENABLE([gles1], |
| 520 | [AS_HELP_STRING([--enable-gles1], |
| 521 | [enable support for OpenGL ES 1.x API @<:@default=no@:>@])], |
| 522 | [enable_gles1="$enableval"], |
| 523 | [enable_gles1=no]) |
| 524 | AC_ARG_ENABLE([gles2], |
| 525 | [AS_HELP_STRING([--enable-gles2], |
| 526 | [enable support for OpenGL ES 2.x API @<:@default=no@:>@])], |
| 527 | [enable_gles2="$enableval"], |
| 528 | [enable_gles2=no]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 529 | AC_ARG_ENABLE([openvg], |
| 530 | [AS_HELP_STRING([--enable-openvg], |
| 531 | [enable support for OpenVG API @<:@default=no@:>@])], |
| 532 | [enable_openvg="$enableval"], |
| 533 | [enable_openvg=no]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 534 | |
| 535 | AC_ARG_ENABLE([dri], |
| 536 | [AS_HELP_STRING([--enable-dri], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 537 | [enable DRI modules @<:@default=enabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 538 | [enable_dri="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 539 | [enable_dri=yes]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 540 | AC_ARG_ENABLE([glx], |
| 541 | [AS_HELP_STRING([--enable-glx], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 542 | [enable GLX library @<:@default=enabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 543 | [enable_glx="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 544 | [enable_glx=yes]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 545 | AC_ARG_ENABLE([osmesa], |
| 546 | [AS_HELP_STRING([--enable-osmesa], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 547 | [enable OSMesa library @<:@default=disabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 548 | [enable_osmesa="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 549 | [enable_osmesa=no]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 550 | AC_ARG_ENABLE([egl], |
| 551 | [AS_HELP_STRING([--disable-egl], |
| 552 | [disable EGL library @<:@default=enabled@:>@])], |
| 553 | [enable_egl="$enableval"], |
| 554 | [enable_egl=yes]) |
| 555 | |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 556 | AC_ARG_ENABLE([xorg], |
| 557 | [AS_HELP_STRING([--enable-xorg], |
| 558 | [enable support for X.Org DDX API @<:@default=no@:>@])], |
| 559 | [enable_xorg="$enableval"], |
| 560 | [enable_xorg=no]) |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 561 | AC_ARG_ENABLE([xa], |
| 562 | [AS_HELP_STRING([--enable-xa], |
| 563 | [enable build of the XA X Acceleration API @<:@default=no@:>@])], |
| 564 | [enable_xa="$enableval"], |
| 565 | [enable_xa=no]) |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 566 | AC_ARG_ENABLE([d3d1x], |
| 567 | [AS_HELP_STRING([--enable-d3d1x], |
| 568 | [enable support for Direct3D 10 & 11 low-level API @<:@default=no@:>@])], |
| 569 | [enable_d3d1x="$enableval"], |
| 570 | [enable_d3d1x=no]) |
Benjamin Franzke | eddcecb | 2011-05-26 15:09:39 +0200 | [diff] [blame] | 571 | AC_ARG_ENABLE([gbm], |
| 572 | [AS_HELP_STRING([--enable-gbm], |
| 573 | [enable gbm library @<:@default=auto@:>@])], |
| 574 | [enable_gbm="$enableval"], |
| 575 | [enable_gbm=auto]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 576 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 577 | AC_ARG_ENABLE([xvmc], |
| 578 | [AS_HELP_STRING([--enable-xvmc], |
| 579 | [enable xvmc library @<:@default=auto@:>@])], |
| 580 | [enable_xvmc="$enableval"], |
| 581 | [enable_xvmc=auto]) |
| 582 | AC_ARG_ENABLE([vdpau], |
| 583 | [AS_HELP_STRING([--enable-vdpau], |
| 584 | [enable vdpau library @<:@default=auto@:>@])], |
| 585 | [enable_vdpau="$enableval"], |
| 586 | [enable_vdpau=auto]) |
| 587 | AC_ARG_ENABLE([va], |
| 588 | [AS_HELP_STRING([--enable-va], |
| 589 | [enable va library @<:@default=auto@:>@])], |
| 590 | [enable_va="$enableval"], |
| 591 | [enable_va=auto]) |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 592 | AC_ARG_ENABLE([opencl], |
| 593 | [AS_HELP_STRING([--enable-opencl], |
| 594 | [enable OpenCL library @<:@default=no@:>@])], |
| 595 | [enable_opencl="$enableval"], |
| 596 | [enable_opencl=no]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 597 | AC_ARG_ENABLE([xlib_glx], |
| 598 | [AS_HELP_STRING([--enable-xlib-glx], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 599 | [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])], |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 600 | [enable_xlib_glx="$enableval"], |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 601 | [enable_xlib_glx=no]) |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 602 | AC_ARG_ENABLE([gallium_egl], |
| 603 | [AS_HELP_STRING([--enable-gallium-egl], |
| 604 | [enable optional EGL state tracker (not required |
| 605 | for EGL support in Gallium with OpenGL and OpenGL ES) |
| 606 | @<:@default=disable@:>@])], |
| 607 | [enable_gallium_egl="$enableval"], |
| 608 | [enable_gallium_egl=no]) |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 609 | AC_ARG_ENABLE([gallium_gbm], |
| 610 | [AS_HELP_STRING([--enable-gallium-gbm], |
| 611 | [enable optional gbm state tracker (not required for |
| 612 | gbm support in Gallium) |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 613 | @<:@default=auto@:>@])], |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 614 | [enable_gallium_gbm="$enableval"], |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 615 | [enable_gallium_gbm=auto]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 616 | |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 617 | AC_ARG_ENABLE([r600-llvm-compiler], |
Homer Hsing | 4050756 | 2012-05-15 18:56:17 -0400 | [diff] [blame] | 618 | [AS_HELP_STRING([--enable-r600-llvm-compiler], |
| 619 | [Enable experimental LLVM backend for graphics shaders @<:@default=disable@:>@])], |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 620 | [enable_r600_llvm="$enableval"], |
| 621 | [enable_r600_llvm=no]) |
| 622 | |
Francisco Jerez | 66f7fd9 | 2012-04-25 22:16:26 +0200 | [diff] [blame] | 623 | AC_ARG_ENABLE([gallium_tests], |
| 624 | [AS_HELP_STRING([--enable-gallium-tests], |
| 625 | [Enable optional Gallium tests) @<:@default=disable@:>@])], |
| 626 | [enable_gallium_tests="$enableval"], |
| 627 | [enable_gallium_tests=no]) |
| 628 | |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 629 | # Option for Gallium drivers |
Thomas Hellstrom | 87118d8 | 2012-01-12 12:10:53 +0100 | [diff] [blame] | 630 | GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 631 | |
| 632 | AC_ARG_WITH([gallium-drivers], |
| 633 | [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@], |
| 634 | [comma delimited Gallium drivers list, e.g. |
Andreas Boll | 17f09b6 | 2012-08-28 17:28:19 +0200 | [diff] [blame] | 635 | "i915,nouveau,r300,r600,radeonsi,svga,swrast" |
Marek Olšák | 0c7c5b6 | 2011-06-14 08:31:11 +0200 | [diff] [blame] | 636 | @<:@default=r300,r600,swrast@:>@])], |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 637 | [with_gallium_drivers="$withval"], |
| 638 | [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"]) |
Chia-I Wu | 156e955 | 2010-10-30 14:26:01 +0800 | [diff] [blame] | 639 | |
Ian Romanick | db311b4 | 2011-06-22 11:35:27 -0700 | [diff] [blame] | 640 | # Doing '--without-gallium-drivers' will set this variable to 'no'. Clear it |
| 641 | # here so that the script doesn't choke on an unknown driver name later. |
| 642 | case "$with_gallium_drivers" in |
| 643 | yes) with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT" ;; |
| 644 | no) with_gallium_drivers='' ;; |
| 645 | esac |
| 646 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 647 | if test "x$enable_opengl" = xno -a \ |
| 648 | "x$enable_gles1" = xno -a \ |
| 649 | "x$enable_gles2" = xno -a \ |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 650 | "x$enable_openvg" = xno -a \ |
| 651 | "x$enable_xorg" = xno -a \ |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 652 | "x$enable_xa" = xno -a \ |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 653 | "x$enable_d3d1x" = xno -a \ |
| 654 | "x$enable_xvmc" = xno -a \ |
| 655 | "x$enable_vdpau" = xno -a \ |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 656 | "x$enable_va" = xno -a \ |
| 657 | "x$enable_opencl" = xno; then |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 658 | AC_MSG_ERROR([at least one API should be enabled]) |
| 659 | fi |
| 660 | |
| 661 | API_DEFINES="" |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 662 | if test "x$enable_opengl" = xno; then |
| 663 | API_DEFINES="$API_DEFINES -DFEATURE_GL=0" |
| 664 | else |
| 665 | API_DEFINES="$API_DEFINES -DFEATURE_GL=1" |
| 666 | fi |
| 667 | if test "x$enable_gles1" = xyes; then |
| 668 | API_DEFINES="$API_DEFINES -DFEATURE_ES1=1" |
| 669 | fi |
| 670 | if test "x$enable_gles2" = xyes; then |
| 671 | API_DEFINES="$API_DEFINES -DFEATURE_ES2=1" |
| 672 | fi |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 673 | AC_SUBST([API_DEFINES]) |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 674 | |
Kenneth Graunke | 9d21b5d | 2012-01-04 23:49:18 -0800 | [diff] [blame] | 675 | if test "x$enable_glx" = xno; then |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 676 | AC_MSG_WARN([GLX disabled, disabling Xlib-GLX]) |
Kenneth Graunke | 9d21b5d | 2012-01-04 23:49:18 -0800 | [diff] [blame] | 677 | enable_xlib_glx=no |
| 678 | fi |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 679 | |
Matt Turner | 32e8ce6 | 2012-08-17 14:05:56 -0700 | [diff] [blame] | 680 | if test "x$enable_dri$enable_xlib_glx" = xyesyes; then |
| 681 | AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together]) |
| 682 | fi |
| 683 | |
| 684 | # Disable GLX if DRI and Xlib-GLX are not enabled |
| 685 | if test "x$enable_glx" = xyes -a \ |
| 686 | "x$enable_dri" = xno -a \ |
| 687 | "x$enable_xlib_glx" = xno; then |
| 688 | AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX]) |
| 689 | enable_glx=no |
| 690 | fi |
| 691 | |
Matt Turner | 00f3d9b | 2012-08-21 22:06:17 -0700 | [diff] [blame] | 692 | AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes) |
Matt Turner | 8cdce6c | 2012-08-21 22:26:52 -0700 | [diff] [blame] | 693 | AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \ |
| 694 | "x$enable_osmesa" = xyes) |
Matt Turner | 06ad64a | 2012-01-15 21:30:26 -0500 | [diff] [blame] | 695 | |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 696 | AC_ARG_ENABLE([shared-glapi], |
| 697 | [AS_HELP_STRING([--enable-shared-glapi], |
| 698 | [Enable shared glapi for OpenGL @<:@default=yes@:>@])], |
| 699 | [enable_shared_glapi="$enableval"], |
| 700 | [enable_shared_glapi="$enable_dri"]) |
| 701 | |
| 702 | # Shared GLAPI is only useful for DRI |
| 703 | if test "x$enable_dri" = xno; then |
| 704 | AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling]) |
| 705 | enable_shared_glapi=no |
| 706 | fi |
| 707 | |
| 708 | # TODO: Get rid of SHARED_GLAPI variable |
| 709 | SHARED_GLAPI="0" |
| 710 | if test "x$enable_shared_glapi" = xyes; then |
| 711 | SHARED_GLAPI="1" |
| 712 | # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use |
| 713 | # the remap table) |
| 714 | DEFINES="$DEFINES -DIN_DRI_DRIVER" |
Matt Turner | d9b1098 | 2012-08-17 14:54:25 -0700 | [diff] [blame] | 715 | CORE_DIRS="mapi/shared-glapi" |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 716 | fi |
| 717 | AC_SUBST([SHARED_GLAPI]) |
| 718 | AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes) |
| 719 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 720 | dnl |
| 721 | dnl Driver specific build directories |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 722 | dnl |
Eric Anholt | 94726d2 | 2012-03-05 17:01:13 -0800 | [diff] [blame] | 723 | SRC_DIRS="gtest" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 724 | GALLIUM_DIRS="auxiliary drivers state_trackers" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 725 | GALLIUM_TARGET_DIRS="" |
Jakob Bornecrantz | c9f9867 | 2010-03-16 13:54:18 +0000 | [diff] [blame] | 726 | GALLIUM_WINSYS_DIRS="sw" |
Kai Wasserbäch | 0a22fb6 | 2011-11-29 22:36:02 +0100 | [diff] [blame] | 727 | GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 728 | GALLIUM_STATE_TRACKERS_DIRS="" |
| 729 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 730 | # build glapi if OpenGL is enabled |
| 731 | if test "x$enable_opengl" = xyes; then |
| 732 | CORE_DIRS="$CORE_DIRS mapi/glapi" |
| 733 | fi |
| 734 | |
Chia-I Wu | 1258317 | 2011-01-07 17:24:16 +0800 | [diff] [blame] | 735 | # build es1api if OpenGL ES 1.x is enabled |
| 736 | if test "x$enable_gles1" = xyes; then |
| 737 | CORE_DIRS="$CORE_DIRS mapi/es1api" |
| 738 | fi |
| 739 | |
| 740 | # build es2api if OpenGL ES 2.x is enabled |
| 741 | if test "x$enable_gles2" = xyes; then |
| 742 | CORE_DIRS="$CORE_DIRS mapi/es2api" |
| 743 | fi |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 744 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 745 | # build glsl and mesa if OpenGL or OpenGL ES is enabled |
Chia-I Wu | 1258317 | 2011-01-07 17:24:16 +0800 | [diff] [blame] | 746 | case "x$enable_opengl$enable_gles1$enable_gles2" in |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 747 | x*yes*) |
Eric Anholt | 0ce0f7c | 2012-05-15 13:06:22 -0700 | [diff] [blame] | 748 | CORE_DIRS="mapi/glapi/gen $CORE_DIRS glsl mesa" |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 749 | ;; |
| 750 | esac |
| 751 | |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 752 | case "x$enable_glx$enable_xlib_glx" in |
| 753 | xyesyes) |
| 754 | DRIVER_DIRS="$DRIVER_DIRS x11" |
Jakob Bornecrantz | c9f9867 | 2010-03-16 13:54:18 +0000 | [diff] [blame] | 755 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 756 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS libgl-xlib" |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 757 | GALLIUM_STATE_TRACKERS_DIRS="glx $GALLIUM_STATE_TRACKERS_DIRS" |
Younes Manton | b97816d | 2011-07-14 12:22:20 -0400 | [diff] [blame] | 758 | HAVE_WINSYS_XLIB="yes" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 759 | ;; |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 760 | xyesno) |
| 761 | # DRI-based GLX |
Kristian Høgsberg | 6e8897f | 2010-02-09 09:58:36 -0500 | [diff] [blame] | 762 | SRC_DIRS="$SRC_DIRS glx" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 763 | ;; |
| 764 | esac |
| 765 | |
| 766 | if test "x$enable_dri" = xyes; then |
| 767 | DRIVER_DIRS="$DRIVER_DIRS dri" |
| 768 | |
Emil Velikov | 4ef9c3d | 2011-07-11 15:58:29 +0100 | [diff] [blame] | 769 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/dri" |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 770 | GALLIUM_STATE_TRACKERS_DIRS="dri $GALLIUM_STATE_TRACKERS_DIRS" |
| 771 | HAVE_ST_DRI="yes" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 772 | fi |
| 773 | |
| 774 | if test "x$enable_osmesa" = xyes; then |
Eric Anholt | 2d51ac8 | 2012-06-12 12:51:32 -0700 | [diff] [blame] | 775 | DRIVER_DIRS="$DRIVER_DIRS osmesa" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 776 | fi |
| 777 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 778 | AC_SUBST([SRC_DIRS]) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 779 | AC_SUBST([DRIVER_DIRS]) |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 780 | AC_SUBST([GALLIUM_DIRS]) |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 781 | AC_SUBST([GALLIUM_TARGET_DIRS]) |
Jerome Glisse | 14f79d4 | 2008-12-18 13:36:07 +0100 | [diff] [blame] | 782 | AC_SUBST([GALLIUM_WINSYS_DIRS]) |
Jakob Bornecrantz | d67bd60 | 2009-02-20 11:03:18 +0000 | [diff] [blame] | 783 | AC_SUBST([GALLIUM_DRIVERS_DIRS]) |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 784 | AC_SUBST([GALLIUM_STATE_TRACKERS_DIRS]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 785 | AC_SUBST([MESA_LLVM]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 786 | |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 787 | # Check for libdrm |
| 788 | PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED], |
| 789 | [have_libdrm=yes], [have_libdrm=no]) |
| 790 | |
| 791 | if test "x$enable_dri" = xyes; then |
| 792 | # DRI must be shared, I think |
| 793 | if test "$enable_static" = yes; then |
Matt Turner | 14819eb | 2012-08-01 08:32:49 -0700 | [diff] [blame] | 794 | AC_MSG_ERROR([Cannot use static libraries for DRI drivers]) |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 795 | fi |
| 796 | |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 797 | # not a hard requirement as swrast does not depend on it |
| 798 | if test "x$have_libdrm" = xyes; then |
| 799 | DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED" |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 800 | fi |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 801 | fi |
| 802 | |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 803 | dnl Find out if X is available. |
| 804 | PKG_CHECK_MODULES([X11], [x11]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 805 | |
Dan Nicholson | 99803a4 | 2008-07-01 09:03:15 -0700 | [diff] [blame] | 806 | dnl Try to tell the user that the --x-* options are only used when |
| 807 | dnl pkg-config is not available. This must be right after AC_PATH_XTRA. |
| 808 | m4_divert_once([HELP_BEGIN], |
| 809 | [These options are only used when the X libraries cannot be found by the |
| 810 | pkg-config utility.]) |
| 811 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 812 | dnl We need X for xlib and dri, so bomb now if it's not found |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 813 | if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then |
| 814 | AC_MSG_ERROR([X11 development libraries needed for GLX]) |
| 815 | fi |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 816 | |
Ian Romanick | b518dfb | 2012-01-02 17:44:30 -0800 | [diff] [blame] | 817 | if test "x$enable_glx" = xyes; then |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 818 | DEFINES="$DEFINES -DUSE_XCB" |
Dan Nicholson | 2d709fe | 2008-05-06 10:51:49 -0700 | [diff] [blame] | 819 | fi |
| 820 | |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 821 | dnl Direct rendering or just indirect rendering |
nobled | e7d18ed | 2011-03-14 22:08:22 +0000 | [diff] [blame] | 822 | case "$host_os" in |
| 823 | gnu*) |
| 824 | dnl Disable by default on GNU/Hurd |
| 825 | driglx_direct_default="no" |
| 826 | ;; |
Jon TURNEY | c6e33ca | 2011-03-14 22:08:23 +0000 | [diff] [blame] | 827 | cygwin*) |
| 828 | dnl Disable by default on cygwin |
| 829 | driglx_direct_default="no" |
| 830 | ;; |
nobled | e7d18ed | 2011-03-14 22:08:22 +0000 | [diff] [blame] | 831 | *) |
| 832 | driglx_direct_default="yes" |
| 833 | ;; |
| 834 | esac |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 835 | AC_ARG_ENABLE([driglx-direct], |
| 836 | [AS_HELP_STRING([--disable-driglx-direct], |
| 837 | [enable direct rendering in GLX and EGL for DRI \ |
nobled | e7d18ed | 2011-03-14 22:08:22 +0000 | [diff] [blame] | 838 | @<:@default=auto@:>@])], |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 839 | [driglx_direct="$enableval"], |
nobled | e7d18ed | 2011-03-14 22:08:22 +0000 | [diff] [blame] | 840 | [driglx_direct="$driglx_direct_default"]) |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 841 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 842 | dnl |
| 843 | dnl libGL configuration per driver |
| 844 | dnl |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 845 | case "x$enable_glx$enable_xlib_glx" in |
| 846 | xyesyes) |
| 847 | # Xlib-based GLX |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 848 | PKG_CHECK_MODULES([XLIBGL], [x11 xext]) |
| 849 | GL_PC_REQ_PRIV="x11 xext" |
| 850 | X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS" |
| 851 | GL_LIB_DEPS="$XLIBGL_LIBS" |
Marek Olšák | 0aed27e | 2011-07-26 01:05:51 +0200 | [diff] [blame] | 852 | GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS" |
Kenneth Graunke | d1d81205 | 2011-01-16 16:01:54 -0800 | [diff] [blame] | 853 | GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 854 | ;; |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 855 | xyesno) |
| 856 | # DRI-based GLX |
Jesse Barnes | f2f83d9 | 2010-01-11 17:28:10 -0500 | [diff] [blame] | 857 | PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED]) |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 858 | GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED" |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 859 | if test x"$driglx_direct" = xyes; then |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 860 | if test "x$have_libdrm" != xyes; then |
| 861 | AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED]) |
| 862 | fi |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 863 | PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) |
| 864 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED" |
Samuel Thibault | 7585617 | 2011-03-14 22:08:21 +0000 | [diff] [blame] | 865 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 866 | |
| 867 | # find the DRI deps for libGL |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 868 | dri_modules="x11 xext xdamage xfixes x11-xcb xcb-glx >= 1.8.1" |
Jon TURNEY | 2b9dac3 | 2010-04-21 12:58:54 +0100 | [diff] [blame] | 869 | |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 870 | # add xf86vidmode if available |
| 871 | PKG_CHECK_MODULES([XF86VIDMODE], [xxf86vm], HAVE_XF86VIDMODE=yes, HAVE_XF86VIDMODE=no) |
| 872 | if test "$HAVE_XF86VIDMODE" = yes ; then |
| 873 | dri_modules="$dri_modules xxf86vm" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 874 | fi |
| 875 | |
Matt Turner | e273ed3 | 2012-08-14 12:24:31 -0700 | [diff] [blame] | 876 | PKG_CHECK_MODULES([DRIGL], [$dri_modules]) |
| 877 | GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV $dri_modules" |
| 878 | X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS" |
| 879 | GL_LIB_DEPS="$DRIGL_LIBS" |
| 880 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 881 | # need DRM libs, -lpthread, etc. |
Alan Coopersmith | 3cf6e62 | 2009-03-23 16:51:54 -0700 | [diff] [blame] | 882 | GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
| 883 | GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 884 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 885 | esac |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 886 | |
Ian Romanick | 4becf67 | 2012-01-03 11:35:59 -0800 | [diff] [blame] | 887 | # This is outside the case (above) so that it is invoked even for non-GLX |
| 888 | # builds. |
Eric Anholt | 8ffb098 | 2012-02-05 06:10:56 +0100 | [diff] [blame] | 889 | AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes) |
Ian Romanick | 4becf67 | 2012-01-03 11:35:59 -0800 | [diff] [blame] | 890 | |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 891 | GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
| 892 | GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
| 893 | GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS" |
| 894 | GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
| 895 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 896 | AC_SUBST([GL_LIB_DEPS]) |
Dan Nicholson | 71e208b | 2008-11-24 11:01:57 -0800 | [diff] [blame] | 897 | AC_SUBST([GL_PC_REQ_PRIV]) |
| 898 | AC_SUBST([GL_PC_LIB_PRIV]) |
| 899 | AC_SUBST([GL_PC_CFLAGS]) |
| 900 | AC_SUBST([DRI_PC_REQ_PRIV]) |
Li Peng | c33c191 | 2010-07-30 12:26:15 +0800 | [diff] [blame] | 901 | AC_SUBST([GLESv1_CM_LIB_DEPS]) |
Kristian Høgsberg | 9e4f2da | 2010-05-04 14:13:11 -0400 | [diff] [blame] | 902 | AC_SUBST([GLESv1_CM_PC_LIB_PRIV]) |
Kristian Høgsberg | 9339c12 | 2010-03-05 19:01:43 -0500 | [diff] [blame] | 903 | AC_SUBST([GLESv2_LIB_DEPS]) |
Kristian Høgsberg | 9e4f2da | 2010-05-04 14:13:11 -0400 | [diff] [blame] | 904 | AC_SUBST([GLESv2_PC_LIB_PRIV]) |
| 905 | |
Chia-I Wu | 0c771e2 | 2011-11-04 16:32:17 +0800 | [diff] [blame] | 906 | GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS" |
Chia-I Wu | 9767d3b | 2010-12-26 18:02:59 +0800 | [diff] [blame] | 907 | AC_SUBST([GLAPI_LIB_DEPS]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 908 | |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 909 | |
Matt Turner | bee2edb | 2012-08-17 16:24:32 -0700 | [diff] [blame] | 910 | DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la" |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 911 | |
Jon TURNEY | 2b9dac3 | 2010-04-21 12:58:54 +0100 | [diff] [blame] | 912 | AC_SUBST([HAVE_XF86VIDMODE]) |
| 913 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 914 | dnl |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 915 | dnl More GLX setup |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 916 | dnl |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 917 | case "x$enable_glx$enable_xlib_glx" in |
| 918 | xyesyes) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 919 | DEFINES="$DEFINES -DUSE_XSHM" |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 920 | ;; |
| 921 | xyesno) |
| 922 | DEFINES="$DEFINES -DGLX_INDIRECT_RENDERING" |
| 923 | if test "x$driglx_direct" = xyes; then |
| 924 | DEFINES="$DEFINES -DGLX_DIRECT_RENDERING" |
| 925 | fi |
| 926 | ;; |
| 927 | esac |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 928 | |
| 929 | dnl |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 930 | dnl TLS detection |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 931 | dnl |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 932 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 933 | AC_ARG_ENABLE([glx-tls], |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 934 | [AS_HELP_STRING([--enable-glx-tls], |
Dan Nicholson | 79ad458 | 2007-12-07 19:11:01 -0800 | [diff] [blame] | 935 | [enable TLS support in GLX @<:@default=disabled@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 936 | [GLX_USE_TLS="$enableval"], |
| 937 | [GLX_USE_TLS=no]) |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 938 | AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) |
| 939 | |
Tom Fogal | 4484297 | 2011-02-21 22:32:18 -0700 | [diff] [blame] | 940 | AS_IF([test "x$GLX_USE_TLS" = xyes], |
| 941 | [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"]) |
| 942 | |
Tom Fogal | 31351dc | 2010-12-05 17:58:32 -0700 | [diff] [blame] | 943 | dnl |
| 944 | dnl More DRI setup |
| 945 | dnl |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 946 | dnl Directory for DRI drivers |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 947 | AC_ARG_WITH([dri-driverdir], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 948 | [AS_HELP_STRING([--with-dri-driverdir=DIR], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 949 | [directory for the DRI drivers @<:@${libdir}/dri@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 950 | [DRI_DRIVER_INSTALL_DIR="$withval"], |
Dan Nicholson | 5dbbde5 | 2008-05-06 06:21:41 -0700 | [diff] [blame] | 951 | [DRI_DRIVER_INSTALL_DIR='${libdir}/dri']) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 952 | AC_SUBST([DRI_DRIVER_INSTALL_DIR]) |
Chow Loong Jin | 35506de | 2009-10-28 14:34:14 +0800 | [diff] [blame] | 953 | dnl Extra search path for DRI drivers |
| 954 | AC_ARG_WITH([dri-searchpath], |
| 955 | [AS_HELP_STRING([--with-dri-searchpath=DIRS...], |
| 956 | [semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])], |
| 957 | [DRI_DRIVER_SEARCH_DIR="$withval"], |
| 958 | [DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}']) |
| 959 | AC_SUBST([DRI_DRIVER_SEARCH_DIR]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 960 | dnl Which drivers to build - default is chosen by platform |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 961 | AC_ARG_WITH([dri-drivers], |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 962 | [AS_HELP_STRING([--with-dri-drivers@<:@=DIRS...@:>@], |
Dan Nicholson | 5cae1b7 | 2008-06-30 10:28:02 -0700 | [diff] [blame] | 963 | [comma delimited DRI drivers list, e.g. |
Michel Dänzer | cade071 | 2009-07-10 14:49:46 +0200 | [diff] [blame] | 964 | "swrast,i965,radeon" @<:@default=auto@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 965 | [with_dri_drivers="$withval"], |
| 966 | [with_dri_drivers=yes]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 967 | if test "x$with_dri_drivers" = x; then |
| 968 | with_dri_drivers=no |
| 969 | fi |
| 970 | |
| 971 | dnl If $with_dri_drivers is yes, directories will be added through |
| 972 | dnl platform checks |
| 973 | DRI_DIRS="" |
| 974 | case "$with_dri_drivers" in |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 975 | no) ;; |
| 976 | yes) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 977 | # classic DRI drivers require FEATURE_GL to build |
| 978 | if test "x$enable_opengl" = xyes; then |
| 979 | DRI_DIRS="yes" |
| 980 | fi |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 981 | ;; |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 982 | *) |
| 983 | # verify the requested driver directories exist |
Dan Nicholson | e6e4f25 | 2008-07-06 14:17:39 -0700 | [diff] [blame] | 984 | dri_drivers=`IFS=', '; echo $with_dri_drivers` |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 985 | for driver in $dri_drivers; do |
| 986 | test -d "$srcdir/src/mesa/drivers/dri/$driver" || \ |
Matt Turner | 14819eb | 2012-08-01 08:32:49 -0700 | [diff] [blame] | 987 | AC_MSG_ERROR([DRI driver directory '$driver' does not exist]) |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 988 | done |
| 989 | DRI_DIRS="$dri_drivers" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 990 | if test -n "$DRI_DIRS" -a "x$enable_opengl" != xyes; then |
| 991 | AC_MSG_ERROR([--with-dri-drivers requires OpenGL]) |
| 992 | fi |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 993 | ;; |
| 994 | esac |
| 995 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 996 | dnl Set DRI_DIRS, DEFINES and LIB_DEPS |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 997 | if test "x$enable_dri" = xyes; then |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 998 | # Platform specific settings and drivers to build |
| 999 | case "$host_os" in |
| 1000 | linux*) |
| 1001 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1002 | DEFINES="$DEFINES -DHAVE_ALIAS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1003 | |
| 1004 | case "$host_cpu" in |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1005 | x86_64) |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1006 | if test "x$DRI_DIRS" = "xyes"; then |
Eric Anholt | 2f4c7eb | 2011-10-20 14:55:53 -0700 | [diff] [blame] | 1007 | DRI_DIRS="i915 i965 nouveau r200 radeon swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1008 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1009 | ;; |
| 1010 | powerpc*) |
Dan Nicholson | a76e245 | 2007-12-07 11:25:08 -0800 | [diff] [blame] | 1011 | # Build only the drivers for cards that exist on PowerPC. |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1012 | if test "x$DRI_DIRS" = "xyes"; then |
Eric Anholt | 2f4c7eb | 2011-10-20 14:55:53 -0700 | [diff] [blame] | 1013 | DRI_DIRS="r200 radeon swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1014 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1015 | ;; |
Dave Airlie | 2b0e75e | 2008-06-12 12:06:50 +1000 | [diff] [blame] | 1016 | sparc*) |
Ian Romanick | e434416 | 2011-08-24 15:21:58 -0700 | [diff] [blame] | 1017 | # Build only the drivers for cards that exist on sparc |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1018 | if test "x$DRI_DIRS" = "xyes"; then |
Eric Anholt | 2f4c7eb | 2011-10-20 14:55:53 -0700 | [diff] [blame] | 1019 | DRI_DIRS="r200 radeon swrast" |
Dave Airlie | 2b0e75e | 2008-06-12 12:06:50 +1000 | [diff] [blame] | 1020 | fi |
| 1021 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1022 | esac |
| 1023 | ;; |
Pierre Allegraud | 8fd8de3 | 2011-01-06 07:58:57 -0700 | [diff] [blame] | 1024 | freebsd* | dragonfly* | *netbsd*) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1025 | DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1" |
| 1026 | DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1027 | |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1028 | if test "x$DRI_DIRS" = "xyes"; then |
Eric Anholt | 2f4c7eb | 2011-10-20 14:55:53 -0700 | [diff] [blame] | 1029 | DRI_DIRS="i915 i965 nouveau r200 radeon swrast" |
Dan Nicholson | af3d2f2 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1030 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1031 | ;; |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 1032 | gnu*) |
| 1033 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
Chia-I Wu | 5029ea4 | 2011-06-27 13:06:39 +0900 | [diff] [blame] | 1034 | DEFINES="$DEFINES -DHAVE_ALIAS" |
Samuel Thibault | d18dd6a | 2009-04-23 05:43:22 -0700 | [diff] [blame] | 1035 | ;; |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1036 | solaris*) |
| 1037 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1038 | ;; |
Jon TURNEY | c6e33ca | 2011-03-14 22:08:23 +0000 | [diff] [blame] | 1039 | cygwin*) |
| 1040 | DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER" |
Jon TURNEY | c6e33ca | 2011-03-14 22:08:23 +0000 | [diff] [blame] | 1041 | if test "x$DRI_DIRS" = "xyes"; then |
| 1042 | DRI_DIRS="swrast" |
| 1043 | fi |
| 1044 | ;; |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1045 | esac |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 1046 | |
| 1047 | # default drivers |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 1048 | if test "x$DRI_DIRS" = "xyes"; then |
Eric Anholt | 2f4c7eb | 2011-10-20 14:55:53 -0700 | [diff] [blame] | 1049 | DRI_DIRS="i915 i965 nouveau r200 radeon swrast" |
Dan Nicholson | 112a40e | 2008-02-21 10:17:19 -0800 | [diff] [blame] | 1050 | fi |
| 1051 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1052 | DRI_DIRS=`echo "$DRI_DIRS" | $SED 's/ */ /g'` |
| 1053 | |
| 1054 | # Check for expat |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1055 | if test "x$enable_dri" = xyes; then |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1056 | EXPAT_INCLUDES="" |
| 1057 | EXPAT_LIB=-lexpat |
| 1058 | AC_ARG_WITH([expat], |
| 1059 | [AS_HELP_STRING([--with-expat=DIR], |
| 1060 | [expat install directory])],[ |
| 1061 | EXPAT_INCLUDES="-I$withval/include" |
| 1062 | CPPFLAGS="$CPPFLAGS $EXPAT_INCLUDES" |
| 1063 | LDFLAGS="$LDFLAGS -L$withval/$LIB_DIR" |
| 1064 | EXPAT_LIB="-L$withval/$LIB_DIR -lexpat" |
| 1065 | ]) |
| 1066 | AC_CHECK_HEADER([expat.h],[],[AC_MSG_ERROR([Expat required for DRI.])]) |
Eric Anholt | 3647339 | 2012-01-18 11:27:24 -0800 | [diff] [blame] | 1067 | save_LIBS="$LIBS" |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1068 | AC_CHECK_LIB([expat],[XML_ParserCreate],[], |
| 1069 | [AC_MSG_ERROR([Expat required for DRI.])]) |
Eric Anholt | 3647339 | 2012-01-18 11:27:24 -0800 | [diff] [blame] | 1070 | LIBS="$save_LIBS" |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1071 | fi |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1072 | |
Jon TURNEY | ffc8494 | 2012-02-02 10:39:04 +0000 | [diff] [blame] | 1073 | # if we are building any dri driver other than swrast ... |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 1074 | if test -n "$DRI_DIRS" -a x"$DRI_DIRS" != xswrast; then |
Jon TURNEY | ffc8494 | 2012-02-02 10:39:04 +0000 | [diff] [blame] | 1075 | # ... libdrm is required |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 1076 | if test "x$have_libdrm" != xyes; then |
| 1077 | AC_MSG_ERROR([DRI drivers requires libdrm >= $LIBDRM_REQUIRED]) |
| 1078 | fi |
Jon TURNEY | ffc8494 | 2012-02-02 10:39:04 +0000 | [diff] [blame] | 1079 | # ... and build dricommon |
| 1080 | HAVE_COMMON_DRI=yes |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 1081 | fi |
| 1082 | |
Matt Turner | 2b3a8cb | 2012-01-13 14:30:36 -0500 | [diff] [blame] | 1083 | # put all the necessary libs together |
Christopher James Halse Rogers | d1e28b2 | 2011-02-03 11:19:32 +1100 | [diff] [blame] | 1084 | DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS" |
Jon TURNEY | defadf2 | 2012-07-08 12:19:24 +0100 | [diff] [blame] | 1085 | GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS" |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1086 | fi |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1087 | AC_SUBST([DRI_DIRS]) |
| 1088 | AC_SUBST([EXPAT_INCLUDES]) |
| 1089 | AC_SUBST([DRI_LIB_DEPS]) |
Jon TURNEY | defadf2 | 2012-07-08 12:19:24 +0100 | [diff] [blame] | 1090 | AC_SUBST([GALLIUM_DRI_LIB_DEPS]) |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1091 | |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1092 | case $DRI_DIRS in |
| 1093 | *i915*|*i965*) |
Tormod Volden | 903185b | 2011-01-25 13:25:18 -0800 | [diff] [blame] | 1094 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 1095 | |
Matt Turner | 3c87dfc | 2012-01-14 21:57:32 -0500 | [diff] [blame] | 1096 | for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do |
| 1097 | case $d in |
| 1098 | i915) |
| 1099 | HAVE_I915_DRI=yes; |
| 1100 | ;; |
| 1101 | i965) |
| 1102 | HAVE_I965_DRI=yes; |
| 1103 | ;; |
| 1104 | esac |
| 1105 | done |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 1106 | |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1107 | ;; |
Kristian Høgsberg | 27fe7a7 | 2010-01-07 10:29:29 -0500 | [diff] [blame] | 1108 | esac |
Kristian Høgsberg | 8616cec | 2010-01-01 17:03:33 -0500 | [diff] [blame] | 1109 | |
Matt Turner | e0ee818 | 2012-01-14 22:21:30 -0500 | [diff] [blame] | 1110 | case $DRI_DIRS in |
Matt Turner | 3f96434 | 2012-01-15 10:20:30 -0500 | [diff] [blame] | 1111 | *nouveau*) |
Ben Skeggs | 2e47d01 | 2011-12-23 14:03:49 +1000 | [diff] [blame] | 1112 | PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NVVIEUX_REQUIRED]) |
Matt Turner | 3f96434 | 2012-01-15 10:20:30 -0500 | [diff] [blame] | 1113 | HAVE_NOUVEAU_DRI=yes; |
| 1114 | ;; |
| 1115 | esac |
| 1116 | |
| 1117 | case $DRI_DIRS in |
Matt Turner | b38d7a0 | 2012-01-15 10:04:58 -0500 | [diff] [blame] | 1118 | *radeon*|*r200*) |
Matt Turner | e0ee818 | 2012-01-14 22:21:30 -0500 | [diff] [blame] | 1119 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
| 1120 | |
| 1121 | for d in $(echo $DRI_DIRS | sed 's/,/ /g'); do |
| 1122 | case $d in |
| 1123 | radeon) |
| 1124 | HAVE_RADEON_DRI=yes; |
| 1125 | ;; |
Matt Turner | b38d7a0 | 2012-01-15 10:04:58 -0500 | [diff] [blame] | 1126 | r200) |
| 1127 | HAVE_R200_DRI=yes; |
| 1128 | ;; |
Matt Turner | e0ee818 | 2012-01-14 22:21:30 -0500 | [diff] [blame] | 1129 | esac |
| 1130 | done |
| 1131 | |
| 1132 | ;; |
| 1133 | esac |
| 1134 | |
Matt Turner | 349845f | 2012-01-15 11:39:48 -0500 | [diff] [blame] | 1135 | case $DRI_DIRS in |
| 1136 | *swrast*) |
| 1137 | HAVE_SWRAST_DRI=yes; |
| 1138 | ;; |
| 1139 | esac |
| 1140 | |
Matt Turner | 3c87dfc | 2012-01-14 21:57:32 -0500 | [diff] [blame] | 1141 | AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes) |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 1142 | AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes) |
Matt Turner | 3f96434 | 2012-01-15 10:20:30 -0500 | [diff] [blame] | 1143 | AM_CONDITIONAL(HAVE_NOUVEAU_DRI, test x$HAVE_NOUVEAU_DRI = xyes) |
Matt Turner | b38d7a0 | 2012-01-15 10:04:58 -0500 | [diff] [blame] | 1144 | AM_CONDITIONAL(HAVE_R200_DRI, test x$HAVE_R200_DRI = xyes) |
Matt Turner | e0ee818 | 2012-01-14 22:21:30 -0500 | [diff] [blame] | 1145 | AM_CONDITIONAL(HAVE_RADEON_DRI, test x$HAVE_RADEON_DRI = xyes) |
Matt Turner | 349845f | 2012-01-15 11:39:48 -0500 | [diff] [blame] | 1146 | AM_CONDITIONAL(HAVE_SWRAST_DRI, test x$HAVE_SWRAST_DRI = xyes) |
Jon TURNEY | ffc8494 | 2012-02-02 10:39:04 +0000 | [diff] [blame] | 1147 | AM_CONDITIONAL(HAVE_COMMON_DRI, test x$HAVE_COMMON_DRI = xyes) |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 1148 | |
Dan Nicholson | 44d9914 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1149 | dnl |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1150 | dnl OSMesa configuration |
| 1151 | dnl |
Dan Nicholson | 979ff51 | 2007-12-05 18:47:01 -0800 | [diff] [blame] | 1152 | |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1153 | dnl Configure the channel bits for OSMesa (libOSMesa, libOSMesa16, ...) |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1154 | AC_ARG_WITH([osmesa-bits], |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1155 | [AS_HELP_STRING([--with-osmesa-bits=BITS], |
| 1156 | [OSMesa channel bits and library name: 8, 16, 32 @<:@default=8@:>@])], |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1157 | [osmesa_bits="$withval"], |
| 1158 | [osmesa_bits=8]) |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1159 | if test "x$osmesa_bits" != x8; then |
| 1160 | if test "x$enable_dri" = xyes -o "x$enable_glx" = xyes; then |
| 1161 | AC_MSG_WARN([Ignoring OSMesa channel bits because of non-OSMesa driver]) |
| 1162 | osmesa_bits=8 |
| 1163 | fi |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1164 | fi |
| 1165 | case "x$osmesa_bits" in |
| 1166 | x8) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 1167 | OSMESA_LIB="${OSMESA_LIB}" |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1168 | ;; |
| 1169 | x16|x32) |
Tom Fogal | c0573fb | 2011-10-10 10:33:18 -0600 | [diff] [blame] | 1170 | OSMESA_LIB="${OSMESA_LIB}$osmesa_bits" |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1171 | DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31" |
| 1172 | ;; |
| 1173 | *) |
| 1174 | AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option]) |
| 1175 | ;; |
| 1176 | esac |
Dan Nicholson | 6689f9e | 2007-12-05 21:04:15 -0800 | [diff] [blame] | 1177 | |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1178 | if test "x$enable_osmesa" = xyes; then |
Alan Coopersmith | e1f9adc | 2008-06-20 17:58:53 -0700 | [diff] [blame] | 1179 | # only link libraries with osmesa if shared |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1180 | if test "$enable_static" = no; then |
Kenneth Graunke | d1d81205 | 2011-01-16 16:01:54 -0800 | [diff] [blame] | 1181 | OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS" |
Dan Nicholson | 8858633 | 2007-11-15 08:59:57 -0800 | [diff] [blame] | 1182 | else |
| 1183 | OSMESA_LIB_DEPS="" |
| 1184 | fi |
Matt Turner | 7ef94c6 | 2012-01-31 21:34:42 -0500 | [diff] [blame] | 1185 | OSMESA_MESA_DEPS="" |
Kenneth Graunke | d1d81205 | 2011-01-16 16:01:54 -0800 | [diff] [blame] | 1186 | OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1187 | fi |
Laurent Carlier | 284325d | 2012-06-24 09:51:27 +0200 | [diff] [blame] | 1188 | |
Dan Nicholson | 297e16c | 2008-05-05 15:42:53 -0700 | [diff] [blame] | 1189 | AC_SUBST([OSMESA_LIB_DEPS]) |
Matt Turner | 7ef94c6 | 2012-01-31 21:34:42 -0500 | [diff] [blame] | 1190 | AC_SUBST([OSMESA_MESA_DEPS]) |
| 1191 | AC_SUBST([OSMESA_PC_REQ]) |
Dan Nicholson | 8be02fc | 2008-12-14 09:35:29 -0800 | [diff] [blame] | 1192 | AC_SUBST([OSMESA_PC_LIB_PRIV]) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1193 | |
| 1194 | dnl |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1195 | dnl gbm configuration |
| 1196 | dnl |
| 1197 | if test "x$enable_gbm" = xauto; then |
| 1198 | case "$with_egl_platforms" in |
| 1199 | *drm*) |
| 1200 | enable_gbm=yes ;; |
| 1201 | *) |
| 1202 | enable_gbm=no ;; |
| 1203 | esac |
| 1204 | fi |
| 1205 | if test "x$enable_gbm" = xyes; then |
| 1206 | SRC_DIRS="$SRC_DIRS gbm" |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1207 | |
| 1208 | PKG_CHECK_MODULES([LIBUDEV], [libudev], [], |
| 1209 | AC_MSG_ERROR([gbm needs udev])) |
Matt Turner | 027ce0c | 2012-01-24 11:34:42 -0500 | [diff] [blame] | 1210 | |
| 1211 | if test "x$enable_dri" = xyes; then |
| 1212 | GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri" |
Matt Turner | 8c9b78a | 2012-08-17 14:22:47 -0700 | [diff] [blame] | 1213 | if test "x$enable_shared_glapi" = xno; then |
Matt Turner | 027ce0c | 2012-01-24 11:34:42 -0500 | [diff] [blame] | 1214 | AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi]) |
| 1215 | fi |
Jakob Bornecrantz | a669a50 | 2012-08-13 15:55:23 +0200 | [diff] [blame] | 1216 | PKG_CHECK_MODULES([LIBKMS], [libkms], [], |
| 1217 | AC_MSG_ERROR([gbm needs libkms])) |
Matt Turner | 027ce0c | 2012-01-24 11:34:42 -0500 | [diff] [blame] | 1218 | fi |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1219 | fi |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1220 | GBM_PC_REQ_PRIV="libudev" |
| 1221 | GBM_PC_LIB_PRIV="$DLOPEN_LIBS" |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1222 | AC_SUBST([GBM_PC_REQ_PRIV]) |
| 1223 | AC_SUBST([GBM_PC_LIB_PRIV]) |
Benjamin Franzke | 42cdf40 | 2011-07-25 09:37:02 +0200 | [diff] [blame] | 1224 | |
| 1225 | dnl |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1226 | dnl EGL configuration |
| 1227 | dnl |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1228 | EGL_CLIENT_APIS="" |
| 1229 | |
Dan Nicholson | 66f9786 | 2009-04-29 12:11:43 -0700 | [diff] [blame] | 1230 | if test "x$enable_egl" = xyes; then |
| 1231 | SRC_DIRS="$SRC_DIRS egl" |
Tapani Pälli | 2758e65 | 2011-05-16 16:56:43 +0300 | [diff] [blame] | 1232 | EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread" |
Marek Olšák | ad50abba | 2011-06-14 05:14:27 +0200 | [diff] [blame] | 1233 | |
Benjamin Franzke | 85fe948 | 2011-08-09 14:23:18 +0200 | [diff] [blame] | 1234 | AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"]) |
| 1235 | |
Chia-I Wu | 2eb7a2f | 2010-02-05 10:46:11 +0800 | [diff] [blame] | 1236 | if test "$enable_static" != yes; then |
Chia-I Wu | d4c1ee0 | 2009-12-21 11:13:18 +0800 | [diff] [blame] | 1237 | # build egl_glx when libGL is built |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1238 | if test "x$enable_glx" = xyes; then |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1239 | HAVE_EGL_DRIVER_GLX=1 |
Chia-I Wu | 2eb7a2f | 2010-02-05 10:46:11 +0800 | [diff] [blame] | 1240 | fi |
| 1241 | |
Benjamin Franzke | 184bb09 | 2011-04-30 11:18:23 +0200 | [diff] [blame] | 1242 | PKG_CHECK_MODULES([LIBUDEV], [libudev > 150], |
| 1243 | [have_libudev=yes],[have_libudev=no]) |
Benjamin Franzke | a7cd65f | 2011-05-31 11:14:46 +0200 | [diff] [blame] | 1244 | if test "$have_libudev" = yes; then |
| 1245 | DEFINES="$DEFINES -DHAVE_LIBUDEV" |
| 1246 | fi |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1247 | |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 1248 | if test "x$enable_dri" = xyes; then |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1249 | HAVE_EGL_DRIVER_DRI2=1 |
Chia-I Wu | 39ae965 | 2010-07-16 19:48:52 +0800 | [diff] [blame] | 1250 | fi |
Kristian Høgsberg | 2168b87 | 2010-06-02 22:48:06 -0400 | [diff] [blame] | 1251 | |
Kristian Høgsberg | 42fa009 | 2010-02-03 10:18:28 -0500 | [diff] [blame] | 1252 | fi |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1253 | fi |
Dan Nicholson | 53b3734 | 2009-02-25 17:45:34 -0800 | [diff] [blame] | 1254 | AC_SUBST([EGL_LIB_DEPS]) |
| 1255 | |
| 1256 | dnl |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1257 | dnl EGL Gallium configuration |
| 1258 | dnl |
| 1259 | if test "x$enable_gallium_egl" = xyes; then |
| 1260 | if test "x$with_gallium_drivers" = x; then |
| 1261 | AC_MSG_ERROR([cannot enable egl_gallium without Gallium]) |
| 1262 | fi |
| 1263 | if test "x$enable_egl" = xno; then |
| 1264 | AC_MSG_ERROR([cannot enable egl_gallium without EGL]) |
| 1265 | fi |
Chia-I Wu | 94ec5fd | 2011-06-27 09:19:02 +0900 | [diff] [blame] | 1266 | if test "x$have_libdrm" != xyes; then |
| 1267 | AC_MSG_ERROR([egl_gallium requires libdrm >= $LIBDRM_REQUIRED]) |
| 1268 | fi |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1269 | |
| 1270 | GALLIUM_STATE_TRACKERS_DIRS="egl $GALLIUM_STATE_TRACKERS_DIRS" |
Chia-I Wu | b8f097f | 2011-06-20 12:01:39 +0900 | [diff] [blame] | 1271 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS egl-static" |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1272 | HAVE_ST_EGL="yes" |
| 1273 | fi |
| 1274 | |
| 1275 | dnl |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1276 | dnl gbm Gallium configuration |
| 1277 | dnl |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 1278 | if test "x$enable_gallium_gbm" = xauto; then |
Chia-I Wu | 95ef069 | 2011-11-05 15:09:36 +0800 | [diff] [blame] | 1279 | case "$enable_gbm$HAVE_ST_EGL$enable_dri$with_egl_platforms" in |
| 1280 | yesyesyes*drm*) |
Benjamin Franzke | b18b299 | 2011-07-02 13:45:14 +0200 | [diff] [blame] | 1281 | enable_gallium_gbm=yes ;; |
| 1282 | *) |
| 1283 | enable_gallium_gbm=no ;; |
| 1284 | esac |
| 1285 | fi |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1286 | if test "x$enable_gallium_gbm" = xyes; then |
| 1287 | if test "x$with_gallium_drivers" = x; then |
| 1288 | AC_MSG_ERROR([cannot enable gbm_gallium without Gallium]) |
| 1289 | fi |
| 1290 | if test "x$enable_gbm" = xno; then |
| 1291 | AC_MSG_ERROR([cannot enable gbm_gallium without gbm]) |
| 1292 | fi |
Chia-I Wu | 95ef069 | 2011-11-05 15:09:36 +0800 | [diff] [blame] | 1293 | # gbm_gallium abuses DRI_LIB_DEPS to link. Make sure it is set. |
| 1294 | if test "x$enable_dri" = xno; then |
| 1295 | AC_MSG_ERROR([gbm_gallium requires --enable-dri to build]) |
| 1296 | fi |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1297 | |
| 1298 | GALLIUM_STATE_TRACKERS_DIRS="gbm $GALLIUM_STATE_TRACKERS_DIRS" |
| 1299 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS gbm" |
| 1300 | HAVE_ST_GBM="yes" |
Francisco Jerez | b52a0f2 | 2012-04-20 16:31:23 +0200 | [diff] [blame] | 1301 | enable_gallium_loader=yes |
Benjamin Franzke | 48d4a00 | 2011-05-26 15:11:50 +0200 | [diff] [blame] | 1302 | fi |
| 1303 | |
| 1304 | dnl |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1305 | dnl X.Org DDX configuration |
| 1306 | dnl |
| 1307 | if test "x$enable_xorg" = xyes; then |
| 1308 | PKG_CHECK_MODULES([XORG], [xorg-server >= 1.6.0]) |
| 1309 | PKG_CHECK_MODULES([LIBDRM_XORG], [libdrm >= $LIBDRM_XORG_REQUIRED]) |
| 1310 | PKG_CHECK_MODULES([LIBKMS_XORG], [libkms >= $LIBKMS_XORG_REQUIRED]) |
| 1311 | PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], |
| 1312 | HAVE_XEXTPROTO_71="yes"; DEFINES="$DEFINES -DHAVE_XEXTPROTO_71", |
| 1313 | HAVE_XEXTPROTO_71="no") |
| 1314 | GALLIUM_STATE_TRACKERS_DIRS="xorg $GALLIUM_STATE_TRACKERS_DIRS" |
| 1315 | HAVE_ST_XORG=yes |
| 1316 | fi |
| 1317 | |
| 1318 | dnl |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1319 | dnl XA configuration |
| 1320 | dnl |
| 1321 | if test "x$enable_xa" = xyes; then |
Thomas Hellstrom | 32b1641 | 2011-11-24 21:54:54 +0100 | [diff] [blame] | 1322 | AC_PROG_AWK |
| 1323 | AC_PROG_GREP |
| 1324 | AC_CHECK_PROG(NM, nm, "nm") |
| 1325 | if test "x$AWK" = x || test "x$GREP" = x || test "x$NM" = x; then |
| 1326 | AC_MSG_WARN([Missing one of nm, grep or awk. Disabling xa.]) |
| 1327 | enable_xa=no |
| 1328 | fi |
| 1329 | fi |
| 1330 | if test "x$enable_xa" = xyes; then |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1331 | GALLIUM_STATE_TRACKERS_DIRS="xa $GALLIUM_STATE_TRACKERS_DIRS" |
| 1332 | HAVE_ST_XA=yes |
Thomas Hellstrom | 32b1641 | 2011-11-24 21:54:54 +0100 | [diff] [blame] | 1333 | AC_SUBST(AWK) |
| 1334 | AC_SUBST(GREP) |
| 1335 | AC_SUBST(NM) |
Thomas Hellstrom | 424b121 | 2011-07-04 10:21:35 +0200 | [diff] [blame] | 1336 | fi |
| 1337 | |
| 1338 | dnl |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1339 | dnl OpenVG configuration |
| 1340 | dnl |
| 1341 | VG_LIB_DEPS="" |
| 1342 | |
| 1343 | if test "x$enable_openvg" = xyes; then |
| 1344 | if test "x$enable_egl" = xno; then |
| 1345 | AC_MSG_ERROR([cannot enable OpenVG without EGL]) |
| 1346 | fi |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1347 | if test "x$with_gallium_drivers" = x; then |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1348 | AC_MSG_ERROR([cannot enable OpenVG without Gallium]) |
| 1349 | fi |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 1350 | if test "x$enable_gallium_egl" = xno; then |
| 1351 | AC_MSG_ERROR([cannot enable OpenVG without egl_gallium]) |
| 1352 | fi |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1353 | |
| 1354 | EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)' |
| 1355 | VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread" |
| 1356 | CORE_DIRS="$CORE_DIRS mapi/vgapi" |
| 1357 | GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS" |
| 1358 | HAVE_ST_VEGA=yes |
Matt Turner | 261719b | 2012-08-22 16:57:38 -0700 | [diff] [blame] | 1359 | VG_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS" |
| 1360 | AC_SUBST([VG_PC_LIB_PRIV]) |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1361 | fi |
| 1362 | |
| 1363 | dnl |
| 1364 | dnl D3D1X configuration |
| 1365 | dnl |
| 1366 | |
| 1367 | if test "x$enable_d3d1x" = xyes; then |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1368 | if test "x$with_gallium_drivers" = x; then |
| 1369 | AC_MSG_ERROR([cannot enable D3D1X without Gallium]) |
| 1370 | fi |
| 1371 | |
Marek Olšák | 440d71d | 2011-06-14 05:38:58 +0200 | [diff] [blame] | 1372 | GALLIUM_STATE_TRACKERS_DIRS="d3d1x $GALLIUM_STATE_TRACKERS_DIRS" |
| 1373 | HAVE_ST_D3D1X=yes |
| 1374 | fi |
| 1375 | |
| 1376 | dnl |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1377 | dnl Gallium G3DVL configuration |
| 1378 | dnl |
| 1379 | AC_ARG_ENABLE([gallium-g3dvl], |
| 1380 | [AS_HELP_STRING([--enable-gallium-g3dvl], |
| 1381 | [build gallium g3dvl @<:@default=disabled@:>@])], |
| 1382 | [enable_gallium_g3dvl="$enableval"], |
| 1383 | [enable_gallium_g3dvl=no]) |
| 1384 | if test "x$enable_gallium_g3dvl" = xyes; then |
| 1385 | if test "x$with_gallium_drivers" = x; then |
| 1386 | AC_MSG_ERROR([cannot enable G3DVL without Gallium]) |
| 1387 | fi |
| 1388 | |
| 1389 | if test "x$enable_xvmc" = xauto; then |
Christian König | a8ae8cf | 2011-07-14 12:42:17 +0200 | [diff] [blame] | 1390 | PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1391 | fi |
| 1392 | |
| 1393 | if test "x$enable_vdpau" = xauto; then |
Christian König | 33bf410 | 2011-07-14 13:57:23 +0200 | [diff] [blame] | 1394 | PKG_CHECK_EXISTS([vdpau], [enable_vdpau=yes], [enable_vdpau=no]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1395 | fi |
| 1396 | |
| 1397 | if test "x$enable_va" = xauto; then |
Christian König | 8619aa5 | 2011-07-14 14:09:25 +0200 | [diff] [blame] | 1398 | #don't enable vaapi state tracker even if package exists |
| 1399 | #PKG_CHECK_EXISTS([libva], [enable_vdpau=yes], [enable_vdpau=no]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1400 | enable_va=no |
| 1401 | fi |
| 1402 | fi |
| 1403 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1404 | if test "x$enable_xvmc" = xyes; then |
Christian König | 66480c0 | 2012-02-24 16:12:27 +0100 | [diff] [blame] | 1405 | PKG_CHECK_MODULES([XVMC], [xvmc >= 1.0.6 x11-xcb xcb-dri2 >= 1.8]) |
Christian König | dcf8ee7 | 2012-02-15 17:30:58 +0100 | [diff] [blame] | 1406 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xvmc" |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1407 | HAVE_ST_XVMC="yes" |
| 1408 | fi |
| 1409 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1410 | if test "x$enable_vdpau" = xyes; then |
Christian König | 66480c0 | 2012-02-24 16:12:27 +0100 | [diff] [blame] | 1411 | PKG_CHECK_MODULES([VDPAU], [vdpau >= 0.4.1 x11-xcb xcb-dri2 >= 1.8]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1412 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS vdpau" |
| 1413 | HAVE_ST_VDPAU="yes" |
| 1414 | fi |
| 1415 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1416 | if test "x$enable_va" = xyes; then |
Christian König | 66480c0 | 2012-02-24 16:12:27 +0100 | [diff] [blame] | 1417 | PKG_CHECK_MODULES([LIBVA], [libva = 0.31.1 x11-xcb xcb-dri2 >= 1.8]) |
Christian König | 8619aa5 | 2011-07-14 14:09:25 +0200 | [diff] [blame] | 1418 | AC_MSG_WARN([vaapi state tracker currently unmaintained]) |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1419 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS va" |
| 1420 | HAVE_ST_VA="yes" |
| 1421 | fi |
| 1422 | |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1423 | dnl |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1424 | dnl OpenCL configuration |
| 1425 | dnl |
| 1426 | |
Tom Stellard | c79e766 | 2012-03-12 13:53:20 -0400 | [diff] [blame] | 1427 | AC_ARG_WITH([libclc-path], |
| 1428 | [AS_HELP_STRING([--with-libclc-path], |
| 1429 | [Path to libclc builtins library. Example: --with-libclc-path=\$HOME/libclc/])], |
| 1430 | [LIBCLC_PATH="$withval"], |
| 1431 | [LIBCLC_PATH=""]) |
| 1432 | |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1433 | AC_ARG_WITH([clang-libdir], |
| 1434 | [AS_HELP_STRING([--with-clang-libdir], |
| 1435 | [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])], |
| 1436 | [CLANG_LIBDIR="$withval"], |
| 1437 | [CLANG_LIBDIR=""]) |
| 1438 | |
Tom Stellard | c79e766 | 2012-03-12 13:53:20 -0400 | [diff] [blame] | 1439 | AC_SUBST([LIBCLC_PATH]) |
| 1440 | |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1441 | if test "x$enable_opencl" = xyes; then |
| 1442 | if test "x$with_gallium_drivers" = x; then |
| 1443 | AC_MSG_ERROR([cannot enable OpenCL without Gallium]) |
| 1444 | fi |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1445 | |
| 1446 | if test $GCC_VERSION_MAJOR -lt 4 -o $GCC_VERSION_MAJOR -eq 4 -a $GCC_VERSION_MINOR -lt 6; then |
| 1447 | AC_MSG_ERROR([gcc >= 4.6 is required to build clover]) |
| 1448 | fi |
| 1449 | |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1450 | GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover" |
| 1451 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl" |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1452 | enable_gallium_loader=yes |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1453 | fi |
| 1454 | |
| 1455 | dnl |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1456 | dnl Gallium configuration |
| 1457 | dnl |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1458 | if test "x$with_gallium_drivers" != x; then |
Jakob Bornecrantz | be38b32 | 2010-03-23 13:23:26 +0000 | [diff] [blame] | 1459 | SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 1460 | fi |
Matt Turner | bfd7d6f | 2012-08-17 15:51:59 -0700 | [diff] [blame] | 1461 | AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x) |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1462 | |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1463 | AC_SUBST([LLVM_BINDIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1464 | AC_SUBST([LLVM_CFLAGS]) |
Tom Stellard | d416780 | 2012-04-24 10:34:57 -0400 | [diff] [blame] | 1465 | AC_SUBST([LLVM_CPPFLAGS]) |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1466 | AC_SUBST([LLVM_CXXFLAGS]) |
Tom Stellard | d416780 | 2012-04-24 10:34:57 -0400 | [diff] [blame] | 1467 | AC_SUBST([LLVM_LIBDIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1468 | AC_SUBST([LLVM_LIBS]) |
| 1469 | AC_SUBST([LLVM_LDFLAGS]) |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1470 | AC_SUBST([LLVM_INCLUDEDIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1471 | AC_SUBST([LLVM_VERSION]) |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1472 | AC_SUBST([CLANG_RESOURCE_DIR]) |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1473 | |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1474 | case "x$enable_opengl$enable_gles1$enable_gles2" in |
| 1475 | x*yes*) |
| 1476 | EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)' |
| 1477 | ;; |
| 1478 | esac |
Chia-I Wu | be5f34a | 2010-10-27 16:14:27 +0800 | [diff] [blame] | 1479 | |
Chia-I Wu | 874ccd5 | 2010-05-04 22:43:05 +0800 | [diff] [blame] | 1480 | AC_SUBST([VG_LIB_DEPS]) |
Chia-I Wu | 63ab250 | 2010-05-05 15:38:02 +0800 | [diff] [blame] | 1481 | AC_SUBST([EGL_CLIENT_APIS]) |
| 1482 | |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1483 | dnl |
| 1484 | dnl EGL Platforms configuration |
| 1485 | dnl |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1486 | AC_ARG_WITH([egl-platforms], |
| 1487 | [AS_HELP_STRING([--with-egl-platforms@<:@=DIRS...@:>@], |
| 1488 | [comma delimited native platforms libEGL supports, e.g. |
Chia-I Wu | e7424d7 | 2010-09-19 16:54:39 +0800 | [diff] [blame] | 1489 | "x11,drm" @<:@default=auto@:>@])], |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1490 | [with_egl_platforms="$withval"], |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1491 | [if test "x$enable_egl" = xyes; then |
| 1492 | with_egl_platforms="x11" |
| 1493 | else |
| 1494 | with_egl_platforms="" |
| 1495 | fi]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1496 | |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1497 | EGL_PLATFORMS="" |
Benjamin Franzke | 214fc6e | 2011-02-04 12:24:08 +0100 | [diff] [blame] | 1498 | |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1499 | if test "x$with_egl_platforms" != "x" -a "x$enable_egl" != xyes; then |
| 1500 | AC_MSG_ERROR([cannot build egl state tracker without EGL library]) |
| 1501 | fi |
| 1502 | |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1503 | # Do per-EGL platform setups and checks |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1504 | egl_platforms=`IFS=', '; echo $with_egl_platforms` |
| 1505 | for plat in $egl_platforms; do |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1506 | case "$plat" in |
| 1507 | fbdev|null) |
| 1508 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/$plat" |
| 1509 | ;; |
| 1510 | |
| 1511 | wayland) |
Benjamin Franzke | 6b369c4 | 2011-02-21 16:22:34 +0100 | [diff] [blame] | 1512 | PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \ |
Benjamin Franzke | e586c4b | 2011-02-04 12:22:58 +0100 | [diff] [blame] | 1513 | [AC_MSG_ERROR([cannot find libwayland-client])]) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1514 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland" |
Benjamin Franzke | 8b90205 | 2012-01-24 20:38:01 +0100 | [diff] [blame] | 1515 | |
Kristian Høgsberg | 426a23a | 2012-07-13 11:06:32 -0400 | [diff] [blame] | 1516 | WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client` |
| 1517 | AC_PATH_PROG([WAYLAND_SCANNER], [wayland-scanner],, |
| 1518 | [${WAYLAND_PREFIX}/bin$PATH_SEPARATOR$PATH]) |
Kristian Høgsberg | 2c4f6ce | 2012-06-01 14:14:20 -0400 | [diff] [blame] | 1519 | ;; |
| 1520 | |
| 1521 | x11) |
| 1522 | PKG_CHECK_MODULES([XCB_DRI2], [x11-xcb xcb-dri2 xcb-xfixes]) |
| 1523 | # workaround a bug in xcb-dri2 generated by xcb-proto 1.6 |
| 1524 | save_LIBS="$LIBS" |
| 1525 | AC_CHECK_LIB(xcb-dri2, xcb_dri2_connect_alignment_pad, [], |
| 1526 | [DEFINES="$DEFINES -DXCB_DRI2_CONNECT_DEVICE_NAME_BROKEN"]) |
| 1527 | LIBS="$save_LIBS" |
| 1528 | ;; |
| 1529 | |
| 1530 | drm) |
| 1531 | test "x$enable_gbm" = "xno" && |
| 1532 | AC_MSG_ERROR([EGL platform drm needs gbm]) |
| 1533 | ;; |
| 1534 | |
| 1535 | android|gdi) |
| 1536 | ;; |
| 1537 | |
| 1538 | *) |
| 1539 | AC_MSG_ERROR([EGL platform '$plat' does not exist]) |
| 1540 | ;; |
| 1541 | esac |
| 1542 | |
Benjamin Franzke | 7ed1826 | 2011-07-02 13:46:42 +0200 | [diff] [blame] | 1543 | case "$plat$have_libudev" in |
| 1544 | waylandno|drmno) |
| 1545 | AC_MSG_ERROR([cannot build $plat platfrom without udev]) ;; |
| 1546 | esac |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1547 | done |
| 1548 | |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1549 | # libEGL wants to default to the first platform specified in |
| 1550 | # ./configure. parse that here. |
| 1551 | if test "x$egl_platforms" != "x"; then |
| 1552 | FIRST_PLATFORM_CAPS=`echo $egl_platforms | sed 's| .*||' | tr 'a-z' 'A-Z'` |
| 1553 | EGL_NATIVE_PLATFORM="_EGL_PLATFORM_$FIRST_PLATFORM_CAPS" |
| 1554 | else |
| 1555 | EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM" |
| 1556 | fi |
| 1557 | |
Eric Anholt | 28d92ef | 2012-02-05 07:54:38 +0100 | [diff] [blame] | 1558 | EGL_PLATFORMS="$egl_platforms" |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1559 | |
| 1560 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1) |
| 1561 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1) |
| 1562 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1) |
| 1563 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1) |
| 1564 | AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1) |
| 1565 | |
| 1566 | AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x") |
| 1567 | AM_CONDITIONAL(HAVE_EGL_DRIVER_GLX, test "x$HAVE_EGL_DRIVER_GLX" != "x") |
| 1568 | |
| 1569 | AC_SUBST([EGL_NATIVE_PLATFORM]) |
Chia-I Wu | da39d5d | 2010-06-17 16:07:46 +0800 | [diff] [blame] | 1570 | AC_SUBST([EGL_PLATFORMS]) |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1571 | AC_SUBST([EGL_CFLAGS]) |
Chia-I Wu | 49381d6 | 2010-01-11 01:23:01 +0800 | [diff] [blame] | 1572 | |
Chia-I Wu | 28c3e57 | 2010-01-23 20:18:43 +0800 | [diff] [blame] | 1573 | AC_ARG_WITH([egl-driver-dir], |
| 1574 | [AS_HELP_STRING([--with-egl-driver-dir=DIR], |
| 1575 | [directory for EGL drivers [[default=${libdir}/egl]]])], |
| 1576 | [EGL_DRIVER_INSTALL_DIR="$withval"], |
| 1577 | [EGL_DRIVER_INSTALL_DIR='${libdir}/egl']) |
| 1578 | AC_SUBST([EGL_DRIVER_INSTALL_DIR]) |
| 1579 | |
Joel Bosveld | 8acca48 | 2009-03-06 08:46:08 +0900 | [diff] [blame] | 1580 | AC_ARG_WITH([xorg-driver-dir], |
| 1581 | [AS_HELP_STRING([--with-xorg-driver-dir=DIR], |
| 1582 | [Default xorg driver directory[[default=${libdir}/xorg/modules/drivers]]])], |
| 1583 | [XORG_DRIVER_INSTALL_DIR="$withval"], |
| 1584 | [XORG_DRIVER_INSTALL_DIR="${libdir}/xorg/modules/drivers"]) |
| 1585 | AC_SUBST([XORG_DRIVER_INSTALL_DIR]) |
| 1586 | |
Tom Fogal | 7085dce | 2009-08-13 19:40:30 -0600 | [diff] [blame] | 1587 | AC_ARG_WITH([max-width], |
| 1588 | [AS_HELP_STRING([--with-max-width=N], |
| 1589 | [Maximum framebuffer width (4096)])], |
| 1590 | [DEFINES="${DEFINES} -DMAX_WIDTH=${withval}"; |
| 1591 | AS_IF([test "${withval}" -gt "4096"], |
| 1592 | [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])] |
| 1593 | ) |
| 1594 | AC_ARG_WITH([max-height], |
| 1595 | [AS_HELP_STRING([--with-max-height=N], |
| 1596 | [Maximum framebuffer height (4096)])], |
| 1597 | [DEFINES="${DEFINES} -DMAX_HEIGHT=${withval}"; |
| 1598 | AS_IF([test "${withval}" -gt "4096"], |
| 1599 | [AC_MSG_WARN([Large framebuffer: see s_tritemp.h comments.])])] |
| 1600 | ) |
| 1601 | |
Jakob Bornecrantz | 3ede377 | 2009-02-13 00:57:47 +0100 | [diff] [blame] | 1602 | dnl |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1603 | dnl Gallium LLVM |
| 1604 | dnl |
| 1605 | AC_ARG_ENABLE([gallium-llvm], |
| 1606 | [AS_HELP_STRING([--enable-gallium-llvm], |
Marek Olšák | a86fc71 | 2011-04-21 13:27:55 +0200 | [diff] [blame] | 1607 | [build gallium LLVM support @<:@default=enabled on x86/x86_64@:>@])], |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1608 | [enable_gallium_llvm="$enableval"], |
| 1609 | [enable_gallium_llvm=auto]) |
Tom Stellard | 7d87c71 | 2012-03-27 22:24:39 -0400 | [diff] [blame] | 1610 | |
| 1611 | AC_ARG_WITH([llvm-shared-libs], |
| 1612 | [AS_HELP_STRING([--with-llvm-shared-libs], |
| 1613 | [link with LLVM shared libraries @<:@default=disabled@:>@])], |
| 1614 | [with_llvm_shared_libs=yes], |
| 1615 | [with_llvm_shared_libs=no]) |
| 1616 | |
Tom Stellard | 17f6c91 | 2012-07-17 18:32:56 +0000 | [diff] [blame] | 1617 | AC_ARG_WITH([llvm-prefix], |
| 1618 | [AS_HELP_STRING([--with-llvm-prefix], |
| 1619 | [Prefix for LLVM installations in non-standard locations])], |
| 1620 | [llvm_prefix="$withval"], |
| 1621 | [llvm_prefix=""]) |
| 1622 | |
| 1623 | |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1624 | if test "x$with_gallium_drivers" = x; then |
| 1625 | enable_gallium_llvm=no |
| 1626 | fi |
Marek Olšák | a86fc71 | 2011-04-21 13:27:55 +0200 | [diff] [blame] | 1627 | if test "x$enable_gallium_llvm" = xauto; then |
| 1628 | case "$host_cpu" in |
| 1629 | i*86|x86_64) enable_gallium_llvm=yes;; |
| 1630 | esac |
| 1631 | fi |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1632 | if test "x$enable_gallium_llvm" = xyes; then |
Tom Stellard | 17f6c91 | 2012-07-17 18:32:56 +0000 | [diff] [blame] | 1633 | if test "x$llvm_prefix" != x; then |
| 1634 | AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no], ["$llvm_prefix/bin"]) |
| 1635 | else |
| 1636 | AC_PATH_PROG([LLVM_CONFIG], [llvm-config], [no]) |
| 1637 | fi |
Marek Olšák | 99fba50 | 2011-07-23 15:57:51 +0200 | [diff] [blame] | 1638 | |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1639 | if test "x$LLVM_CONFIG" != xno; then |
ojab | 2fe6c25 | 2012-01-05 14:18:34 +0400 | [diff] [blame] | 1640 | LLVM_VERSION=`$LLVM_CONFIG --version | sed 's/svn.*//g'` |
ojab | 3d2bf91 | 2012-05-13 14:56:00 +0400 | [diff] [blame] | 1641 | LLVM_CFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'` |
Tom Stellard | 7d87c71 | 2012-03-27 22:24:39 -0400 | [diff] [blame] | 1642 | if test "x$with_llvm_shared_libs" = xyes; then |
| 1643 | dnl We can't use $LLVM_VERSION because it has 'svn' stripped out, |
| 1644 | LLVM_LIBS="-lLLVM-`$LLVM_CONFIG --version`" |
| 1645 | else |
José Fonseca | bd9bf7a | 2012-07-21 11:43:06 +0100 | [diff] [blame] | 1646 | LLVM_COMPONENTS="engine bitwriter" |
| 1647 | if $LLVM_CONFIG --components | grep -q '\<mcjit\>'; then |
| 1648 | LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit" |
Tom Stellard | 7a6b5d4 | 2012-05-02 11:06:13 -0400 | [diff] [blame] | 1649 | fi |
José Fonseca | bd9bf7a | 2012-07-21 11:43:06 +0100 | [diff] [blame] | 1650 | if test "x$enable_opencl" = xyes; then |
| 1651 | LLVM_COMPONENTS="${LLVM_COMPONENTS} ipo linker instrumentation" |
| 1652 | fi |
| 1653 | LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`" |
Tom Stellard | 7d87c71 | 2012-03-27 22:24:39 -0400 | [diff] [blame] | 1654 | fi |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1655 | LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags` |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1656 | LLVM_BINDIR=`$LLVM_CONFIG --bindir` |
| 1657 | LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags` |
Tom Stellard | d416780 | 2012-04-24 10:34:57 -0400 | [diff] [blame] | 1658 | LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags` |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1659 | LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` |
Tom Stellard | d416780 | 2012-04-24 10:34:57 -0400 | [diff] [blame] | 1660 | LLVM_LIBDIR=`$LLVM_CONFIG --libdir` |
Tom Stellard | adb8eca | 2012-04-17 09:24:29 -0400 | [diff] [blame] | 1661 | DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`" |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1662 | MESA_LLVM=1 |
Tom Stellard | ea76f03 | 2012-06-15 16:52:16 -0400 | [diff] [blame] | 1663 | |
| 1664 | dnl Check for Clang interanl headers |
| 1665 | if test "x$enable_opencl" = xyes; then |
| 1666 | if test "x$CLANG_LIBDIR" = x; then |
| 1667 | CLANG_LIBDIR=${LLVM_LIBDIR} |
| 1668 | fi |
| 1669 | CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} |
| 1670 | AC_CHECK_FILE("$CLANG_RESOURCE_DIR/include/stddef.h",, |
| 1671 | AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])) |
| 1672 | fi |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1673 | else |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1674 | MESA_LLVM=0 |
Dave Airlie | 22e8ddc | 2010-04-25 07:48:48 +1000 | [diff] [blame] | 1675 | fi |
| 1676 | else |
| 1677 | MESA_LLVM=0 |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1678 | fi |
| 1679 | |
Alexandre Demers | 3ea3695 | 2012-04-04 10:54:56 +0200 | [diff] [blame] | 1680 | dnl Directory for XVMC libs |
| 1681 | AC_ARG_WITH([xvmc-libdir], |
| 1682 | [AS_HELP_STRING([--with-xvmc-libdir=DIR], |
| 1683 | [directory for the XVMC libraries @<:@default=${libdir}@:>@])], |
| 1684 | [XVMC_LIB_INSTALL_DIR="$withval"], |
| 1685 | [XVMC_LIB_INSTALL_DIR='${libdir}']) |
| 1686 | AC_SUBST([XVMC_LIB_INSTALL_DIR]) |
| 1687 | |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1688 | dnl |
| 1689 | dnl Gallium Tests |
| 1690 | dnl |
| 1691 | if test "x$enable_gallium_tests" = xyes; then |
| 1692 | SRC_DIRS="$SRC_DIRS gallium/tests/trivial" |
| 1693 | enable_gallium_loader=yes |
| 1694 | fi |
| 1695 | |
Thomas Balling Sørensen | 3299997 | 2010-07-14 00:34:56 +0200 | [diff] [blame] | 1696 | dnl Directory for VDPAU libs |
| 1697 | AC_ARG_WITH([vdpau-libdir], |
| 1698 | [AS_HELP_STRING([--with-vdpau-libdir=DIR], |
| 1699 | [directory for the VDPAU libraries @<:@default=${libdir}/vdpau@:>@])], |
| 1700 | [VDPAU_LIB_INSTALL_DIR="$withval"], |
| 1701 | [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau']) |
| 1702 | AC_SUBST([VDPAU_LIB_INSTALL_DIR]) |
Younes Manton | 40cd082 | 2010-03-05 23:11:05 -0500 | [diff] [blame] | 1703 | |
Thomas Balling Sørensen | 501ac57 | 2010-10-24 19:27:29 +0200 | [diff] [blame] | 1704 | dnl Directory for VA libs |
| 1705 | AC_ARG_WITH([va-libdir], |
| 1706 | [AS_HELP_STRING([--with-va-libdir=DIR], |
| 1707 | [directory for the VA libraries @<:@default=${libdir}/va@:>@])], |
| 1708 | [VA_LIB_INSTALL_DIR="$withval"], |
| 1709 | [VA_LIB_INSTALL_DIR='${libdir}/va']) |
| 1710 | AC_SUBST([VA_LIB_INSTALL_DIR]) |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 1711 | |
Francisco Jerez | c6db1b3 | 2012-04-20 16:56:19 +0200 | [diff] [blame] | 1712 | dnl Directory for OpenCL libs |
| 1713 | AC_ARG_WITH([opencl-libdir], |
| 1714 | [AS_HELP_STRING([--with-opencl-libdir=DIR], |
| 1715 | [directory for the OpenCL libraries @<:@default=${libdir}/opencl@:>@])], |
| 1716 | [OPENCL_LIB_INSTALL_DIR="$withval"], |
| 1717 | [OPENCL_LIB_INSTALL_DIR='${libdir}/opencl']) |
| 1718 | AC_SUBST([OPENCL_LIB_INSTALL_DIR]) |
| 1719 | |
Dave Airlie | 81fe198 | 2010-04-22 14:59:29 +1000 | [diff] [blame] | 1720 | dnl |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1721 | dnl Gallium helper functions |
| 1722 | dnl |
| 1723 | gallium_check_st() { |
Thomas Hellstrom | 9f2f5b3 | 2011-06-15 10:46:24 +0200 | [diff] [blame] | 1724 | if test "x$HAVE_ST_DRI" = xyes || test "x$HAVE_ST_XORG" = xyes || |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1725 | test "x$HAVE_ST_XA" = xyes || test "x$HAVE_ST_XVMC" = xyes || |
| 1726 | test "x$HAVE_ST_VDPAU" = xyes || test "x$HAVE_ST_VA" = xyes; then |
Chia-I Wu | 8123934 | 2011-07-02 09:49:17 +0900 | [diff] [blame] | 1727 | if test "x$have_libdrm" != xyes; then |
| 1728 | AC_MSG_ERROR([DRI or Xorg DDX requires libdrm >= $LIBDRM_REQUIRED]) |
| 1729 | fi |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1730 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS $1" |
| 1731 | fi |
| 1732 | if test "x$HAVE_ST_DRI" = xyes && test "x$2" != x; then |
| 1733 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $2" |
| 1734 | fi |
Chia-I Wu | d8e0e11 | 2010-06-29 14:04:27 +0800 | [diff] [blame] | 1735 | if test "x$HAVE_ST_XORG" = xyes && test "x$3" != x; then |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1736 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $3" |
| 1737 | fi |
Thomas Hellstrom | 9f2f5b3 | 2011-06-15 10:46:24 +0200 | [diff] [blame] | 1738 | if test "x$HAVE_ST_XA" = xyes && test "x$4" != x; then |
| 1739 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $4" |
| 1740 | fi |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1741 | if test "x$HAVE_ST_XVMC" = xyes && test "x$5" != x; then |
| 1742 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $5" |
| 1743 | fi |
| 1744 | if test "x$HAVE_ST_VDPAU" = xyes && test "x$6" != x; then |
| 1745 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $6" |
| 1746 | fi |
| 1747 | if test "x$HAVE_ST_VA" = xyes && test "x$7" != x; then |
| 1748 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS $7" |
| 1749 | fi |
Jakob Bornecrantz | a82e37b | 2010-03-25 22:21:39 +0100 | [diff] [blame] | 1750 | } |
| 1751 | |
Marek Olšák | c17fb85 | 2011-06-14 04:03:17 +0200 | [diff] [blame] | 1752 | gallium_require_llvm() { |
| 1753 | if test "x$MESA_LLVM" = x0; then |
| 1754 | case "$host_cpu" in |
| 1755 | i*86|x86_64) AC_MSG_ERROR([LLVM is required to build $1 on x86 and x86_64]);; |
| 1756 | esac |
| 1757 | fi |
| 1758 | } |
| 1759 | |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1760 | gallium_require_drm_loader() { |
| 1761 | if test "x$enable_gallium_loader" = xyes; then |
| 1762 | PKG_CHECK_MODULES([LIBUDEV], [libudev], [], |
| 1763 | AC_MSG_ERROR([Gallium drm loader requrires libudev])) |
| 1764 | if test "x$have_libdrm" != xyes; then |
| 1765 | AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED]) |
| 1766 | fi |
| 1767 | enable_gallium_drm_loader=yes |
| 1768 | fi |
| 1769 | } |
| 1770 | |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1771 | dnl Gallium drivers |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1772 | dnl Duplicates in GALLIUM_DRIVERS_DIRS are removed by sorting it after this block |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1773 | if test "x$with_gallium_drivers" != x; then |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1774 | gallium_drivers=`IFS=', '; echo $with_gallium_drivers` |
| 1775 | for driver in $gallium_drivers; do |
| 1776 | case "x$driver" in |
| 1777 | xsvga) |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1778 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS svga softpipe" |
Thomas Hellstrom | d742a64 | 2011-09-29 21:41:21 +0200 | [diff] [blame] | 1779 | gallium_check_st "svga/drm" "dri-vmwgfx" "" "xa-vmwgfx" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1780 | ;; |
| 1781 | xi915) |
Emil Velikov | c2426bb | 2011-07-14 23:07:19 +0100 | [diff] [blame] | 1782 | PKG_CHECK_MODULES([INTEL], [libdrm_intel >= $LIBDRM_INTEL_REQUIRED]) |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1783 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915 softpipe" |
| 1784 | if test "x$MESA_LLVM" = x1; then |
| 1785 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe" |
| 1786 | fi |
| 1787 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS i915/sw" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1788 | gallium_check_st "i915/drm" "dri-i915" "xorg-i915" |
| 1789 | ;; |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1790 | xr300) |
Jerome Glisse | c0c979e | 2012-01-30 17:22:13 -0500 | [diff] [blame] | 1791 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1792 | gallium_require_llvm "Gallium R300" |
Marek Olšák | 02c8ee2 | 2011-06-27 08:02:31 +0200 | [diff] [blame] | 1793 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300" |
| 1794 | gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300" "va-r300" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1795 | ;; |
| 1796 | xr600) |
Jerome Glisse | c0c979e | 2012-01-30 17:22:13 -0500 | [diff] [blame] | 1797 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1798 | gallium_require_drm_loader |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1799 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r600" |
Adam Rak | 6a829a1 | 2011-11-30 22:20:41 +0100 | [diff] [blame] | 1800 | if test "x$enable_r600_llvm" = xyes -o "x$enable_opencl" = xyes; then |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 1801 | if test "x$LLVM_VERSION" != "x3.1"; then |
| 1802 | AC_MSG_ERROR([LLVM 3.1 is required for the r600 llvm compiler.]) |
| 1803 | fi |
| 1804 | NEED_RADEON_GALLIUM=yes; |
Adam Rak | 6a829a1 | 2011-11-30 22:20:41 +0100 | [diff] [blame] | 1805 | fi |
| 1806 | if test "x$enable_r600_llvm" = xyes; then |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 1807 | USE_R600_LLVM_COMPILER=yes; |
| 1808 | fi |
Adam Rak | 6a829a1 | 2011-11-30 22:20:41 +0100 | [diff] [blame] | 1809 | if test "x$enable_opencl" = xyes -a "x$with_llvm_shared_libs" = xno; then |
Michel Dänzer | 761131c | 2012-07-17 18:30:13 +0200 | [diff] [blame] | 1810 | LLVM_LIBS="${LLVM_LIBS} `$LLVM_CONFIG --libs bitreader asmparser`" |
Adam Rak | 6a829a1 | 2011-11-30 22:20:41 +0100 | [diff] [blame] | 1811 | fi |
Marek Olšák | bf0baa7 | 2011-09-27 16:42:01 +0200 | [diff] [blame] | 1812 | gallium_check_st "radeon/drm" "dri-r600" "xorg-r600" "" "xvmc-r600" "vdpau-r600" "va-r600" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1813 | ;; |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1814 | xradeonsi) |
Michel Dänzer | 24bc382 | 2012-05-12 12:12:21 +0200 | [diff] [blame] | 1815 | PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED]) |
| 1816 | gallium_require_drm_loader |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1817 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi" |
| 1818 | if test "x$LLVM_VERSION" != "x3.1"; then |
| 1819 | AC_MSG_ERROR([LLVM 3.1 is required to build the radeonsi driver.]) |
| 1820 | fi |
| 1821 | NEED_RADEON_GALLIUM=yes; |
Christian König | 41625af | 2012-07-13 11:23:10 +0200 | [diff] [blame] | 1822 | gallium_check_st "radeon/drm" "dri-radeonsi" "xorg-radeonsi" "" "" "vdpau-radeonsi" "" |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1823 | ;; |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1824 | xnouveau) |
Emil Velikov | c2426bb | 2011-07-14 23:07:19 +0100 | [diff] [blame] | 1825 | PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED]) |
Tom Stellard | 79d77b3 | 2012-04-20 16:56:46 +0200 | [diff] [blame] | 1826 | gallium_require_drm_loader |
Ben Skeggs | a2fc42b | 2012-01-11 12:42:07 +0100 | [diff] [blame] | 1827 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau nv30 nv50 nvc0" |
Maarten Lankhorst | df8f864 | 2011-10-18 14:24:30 +0200 | [diff] [blame] | 1828 | gallium_check_st "nouveau/drm" "dri-nouveau" "xorg-nouveau" "" "xvmc-nouveau" "vdpau-nouveau" |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1829 | ;; |
| 1830 | xswrast) |
Marek Olšák | c6f59fc | 2011-07-26 01:05:13 +0200 | [diff] [blame] | 1831 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS softpipe" |
| 1832 | if test "x$MESA_LLVM" = x1; then |
| 1833 | GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS llvmpipe" |
| 1834 | fi |
| 1835 | |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1836 | if test "x$HAVE_ST_DRI" = xyes; then |
| 1837 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS dri-swrast" |
| 1838 | fi |
Christian König | c3b2230 | 2011-07-04 15:04:41 +0200 | [diff] [blame] | 1839 | if test "x$HAVE_ST_VDPAU" = xyes; then |
| 1840 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS vdpau-softpipe" |
| 1841 | fi |
| 1842 | if test "x$HAVE_ST_XVMC" = xyes; then |
| 1843 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS xvmc-softpipe" |
| 1844 | fi |
| 1845 | if test "x$HAVE_ST_VA" = xyes; then |
| 1846 | GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS va-softpipe" |
| 1847 | fi |
Eric Anholt | 48c9925 | 2011-10-14 14:33:00 -0700 | [diff] [blame] | 1848 | if test "x$HAVE_ST_VDPAU" = xyes || |
| 1849 | test "x$HAVE_ST_XVMC" = xyes || |
| 1850 | test "x$HAVE_ST_VA" = xyes; then |
Younes Manton | b97816d | 2011-07-14 12:22:20 -0400 | [diff] [blame] | 1851 | if test "x$HAVE_WINSYS_XLIB" != xyes; then |
| 1852 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" |
| 1853 | fi |
| 1854 | fi |
Marek Olšák | 58b6a19 | 2011-06-14 07:46:59 +0200 | [diff] [blame] | 1855 | ;; |
| 1856 | *) |
| 1857 | AC_MSG_ERROR([Unknown Gallium driver: $driver]) |
| 1858 | ;; |
| 1859 | esac |
| 1860 | done |
Chia-I Wu | a1306f4 | 2010-01-22 15:51:51 +0800 | [diff] [blame] | 1861 | fi |
| 1862 | |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 1863 | if test "x$enable_gallium_loader" = xyes; then |
| 1864 | GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null" |
| 1865 | GALLIUM_PIPE_LOADER_DEFINES="-DHAVE_PIPE_LOADER_SW" |
| 1866 | GALLIUM_PIPE_LOADER_LIBS="\$(TOP)/src/gallium/auxiliary/pipe-loader/libpipe_loader.a" |
| 1867 | GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(TOP)/src/gallium/winsys/sw/null/libws_null.a" |
| 1868 | |
| 1869 | if test "x$HAVE_WINSYS_XLIB" = xyes; then |
| 1870 | GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB" |
| 1871 | GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS \$(TOP)/src/gallium/winsys/sw/xlib/libws_xlib.a" |
| 1872 | fi |
| 1873 | |
| 1874 | if test "x$enable_gallium_drm_loader" = xyes; then |
| 1875 | GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM" |
Tom Stellard | 044de40 | 2012-07-17 18:36:06 +0000 | [diff] [blame] | 1876 | PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2], |
| 1877 | pipe_loader_have_xcb=yes, pipe_loader_have_xcb=no) |
| 1878 | if test "x$pipe_loader_have_xcb" = xyes; then |
| 1879 | GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DPIPE_LOADER_HAVE_XCB" |
| 1880 | GALLIUM_PIPE_LOADER_LIBS="$GALLIUM_PIPE_LOADER_LIBS $GALLIUM_PIPE_LOADER_XCB_LIBS $LIBDRM_LIBS" |
| 1881 | fi |
Francisco Jerez | e136453 | 2012-04-25 22:16:00 +0200 | [diff] [blame] | 1882 | fi |
| 1883 | |
| 1884 | AC_SUBST([GALLIUM_PIPE_LOADER_DEFINES]) |
| 1885 | AC_SUBST([GALLIUM_PIPE_LOADER_LIBS]) |
| 1886 | fi |
| 1887 | |
Tom Stellard | 26ab747 | 2012-03-03 20:02:05 -0500 | [diff] [blame] | 1888 | dnl Tell Automake which drivers to build |
| 1889 | for driver in $GALLIUM_DRIVERS_DIRS; do |
| 1890 | case "x$driver" in |
| 1891 | xgalahad) |
| 1892 | HAVE_GALAHAD_GALLIUM=yes; |
| 1893 | ;; |
Tom Stellard | 3f3f10f | 2012-03-03 20:14:00 -0500 | [diff] [blame] | 1894 | xidentity) |
| 1895 | HAVE_IDENTITY_GALLIUM=yes; |
| 1896 | ;; |
Tom Stellard | dc382e5 | 2012-03-03 20:35:39 -0500 | [diff] [blame] | 1897 | xnoop) |
| 1898 | HAVE_NOOP_GALLIUM=yes; |
| 1899 | ;; |
Tom Stellard | 26ab747 | 2012-03-03 20:02:05 -0500 | [diff] [blame] | 1900 | *) |
| 1901 | GALLIUM_MAKE_DIRS="$GALLIUM_MAKE_DIRS $driver" |
| 1902 | ;; |
| 1903 | esac |
| 1904 | done |
| 1905 | |
| 1906 | AM_CONDITIONAL(HAVE_GALAHAD_GALLIUM, test x$HAVE_GALAHAD_GALLIUM = xyes) |
Tom Stellard | 3f3f10f | 2012-03-03 20:14:00 -0500 | [diff] [blame] | 1907 | AM_CONDITIONAL(HAVE_IDENTITY_GALLIUM, test x$HAVE_IDENTITY_GALLIUM = xyes) |
Tom Stellard | dc382e5 | 2012-03-03 20:35:39 -0500 | [diff] [blame] | 1908 | AM_CONDITIONAL(HAVE_NOOP_GALLIUM, test x$HAVE_NOOP_GALLIUM = xyes) |
Tom Stellard | a75c616 | 2012-01-06 17:38:37 -0500 | [diff] [blame] | 1909 | AM_CONDITIONAL(NEED_RADEON_GALLIUM, test x$NEED_RADEON_GALLIUM = xyes) |
Tom Stellard | ced73ea | 2012-04-17 09:26:28 -0400 | [diff] [blame] | 1910 | 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] | 1911 | AM_CONDITIONAL(HAVE_LOADER_GALLIUM, test x$enable_gallium_loader = xyes) |
| 1912 | 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] | 1913 | AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes) |
Tom Stellard | 26ab747 | 2012-03-03 20:02:05 -0500 | [diff] [blame] | 1914 | AC_SUBST([GALLIUM_MAKE_DIRS]) |
| 1915 | |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 1916 | AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1) |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 1917 | |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 1918 | AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1) |
| 1919 | AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1) |
| 1920 | AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1) |
Eric Anholt | f9d1562 | 2012-05-24 13:59:21 -0700 | [diff] [blame] | 1921 | |
Matt Turner | a8fd8cb | 2012-08-22 11:43:05 -0700 | [diff] [blame] | 1922 | # To pass as an argument to libtool's -version-number flag |
| 1923 | VERSION_NUMBER=`echo "$VERSION" | $SED 's/\./:/g'` |
| 1924 | AC_SUBST([VERSION_NUMBER]) |
| 1925 | |
Chia-I Wu | 99a37ed | 2010-01-05 17:39:05 +0800 | [diff] [blame] | 1926 | dnl prepend CORE_DIRS to SRC_DIRS |
| 1927 | SRC_DIRS="$CORE_DIRS $SRC_DIRS" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1928 | |
| 1929 | dnl Restore LDFLAGS and CPPFLAGS |
| 1930 | LDFLAGS="$_SAVE_LDFLAGS" |
| 1931 | CPPFLAGS="$_SAVE_CPPFLAGS" |
| 1932 | |
Marcin Baczyński | ff2efdf | 2011-07-13 21:26:49 +0200 | [diff] [blame] | 1933 | dnl Add user CFLAGS and CXXFLAGS |
| 1934 | CFLAGS="$CFLAGS $USER_CFLAGS" |
| 1935 | CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" |
| 1936 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 1937 | dnl Substitute the config |
Eric Anholt | 9ff2709 | 2012-06-11 10:49:38 -0700 | [diff] [blame] | 1938 | AC_CONFIG_FILES([configs/current |
Eric Anholt | 07abd91 | 2012-05-14 18:38:54 -0700 | [diff] [blame] | 1939 | Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1940 | src/egl/Makefile |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1941 | src/egl/drivers/Makefile |
Eric Anholt | e5f8954 | 2012-02-06 12:12:53 +0100 | [diff] [blame] | 1942 | src/egl/drivers/dri2/Makefile |
| 1943 | src/egl/drivers/glx/Makefile |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 1944 | src/egl/main/Makefile |
| 1945 | src/egl/main/egl.pc |
Benjamin Franzke | 8b90205 | 2012-01-24 20:38:01 +0100 | [diff] [blame] | 1946 | src/egl/wayland/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1947 | src/egl/wayland/wayland-drm/Makefile |
Benjamin Franzke | 8b90205 | 2012-01-24 20:38:01 +0100 | [diff] [blame] | 1948 | src/egl/wayland/wayland-egl/Makefile |
| 1949 | src/egl/wayland/wayland-egl/wayland-egl.pc |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1950 | src/gallium/Makefile |
| 1951 | src/gallium/auxiliary/pipe-loader/Makefile |
| 1952 | src/gallium/drivers/Makefile |
| 1953 | src/gallium/drivers/r300/Makefile |
| 1954 | src/gallium/drivers/r600/Makefile |
| 1955 | src/gallium/state_trackers/clover/Makefile |
| 1956 | src/gallium/targets/opencl/Makefile |
| 1957 | src/gbm/Makefile |
| 1958 | src/gbm/main/gbm.pc |
Jon TURNEY | 68e04cc | 2012-06-28 23:15:48 +0100 | [diff] [blame] | 1959 | src/glsl/Makefile |
| 1960 | src/glsl/glcpp/Makefile |
Eric Anholt | cc7e0de | 2012-04-16 09:53:29 -0700 | [diff] [blame] | 1961 | src/glsl/tests/Makefile |
Eric Anholt | 8ffb098 | 2012-02-05 06:10:56 +0100 | [diff] [blame] | 1962 | src/glx/Makefile |
Ian Romanick | 2e8c866 | 2012-05-23 15:23:22 -0700 | [diff] [blame] | 1963 | src/glx/tests/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1964 | src/gtest/Makefile |
| 1965 | src/Makefile |
Matt Turner | a6b8b70 | 2012-08-21 14:36:44 -0700 | [diff] [blame] | 1966 | src/mapi/es1api/Makefile |
| 1967 | src/mapi/es1api/glesv1_cm.pc |
Matt Turner | 0f8110c | 2012-08-21 14:52:59 -0700 | [diff] [blame] | 1968 | src/mapi/es2api/Makefile |
| 1969 | src/mapi/es2api/glesv2.pc |
Jon TURNEY | b2a37e2 | 2012-06-29 18:09:37 +0100 | [diff] [blame] | 1970 | src/mapi/glapi/Makefile |
Eric Anholt | 3a70f75 | 2012-06-11 12:59:21 -0700 | [diff] [blame] | 1971 | src/mapi/glapi/gen/Makefile |
Ian Romanick | a29ad2b | 2012-05-29 11:28:11 -0700 | [diff] [blame] | 1972 | src/mapi/glapi/tests/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1973 | src/mapi/shared-glapi/Makefile |
Ian Romanick | 45d3d0a | 2012-08-01 14:48:27 -0700 | [diff] [blame] | 1974 | src/mapi/shared-glapi/tests/Makefile |
Matt Turner | 261719b | 2012-08-22 16:57:38 -0700 | [diff] [blame] | 1975 | src/mapi/vgapi/Makefile |
| 1976 | src/mapi/vgapi/vg.pc |
Eric Anholt | 417c1a6 | 2012-06-12 12:10:58 -0700 | [diff] [blame] | 1977 | src/mesa/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1978 | src/mesa/gl.pc |
Eric Anholt | d59149d | 2012-06-11 10:53:09 -0700 | [diff] [blame] | 1979 | src/mesa/drivers/Makefile |
Matt Turner | 129213e | 2012-01-15 11:50:20 -0500 | [diff] [blame] | 1980 | src/mesa/drivers/dri/dri.pc |
Matt Turner | 80aa781 | 2012-01-26 19:31:12 -0500 | [diff] [blame] | 1981 | src/mesa/drivers/dri/common/Makefile |
Matt Turner | 3c87dfc | 2012-01-14 21:57:32 -0500 | [diff] [blame] | 1982 | src/mesa/drivers/dri/i915/Makefile |
Eric Anholt | e326480 | 2012-01-12 14:28:37 -0800 | [diff] [blame] | 1983 | src/mesa/drivers/dri/i965/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1984 | src/mesa/drivers/dri/Makefile |
Matt Turner | 3f96434 | 2012-01-15 10:20:30 -0500 | [diff] [blame] | 1985 | src/mesa/drivers/dri/nouveau/Makefile |
Matt Turner | b38d7a0 | 2012-01-15 10:04:58 -0500 | [diff] [blame] | 1986 | src/mesa/drivers/dri/r200/Makefile |
Matt Turner | e0ee818 | 2012-01-14 22:21:30 -0500 | [diff] [blame] | 1987 | src/mesa/drivers/dri/radeon/Makefile |
Eric Anholt | 2d4b77c | 2012-06-12 11:38:19 -0700 | [diff] [blame] | 1988 | src/mesa/drivers/dri/swrast/Makefile |
Laurent Carlier | 284325d | 2012-06-24 09:51:27 +0200 | [diff] [blame] | 1989 | src/mesa/drivers/osmesa/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1990 | src/mesa/drivers/osmesa/osmesa.pc |
Eric Anholt | fa4cf4d | 2012-05-15 12:23:00 -0700 | [diff] [blame] | 1991 | src/mesa/drivers/x11/Makefile |
Matt Turner | 383a70b | 2012-08-22 10:01:42 -0700 | [diff] [blame] | 1992 | src/mesa/libdricore/Makefile |
| 1993 | src/mesa/main/tests/Makefile |
| 1994 | src/mesa/x86-64/Makefile |
| 1995 | src/mesa/x86/Makefile]) |
Dan Nicholson | f64d6fe | 2007-12-12 17:57:45 -0800 | [diff] [blame] | 1996 | |
Marek Olšák | 618dbc8 | 2011-06-27 03:12:57 +0200 | [diff] [blame] | 1997 | dnl Sort the dirs alphabetically |
Marek Olšák | 3c79962 | 2011-09-27 16:51:05 +0200 | [diff] [blame] | 1998 | GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
| 1999 | GALLIUM_WINSYS_DIRS=`echo $GALLIUM_WINSYS_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
| 2000 | GALLIUM_DRIVERS_DIRS=`echo $GALLIUM_DRIVERS_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
Tom Stellard | 26ab747 | 2012-03-03 20:02:05 -0500 | [diff] [blame] | 2001 | GALLIUM_MAKE_DIRS=`echo $GALLIUM_MAKE_DIRS|tr " " "\n"|sort -u|tr "\n" " "` |
Marek Olšák | 3c79962 | 2011-09-27 16:51:05 +0200 | [diff] [blame] | 2002 | 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] | 2003 | |
Dan Nicholson | e14ebbc | 2008-05-06 11:28:43 -0700 | [diff] [blame] | 2004 | AC_OUTPUT |
Dan Nicholson | aab38cf | 2007-12-11 08:21:51 -0800 | [diff] [blame] | 2005 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2006 | dnl |
| 2007 | dnl Output some configuration info for the user |
| 2008 | dnl |
| 2009 | echo "" |
| 2010 | echo " prefix: $prefix" |
| 2011 | echo " exec_prefix: $exec_prefix" |
| 2012 | echo " libdir: $libdir" |
Dan Nicholson | 11ac5b2 | 2008-07-03 09:17:44 -0700 | [diff] [blame] | 2013 | echo " includedir: $includedir" |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2014 | |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2015 | dnl API info |
| 2016 | echo "" |
| 2017 | echo " OpenGL: $enable_opengl (ES1: $enable_gles1 ES2: $enable_gles2)" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2018 | echo " OpenVG: $enable_openvg" |
| 2019 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2020 | dnl Driver info |
| 2021 | echo "" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2022 | if test "x$enable_osmesa" != xno; then |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2023 | echo " OSMesa: lib$OSMESA_LIB" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2024 | else |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2025 | echo " OSMesa: no" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2026 | fi |
| 2027 | |
| 2028 | if test "x$enable_dri" != xno; then |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2029 | # cleanup the drivers var |
| 2030 | dri_dirs=`echo $DRI_DIRS | $SED 's/^ *//;s/ */ /;s/ *$//'` |
| 2031 | if test "x$DRI_DIRS" = x; then |
| 2032 | echo " DRI drivers: no" |
| 2033 | else |
| 2034 | echo " DRI drivers: $dri_dirs" |
| 2035 | fi |
| 2036 | echo " DRI driver dir: $DRI_DRIVER_INSTALL_DIR" |
Dan Nicholson | 544ab20 | 2007-12-30 08:41:53 -0800 | [diff] [blame] | 2037 | fi |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2038 | |
| 2039 | case "x$enable_glx$enable_xlib_glx" in |
| 2040 | xyesyes) |
| 2041 | echo " GLX: Xlib-based" |
| 2042 | ;; |
| 2043 | xyesno) |
| 2044 | echo " GLX: DRI-based" |
Chia-I Wu | 9e7a414 | 2011-06-26 13:24:32 +0900 | [diff] [blame] | 2045 | ;; |
| 2046 | *) |
| 2047 | echo " GLX: $enable_glx" |
| 2048 | ;; |
| 2049 | esac |
| 2050 | |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2051 | dnl EGL |
| 2052 | echo "" |
| 2053 | echo " EGL: $enable_egl" |
| 2054 | if test "$enable_egl" = yes; then |
| 2055 | echo " EGL platforms: $EGL_PLATFORMS" |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2056 | |
| 2057 | egl_drivers="" |
Eric Anholt | 8861202 | 2012-02-05 10:46:13 +0100 | [diff] [blame] | 2058 | if test "x$HAVE_EGL_DRIVER_GLX" != "x"; then |
| 2059 | egl_drivers="$egl_drivers builtin:egl_glx" |
| 2060 | fi |
| 2061 | if test "x$HAVE_EGL_DRIVER_DRI2" != "x"; then |
| 2062 | egl_drivers="$egl_drivers builtin:egl_dri2" |
| 2063 | fi |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2064 | |
Marek Olšák | 1251e1d | 2011-06-18 20:33:55 +0200 | [diff] [blame] | 2065 | if test "x$HAVE_ST_EGL" = xyes; then |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2066 | echo " EGL drivers: ${egl_drivers} egl_gallium" |
| 2067 | echo " EGL Gallium STs:$EGL_CLIENT_APIS" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2068 | else |
Chia-I Wu | 1230050 | 2010-10-31 21:01:54 +0800 | [diff] [blame] | 2069 | echo " EGL drivers: $egl_drivers" |
Chia-I Wu | 815faa4 | 2010-10-29 12:34:44 +0800 | [diff] [blame] | 2070 | fi |
Florent Thoumie | b5095ab | 2008-07-28 14:44:43 +0100 | [diff] [blame] | 2071 | fi |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2072 | |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2073 | echo "" |
Eric Anholt | 1a8b127 | 2010-05-21 12:17:24 -0700 | [diff] [blame] | 2074 | if test "x$MESA_LLVM" = x1; then |
Jakob Bornecrantz | fe0fe67 | 2010-04-28 13:38:58 +0100 | [diff] [blame] | 2075 | echo " llvm: yes" |
| 2076 | echo " llvm-config: $LLVM_CONFIG" |
| 2077 | echo " llvm-version: $LLVM_VERSION" |
| 2078 | else |
| 2079 | echo " llvm: no" |
| 2080 | fi |
| 2081 | |
| 2082 | echo "" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2083 | if echo "$SRC_DIRS" | grep 'gallium' >/dev/null 2>&1; then |
| 2084 | echo " Gallium: yes" |
| 2085 | echo " Gallium dirs: $GALLIUM_DIRS" |
Keith Whitwell | 51bff09 | 2010-03-11 14:43:00 +0000 | [diff] [blame] | 2086 | echo " Target dirs: $GALLIUM_TARGET_DIRS" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2087 | echo " Winsys dirs: $GALLIUM_WINSYS_DIRS" |
Jakob Bornecrantz | d67bd60 | 2009-02-20 11:03:18 +0000 | [diff] [blame] | 2088 | echo " Driver dirs: $GALLIUM_DRIVERS_DIRS" |
Jakob Bornecrantz | 7e54d7d | 2009-02-11 02:38:21 +0100 | [diff] [blame] | 2089 | echo " Trackers dirs: $GALLIUM_STATE_TRACKERS_DIRS" |
| 2090 | else |
| 2091 | echo " Gallium: no" |
| 2092 | fi |
| 2093 | |
Daniel Vetter | 8f15c31 | 2011-11-28 22:24:26 +0100 | [diff] [blame] | 2094 | |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2095 | dnl Libraries |
| 2096 | echo "" |
| 2097 | echo " Shared libs: $enable_shared" |
| 2098 | echo " Static libs: $enable_static" |
Matt Turner | 53248e5 | 2012-08-17 11:25:14 -0700 | [diff] [blame] | 2099 | echo " Shared-glapi: $enable_shared_glapi" |
Dan Nicholson | 9cad8e3 | 2007-11-30 08:49:57 -0800 | [diff] [blame] | 2100 | |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2101 | dnl Compiler options |
| 2102 | # cleanup the CFLAGS/CXXFLAGS/DEFINES vars |
Eric Anholt | 11ff18f | 2012-07-26 09:35:36 -0700 | [diff] [blame] | 2103 | cflags=`echo $CFLAGS $PIC_FLAGS | \ |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2104 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
Eric Anholt | 11ff18f | 2012-07-26 09:35:36 -0700 | [diff] [blame] | 2105 | cxxflags=`echo $CXXFLAGS $PIC_FLAGS | \ |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2106 | $SED 's/^ *//;s/ */ /;s/ *$//'` |
Eric Anholt | e426949 | 2012-06-11 10:25:05 -0700 | [diff] [blame] | 2107 | defines=`echo $DEFINES | $SED 's/^ *//;s/ */ /;s/ *$//'` |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2108 | echo "" |
| 2109 | echo " CFLAGS: $cflags" |
| 2110 | echo " CXXFLAGS: $cxxflags" |
| 2111 | echo " Macros: $defines" |
Kenneth Graunke | 3acc826 | 2010-10-25 13:52:58 -0700 | [diff] [blame] | 2112 | echo "" |
| 2113 | echo " PYTHON2: $PYTHON2" |
Dan Nicholson | 16a07fb | 2007-12-12 09:12:15 -0800 | [diff] [blame] | 2114 | |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2115 | echo "" |
Dan Nicholson | b645942 | 2008-03-24 10:01:50 -0700 | [diff] [blame] | 2116 | echo " Run '${MAKE-make}' to build Mesa" |
Dan Nicholson | dca1b79 | 2007-10-23 09:25:58 -0700 | [diff] [blame] | 2117 | echo "" |